// Copyright (c) Apptimize, Inc. | https://sdk.apptimize.com/license
(function ($hx_exports, $global) { "use strict";
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 apptimize_Apptimize = $hx_exports["Apptimize"] = function() { };
$hxClasses["apptimize.Apptimize"] = apptimize_Apptimize;
apptimize_Apptimize.__name__ = "apptimize.Apptimize";
apptimize_Apptimize._isInitialized = function() {
	return apptimize_ApptimizeInternal._isInitialized();
};
apptimize_Apptimize._getApptimizeAnonUserId = function() {
	var anonUserId = apptimize_support_persistence_ABTPersistence.loadString(apptimize_support_persistence_ABTPersistence.kAnonymousGuidKey);
	if(anonUserId == null || anonUserId == "" || !apptimize_api_ABTUserGuid.isValidGuid(anonUserId)) {
		anonUserId = apptimize_api_ABTUserGuid.generateUserGuid();
		apptimize_support_persistence_ABTPersistence.saveString(apptimize_support_persistence_ABTPersistence.kAnonymousGuidKey,anonUserId);
	}
	return anonUserId;
};
apptimize_Apptimize.setAppVersion = $hx_exports["setAppVersion"] = function(version) {
	apptimize_support_properties_ABTApplicationProperties.sharedInstance().setProperty("app_version",version);
	var app_version = apptimize_support_properties_ABTApplicationProperties.sharedInstance().valueForProperty("app_version");
	apptimize_ABTLogger.v("App Version set to: " + app_version,{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 267, className : "apptimize.Apptimize", methodName : "setAppVersion"});
};
apptimize_Apptimize.setAppName = $hx_exports["setAppName"] = function(name) {
	apptimize_support_properties_ABTApplicationProperties.sharedInstance().setProperty("app_name",name);
	var app_name = apptimize_support_properties_ABTApplicationProperties.sharedInstance().valueForProperty("app_name");
	apptimize_ABTLogger.v("App Name set to: " + app_name,{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 278, className : "apptimize.Apptimize", methodName : "setAppName"});
};
apptimize_Apptimize.setOnParticipationCallback = $hx_exports["setOnParticipationCallback"] = function(callback) {
	apptimize_events_ABTEventManager.setOnParticipationCallback(callback);
	apptimize_ABTLogger.w("setOnParticipationCallback is deprecated - please use setOnParticipatedInExperimentCallback.",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 299, className : "apptimize.Apptimize", methodName : "setOnParticipationCallback"});
};
apptimize_Apptimize.setOnMetadataUpdatedCallback = $hx_exports["setOnMetadataUpdatedCallback"] = function(callback) {
	apptimize_events_ABTEventManager.setOnMetadataUpdatedCallback(callback);
	apptimize_ABTLogger.v("OnMetadataProcessedCallback set!",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 318, className : "apptimize.Apptimize", methodName : "setOnMetadataUpdatedCallback"});
};
apptimize_Apptimize.setOnApptimizeInitializedCallback = $hx_exports["setOnApptimizeInitializedCallback"] = function(callback) {
	apptimize_events_ABTEventManager.setOnApptimizeInitializedCallback(callback);
	apptimize_ABTLogger.v("OnApptimizeInitializedCallback set!",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 339, className : "apptimize.Apptimize", methodName : "setOnApptimizeInitializedCallback"});
};
apptimize_Apptimize.setOnParticipatedInExperimentCallback = $hx_exports["setOnParticipatedInExperimentCallback"] = function(callback) {
	apptimize_events_ABTEventManager.setOnParticipatedInExperimentCallback(callback);
	apptimize_ABTLogger.v("OnParticipatedInExperimentCallback set!",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 357, className : "apptimize.Apptimize", methodName : "setOnParticipatedInExperimentCallback"});
};
apptimize_Apptimize.setup = $hx_exports["setup"] = function(appKey,configAttributes) {
	if(appKey == null || appKey == "") {
		apptimize_ABTLogger.c("Unable to initialize Apptimize due to missing app key.",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 413, className : "apptimize.Apptimize", methodName : "setup"});
		return;
	} else if(apptimize_ABTDataStore.getAppKey() != null && apptimize_ABTDataStore.getAppKey() == appKey) {
		apptimize_ABTLogger.w("Apptimize is already initialized with app key: \"" + appKey + "\".",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 416, className : "apptimize.Apptimize", methodName : "setup"});
		return;
	}
	apptimize_ApptimizeInternal._setup(appKey,configAttributes,function() {
		if(apptimize_ABTDataStore.getAppKey() != null && apptimize_ABTDataStore.getAppKey() != appKey) {
			apptimize_ABTDataStore.clear();
		}
		apptimize_ABTLogger.v("Set Anonymous User ID: " + apptimize_Apptimize._getApptimizeAnonUserId(),{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 427, className : "apptimize.Apptimize", methodName : "setup"});
		apptimize_ABTLogger.i("Apptimize " + apptimize_Apptimize.getApptimizeSDKPlatform() + " SDK initialized.\nApptimize SDK Version: " + apptimize_Apptimize.getApptimizeSDKVersion(),{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 428, className : "apptimize.Apptimize", methodName : "setup"});
		apptimize_Apptimize._initialize(appKey);
	});
};
apptimize_Apptimize.shutdown = $hx_exports["shutdown"] = function() {
	apptimize_ApptimizeInternal.shutdown();
};
apptimize_Apptimize.updateApptimizeMetadataOnce = $hx_exports["updateApptimizeMetadataOnce"] = function() {
	try {
		apptimize_ABTDataStore.checkForUpdatedMetaData(true);
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_ABTLogger.e("Failed to update Metadata: " + Std.string(e),{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 460, className : "apptimize.Apptimize", methodName : "updateApptimizeMetadataOnce"});
	}
};
apptimize_Apptimize.flushTracking = $hx_exports["flushTracking"] = function() {
	if(apptimize_Apptimize._isInitialized()) {
		apptimize_ABTDataStore.sharedInstance().flushTracking();
	} else {
		apptimize_ABTLogger.w("Tracking can only be flushed after setup().",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 475, className : "apptimize.Apptimize", methodName : "flushTracking"});
	}
};
apptimize_Apptimize.getApptimizeSDKVersion = $hx_exports["getApptimizeSDKVersion"] = function() {
	return "1.2.44";
};
apptimize_Apptimize.getApptimizeSDKPlatform = $hx_exports["getApptimizeSDKPlatform"] = function() {
	var sdkPlatform = "N/A";
	return "Node.js";
};
apptimize_Apptimize._initialize = function(appKey) {
	apptimize_ABTDataStore.sharedInstance().loadMetaData(appKey);
	apptimize_ApptimizeInternal.setState(2);
	if(apptimize_ABTDataStore.sharedInstance().hasMetadata(apptimize_ABTDataStore.getAppKey()) && apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.REFRESH_META_DATA_ON_SETUP) == false && apptimize_ApptimizeInternal._trySetReady()) {
		apptimize_events_ABTEventManager.dispatchOnApptimizeInitialized();
		apptimize_ABTLogger.i("Apptimize initialized with app key \"" + appKey + "\".",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 532, className : "apptimize.Apptimize", methodName : "_initialize"});
	}
};
apptimize_Apptimize._getAlterations = function(userID,customAttributes) {
	apptimize_ABTDataStore._checkForUpdatedMetadataIfNecessary();
	if(apptimize_Apptimize._isInitialized()) {
		var envParams = new apptimize_filter_ABTFilterEnvParams(userID,apptimize_Apptimize._getApptimizeAnonUserId(),customAttributes,apptimize_ABTDataStore.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
		return apptimize_ApptimizeInternal._getAlterations(envParams);
	}
	return [];
};
apptimize_Apptimize._getCodeBlockMethod = function(codeBlockVariableName,userID,customAttributes) {
	apptimize_ABTDataStore._checkForUpdatedMetadataIfNecessary();
	var envParams = new apptimize_filter_ABTFilterEnvParams(userID,apptimize_Apptimize._getApptimizeAnonUserId(),customAttributes,apptimize_ABTDataStore.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
	return apptimize_ApptimizeInternal._getCodeBlockMethod(envParams,codeBlockVariableName);
};
apptimize_Apptimize.runCodeBlock = $hx_exports["runCodeBlock"] = function(codeBlockVariableName,callback,userID,customAttributes) {
	if(userID != null) {
		if(!apptimize_util_ABTTypes.isString(userID) || StringTools.ltrim(userID) == "") {
			apptimize_ABTLogger.w("The `userID` argument cannot be set to a non-string value, be empty or be whitespace only, setting to null instead.",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 47, className : "apptimize.Apptimize", methodName : "runCodeBlock"});
			userID = null;
		}
	}
	if(userID == null) {
		apptimize_ABTLogger.c("The parameter " + "userID" + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 53, className : "apptimize.Apptimize", methodName : "runCodeBlock"});
	}
	if(customAttributes == null && false) {
		apptimize_ABTLogger.c("The parameter " + null + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 59, className : "apptimize.Apptimize", methodName : "runCodeBlock"});
	}
	var attrs = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(customAttributes);
	var methodName = apptimize_Apptimize._getCodeBlockMethod(codeBlockVariableName,userID,attrs);
	var callbackMap = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(callback);
	if(methodName == null || methodName == "") {
		apptimize_ABTLogger.w("No Code Block with variable name " + codeBlockVariableName + " found, skipping callback.",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 627, className : "apptimize.Apptimize", methodName : "runCodeBlock"});
		return;
	} else if(callback == null || callbackMap.h[methodName] == null) {
		var method = Reflect.getProperty(callback,methodName);
		if(method != null) {
			method.apply(callback,[]);
		} else {
			apptimize_ABTLogger.w("Supplied callbacks do not include method: " + methodName,{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 635, className : "apptimize.Apptimize", methodName : "runCodeBlock"});
		}
	} else {
		apptimize_ABTLogger.v("Calling callback method: " + methodName,{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 638, className : "apptimize.Apptimize", methodName : "runCodeBlock"});
		var func = callbackMap.h[methodName];
		if(!Reflect.isFunction(func)) {
			apptimize_ABTLogger.e("runCodeBlock() called with callback that isn't a function/method.",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 642, className : "apptimize.Apptimize", methodName : "runCodeBlock"});
			return;
		}
		func();
	}
};
apptimize_Apptimize.isFeatureFlagEnabled = $hx_exports["isFeatureFlagEnabled"] = function(name,userID,customAttributes) {
	return apptimize_Apptimize.getBool(name,false,userID,customAttributes);
};
apptimize_Apptimize.getString = $hx_exports["getString"] = function(name,defaultValue,userID,customAttributes) {
	var stringValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.String,null,customAttributes);
	if(stringValue == null) {
		return defaultValue;
	}
	return stringValue;
};
apptimize_Apptimize.getBool = $hx_exports["getBool"] = function(name,defaultValue,userID,customAttributes) {
	var boolValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Boolean,null,customAttributes);
	if(boolValue == null) {
		return defaultValue;
	}
	return boolValue;
};
apptimize_Apptimize.getInt = $hx_exports["getInt"] = function(name,defaultValue,userID,customAttributes) {
	var intValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Integer,null,customAttributes);
	if(intValue == null) {
		return defaultValue;
	}
	return intValue;
};
apptimize_Apptimize.getDouble = $hx_exports["getDouble"] = function(name,defaultValue,userID,customAttributes) {
	var floatValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Double,null,customAttributes);
	if(floatValue == null) {
		return defaultValue;
	}
	return floatValue;
};
apptimize_Apptimize.getStringArray = $hx_exports["getStringArray"] = function(name,defaultValue,userID,customAttributes) {
	var stringArrayValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Array,apptimize_ABTApptimizeVariableType.String,customAttributes);
	if(stringArrayValue == null) {
		return defaultValue;
	}
	return apptimize_util_ABTUtilArray.toNativeArray(stringArrayValue,apptimize_util_ArrayType.String);
};
apptimize_Apptimize.getBoolArray = $hx_exports["getBoolArray"] = function(name,defaultValue,userID,customAttributes) {
	var boolArrayValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Array,apptimize_ABTApptimizeVariableType.Boolean,customAttributes);
	if(boolArrayValue == null) {
		return defaultValue;
	}
	return apptimize_util_ABTUtilArray.toNativeArray(boolArrayValue,apptimize_util_ArrayType.Bool);
};
apptimize_Apptimize.getIntArray = $hx_exports["getIntArray"] = function(name,defaultValue,userID,customAttributes) {
	var intArrayValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Array,apptimize_ABTApptimizeVariableType.Integer,customAttributes);
	if(intArrayValue == null) {
		return defaultValue;
	}
	return apptimize_util_ABTUtilArray.toNativeArray(intArrayValue,apptimize_util_ArrayType.Int);
};
apptimize_Apptimize.getDoubleArray = $hx_exports["getDoubleArray"] = function(name,defaultValue,userID,customAttributes) {
	var doubleArrayValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Array,apptimize_ABTApptimizeVariableType.Double,customAttributes);
	if(doubleArrayValue == null) {
		return defaultValue;
	}
	return apptimize_util_ABTUtilArray.toNativeArray(doubleArrayValue,apptimize_util_ArrayType.Double);
};
apptimize_Apptimize.getStringDictionary = $hx_exports["getStringDictionary"] = function(name,defaultValue,userID,customAttributes) {
	var stringDictionaryValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Dictionary,apptimize_ABTApptimizeVariableType.String,customAttributes);
	if(stringDictionaryValue == null) {
		return defaultValue;
	}
	return stringDictionaryValue;
};
apptimize_Apptimize.getBoolDictionary = $hx_exports["getBoolDictionary"] = function(name,defaultValue,userID,customAttributes) {
	var boolDictionaryValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Dictionary,apptimize_ABTApptimizeVariableType.Boolean,customAttributes);
	if(boolDictionaryValue == null) {
		return defaultValue;
	}
	return boolDictionaryValue;
};
apptimize_Apptimize.getIntDictionary = $hx_exports["getIntDictionary"] = function(name,defaultValue,userID,customAttributes) {
	var intDictionaryValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Dictionary,apptimize_ABTApptimizeVariableType.Integer,customAttributes);
	if(intDictionaryValue == null) {
		return defaultValue;
	}
	return intDictionaryValue;
};
apptimize_Apptimize.getDoubleDictionary = $hx_exports["getDoubleDictionary"] = function(name,defaultValue,userID,customAttributes) {
	var doubleDictionaryValue = apptimize_Apptimize._getValue(name,userID,apptimize_ABTApptimizeVariableType.Dictionary,apptimize_ABTApptimizeVariableType.Double,customAttributes);
	if(doubleDictionaryValue == null) {
		return defaultValue;
	}
	return doubleDictionaryValue;
};
apptimize_Apptimize._getValue = function(name,userID,type,nestedType,customAttributes) {
	if(!apptimize_Apptimize._isInitialized()) {
		return null;
	}
	if(userID != null) {
		if(!apptimize_util_ABTTypes.isString(userID) || StringTools.ltrim(userID) == "") {
			apptimize_ABTLogger.w("The `userID` argument cannot be set to a non-string value, be empty or be whitespace only, setting to null instead.",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 47, className : "apptimize.Apptimize", methodName : "_getValue"});
			userID = null;
		}
	}
	if(userID == null) {
		apptimize_ABTLogger.c("The parameter " + "userID" + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 53, className : "apptimize.Apptimize", methodName : "_getValue"});
	}
	if(customAttributes == null && false) {
		apptimize_ABTLogger.c("The parameter " + null + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 59, className : "apptimize.Apptimize", methodName : "_getValue"});
	}
	var attrMap = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(customAttributes);
	var envParams = new apptimize_filter_ABTFilterEnvParams(userID,apptimize_Apptimize._getApptimizeAnonUserId(),attrMap,apptimize_ABTDataStore.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
	return apptimize_ABTApptimizeVariable.getValue(envParams,name,type,nestedType);
};
apptimize_Apptimize.getVariantInfo = $hx_exports["getVariantInfo"] = function(userID,customAttributes) {
	if(userID != null) {
		if(!apptimize_util_ABTTypes.isString(userID) || StringTools.ltrim(userID) == "") {
			apptimize_ABTLogger.w("The `userID` argument cannot be set to a non-string value, be empty or be whitespace only, setting to null instead.",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 47, className : "apptimize.Apptimize", methodName : "getVariantInfo"});
			userID = null;
		}
	}
	if(userID == null) {
		apptimize_ABTLogger.c("The parameter " + "userID" + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 53, className : "apptimize.Apptimize", methodName : "getVariantInfo"});
	}
	if(customAttributes == null && false) {
		apptimize_ABTLogger.c("The parameter " + null + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 59, className : "apptimize.Apptimize", methodName : "getVariantInfo"});
	}
	var variantInfos = [];
	var anonID = apptimize_Apptimize._getApptimizeAnonUserId();
	var attrMap = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(customAttributes);
	var envParams = new apptimize_filter_ABTFilterEnvParams(userID,anonID,attrMap,apptimize_ABTDataStore.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
	var _g = 0;
	var _g1 = apptimize_ApptimizeInternal._getVariants(envParams,false);
	while(_g < _g1.length) {
		var variant = _g1[_g];
		++_g;
		variantInfos.push(apptimize_VariantInfo.initWithVariant(variant,userID,anonID));
	}
	return apptimize_util_ABTUtilArray.toNativeArray(variantInfos,apptimize_util_ArrayType.VariantInfo);
};
apptimize_Apptimize.getWinnerVariantInfo = $hx_exports["getWinnerVariantInfo"] = function(userID,customAttributes) {
	return apptimize_ApptimizeInternal.getWinnerVariantInfo(userID,apptimize_Apptimize._getApptimizeAnonUserId(),customAttributes);
};
apptimize_Apptimize._getVariantInfoForAlteration = function(name,userID,customAttributes) {
	var anonID = apptimize_Apptimize._getApptimizeAnonUserId();
	var _g = 0;
	var _g1 = apptimize_Apptimize._getAlterations(userID,customAttributes);
	while(_g < _g1.length) {
		var alteration = _g1[_g];
		++_g;
		if(alteration.getKey() == name) {
			return apptimize_VariantInfo.initWithVariant(alteration.getVariant(),userID,anonID);
		}
	}
	return null;
};
apptimize_Apptimize._getVariantInfoForDynamicVariable = function(name,userID,customAttributes) {
	if(userID != null) {
		if(!apptimize_util_ABTTypes.isString(userID) || StringTools.ltrim(userID) == "") {
			apptimize_ABTLogger.w("The `userID` argument cannot be set to a non-string value, be empty or be whitespace only, setting to null instead.",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 47, className : "apptimize.Apptimize", methodName : "_getVariantInfoForDynamicVariable"});
			userID = null;
		}
	}
	if(userID == null) {
		apptimize_ABTLogger.c("The parameter " + "userID" + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 53, className : "apptimize.Apptimize", methodName : "_getVariantInfoForDynamicVariable"});
	}
	if(customAttributes == null && false) {
		apptimize_ABTLogger.c("The parameter " + null + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 59, className : "apptimize.Apptimize", methodName : "_getVariantInfoForDynamicVariable"});
	}
	var attrMap = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(customAttributes);
	return apptimize_Apptimize._getVariantInfoForAlteration(name,userID,attrMap);
};
apptimize_Apptimize._getVariantInfoForExperiment = function(name,userID,customAttributes) {
	if(userID != null) {
		if(!apptimize_util_ABTTypes.isString(userID) || StringTools.ltrim(userID) == "") {
			apptimize_ABTLogger.w("The `userID` argument cannot be set to a non-string value, be empty or be whitespace only, setting to null instead.",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 47, className : "apptimize.Apptimize", methodName : "_getVariantInfoForExperiment"});
			userID = null;
		}
	}
	if(userID == null) {
		apptimize_ABTLogger.c("The parameter " + "userID" + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 53, className : "apptimize.Apptimize", methodName : "_getVariantInfoForExperiment"});
	}
	if(customAttributes == null && false) {
		apptimize_ABTLogger.c("The parameter " + null + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 59, className : "apptimize.Apptimize", methodName : "_getVariantInfoForExperiment"});
	}
	var anonID = apptimize_Apptimize._getApptimizeAnonUserId();
	var attrMap = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(customAttributes);
	var envParams = new apptimize_filter_ABTFilterEnvParams(userID,anonID,attrMap,apptimize_ABTDataStore.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
	var _g = 0;
	var _g1 = apptimize_ApptimizeInternal._getVariants(envParams);
	while(_g < _g1.length) {
		var variant = _g1[_g];
		++_g;
		if(variant.getExperimentName() == name) {
			return apptimize_VariantInfo.initWithVariant(variant,userID,anonID);
		}
	}
	return null;
};
apptimize_Apptimize.track = $hx_exports["track"] = function(eventName,userID,customAttributes) {
	if(apptimize_Apptimize._isInitialized()) {
		if(userID != null) {
			if(!apptimize_util_ABTTypes.isString(userID) || StringTools.ltrim(userID) == "") {
				apptimize_ABTLogger.w("The `userID` argument cannot be set to a non-string value, be empty or be whitespace only, setting to null instead.",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 47, className : "apptimize.Apptimize", methodName : "track"});
				userID = null;
			}
		}
		if(userID == null) {
			apptimize_ABTLogger.c("The parameter " + "userID" + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 53, className : "apptimize.Apptimize", methodName : "track"});
		}
		if(customAttributes == null && false) {
			apptimize_ABTLogger.c("The parameter " + null + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 59, className : "apptimize.Apptimize", methodName : "track"});
		}
		var attrMap = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(customAttributes);
		var envParams = new apptimize_filter_ABTFilterEnvParams(userID,apptimize_Apptimize._getApptimizeAnonUserId(),attrMap,apptimize_ABTDataStore.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
		apptimize_ApptimizeInternal.generateTrackEvent(envParams,eventName,null);
	} else {
		apptimize_ABTLogger.w("Events can only be tracked after setup() has been called.",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 1253, className : "apptimize.Apptimize", methodName : "track"});
	}
};
apptimize_Apptimize.trackValue = $hx_exports["trackValue"] = function(eventName,value,userID,customAttributes) {
	if(apptimize_Apptimize._isInitialized()) {
		if(userID != null) {
			if(!apptimize_util_ABTTypes.isString(userID) || StringTools.ltrim(userID) == "") {
				apptimize_ABTLogger.w("The `userID` argument cannot be set to a non-string value, be empty or be whitespace only, setting to null instead.",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 47, className : "apptimize.Apptimize", methodName : "trackValue"});
				userID = null;
			}
		}
		if(userID == null) {
			apptimize_ABTLogger.c("The parameter " + "userID" + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 53, className : "apptimize.Apptimize", methodName : "trackValue"});
		}
		if(customAttributes == null && false) {
			apptimize_ABTLogger.c("The parameter " + null + " is required",{ fileName : "src/apptimize/macros/ABTClientMacro.hx", lineNumber : 59, className : "apptimize.Apptimize", methodName : "trackValue"});
		}
		if(typeof(value) != "number" && !js_Boot.__instanceof(value,apptimize_util_ArrayType.Int)) {
			apptimize_ABTLogger.w("trackValue() called with a non-float value. Event not logged.",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 1284, className : "apptimize.Apptimize", methodName : "trackValue"});
			return;
		}
		var attrMap = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(customAttributes);
		var envParams = new apptimize_filter_ABTFilterEnvParams(userID,apptimize_Apptimize._getApptimizeAnonUserId(),attrMap,apptimize_ABTDataStore.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
		apptimize_ApptimizeInternal.generateTrackEvent(envParams,eventName,value);
	} else {
		apptimize_ABTLogger.w("Events can only be tracked after setup() has been called.",{ fileName : "src/apptimize/Apptimize.hx", lineNumber : 1292, className : "apptimize.Apptimize", methodName : "trackValue"});
	}
};
apptimize_Apptimize.getMetadataSequenceNumber = $hx_exports["getMetadataSequenceNumber"] = function() {
	var store = apptimize_ABTDataStore.sharedInstance();
	var md = store.getMetaData(apptimize_ABTDataStore.getAppKey());
	if(md != null) {
		return md.getSequenceNumber();
	}
	return 0;
};
var Apptimize = function() { };
$hxClasses["Apptimize"] = Apptimize;
Apptimize.__name__ = "Apptimize";
Apptimize.__super__ = apptimize_Apptimize;
Apptimize.prototype = $extend(apptimize_Apptimize.prototype,{
	__class__: Apptimize
});
var apptimize_VariantInfo = $hx_exports["VariantInfo"] = function(variantId,variantName,experimentId,experimentName,experimentType,cycle,currentPhase,participationPhase,userId,anonymousUserId,userHasParticipated) {
	this._variantId = variantId;
	this._variantName = variantName;
	this._experimentId = experimentId;
	this._experimentName = experimentName;
	this._experimentType = apptimize_VariantInfo.apptimizeExperimentTypeForString(experimentType);
	this._experimentTypeName = experimentType;
	this._cycle = cycle;
	this._currentPhase = currentPhase;
	this._participationPhase = participationPhase;
	this._userId = userId;
	this._anonymousUserId = anonymousUserId;
	this._userHasParticipated = userHasParticipated;
};
$hxClasses["apptimize.VariantInfo"] = apptimize_VariantInfo;
apptimize_VariantInfo.__name__ = "apptimize.VariantInfo";
apptimize_VariantInfo.initWithVariant = function(variant,userId,anonymousUserId) {
	var participationPhase = 0;
	var variantString = "v" + variant.getVariantID() + "_" + variant.getCycle();
	var userHasParticipated = false;
	return new apptimize_VariantInfo(variant.getVariantID(),variant.getVariantName(),variant.getExperimentID(),variant.getExperimentName(),variant.getExperimentType(),variant.getCycle(),variant.getPhase(),participationPhase,userId,anonymousUserId,userHasParticipated);
};
apptimize_VariantInfo.apptimizeExperimentTypeForString = function(stringType) {
	var type = stringType.toLowerCase();
	switch(type) {
	case "code-block":
		return apptimize_ApptimizeExperimentType.CodeBlock;
	case "double-value":
		return apptimize_ApptimizeExperimentType.DynamicVariables;
	case "feature-config":
		return apptimize_ApptimizeExperimentType.FeatureVariables;
	case "feature-flag":
		return apptimize_ApptimizeExperimentType.FeatureFlag;
	case "int-value":
		return apptimize_ApptimizeExperimentType.DynamicVariables;
	case "string-value":
		return apptimize_ApptimizeExperimentType.DynamicVariables;
	case "variables":
		return apptimize_ApptimizeExperimentType.DynamicVariables;
	case "wysiwyg":
		return apptimize_ApptimizeExperimentType.Visual;
	default:
		return apptimize_ApptimizeExperimentType.Unknown;
	}
};
apptimize_VariantInfo.prototype = {
	_variantId: null
	,_variantName: null
	,_experimentId: null
	,_experimentName: null
	,_experimentType: null
	,_experimentTypeName: null
	,_currentPhase: null
	,_participationPhase: null
	,_cycle: null
	,_userId: null
	,_anonymousUserId: null
	,_userHasParticipated: null
	,getVariantId: function() {
		return this._variantId;
	}
	,getVariantName: function() {
		return this._variantName;
	}
	,getExperimentId: function() {
		return this._experimentId;
	}
	,getExperimentName: function() {
		return this._experimentName;
	}
	,getExperimentType: function() {
		return this._experimentType;
	}
	,getExperimentTypeName: function() {
		return this._experimentTypeName;
	}
	,getCurrentPhase: function() {
		return this._currentPhase;
	}
	,getParticipationPhase: function() {
		return this._participationPhase;
	}
	,getCycle: function() {
		return this._cycle;
	}
	,getUserId: function() {
		return this._userId;
	}
	,getAnonymousUserId: function() {
		return this._anonymousUserId;
	}
	,__class__: apptimize_VariantInfo
};
var VariantInfo = function(variantId,variantName,experimentId,experimentName,experimentType,cycle,currentPhase,participationPhase,userId,anonymousUserId,userHasParticipated) {
	apptimize_VariantInfo.call(this,variantId,variantName,experimentId,experimentName,experimentType,cycle,currentPhase,participationPhase,userId,anonymousUserId,userHasParticipated);
};
$hxClasses["VariantInfo"] = VariantInfo;
VariantInfo.__name__ = "VariantInfo";
VariantInfo.__super__ = apptimize_VariantInfo;
VariantInfo.prototype = $extend(apptimize_VariantInfo.prototype,{
	__class__: VariantInfo
});
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");
		}
	}
	,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;
		}
	}
	,map: function(s,f) {
		var offset = 0;
		var buf_b = "";
		while(true) {
			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;
			}
			if(!this.r.global) {
				break;
			}
		}
		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.now = function() {
	return Date.now();
};
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;
};
Math.__name__ = "Math";
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.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.deleteField = function(o,field) {
	if(!Object.prototype.hasOwnProperty.call(o,field)) {
		return false;
	}
	delete(o[field]);
	return true;
};
var Std = function() { };
$hxClasses["Std"] = Std;
Std.__name__ = "Std";
Std.string = function(s) {
	return js_Boot.__string_rec(s,"");
};
Std.parseInt = function(x) {
	if(x != null) {
		var _g = 0;
		var _g1 = x.length;
		while(_g < _g1) {
			var i = _g++;
			var c = x.charCodeAt(i);
			if(c <= 8 || c >= 14 && c != 32 && c != 45) {
				var nc = x.charCodeAt(i + 1);
				var v = parseInt(x,nc == 120 || nc == 88 ? 16 : 10);
				if(isNaN(v)) {
					return null;
				} else {
					return v;
				}
			}
		}
	}
	return null;
};
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.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.replace = function(s,sub,by) {
	return s.split(sub).join(by);
};
StringTools.hex = function(n,digits) {
	var s = "";
	var hexChars = "0123456789ABCDEF";
	while(true) {
		s = hexChars.charAt(n & 15) + s;
		n >>>= 4;
		if(!(n > 0)) {
			break;
		}
	}
	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.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.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 apptimize_ABTApptimizeVariableType = $hxEnums["apptimize.ABTApptimizeVariableType"] = { __ename__:"apptimize.ABTApptimizeVariableType",__constructs__:null
	,Invalid: {_hx_name:"Invalid",_hx_index:0,__enum__:"apptimize.ABTApptimizeVariableType",toString:$estr}
	,String: {_hx_name:"String",_hx_index:1,__enum__:"apptimize.ABTApptimizeVariableType",toString:$estr}
	,Double: {_hx_name:"Double",_hx_index:2,__enum__:"apptimize.ABTApptimizeVariableType",toString:$estr}
	,Integer: {_hx_name:"Integer",_hx_index:3,__enum__:"apptimize.ABTApptimizeVariableType",toString:$estr}
	,Boolean: {_hx_name:"Boolean",_hx_index:4,__enum__:"apptimize.ABTApptimizeVariableType",toString:$estr}
	,Array: {_hx_name:"Array",_hx_index:5,__enum__:"apptimize.ABTApptimizeVariableType",toString:$estr}
	,Dictionary: {_hx_name:"Dictionary",_hx_index:6,__enum__:"apptimize.ABTApptimizeVariableType",toString:$estr}
};
apptimize_ABTApptimizeVariableType.__constructs__ = [apptimize_ABTApptimizeVariableType.Invalid,apptimize_ABTApptimizeVariableType.String,apptimize_ABTApptimizeVariableType.Double,apptimize_ABTApptimizeVariableType.Integer,apptimize_ABTApptimizeVariableType.Boolean,apptimize_ABTApptimizeVariableType.Array,apptimize_ABTApptimizeVariableType.Dictionary];
var apptimize_ABTApptimizeVariable = function() { };
$hxClasses["apptimize.ABTApptimizeVariable"] = apptimize_ABTApptimizeVariable;
apptimize_ABTApptimizeVariable.__name__ = "apptimize.ABTApptimizeVariable";
apptimize_ABTApptimizeVariable.getValue = function(params,name,type,nestedType) {
	apptimize_ABTDataStore._checkForUpdatedMetadataIfNecessary();
	var store = apptimize_ABTDataStore.sharedInstance();
	var metadata = store.getMetaData(params.appkey);
	if(metadata == null) {
		return null;
	}
	var env = store.makeEnvironment(params);
	var alterations = metadata.selectAlterationsIntoArray(env);
	var _g = 0;
	while(_g < alterations.length) {
		var alteration = alterations[_g];
		++_g;
		if(alteration.getKey() == name) {
			var valueAlteration = ((alteration) instanceof apptimize_models_ABTValueAlteration) ? alteration : null;
			if(valueAlteration == null) {
				apptimize_ABTLogger.v("Alteration found for key \"" + alteration.getKey() + "\" isn't a value alteration.",{ fileName : "src/apptimize/ABTApptimizeVariable.hx", lineNumber : 41, className : "apptimize.ABTApptimizeVariable", methodName : "getValue"});
				return null;
			}
			var alterationType = apptimize_ABTApptimizeVariable.apptimizeVariableTypeForString(valueAlteration.getType());
			var alterationNestedType = null;
			if(valueAlteration.getNestedType() != null) {
				alterationNestedType = apptimize_ABTApptimizeVariable.apptimizeVariableTypeForString(valueAlteration.getNestedType());
			}
			if(alterationType == type && alterationNestedType == nestedType) {
				var variant = valueAlteration.getVariant();
				apptimize_ABTDataStore.sharedInstance().incrementVariantRunCount(params,variant);
				if(!valueAlteration.useDefaultValue()) {
					return valueAlteration.getValue();
				}
			}
		}
	}
	apptimize_ABTLogger.v("No alteration found for dynamic variable \"" + name + "\".",{ fileName : "src/apptimize/ABTApptimizeVariable.hx", lineNumber : 63, className : "apptimize.ABTApptimizeVariable", methodName : "getValue"});
	return null;
};
apptimize_ABTApptimizeVariable.apptimizeVariableTypeForString = function(stringType) {
	var type = stringType.toLowerCase();
	if(type == "string") {
		return apptimize_ABTApptimizeVariableType.String;
	} else if(type == "double") {
		return apptimize_ABTApptimizeVariableType.Double;
	} else if(type == "int") {
		return apptimize_ABTApptimizeVariableType.Integer;
	} else if(type == "boolean") {
		return apptimize_ABTApptimizeVariableType.Boolean;
	} else if(type == "list") {
		return apptimize_ABTApptimizeVariableType.Array;
	} else if(type == "dictionary") {
		return apptimize_ABTApptimizeVariableType.Dictionary;
	} else {
		return apptimize_ABTApptimizeVariableType.Invalid;
	}
};
var apptimize_util_PlatformLock = function() { };
$hxClasses["apptimize.util.PlatformLock"] = apptimize_util_PlatformLock;
apptimize_util_PlatformLock.__name__ = "apptimize.util.PlatformLock";
apptimize_util_PlatformLock.__isInterface__ = true;
apptimize_util_PlatformLock.prototype = {
	acquire: null
	,release: null
	,__class__: apptimize_util_PlatformLock
};
var apptimize_util_DefaultPlatformLock = function() {
};
$hxClasses["apptimize.util.DefaultPlatformLock"] = apptimize_util_DefaultPlatformLock;
apptimize_util_DefaultPlatformLock.__name__ = "apptimize.util.DefaultPlatformLock";
apptimize_util_DefaultPlatformLock.__interfaces__ = [apptimize_util_PlatformLock];
apptimize_util_DefaultPlatformLock.prototype = {
	acquire: function() {
		return true;
	}
	,release: function() {
		return;
	}
	,hxUnserialize: function(u) {
	}
	,__class__: apptimize_util_DefaultPlatformLock
};
var apptimize_util_ABTDataLock = function() { };
$hxClasses["apptimize.util.ABTDataLock"] = apptimize_util_ABTDataLock;
apptimize_util_ABTDataLock.__name__ = "apptimize.util.ABTDataLock";
apptimize_util_ABTDataLock.getNewLock = function(lockName) {
	return new apptimize_util_DefaultPlatformLock();
};
var apptimize_ABTDataStore = function() {
	this.sdkParameters = new apptimize_models_ABTSdkParameters(null);
	this.resultDispatchQueue = new apptimize_util_ABTDispatch("Results Logging Dispatch Queue");
	this.resultDispatchQueue.start();
	this.newMdFetcher = new apptimize_api_ABTSecondaryValuesClient();
	this.propChangeFetcher = new apptimize_api_ABTSecondaryValuesClient();
	this.metaDataCache = new haxe_ds_StringMap();
};
$hxClasses["apptimize.ABTDataStore"] = apptimize_ABTDataStore;
apptimize_ABTDataStore.__name__ = "apptimize.ABTDataStore";
apptimize_ABTDataStore.sharedInstance = function() {
	if(apptimize_ABTDataStore._instance == null) {
		apptimize_ABTDataStore._instance = new apptimize_ABTDataStore();
	}
	return apptimize_ABTDataStore._instance;
};
apptimize_ABTDataStore.clear = function() {
	apptimize_support_persistence_ABTPersistence.clear();
	apptimize_ABTDataStore._instance = null;
};
apptimize_ABTDataStore.shutdown = function() {
	apptimize_ABTDataStore._instance = null;
	apptimize_ABTDataStore.appKey = null;
	apptimize_ABTDataStore.serverGuid = null;
};
apptimize_ABTDataStore._getLastCheckTime = function() {
	var lastCheckTime = apptimize_support_persistence_ABTPersistence.loadString(apptimize_support_persistence_ABTPersistence.kMetadataLastCheckTimeKey);
	if(lastCheckTime != null) {
		return parseFloat(lastCheckTime);
	}
	return -10000.0;
};
apptimize_ABTDataStore._updateLastCheckTime = function(checkTime) {
	apptimize_support_persistence_ABTPersistence.saveString(apptimize_support_persistence_ABTPersistence.kMetadataLastCheckTimeKey,checkTime == null ? "null" : "" + checkTime);
};
apptimize_ABTDataStore._resetCheckTimeIfNeeded = function() {
	var resetClock = false;
	apptimize_util_ABTDataLock.CHECK_TIME_LOCK.acquire();
	try {
		var timeout = parseFloat(apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.METADATA_POLLING_INTERVAL_MS_KEY));
		var currentTime = new Date().getTime();
		var timeSinceLastCheck = currentTime - apptimize_ABTDataStore._getLastCheckTime();
		if(timeSinceLastCheck > timeout) {
			apptimize_ABTDataStore._updateLastCheckTime(currentTime);
			resetClock = true;
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.CHECK_TIME_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.CHECK_TIME_LOCK.release();
	return resetClock;
};
apptimize_ABTDataStore._getLastSubmitTime = function() {
	var lastSubmitCheckTime = apptimize_support_persistence_ABTPersistence.loadString(apptimize_support_persistence_ABTPersistence.kResultLastSubmitTimeKey);
	if(lastSubmitCheckTime != null) {
		return parseFloat(lastSubmitCheckTime);
	}
	return -10000.0;
};
apptimize_ABTDataStore._updateLastSubmitTime = function(checkTime) {
	apptimize_support_persistence_ABTPersistence.saveString(apptimize_support_persistence_ABTPersistence.kResultLastSubmitTimeKey,checkTime == null ? "null" : "" + checkTime);
};
apptimize_ABTDataStore.getAppKey = function() {
	return apptimize_ABTDataStore.appKey;
};
apptimize_ABTDataStore.checkForUpdatedMetaData = function(checkImmediately) {
	if(checkImmediately == null) {
		checkImmediately = false;
	}
	if(apptimize_ABTDataStore.shouldDisable()) {
		apptimize_ABTLogger.w("This SDK version disabled; not checking for updated metadata",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 223, className : "apptimize.ABTDataStore", methodName : "checkForUpdatedMetaData"});
		return;
	}
	apptimize_ABTLogger.v("Checking for updated metadata...",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 226, className : "apptimize.ABTDataStore", methodName : "checkForUpdatedMetaData"});
	if(apptimize_Apptimize._isInitialized() && (apptimize_ABTDataStore._resetCheckTimeIfNeeded() || checkImmediately)) {
		apptimize_api_ABTApiClient.sharedInstance().downloadMetaDataForKey(apptimize_ABTDataStore.getAppKey(),apptimize_ABTDataStore.sharedInstance()._getCurrentEtag(apptimize_ABTDataStore.getAppKey()));
	}
};
apptimize_ABTDataStore._checkForUpdatedMetadataIfNecessary = function() {
	if(!apptimize_api_ABTMetadataPoller.isPolling() && apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.METADATA_POLLING_INTERVAL_MS_KEY) >= 0) {
		apptimize_ABTDataStore.checkForUpdatedMetaData();
	}
	apptimize_ABTDataStore.sharedInstance()._submitResultsIfNecessary();
};
apptimize_ABTDataStore.getServerGUID = function() {
	if(apptimize_ABTDataStore.serverGuid == null) {
		apptimize_ABTDataStore.serverGuid = apptimize_api_ABTUserGuid.generateUserGuid();
	}
	return apptimize_ABTDataStore.serverGuid;
};
apptimize_ABTDataStore.shouldDisable = function() {
	var disabledVersions = apptimize_support_persistence_ABTPersistence.loadObject(apptimize_support_persistence_ABTPersistence.kDisabledVersions);
	if(disabledVersions == null) {
		return false;
	}
	if(disabledVersions.indexOf(apptimize_Apptimize.getApptimizeSDKVersion()) > -1) {
		return true;
	}
	return false;
};
apptimize_ABTDataStore.prototype = {
	resultLogs: null
	,metaDataCache: null
	,newMdFetcher: null
	,propChangeFetcher: null
	,resultDispatchQueue: null
	,sdkParameters: null
	,initialize: function() {
		this.resultLogs = apptimize_support_persistence_ABTPersistence.loadObject(apptimize_support_persistence_ABTPersistence.kResultLogsKey);
		if(this.resultLogs == null) {
			var results_cache_size = apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.RESULTS_CACHE_SIZE_KEY);
			if(js_Boot.getClass(results_cache_size) == String) {
				results_cache_size = Std.parseInt(results_cache_size);
				if(results_cache_size == null) {
					apptimize_ABTLogger.e("Invalid value specified for results_cache_size, defaulting to 10",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 102, className : "apptimize.ABTDataStore", methodName : "initialize"});
					results_cache_size = 10;
				}
			}
			this.resultLogs = new apptimize_util_ABTLRUCache(results_cache_size);
		}
	}
	,hasMetadata: function(appKey) {
		var hasMD = false;
		apptimize_util_ABTDataLock.METADATA_LOCK.acquire();
		try {
			hasMD = Object.prototype.hasOwnProperty.call(this.metaDataCache.h,appKey);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			apptimize_util_ABTDataLock.METADATA_LOCK.release();
			throw haxe_Exception.thrown(e);
		}
		apptimize_util_ABTDataLock.METADATA_LOCK.release();
		return hasMD;
	}
	,_getCurrentEtag: function(appKey) {
		var md = this.getMetaData(appKey);
		if(md == null) {
			return null;
		}
		return md.getEtag();
	}
	,loadMetaData: function(appKey) {
		apptimize_ABTDataStore.appKey = appKey;
		this.reloadFromDisk();
		if(!apptimize_ABTDataStore.shouldDisable()) {
			if(apptimize_ABTDataStore._resetCheckTimeIfNeeded() || apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.REFRESH_META_DATA_ON_SETUP) == true) {
				apptimize_api_ABTApiClient.sharedInstance().downloadMetaDataForKey(appKey,this._getCurrentEtag(appKey));
			}
		}
	}
	,_resetSubmitTimeIfNeeded: function(ignoreAppConfig) {
		if(ignoreAppConfig == null) {
			ignoreAppConfig = false;
		}
		var resetClock = false;
		apptimize_util_ABTDataLock.CHECK_TIME_LOCK.acquire();
		try {
			var timeout = this._getMinTimeBetweenPosts(ignoreAppConfig);
			var currentTime = new Date().getTime();
			var timeSinceLastCheck = currentTime - apptimize_ABTDataStore._getLastSubmitTime();
			if(timeSinceLastCheck > timeout) {
				apptimize_ABTDataStore._updateLastSubmitTime(currentTime);
				resetClock = true;
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			apptimize_util_ABTDataLock.CHECK_TIME_LOCK.release();
			throw haxe_Exception.thrown(e);
		}
		apptimize_util_ABTDataLock.CHECK_TIME_LOCK.release();
		return resetClock;
	}
	,_getMinTimeBetweenPosts: function(ignoreAppConfig) {
		if(ignoreAppConfig == null) {
			ignoreAppConfig = false;
		}
		var timeout = parseFloat(apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.RESULT_POST_DELAY_MS_KEY));
		var minTimeout = this.sdkParameters.minPostFrequencyMs;
		if(ignoreAppConfig) {
			if(minTimeout == null) {
				return -1;
			} else {
				return minTimeout;
			}
		} else {
			if(minTimeout != null && timeout < minTimeout) {
				return minTimeout;
			}
			return timeout;
		}
	}
	,_submitResultsIfNecessary: function() {
		if(this._resetSubmitTimeIfNeeded()) {
			this._flushTrackingInternal();
		}
	}
	,reloadFromDisk: function() {
		var metadata = apptimize_support_persistence_ABTPersistence.loadObject(apptimize_support_persistence_ABTPersistence.kMetadataKey);
		if(metadata != null) {
			apptimize_ABTLogger.v("Existing metadata loaded from storage, will update if necessary.",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 261, className : "apptimize.ABTDataStore", methodName : "reloadFromDisk"});
			this.onMetadataLoaded(metadata);
		} else {
			apptimize_ABTLogger.v("No existing metadata found in storage.",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 264, className : "apptimize.ABTDataStore", methodName : "reloadFromDisk"});
		}
	}
	,getRequestlessEnvironment: function(md) {
		var anonUserId = "anon";
		var currentUserId = null;
		var customProperties = null;
		var params = new apptimize_filter_ABTFilterEnvParams(currentUserId,anonUserId,customProperties,md.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
		var env = md.makeEnvironment(params,this.sdkParameters);
		return env;
	}
	,getUrlsForMetadata: function(md) {
		var env = this.getRequestlessEnvironment(md);
		var urls = md.extractNeededSecondaryUrls(env);
		return urls;
	}
	,onMetadataLoaded: function(md) {
		var _gthis = this;
		this.sdkParameters = md.extractSdkParameters(this.getRequestlessEnvironment(md));
		var urls = this.getUrlsForMetadata(md);
		this.newMdFetcher.fetch(urls,md.getSecondaryValues(),function(values,fetched) {
			var currentUrls = _gthis.getUrlsForMetadata(md);
			if(_gthis.newMdFetcher.needNewUrls(urls,currentUrls)) {
				apptimize_ABTLogger.w("urls changed while fetching values, retrying",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 314, className : "apptimize.ABTDataStore", methodName : "onMetadataLoaded"});
				_gthis.onMetadataLoaded(md);
				return;
			}
			md.setSecondaryValues(values);
			_gthis.overrideMetadata(md,false,fetched);
		});
	}
	,onMetadataReceived: function(md) {
		var _gthis = this;
		if(this.newMdFetcher.fetching()) {
			apptimize_ABTLogger.e("onMetadataReceived called while fetch already in progress",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 335, className : "apptimize.ABTDataStore", methodName : "onMetadataReceived"});
			return;
		}
		this.sdkParameters = md.extractSdkParameters(this.getRequestlessEnvironment(md));
		var urls = this.getUrlsForMetadata(md);
		var oldValues = null;
		var oldMD = this.getMetaData(md.getAppKey());
		if(oldMD != null) {
			oldValues = oldMD.getSecondaryValues();
		}
		this.newMdFetcher.fetch(urls,oldValues,function(values,fetched) {
			var currentUrls = _gthis.getUrlsForMetadata(md);
			if(_gthis.newMdFetcher.needNewUrls(urls,currentUrls)) {
				apptimize_ABTLogger.w("urls changed while fetching values, retrying",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 351, className : "apptimize.ABTDataStore", methodName : "onMetadataReceived"});
				_gthis.onMetadataReceived(md);
				return;
			}
			md.setSecondaryValues(values);
			_gthis.overrideMetadata(md,true,fetched);
		});
	}
	,overrideMetadata: function(md,fromNetwork,secValsChanged) {
		var oldMd = null;
		var isKeyValid = true;
		var mdUpdated = false;
		apptimize_util_ABTDataLock.METADATA_LOCK.acquire();
		try {
			isKeyValid = md.getAppKey() == apptimize_ABTDataStore.getAppKey();
			var key = md.getAppKey();
			oldMd = this.metaDataCache.h[key];
			if(isKeyValid) {
				if(oldMd == null || oldMd.getSequenceNumber() < md.getSequenceNumber()) {
					mdUpdated = true;
				}
				if(mdUpdated || secValsChanged) {
					this.metaDataCache.h[key] = md;
					this.sdkParameters = md.extractSdkParameters(this.getRequestlessEnvironment(md));
					if(fromNetwork) {
						apptimize_support_persistence_ABTPersistence.saveObject(apptimize_support_persistence_ABTPersistence.kDisabledVersions,md.getDisabledVersions());
					}
				}
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			apptimize_util_ABTDataLock.METADATA_LOCK.release();
			throw haxe_Exception.thrown(e);
		}
		apptimize_util_ABTDataLock.METADATA_LOCK.release();
		md.copyPersistentValues(oldMd);
		if(mdUpdated && fromNetwork || secValsChanged) {
			this.writeToDiskIfNeeded();
			this.dispatchEnrollmentChangeCallbacks(oldMd,md);
		}
		if(mdUpdated) {
			apptimize_events_ABTEventManager.dispatchOnMetadataUpdated();
			apptimize_ABTLogger.i("Updated metadata for app key \"" + md.getAppKey() + "\".",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 456, className : "apptimize.ABTDataStore", methodName : "overrideMetadata"});
			apptimize_ABTLogger.v("New metadata:\n" + haxe_format_JsonPrinter.print(md.getMetaData(),null,"  "),{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 458, className : "apptimize.ABTDataStore", methodName : "overrideMetadata"});
			if((oldMd == null || apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.REFRESH_META_DATA_ON_SETUP) == true) && apptimize_ApptimizeInternal._trySetReady()) {
				apptimize_events_ABTEventManager.dispatchOnApptimizeInitialized();
				apptimize_ABTLogger.i("Apptimize initialized after metadata download.",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 465, className : "apptimize.ABTDataStore", methodName : "overrideMetadata"});
			}
		} else {
			apptimize_ABTLogger.i("Existing metadata is up-to-date.",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 469, className : "apptimize.ABTDataStore", methodName : "overrideMetadata"});
			if(apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.REFRESH_META_DATA_ON_SETUP) == true && apptimize_ApptimizeInternal._trySetReady()) {
				apptimize_events_ABTEventManager.dispatchOnApptimizeInitialized();
				apptimize_ABTLogger.i("Apptimize initialized after metadata unchanged.",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 476, className : "apptimize.ABTDataStore", methodName : "overrideMetadata"});
			}
		}
	}
	,getMetaData: function(appKey) {
		if(this.metaDataCache == null) {
			return null;
		}
		var md = null;
		apptimize_util_ABTDataLock.METADATA_LOCK.acquire();
		try {
			md = this.metaDataCache.h[appKey];
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			apptimize_util_ABTDataLock.METADATA_LOCK.release();
			throw haxe_Exception.thrown(e);
		}
		apptimize_util_ABTDataLock.METADATA_LOCK.release();
		if(md != null && md.getAppKey() != appKey) {
			apptimize_ABTLogger.e("Metadata appkey does not match requested key",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 494, className : "apptimize.ABTDataStore", methodName : "getMetaData"});
			return null;
		}
		return md;
	}
	,dispatchEnrollmentChangeCallbacks: function(oldMetadata,newMetadata) {
	}
	,makeEnvironment: function(params) {
		var metadata = this.getMetaData(params.appkey);
		if(metadata == null) {
			return null;
		}
		return metadata.makeEnvironment(params,this.sdkParameters);
	}
	,writeToDiskIfNeeded: function() {
		var md = this.getMetaData(apptimize_ABTDataStore.getAppKey());
		if(md != null) {
			apptimize_support_persistence_ABTPersistence.saveObject(apptimize_support_persistence_ABTPersistence.kMetadataKey,md,null,true);
		}
	}
	,_saveResultLogs: function() {
		apptimize_support_persistence_ABTPersistence.saveObject(apptimize_support_persistence_ABTPersistence.kResultLogsKey,this.resultLogs,null,true);
	}
	,addResultLogEntry: function(env,entry) {
		var logKey = env.getUniqueUserID();
		apptimize_ABTDataStore.resultsLock.acquire();
		try {
			var resultLog = this.resultLogs.getValue(logKey);
			if(resultLog == null) {
				resultLog = new apptimize_models_results_ABTResultLog(env);
				this.resultLogs.insert(logKey,resultLog,$bind(this,this._submitResultLog),this.resultDispatchQueue);
			}
			resultLog.logEntry(entry);
			if(resultLog.entryCount() > apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.MAXIMUM_RESULT_ENTRIES_KEY)) {
				this.resultLogs.remove(logKey,$bind(this,this._submitResultLog),this.resultDispatchQueue);
			}
			this._saveResultLogs();
			this._submitResultsIfNecessary();
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			apptimize_ABTDataStore.resultsLock.release();
			throw haxe_Exception.thrown(e);
		}
		apptimize_ABTDataStore.resultsLock.release();
	}
	,_submitResultLog: function(log) {
		if(apptimize_ABTDataStore.shouldDisable()) {
			return;
		}
		apptimize_api_ABTApiClient.sharedInstance().postResultsForKey(log.getAppKey(),log);
		this._saveResultLogs();
	}
	,flushTracking: function() {
		if(this._resetSubmitTimeIfNeeded(true)) {
			this._flushTrackingInternal();
		}
	}
	,_flushTrackingInternal: function() {
		apptimize_ABTLogger.v("Posting results...",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 752, className : "apptimize.ABTDataStore", methodName : "_flushTrackingInternal"});
		apptimize_ABTDataStore.resultsLock.acquire();
		try {
			this.resultLogs.clear($bind(this,this._submitResultLog),this.resultDispatchQueue);
			this._saveResultLogs();
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			apptimize_ABTDataStore.resultsLock.release();
			throw haxe_Exception.thrown(e);
		}
		apptimize_ABTDataStore.resultsLock.release();
	}
	,incrementVariantRunCount: function(params,variant) {
		if(js_Boot.getClass(variant) == apptimize_models_ABTHotfixVariant) {
			return;
		}
		var variantStickyString = "v" + variant.getVariantID() + "_" + variant.getCycle();
		var experimentStickyString = "e" + variant.getExperimentID() + "_" + variant.getCycle();
		var phase = variant.getPhase();
		var isFirstParticipation = false;
		var env = this.makeEnvironment(params);
		var variantShownEntry = new apptimize_models_results_ABTResultEntryVariantShown(env,variant.getVariantID(),variant.getCycle(),phase);
		apptimize_ABTLogger.v("Incrementing variant run count for variant ID \"" + variant.getVariantID() + "\".",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 787, className : "apptimize.ABTDataStore", methodName : "incrementVariantRunCount"});
		var variantInfo = apptimize_VariantInfo.initWithVariant(variant,env.userID,env.anonID);
		apptimize_events_ABTEventManager.dispatchOnParticipatedInExperiment(variantInfo,isFirstParticipation);
		this.addResultLogEntry(env,variantShownEntry);
	}
	,generateEvent: function(eventName,eventSource,eventAttributes,params) {
		if(!apptimize_Apptimize._isInitialized() || apptimize_ABTDataStore.sharedInstance().getMetaData(params.appkey) == null) {
			apptimize_ABTLogger.w("Event \"" + eventName + "\" will not be tracked until Apptimize.setup() is called and MetaData available.",{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 798, className : "apptimize.ABTDataStore", methodName : "generateEvent"});
			return;
		}
		var env = this.makeEnvironment(params);
		var eventEntry = new apptimize_models_results_ABTResultEntryEvent(env,eventName,eventSource,eventAttributes);
		var logString = "Event \"" + eventName + "\"";
		if(eventAttributes != null) {
			logString = logString + " with value " + Std.string(eventAttributes.h[apptimize_ApptimizeInternal.kABTValueEventKey]);
		}
		logString += " tracked.";
		apptimize_ABTLogger.v(logString,{ fileName : "src/apptimize/ABTDataStore.hx", lineNumber : 812, className : "apptimize.ABTDataStore", methodName : "generateEvent"});
		this.addResultLogEntry(env,eventEntry);
	}
	,__class__: apptimize_ABTDataStore
};
var apptimize_ABTLogger = function() { };
$hxClasses["apptimize.ABTLogger"] = apptimize_ABTLogger;
apptimize_ABTLogger.__name__ = "apptimize.ABTLogger";
apptimize_ABTLogger.logLevelFromString = function(logLevel) {
	var level = logLevel.toUpperCase();
	if(level == "LOG_LEVEL_VERBOSE") {
		return apptimize_ABTLogger.LOG_LEVEL_VERBOSE;
	}
	if(level == "LOG_LEVEL_DEBUG") {
		return apptimize_ABTLogger.LOG_LEVEL_DEBUG;
	}
	if(level == "LOG_LEVEL_INFO") {
		return apptimize_ABTLogger.LOG_LEVEL_INFO;
	}
	if(level == "LOG_LEVEL_WARN") {
		return apptimize_ABTLogger.LOG_LEVEL_WARN;
	}
	if(level == "LOG_LEVEL_ERROR") {
		return apptimize_ABTLogger.LOG_LEVEL_ERROR;
	}
	if(level == "LOG_LEVEL_NONE") {
		return apptimize_ABTLogger.LOG_LEVEL_NONE;
	}
	return apptimize_ABTLogger.LOG_LEVEL_NONE;
};
apptimize_ABTLogger.setLogLevel = function(level) {
	apptimize_ABTLogger.logLevel = level;
};
apptimize_ABTLogger.c = function(msg,infos) {
	apptimize_ABTLogger.log_out(msg,infos);
	apptimize_util_ABTException.throwException(msg);
};
apptimize_ABTLogger.e = function(msg,infos) {
	if(apptimize_ABTLogger.logLevel <= apptimize_ABTLogger.LOG_LEVEL_ERROR) {
		apptimize_ABTLogger.log_out(msg,infos);
	}
};
apptimize_ABTLogger.w = function(msg,infos) {
	if(apptimize_ABTLogger.logLevel <= apptimize_ABTLogger.LOG_LEVEL_WARN) {
		apptimize_ABTLogger.log_out(msg,infos);
	}
};
apptimize_ABTLogger.i = function(msg,infos) {
	if(apptimize_ABTLogger.logLevel <= apptimize_ABTLogger.LOG_LEVEL_INFO) {
		apptimize_ABTLogger.log_out(msg,infos);
	}
};
apptimize_ABTLogger.d = function(msg,infos) {
	if(apptimize_ABTLogger.logLevel <= apptimize_ABTLogger.LOG_LEVEL_DEBUG) {
		apptimize_ABTLogger.log_out(msg,infos);
	}
};
apptimize_ABTLogger.v = function(msg,infos) {
	if(apptimize_ABTLogger.logLevel <= apptimize_ABTLogger.LOG_LEVEL_VERBOSE) {
		apptimize_ABTLogger.log_out(msg,infos);
	}
};
apptimize_ABTLogger.log_out = function(msg,infos) {
	if(apptimize_ABTLogger.useTraceForLogging && haxe_Log.trace != apptimize_ABTLogger.trace) {
		haxe_Log.trace(msg,infos);
		return;
	}
	apptimize_ABTLogger.traceInternal("Apptimize: " + msg,infos);
};
apptimize_ABTLogger.redirectTraceStatements = function() {
	haxe_Log.trace = apptimize_ABTLogger.trace;
};
apptimize_ABTLogger.traceInternal = function(str,infos) {
	if(typeof console != "undefined" && console.log != null) {
		console.log(str);
	}
};
apptimize_ABTLogger.trace = function(val,infos) {
	var str = Std.string(val);
	apptimize_ABTLogger.v(str,infos);
};
var apptimize_ApptimizeInternal = function() { };
$hxClasses["apptimize.ApptimizeInternal"] = apptimize_ApptimizeInternal;
apptimize_ApptimizeInternal.__name__ = "apptimize.ApptimizeInternal";
apptimize_ApptimizeInternal._isInitialized = function() {
	var result = false;
	apptimize_util_ABTDataLock.INITIALIZATION.acquire();
	try {
		result = apptimize_ApptimizeInternal._state == 2 || apptimize_ApptimizeInternal._state == 3;
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.INITIALIZATION.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.INITIALIZATION.release();
	return result;
};
apptimize_ApptimizeInternal.setState = function(state) {
	apptimize_util_ABTDataLock.INITIALIZATION.acquire();
	try {
		apptimize_ApptimizeInternal._state = state;
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.INITIALIZATION.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.INITIALIZATION.release();
};
apptimize_ApptimizeInternal._trySetReady = function() {
	var result = false;
	apptimize_util_ABTDataLock.INITIALIZATION.acquire();
	try {
		if(apptimize_ApptimizeInternal._state == 2) {
			result = true;
			apptimize_ApptimizeInternal._state = 3;
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.INITIALIZATION.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.INITIALIZATION.release();
	return result;
};
apptimize_ApptimizeInternal._setup = function(appKey,configAttributes,setupComplete) {
	var canInitialize = true;
	apptimize_util_ABTDataLock.INITIALIZATION.acquire();
	try {
		if(apptimize_ApptimizeInternal._state != 0) {
			apptimize_ABTLogger.w("Apptimize setup has already been called.",{ fileName : "src/apptimize/ApptimizeInternal.hx", lineNumber : 73, className : "apptimize.ApptimizeInternal", methodName : "_setup"});
			canInitialize = false;
		} else {
			apptimize_ApptimizeInternal._state = 1;
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.INITIALIZATION.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.INITIALIZATION.release();
	if(canInitialize == false) {
		return;
	}
	apptimize_ABTLogger.redirectTraceStatements();
	var configProps = apptimize_support_properties_ABTConfigProperties.sharedInstance();
	if(configAttributes != null) {
		configProps.setProperties(apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(configAttributes));
	}
	if(configProps.isPropertyAvailable(apptimize_support_properties_ABTConfigProperties.LOG_LEVEL_KEY)) {
		var logLevel = configProps.valueForProperty(apptimize_support_properties_ABTConfigProperties.LOG_LEVEL_KEY);
		apptimize_ABTLogger.setLogLevel(apptimize_ABTLogger.logLevelFromString(logLevel));
	}
	if(configProps.isPropertyAvailable(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_ENVIRONMENT_KEY) || configProps.isPropertyAvailable(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_REGION_KEY)) {
		var environment = configProps.valueForProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_ENVIRONMENT_KEY);
		if(environment == null) {
			environment = "prod";
		}
		var region = configProps.valueForProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_REGION_KEY);
		if(region == null) {
			region = "default";
		}
		switch(region) {
		case "eucs":
			switch(environment) {
			case "local":
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY,"https://local.apptimize.co/api/metadata/v4/");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY,"https://local.apptimize.co");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY,0);
				break;
			case "prod":
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_LL_KEY,"https://md-ll.apptimize.eu/api/metadata/v4/");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_HL_KEY,"https://md-hl.apptimize.eu/api/metadata/v4/");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY,"https://mapi.apptimize.eu");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY,6925);
				break;
			case "staging":
				if(region != "default") {
					apptimize_ABTLogger.v("Apptimize region '" + region + "' does not have a staging environment. Falling back to default region.",{ fileName : "src/apptimize/ApptimizeInternal.hx", lineNumber : 116, className : "apptimize.ApptimizeInternal", methodName : "_setup"});
				}
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY,"https://staging-md.apptimize.co/api/metadata/v4/");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY,"https://staging-mapi.apptimize.co");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY,206245);
				break;
			default:
			}
			break;
		case "gcp":
			switch(environment) {
			case "local":
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY,"https://local.apptimize.co/api/metadata/v4/");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY,"https://local.apptimize.co");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY,0);
				break;
			case "staging":
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY,"https://gcp-stag-md.apptimize.co/api/metadata/v4/");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY,"https://gcp-stag-mapi.apptimize.co");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY,206245);
				break;
			default:
			}
			break;
		default:
			switch(environment) {
			case "local":
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY,"https://local.apptimize.co/api/metadata/v4/");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY,"https://local.apptimize.co");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY,0);
				break;
			case "staging":
				if(region != "default") {
					apptimize_ABTLogger.v("Apptimize region '" + region + "' does not have a staging environment. Falling back to default region.",{ fileName : "src/apptimize/ApptimizeInternal.hx", lineNumber : 116, className : "apptimize.ApptimizeInternal", methodName : "_setup"});
				}
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY,"https://staging-md.apptimize.co/api/metadata/v4/");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY,"https://staging-mapi.apptimize.co");
				configProps.setProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY,206245);
				break;
			default:
			}
		}
	}
	if(appKey != null) {
		apptimize_ABTLogger.v("Initializing Apptimize with app key: \"" + appKey + "\".",{ fileName : "src/apptimize/ApptimizeInternal.hx", lineNumber : 129, className : "apptimize.ApptimizeInternal", methodName : "_setup"});
	}
	apptimize_ABTDataStore.sharedInstance().initialize();
	apptimize_support_initialize_ABTPlatformInitialize.initialize();
	var threadCount = 8;
	if(configProps.isPropertyAvailable(apptimize_support_properties_ABTConfigProperties.RESULT_POST_THREAD_POOL_SIZE_KEY)) {
		threadCount = configProps.valueForProperty(apptimize_support_properties_ABTConfigProperties.RESULT_POST_THREAD_POOL_SIZE_KEY);
	}
	apptimize_support_persistence_ABTPersistence.loadFromHighLatency(function() {
		apptimize_api_ABTApiResultsPost.loadPendingLogs();
		setupComplete();
		apptimize_api_ABTApiResultsPost.startDispatching(threadCount);
	});
};
apptimize_ApptimizeInternal.shutdown = function() {
	apptimize_util_ABTDataLock.INITIALIZATION.acquire();
	try {
		if(apptimize_ApptimizeInternal._state == 2 || apptimize_ApptimizeInternal._state == 3) {
			apptimize_api_ABTApiResultsPost.savePendingLogs();
			apptimize_support_persistence_ABTPersistence.saveToHighLatency();
			apptimize_support_initialize_ABTPlatformInitialize.shutdownPlatform();
			apptimize_ABTDataStore.shutdown();
			apptimize_support_persistence_ABTPersistence.shutdown();
			apptimize_ApptimizeInternal._state = 0;
			apptimize_ABTLogger.i("Apptimize has shutdown",{ fileName : "src/apptimize/ApptimizeInternal.hx", lineNumber : 160, className : "apptimize.ApptimizeInternal", methodName : "shutdown"});
		} else {
			apptimize_ABTLogger.w("Apptimize is not initialized. Unable to shutdown().",{ fileName : "src/apptimize/ApptimizeInternal.hx", lineNumber : 162, className : "apptimize.ApptimizeInternal", methodName : "shutdown"});
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.INITIALIZATION.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.INITIALIZATION.release();
};
apptimize_ApptimizeInternal.generateTrackEvent = function(envParams,eventName,eventValue) {
	var value = null;
	if(eventValue != null) {
		var _g = new haxe_ds_StringMap();
		_g.h[apptimize_ApptimizeInternal.kABTValueEventKey] = eventValue;
		value = _g;
	}
	apptimize_ABTDataStore.sharedInstance().generateEvent(eventName,apptimize_ApptimizeInternal.kABTEventSourceApptimize,value,envParams);
};
apptimize_ApptimizeInternal._getCodeBlockMethod = function(envParams,codeBlockVariableName) {
	var cbVarName = codeBlockVariableName;
	if(cbVarName == null || cbVarName == "") {
		apptimize_ABTLogger.w("Attempting to runCodeBlock() without specifying a code block name! Returning baseline original variant.",{ fileName : "src/apptimize/ApptimizeInternal.hx", lineNumber : 179, className : "apptimize.ApptimizeInternal", methodName : "_getCodeBlockMethod"});
	} else {
		var _g = 0;
		var _g1 = apptimize_ApptimizeInternal._getAlterations(envParams);
		while(_g < _g1.length) {
			var alteration = _g1[_g];
			++_g;
			if(alteration != null && js_Boot.getClass(alteration) == apptimize_models_ABTBlockAlteration) {
				var block = alteration;
				var variant = block.getVariant();
				if(variant.getCodeBlockName() != cbVarName) {
					continue;
				}
				apptimize_ABTDataStore.sharedInstance().incrementVariantRunCount(envParams,block.getVariant());
				return block.methodName;
			}
		}
		apptimize_ABTLogger.w("Not participating in any code block experiments with name \"" + codeBlockVariableName + "\". Returning baseline original variant.",{ fileName : "src/apptimize/ApptimizeInternal.hx", lineNumber : 194, className : "apptimize.ApptimizeInternal", methodName : "_getCodeBlockMethod"});
	}
	return "baseline";
};
apptimize_ApptimizeInternal.getWinnerVariantInfo = function(userID,anonID,customAttributes) {
	var variantInfos = [];
	var attrMap = apptimize_util_ABTUtilDictionary.nativeObjectToStringMap(customAttributes);
	var envParams = new apptimize_filter_ABTFilterEnvParams(userID,anonID,attrMap,apptimize_ABTDataStore.getAppKey(),apptimize_support_properties_ABTApplicationProperties.sharedInstance(),apptimize_support_properties_ABTInternalProperties.sharedInstance());
	var _g = 0;
	var _g1 = apptimize_ApptimizeInternal._getVariants(envParams,true);
	while(_g < _g1.length) {
		var variant = _g1[_g];
		++_g;
		var hotfix = variant;
		variantInfos.push(apptimize_WinnerVariantInfo.initWithVariant(hotfix,userID,anonID));
	}
	return apptimize_util_ABTUtilArray.toNativeArray(variantInfos,apptimize_util_ArrayType.WinnerVariantInfo);
};
apptimize_ApptimizeInternal._getVariants = function(envParams,getWinners) {
	if(getWinners == null) {
		getWinners = false;
	}
	apptimize_ABTDataStore._checkForUpdatedMetadataIfNecessary();
	var alterations = apptimize_ApptimizeInternal._getAlterations(envParams);
	var variants = new haxe_ds_IntMap();
	var _g = 0;
	while(_g < alterations.length) {
		var alteration = alterations[_g];
		++_g;
		var variant = alteration.getVariant();
		if(getWinners && js_Boot.getClass(variant) == apptimize_models_ABTHotfixVariant || !getWinners && js_Boot.getClass(variant) != apptimize_models_ABTHotfixVariant) {
			var key = variant.getVariantID();
			if(!variants.h.hasOwnProperty(key)) {
				var k = variant.getVariantID();
				variants.h[k] = variant;
			}
		}
	}
	return Lambda.array(variants);
};
apptimize_ApptimizeInternal._getAlterations = function(envParams) {
	var alterations = [];
	var store = apptimize_ABTDataStore.sharedInstance();
	var metadata = store.getMetaData(envParams.appkey);
	if(metadata != null) {
		alterations = metadata.selectAlterationsIntoArray(store.makeEnvironment(envParams));
	}
	return alterations;
};
var apptimize_ApptimizeExperimentType = $hxEnums["apptimize.ApptimizeExperimentType"] = { __ename__:"apptimize.ApptimizeExperimentType",__constructs__:null
	,CodeBlock: {_hx_name:"CodeBlock",_hx_index:0,__enum__:"apptimize.ApptimizeExperimentType",toString:$estr}
	,FeatureFlag: {_hx_name:"FeatureFlag",_hx_index:1,__enum__:"apptimize.ApptimizeExperimentType",toString:$estr}
	,DynamicVariables: {_hx_name:"DynamicVariables",_hx_index:2,__enum__:"apptimize.ApptimizeExperimentType",toString:$estr}
	,Visual: {_hx_name:"Visual",_hx_index:3,__enum__:"apptimize.ApptimizeExperimentType",toString:$estr}
	,Unknown: {_hx_name:"Unknown",_hx_index:4,__enum__:"apptimize.ApptimizeExperimentType",toString:$estr}
	,FeatureVariables: {_hx_name:"FeatureVariables",_hx_index:5,__enum__:"apptimize.ApptimizeExperimentType",toString:$estr}
};
apptimize_ApptimizeExperimentType.__constructs__ = [apptimize_ApptimizeExperimentType.CodeBlock,apptimize_ApptimizeExperimentType.FeatureFlag,apptimize_ApptimizeExperimentType.DynamicVariables,apptimize_ApptimizeExperimentType.Visual,apptimize_ApptimizeExperimentType.Unknown,apptimize_ApptimizeExperimentType.FeatureVariables];
var apptimize_WinnerVariantInfo = $hx_exports["WinnerVariantInfo"] = function(variantId,hotfixName,userId,anonymousUserId,experimentId) {
	this._variantId = variantId;
	this._hotfixName = hotfixName;
	this._userId = userId;
	this._experimentId = experimentId;
	this._anonymousUserId = anonymousUserId;
};
$hxClasses["apptimize.WinnerVariantInfo"] = apptimize_WinnerVariantInfo;
apptimize_WinnerVariantInfo.__name__ = "apptimize.WinnerVariantInfo";
apptimize_WinnerVariantInfo.initWithVariant = function(variant,userId,anonymousUserId) {
	return new apptimize_WinnerVariantInfo(variant.getVariantID(),variant.getHotfixName(),userId,anonymousUserId,variant.getExperimentID());
};
apptimize_WinnerVariantInfo.prototype = {
	_hotfixName: null
	,_variantId: null
	,_userId: null
	,_anonymousUserId: null
	,_experimentId: null
	,getExperimentId: function() {
		return this._experimentId;
	}
	,getWinnerName: function() {
		return this._hotfixName;
	}
	,getUserId: function() {
		return this._userId;
	}
	,getVariantId: function() {
		return this._variantId;
	}
	,getAnonymousUserId: function() {
		return this._anonymousUserId;
	}
	,__class__: apptimize_WinnerVariantInfo
};
var apptimize_api_ABTApiClient = function() {
};
$hxClasses["apptimize.api.ABTApiClient"] = apptimize_api_ABTApiClient;
apptimize_api_ABTApiClient.__name__ = "apptimize.api.ABTApiClient";
apptimize_api_ABTApiClient.sharedInstance = function() {
	if(apptimize_api_ABTApiClient._instance == null) {
		apptimize_api_ABTApiClient._instance = new apptimize_api_ABTApiClient();
	}
	return apptimize_api_ABTApiClient._instance;
};
apptimize_api_ABTApiClient.prototype = {
	downloadMetaDataForKey: function(appKey,etag) {
		var mdRequest = new apptimize_api_ABTApiMetadataRequest(this,appKey,etag,function(json,etag) {
			var md = apptimize_models_ABTMetadata.loadFromString(json);
			md.setEtag(etag);
			apptimize_ABTDataStore.sharedInstance().onMetadataReceived(md);
		},function(error) {
			apptimize_ABTLogger.e("Failed to download metadata with error: " + error,{ fileName : "src/apptimize/api/ABTApiClient.hx", lineNumber : 25, className : "apptimize.api.ABTApiClient", methodName : "downloadMetaDataForKey"});
			if(apptimize_ApptimizeInternal._trySetReady()) {
				apptimize_events_ABTEventManager.dispatchOnApptimizeInitialized();
			}
		});
	}
	,postResultsForKey: function(appKey,log) {
		var resultsRequest = new apptimize_api_ABTApiResultsPost(this,appKey,log,function(response) {
		},function(response) {
		});
		apptimize_api_ABTApiResultsPost.pushRequest(resultsRequest);
	}
	,__class__: apptimize_api_ABTApiClient
};
var apptimize_api_ABTApiMetadataRequest = function(client,applicationKey,etag,success,failure) {
	var _gthis = this;
	this.apiClient = client;
	this.appKey = applicationKey;
	this.successCallback = success;
	this.failureCallback = failure;
	var url = this._getMetadataUrl();
	url += applicationKey;
	apptimize_ABTLogger.v("Checking for new metadata from url: " + url,{ fileName : "src/apptimize/api/ABTApiMetadataRequest.hx", lineNumber : 28, className : "apptimize.api.ABTApiMetadataRequest", methodName : "new"});
	apptimize_http_ABTHttpRequest.get(url,this._headersForRequest(etag),function(response) {
		_gthis._apiSuccess(response);
	},function(response) {
		_gthis.failureCallback(response.text);
	});
};
$hxClasses["apptimize.api.ABTApiMetadataRequest"] = apptimize_api_ABTApiMetadataRequest;
apptimize_api_ABTApiMetadataRequest.__name__ = "apptimize.api.ABTApiMetadataRequest";
apptimize_api_ABTApiMetadataRequest.prototype = {
	apiClient: null
	,appKey: null
	,successCallback: null
	,failureCallback: null
	,_apiSuccess: function(response) {
		if(response.responseCode == 304) {
			apptimize_ABTLogger.v("Got HTTP response 304, metadata not updated.",{ fileName : "src/apptimize/api/ABTApiMetadataRequest.hx", lineNumber : 39, className : "apptimize.api.ABTApiMetadataRequest", methodName : "_apiSuccess"});
			if(apptimize_ApptimizeInternal._trySetReady()) {
				apptimize_events_ABTEventManager.dispatchOnApptimizeInitialized();
			}
			return;
		}
		var json = apptimize_api_ABTMetadataProcessor.jsonFromMetadataDownload(response.bytes);
		if(json != null) {
			apptimize_ABTLogger.v("Request for metadata completed successfully.",{ fileName : "src/apptimize/api/ABTApiMetadataRequest.hx", lineNumber : 50, className : "apptimize.api.ABTApiMetadataRequest", methodName : "_apiSuccess"});
			this.successCallback(json,response.etag);
		} else {
			var errorString = "Failed to download metadata with error: response was empty.";
			apptimize_ABTLogger.w(errorString,{ fileName : "src/apptimize/api/ABTApiMetadataRequest.hx", lineNumber : 54, className : "apptimize.api.ABTApiMetadataRequest", methodName : "_apiSuccess"});
			this.failureCallback(errorString);
		}
	}
	,_getMetadataUrl: function() {
		var metadataUrl = apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY);
		if(metadataUrl != null) {
			return metadataUrl;
		} else if(apptimize_ABTDataStore.sharedInstance().hasMetadata(this.appKey)) {
			return apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_HL_KEY);
		} else {
			return apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.META_DATA_URL_LL_KEY);
		}
	}
	,_headersForRequest: function(etag) {
		if(etag != null) {
			var _g = new haxe_ds_StringMap();
			_g.h["ETag"] = etag;
			_g.h["If-None-Match"] = etag;
			return _g;
		} else {
			return null;
		}
	}
	,__class__: apptimize_api_ABTApiMetadataRequest
};
var hx_concurrent_atomic__$AtomicInt_AtomicIntImpl = function(initialValue) {
	if(initialValue == null) {
		initialValue = 0;
	}
	this.lock = new hx_concurrent_lock_RLock();
	this._value = initialValue;
};
$hxClasses["hx.concurrent.atomic._AtomicInt.AtomicIntImpl"] = hx_concurrent_atomic__$AtomicInt_AtomicIntImpl;
hx_concurrent_atomic__$AtomicInt_AtomicIntImpl.__name__ = "hx.concurrent.atomic._AtomicInt.AtomicIntImpl";
hx_concurrent_atomic__$AtomicInt_AtomicIntImpl.prototype = {
	lock: null
	,_value: null
	,get_value: function() {
		this.lock.acquire();
		var result = this._value;
		this.lock.release();
		return result;
	}
	,set_value: function(val) {
		this.lock.acquire();
		this._value = val;
		this.lock.release();
		return val;
	}
	,incrementAndGet: function(amount) {
		if(amount == null) {
			amount = 1;
		}
		this.lock.acquire();
		var result = this;
		var result1 = result._value += amount;
		this.lock.release();
		return result1;
	}
	,__class__: hx_concurrent_atomic__$AtomicInt_AtomicIntImpl
	,__properties__: {set_value:"set_value",get_value:"get_value"}
};
var haxe_IMap = function() { };
$hxClasses["haxe.IMap"] = haxe_IMap;
haxe_IMap.__name__ = "haxe.IMap";
haxe_IMap.__isInterface__ = true;
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.createCopy = function(h) {
	var copy = new haxe_ds_StringMap();
	for (var key in h) copy.h[key] = h[key];
	return copy;
};
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
	,__class__: haxe_ds_StringMap
};
var hx_concurrent_collection_SynchronizedLinkedList = {};
hx_concurrent_collection_SynchronizedLinkedList._new = function(initialValues) {
	var this1 = new hx_concurrent_collection__$SynchronizedLinkedList_SynchronizedLinkedListImpl();
	if(initialValues != null) {
		this1.addAll(initialValues);
	}
	return this1;
};
var hx_concurrent_collection_Collection = function() { };
$hxClasses["hx.concurrent.collection.Collection"] = hx_concurrent_collection_Collection;
hx_concurrent_collection_Collection.__name__ = "hx.concurrent.collection.Collection";
hx_concurrent_collection_Collection.__isInterface__ = true;
hx_concurrent_collection_Collection.prototype = {
	iterator: null
	,__class__: hx_concurrent_collection_Collection
};
var hx_concurrent_collection_OrderedCollection = function() { };
$hxClasses["hx.concurrent.collection.OrderedCollection"] = hx_concurrent_collection_OrderedCollection;
hx_concurrent_collection_OrderedCollection.__name__ = "hx.concurrent.collection.OrderedCollection";
hx_concurrent_collection_OrderedCollection.__isInterface__ = true;
hx_concurrent_collection_OrderedCollection.__interfaces__ = [hx_concurrent_collection_Collection];
var hx_concurrent_collection__$SynchronizedLinkedList_SynchronizedLinkedListImpl = function() {
	this._sync = new hx_concurrent_lock_RLock();
	this._items = new haxe_ds_List();
};
$hxClasses["hx.concurrent.collection._SynchronizedLinkedList.SynchronizedLinkedListImpl"] = hx_concurrent_collection__$SynchronizedLinkedList_SynchronizedLinkedListImpl;
hx_concurrent_collection__$SynchronizedLinkedList_SynchronizedLinkedListImpl.__name__ = "hx.concurrent.collection._SynchronizedLinkedList.SynchronizedLinkedListImpl";
hx_concurrent_collection__$SynchronizedLinkedList_SynchronizedLinkedListImpl.__interfaces__ = [hx_concurrent_collection_OrderedCollection];
hx_concurrent_collection__$SynchronizedLinkedList_SynchronizedLinkedListImpl.prototype = {
	_items: null
	,_sync: null
	,get_length: function() {
		var _gthis = this;
		return this._sync.execute(function() {
			var len = 0;
			var _g_head = _gthis._items.h;
			while(_g_head != null) {
				var val = _g_head.item;
				_g_head = _g_head.next;
				var item = val;
				++len;
			}
			return len;
		});
	}
	,add: function(item) {
		var _gthis = this;
		this._sync.execute(function() {
			_gthis._items.add(item);
		});
	}
	,addAll: function(coll) {
		var _gthis = this;
		this._sync.execute(function() {
			var _g = coll;
			switch(_g._hx_index) {
			case 0:
				var coll1 = _g.v;
				var i = coll1.iterator();
				while(i.hasNext()) {
					var i1 = i.next();
					_gthis._items.add(i1);
				}
				break;
			case 1:
				var arr = _g.v;
				var _g1 = 0;
				while(_g1 < arr.length) {
					var i = arr[_g1];
					++_g1;
					_gthis._items.add(i);
				}
				break;
			case 2:
				var list = _g.v;
				var _g_head = list.h;
				while(_g_head != null) {
					var val = _g_head.item;
					_g_head = _g_head.next;
					var i = val;
					_gthis._items.add(i);
				}
				break;
			}
		});
	}
	,clear: function() {
		var _gthis = this;
		this._sync.execute(function() {
			return _gthis._items = new haxe_ds_List();
		});
	}
	,remove: function(x) {
		var _gthis = this;
		return this._sync.execute(function() {
			if(_gthis.indexOf(x) == -1) {
				return false;
			}
			return _gthis._items.remove(x);
		});
	}
	,indexOf: function(x,startAt) {
		if(startAt == null) {
			startAt = 0;
		}
		var _gthis = this;
		return this._sync.execute(function() {
			var i = 0;
			var _g_head = _gthis._items.h;
			while(_g_head != null) {
				var val = _g_head.item;
				_g_head = _g_head.next;
				var item = val;
				if(i >= startAt && item == x) {
					return i;
				}
				++i;
			}
			return -1;
		});
	}
	,iterator: function() {
		var _gthis = this;
		return this._sync.execute(function() {
			return new haxe_ds__$List_ListIterator(_gthis._items.h);
		});
	}
	,toArray: function() {
		var _gthis = this;
		return this._sync.execute(function() {
			var arr = [];
			var _g_head = _gthis._items.h;
			while(_g_head != null) {
				var val = _g_head.item;
				_g_head = _g_head.next;
				var item = val;
				arr.push(item);
			}
			return arr;
		});
	}
	,__class__: hx_concurrent_collection__$SynchronizedLinkedList_SynchronizedLinkedListImpl
	,__properties__: {get_length:"get_length"}
};
var apptimize_util_ABTDispatch = function(name) {
	this.delayedTasks = hx_concurrent_collection_SynchronizedLinkedList._new();
	this.executor = null;
	this.name = name;
};
$hxClasses["apptimize.util.ABTDispatch"] = apptimize_util_ABTDispatch;
apptimize_util_ABTDispatch.__name__ = "apptimize.util.ABTDispatch";
apptimize_util_ABTDispatch.dispatchImmediately = function(task) {
	task();
};
apptimize_util_ABTDispatch.prototype = {
	executor: null
	,delayedTasks: null
	,name: null
	,dispatch: function(task,delay) {
		if(delay == null) {
			delay = 0;
		}
		if(this.executor == null) {
			this.delayedTasks.add(new apptimize_util_ABTDispatchTask(task,delay));
			return;
		}
		try {
			var this1 = hx_concurrent_internal__$Either2__$Either2.a(task);
			this.executor.submit(this1,hx_concurrent_executor_Schedule.ONCE(delay));
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			apptimize_ABTLogger.e("Dispatcher '" + this.name + "' threw an exception submitting a task: " + Std.string(e),{ fileName : "src/apptimize/util/ABTDispatch.hx", lineNumber : 56, className : "apptimize.util.ABTDispatch", methodName : "dispatch"});
		}
	}
	,start: function(maxThreads) {
		if(maxThreads == null) {
			maxThreads = 1;
		}
		if(this.executor != null) {
			return;
		}
		if(maxThreads < 1) {
			apptimize_ABTLogger.w("Invalid thread count of " + maxThreads + ". Starting dispatcher '" + this.name + "' with minimum thread pool size of 1.",{ fileName : "src/apptimize/util/ABTDispatch.hx", lineNumber : 76, className : "apptimize.util.ABTDispatch", methodName : "start"});
			maxThreads = 1;
		}
		this.executor = hx_concurrent_executor_Executor.create(maxThreads);
		var errors = new haxe_ds_List();
		var task = this.delayedTasks.iterator();
		while(task.hasNext()) {
			var task1 = task.next();
			try {
				var delay = js_Boot.__cast(Math.max(0,task1.startTimestampMs - new Date().getTime()) , Int);
				var this1 = hx_concurrent_internal__$Either2__$Either2.a(task1.task);
				this.executor.submit(this1,hx_concurrent_executor_Schedule.ONCE(delay));
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				errors.add(e);
			}
		}
		this.delayedTasks.clear();
		if(!errors.isEmpty()) {
			apptimize_ABTLogger.e("One or more errors occurred starting dispatcher '" + this.name + "':",{ fileName : "src/apptimize/util/ABTDispatch.hx", lineNumber : 97, className : "apptimize.util.ABTDispatch", methodName : "start"});
			var _g_head = errors.h;
			while(_g_head != null) {
				var val = _g_head.item;
				_g_head = _g_head.next;
				var error = val;
				apptimize_ABTLogger.e("Dispatcher '" + this.name + "' threw an exception submitting a task: " + error,{ fileName : "src/apptimize/util/ABTDispatch.hx", lineNumber : 99, className : "apptimize.util.ABTDispatch", methodName : "start"});
			}
		}
	}
	,__class__: apptimize_util_ABTDispatch
};
var apptimize_api_ABTApiResultsPost = function(client,applicationKey,log,success,failure) {
	this._failureCount = 0;
	this._apiClient = client;
	this._appKey = applicationKey;
	this._success = success;
	this._failure = failure;
	this._uniqueID = log.getUniqueUserKey();
	this._url = this._getUrl(applicationKey);
	var jsonBytes = haxe_io_Bytes.ofString(log.toJSON());
	this._requestBytes = jsonBytes;
};
$hxClasses["apptimize.api.ABTApiResultsPost"] = apptimize_api_ABTApiResultsPost;
apptimize_api_ABTApiResultsPost.__name__ = "apptimize.api.ABTApiResultsPost";
apptimize_api_ABTApiResultsPost._getPendingResultsCount = function() {
	var count = 0;
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.acquire();
	try {
		count = apptimize_api_ABTApiResultsPost._pendingResults.get_length();
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
	return count;
};
apptimize_api_ABTApiResultsPost.onSuccess = function(request,response) {
	apptimize_api_ABTApiResultsPost.clearFailureDelay();
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.acquire();
	try {
		apptimize_api_ABTApiResultsPost._pendingResults.remove(request);
		var count = apptimize_api_ABTApiResultsPost.decrementPendingCount(request._uniqueID);
		if(count > 0) {
			apptimize_api_ABTApiResultsPost.postNextRequestForID(request._uniqueID);
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
	if(request != null && request._success != null) {
		request._success(response);
	}
};
apptimize_api_ABTApiResultsPost.postNextRequestForID = function(id) {
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.acquire();
	try {
		var request = apptimize_api_ABTApiResultsPost._pendingResults.iterator();
		while(request.hasNext()) {
			var request1 = [request.next()];
			if(request1[0]._uniqueID == id) {
				var task = (function(request) {
					return function() {
						request[0]._post();
					};
				})(request1);
				if(apptimize_api_ABTApiResultsPost._postDispatch != null) {
					apptimize_api_ABTApiResultsPost._postDispatch.dispatch(task,0);
				} else {
					apptimize_util_ABTDispatch.dispatchImmediately(task);
				}
				break;
			}
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
};
apptimize_api_ABTApiResultsPost.decrementPendingCount = function(id) {
	var count = 0;
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.acquire();
	try {
		count = apptimize_api_ABTApiResultsPost._pendingMap.h[id];
		--count;
		if(count == 0) {
			var _this = apptimize_api_ABTApiResultsPost._pendingMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
				delete(_this.h[id]);
			}
		} else {
			apptimize_api_ABTApiResultsPost._pendingMap.h[id] = count;
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
	return count;
};
apptimize_api_ABTApiResultsPost.incrementFailureDelay = function() {
	var delay = apptimize_api_ABTApiResultsPost._failureDelayMs.get_value() * 2;
	if(delay > apptimize_api_ABTApiResultsPost.MAX_FAILURE_DELAY_MS) {
		delay = apptimize_api_ABTApiResultsPost.MAX_FAILURE_DELAY_MS;
	}
	apptimize_api_ABTApiResultsPost._failureDelayMs.set_value(delay);
	return apptimize_api_ABTApiResultsPost._failureDelayMs.get_value();
};
apptimize_api_ABTApiResultsPost.clearFailureDelay = function() {
	apptimize_api_ABTApiResultsPost._failureDelayMs.set_value(apptimize_api_ABTApiResultsPost.DEFAULT_FAILURE_DELAY_MS);
};
apptimize_api_ABTApiResultsPost.onFailure = function(request,response) {
	if(request._failureCount > apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.MAXIMUM_RESULT_POST_FAILURE_KEY)) {
		apptimize_ABTLogger.e("Dropping result post after repeated failure.",{ fileName : "src/apptimize/api/ABTApiResultsPost.hx", lineNumber : 267, className : "apptimize.api.ABTApiResultsPost", methodName : "onFailure"});
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.acquire();
		try {
			apptimize_api_ABTApiResultsPost._pendingResults.remove(request);
			var count = apptimize_api_ABTApiResultsPost.decrementPendingCount(request._uniqueID);
			if(count > 0) {
				apptimize_api_ABTApiResultsPost.postNextRequestForID(request._uniqueID);
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
			throw haxe_Exception.thrown(e);
		}
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
	} else {
		var task = function() {
			request._post();
		};
		if(apptimize_api_ABTApiResultsPost._postDispatch != null) {
			apptimize_api_ABTApiResultsPost._postDispatch.dispatch(task,apptimize_api_ABTApiResultsPost.incrementFailureDelay());
		} else {
			apptimize_util_ABTDispatch.dispatchImmediately(task);
		}
	}
	if(request._failure != null) {
		request._failure(response);
	}
};
apptimize_api_ABTApiResultsPost.pushRequest = function(resultRequest,savePending) {
	if(savePending == null) {
		savePending = true;
	}
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.acquire();
	try {
		apptimize_api_ABTApiResultsPost._pendingResults.add(resultRequest);
		if(!Object.prototype.hasOwnProperty.call(apptimize_api_ABTApiResultsPost._pendingMap.h,resultRequest._uniqueID)) {
			apptimize_api_ABTApiResultsPost._pendingMap.h[resultRequest._uniqueID] = 1;
			var task = function() {
				resultRequest._post();
			};
			if(apptimize_api_ABTApiResultsPost._postDispatch != null) {
				apptimize_api_ABTApiResultsPost._postDispatch.dispatch(task,0);
			} else {
				apptimize_util_ABTDispatch.dispatchImmediately(task);
			}
		} else {
			apptimize_api_ABTApiResultsPost._pendingMap.h[resultRequest._uniqueID] += 1;
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
};
apptimize_api_ABTApiResultsPost.savePendingLogs = function() {
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.acquire();
	try {
		apptimize_support_persistence_ABTPersistence.saveObject(apptimize_support_persistence_ABTPersistence.kResultPostsListKey,apptimize_api_ABTApiResultsPost._pendingResults.toArray());
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
};
apptimize_api_ABTApiResultsPost.loadPendingLogs = function() {
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.acquire();
	try {
		if(apptimize_api_ABTApiResultsPost._loadedPending == false) {
			var pendingObject = apptimize_support_persistence_ABTPersistence.loadObject(apptimize_support_persistence_ABTPersistence.kResultPostsListKey);
			try {
				var pendingArray = pendingObject == null ? [] : pendingObject;
				var _g = 0;
				while(_g < pendingArray.length) {
					var p = pendingArray[_g];
					++_g;
					apptimize_api_ABTApiResultsPost.pushRequest(p,false);
				}
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				apptimize_ABTLogger.e("Unable to load pending results posts: " + Std.string(e),{ fileName : "src/apptimize/api/ABTApiResultsPost.hx", lineNumber : 335, className : "apptimize.api.ABTApiResultsPost", methodName : "loadPendingLogs"});
			}
		}
		apptimize_api_ABTApiResultsPost._loadedPending = true;
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_api_ABTApiResultsPost.PENDING_LOCK.release();
};
apptimize_api_ABTApiResultsPost.startDispatching = function(threadCount) {
	apptimize_api_ABTApiResultsPost._postDispatch.start(threadCount);
};
apptimize_api_ABTApiResultsPost.prototype = {
	_apiClient: null
	,_appKey: null
	,_uniqueID: null
	,_requestBytes: null
	,_success: null
	,_failure: null
	,_failureCount: null
	,_url: null
	,_getUrl: function(appKey) {
		var metadata = apptimize_ABTDataStore.sharedInstance().getMetaData(appKey);
		if(metadata == null) {
			return null;
		}
		var urls = metadata.getCheckinUrls();
		if(urls == null || urls.length < 1) {
			return null;
		}
		var index = Math.floor((urls.length - 1 + 1) * Math.random());
		var endpoint = "server/v4/";
		return urls[index] + endpoint;
	}
	,_post: function() {
		var _gthis = this;
		if(!apptimize_ApptimizeInternal._isInitialized()) {
			return;
		}
		if(this._url == null) {
			this._url = this._getUrl(this._appKey);
			if(this._url == null) {
				apptimize_ABTLogger.e("Unable to post results until metadata is available.",{ fileName : "src/apptimize/api/ABTApiResultsPost.hx", lineNumber : 155, className : "apptimize.api.ABTApiResultsPost", methodName : "_post"});
				apptimize_api_ABTApiResultsPost.onFailure(this,null);
				return;
			}
		}
		apptimize_ABTLogger.v("Posting results to: " + this._url,{ fileName : "src/apptimize/api/ABTApiResultsPost.hx", lineNumber : 161, className : "apptimize.api.ABTApiResultsPost", methodName : "_post"});
		apptimize_http_ABTHttpRequest.post(this._url,this._requestBytes,this._appKey,function(response) {
			apptimize_ABTLogger.d("Successfully posted results.",{ fileName : "src/apptimize/api/ABTApiResultsPost.hx", lineNumber : 171, className : "apptimize.api.ABTApiResultsPost", methodName : "_post"});
			apptimize_ABTLogger.d("Results JSON:\n" + Std.string(_gthis._requestBytes),{ fileName : "src/apptimize/api/ABTApiResultsPost.hx", lineNumber : 173, className : "apptimize.api.ABTApiResultsPost", methodName : "_post"});
			apptimize_api_ABTApiResultsPost.onSuccess(_gthis,response);
		},function(response) {
			_gthis.incrementFailureCountForCode(response.responseCode);
			apptimize_ABTLogger.e("Failed to post results, queuing for retry later: " + response.responseCode + " " + response.text,{ fileName : "src/apptimize/api/ABTApiResultsPost.hx", lineNumber : 180, className : "apptimize.api.ABTApiResultsPost", methodName : "_post"});
			apptimize_ABTLogger.e("Results JSON:\n" + Std.string(_gthis._requestBytes),{ fileName : "src/apptimize/api/ABTApiResultsPost.hx", lineNumber : 182, className : "apptimize.api.ABTApiResultsPost", methodName : "_post"});
			apptimize_api_ABTApiResultsPost.onFailure(_gthis,response);
		});
	}
	,incrementFailureCountForCode: function(status) {
		if(status >= 400) {
			this._failureCount++;
		}
	}
	,hxSerialize: function(s) {
		s.serialize(this._appKey);
		s.serialize(this._requestBytes);
		s.serialize(this._failureCount);
		s.serialize(this._url);
		s.serialize(this._uniqueID);
	}
	,hxUnserialize: function(u) {
		this._appKey = u.unserialize();
		this._requestBytes = u.unserialize();
		this._failureCount = u.unserialize();
		this._url = u.unserialize();
		this._uniqueID = u.unserialize();
	}
	,__class__: apptimize_api_ABTApiResultsPost
};
var apptimize_api_ABTMetadataPoller = function() { };
$hxClasses["apptimize.api.ABTMetadataPoller"] = apptimize_api_ABTMetadataPoller;
apptimize_api_ABTMetadataPoller.__name__ = "apptimize.api.ABTMetadataPoller";
apptimize_api_ABTMetadataPoller.isPolling = function() {
	return apptimize_api_ABTMetadataPoller._isPolling;
};
apptimize_api_ABTMetadataPoller.stopPolling = function() {
	apptimize_api_ABTMetadataPoller._stopMetadataTimer();
	apptimize_api_ABTMetadataPoller._isPolling = false;
};
apptimize_api_ABTMetadataPoller.startPolling = function(foreground) {
	if(foreground == null) {
		foreground = true;
	}
	apptimize_api_ABTMetadataPoller._isThreadingEnabled = apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.THREADING_ENABLED_KEY);
	apptimize_api_ABTMetadataPoller._interval = apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.METADATA_POLLING_INTERVAL_MS_KEY);
	apptimize_api_ABTMetadataPoller._backgroundInterval = apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.METADATA_POLLING_BACKGROUND_INTERVAL_MS_KEY);
	apptimize_api_ABTMetadataPoller._stopMetadataTimer();
	var time = foreground ? apptimize_api_ABTMetadataPoller._interval : apptimize_api_ABTMetadataPoller._backgroundInterval;
	if(time > 0) {
		apptimize_ABTLogger.v("Metadata update interval set to " + time + " milliseconds.",{ fileName : "src/apptimize/api/ABTMetadataPoller.hx", lineNumber : 52, className : "apptimize.api.ABTMetadataPoller", methodName : "startPolling"});
		apptimize_api_ABTMetadataPoller._startMetadataTimer(time);
		apptimize_api_ABTMetadataPoller._isPolling = true;
	}
};
apptimize_api_ABTMetadataPoller._stopMetadataTimer = function() {
	if(apptimize_api_ABTMetadataPoller._metadataTimer != null) {
		apptimize_api_ABTMetadataPoller._metadataTimer.stop();
		apptimize_api_ABTMetadataPoller._metadataTimer = null;
	}
};
apptimize_api_ABTMetadataPoller._startMetadataTimer = function(interval) {
	if(apptimize_api_ABTMetadataPoller._metadataTimer != null) {
		apptimize_api_ABTMetadataPoller._stopMetadataTimer();
	}
	apptimize_api_ABTMetadataPoller._metadataTimer = new haxe_Timer(interval);
	apptimize_api_ABTMetadataPoller._metadataTimer.run = apptimize_Apptimize.updateApptimizeMetadataOnce;
};
var apptimize_api_ABTMetadataProcessor = function() { };
$hxClasses["apptimize.api.ABTMetadataProcessor"] = apptimize_api_ABTMetadataProcessor;
apptimize_api_ABTMetadataProcessor.__name__ = "apptimize.api.ABTMetadataProcessor";
apptimize_api_ABTMetadataProcessor.jsonFromMetadataDownload = function(bytes) {
	var decompressedData = apptimize_util_ABTUtilGzip.decompress(bytes);
	return decompressedData.getString(0,decompressedData.length);
};
var apptimize_api_ABTSecondaryValuesClient = function() {
	this._fetching = false;
};
$hxClasses["apptimize.api.ABTSecondaryValuesClient"] = apptimize_api_ABTSecondaryValuesClient;
apptimize_api_ABTSecondaryValuesClient.__name__ = "apptimize.api.ABTSecondaryValuesClient";
apptimize_api_ABTSecondaryValuesClient.prototype = {
	_fetching: null
	,fetching: function() {
		return this._fetching;
	}
	,fetch: function(urls,startingValues,done) {
		var _gthis = this;
		this._fetching = true;
		var state = new apptimize_api_ABTSecValFetchState(urls,startingValues);
		var needFetch = !state.missingUrls.isEmpty();
		this.fetchNext(state,function(allValues) {
			_gthis._fetching = false;
			done(allValues,needFetch);
		});
	}
	,fetchNext: function(state,done) {
		var _gthis = this;
		if(state.missingUrls.isEmpty()) {
			done(state.allValues);
			return;
		}
		var url = state.missingUrls.pop();
		apptimize_http_ABTHttpRequest.get(url,null,function(response) {
			var bytes = haxe_io_Bytes.ofData(response.bytes);
			var this1 = state.allValues;
			var v = new haxe_format_JsonParser(bytes.getString(0,bytes.length)).doParse();
			this1.h[url] = v;
			_gthis.fetchNext(state,done);
		},function(response) {
			apptimize_ABTLogger.e("GET " + url + " failed: " + response.responseCode,{ fileName : "src/apptimize/api/ABTSecondaryValuesClient.hx", lineNumber : 47, className : "apptimize.api.ABTSecondaryValuesClient", methodName : "fetchNext"});
			_gthis.fetchNext(state,done);
		});
	}
	,needNewUrls: function(old,current) {
		var _g = [];
		var _g1 = 0;
		var _g2 = current;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(old.indexOf(v) < 0) {
				_g.push(v);
			}
		}
		return _g.length > 0;
	}
	,__class__: apptimize_api_ABTSecondaryValuesClient
};
var apptimize_api_ABTSecValFetchState = function(allUrls,oldValues) {
	var missingUrls = new haxe_ds_List();
	var startingValues = new haxe_ds_StringMap();
	var _g = 0;
	while(_g < allUrls.length) {
		var url = allUrls[_g];
		++_g;
		if(oldValues != null && Object.prototype.hasOwnProperty.call(oldValues.h,url)) {
			var v = oldValues.h[url];
			startingValues.h[url] = v;
		} else {
			missingUrls.add(url);
		}
	}
	this.missingUrls = missingUrls;
	this.allValues = startingValues;
};
$hxClasses["apptimize.api.ABTSecValFetchState"] = apptimize_api_ABTSecValFetchState;
apptimize_api_ABTSecValFetchState.__name__ = "apptimize.api.ABTSecValFetchState";
apptimize_api_ABTSecValFetchState.prototype = {
	missingUrls: null
	,allValues: null
	,__class__: apptimize_api_ABTSecValFetchState
};
var apptimize_api_ABTUserGuid = function() { };
$hxClasses["apptimize.api.ABTUserGuid"] = apptimize_api_ABTUserGuid;
apptimize_api_ABTUserGuid.__name__ = "apptimize.api.ABTUserGuid";
apptimize_api_ABTUserGuid.generateUserGuid = function() {
	apptimize_api_ABTUserGuid._userGuid = apptimize_api_ABTUserGuid.S4() + apptimize_api_ABTUserGuid.S4() + "-" + apptimize_api_ABTUserGuid.S4() + "-" + apptimize_api_ABTUserGuid.S4() + "-" + apptimize_api_ABTUserGuid.S4() + "-" + apptimize_api_ABTUserGuid.S4() + apptimize_api_ABTUserGuid.S4() + apptimize_api_ABTUserGuid.S4();
	return apptimize_api_ABTUserGuid._userGuid;
};
apptimize_api_ABTUserGuid.S4 = function(randomFunction) {
	if(randomFunction == null) {
		randomFunction = Math.random;
	}
	var rnd = randomFunction() * 65536 | 0;
	return StringTools.hex(rnd,4);
};
apptimize_api_ABTUserGuid.isValidGuid = function(guid) {
	var regex = new EReg("(^([0-9A-Fa-f]{8}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{12})$)","");
	return regex.match(guid);
};
var apptimize_events_ABTEventManager = function() { };
$hxClasses["apptimize.events.ABTEventManager"] = apptimize_events_ABTEventManager;
apptimize_events_ABTEventManager.__name__ = "apptimize.events.ABTEventManager";
apptimize_events_ABTEventManager.setOnMetadataUpdatedCallback = function(updatedCallback) {
	apptimize_events_ABTEventManager._onMetadataUpdatedCallback = updatedCallback;
};
apptimize_events_ABTEventManager.dispatchOnMetadataUpdated = function() {
	if(apptimize_events_ABTEventManager._onMetadataUpdatedCallback != null) {
		apptimize_events_ABTEventManager._onMetadataUpdatedCallback();
	}
};
apptimize_events_ABTEventManager.setOnParticipationCallback = function(runCallback) {
	apptimize_events_ABTEventManager._onParticipationCallback = runCallback;
};
apptimize_events_ABTEventManager.dispatchOnParticipation = function(experimentName,variantName) {
	if(apptimize_events_ABTEventManager._onParticipationCallback != null) {
		apptimize_events_ABTEventManager._onParticipationCallback(experimentName,variantName);
	}
};
apptimize_events_ABTEventManager.setOnParticipatedInExperimentCallback = function(callback) {
	apptimize_events_ABTEventManager._onParticipatedInExperimentCallback = callback;
};
apptimize_events_ABTEventManager.dispatchOnParticipatedInExperiment = function(variantInfo,isFirstParticipation) {
	if(apptimize_events_ABTEventManager._onParticipatedInExperimentCallback != null) {
		apptimize_events_ABTEventManager._onParticipatedInExperimentCallback(variantInfo,isFirstParticipation);
	}
	apptimize_events_ABTEventManager.dispatchOnParticipation(variantInfo.getExperimentName(),variantInfo.getVariantName());
};
apptimize_events_ABTEventManager.setOnApptimizeInitializedCallback = function(callback) {
	apptimize_events_ABTEventManager._onApptimizeInitializedCallback = callback;
};
apptimize_events_ABTEventManager.dispatchOnApptimizeInitialized = function() {
	if(apptimize_events_ABTEventManager._onApptimizeInitializedCallback != null) {
		apptimize_events_ABTEventManager._onApptimizeInitializedCallback();
	}
};
var apptimize_filter_ABTFilterResult = $hxEnums["apptimize.filter.ABTFilterResult"] = { __ename__:"apptimize.filter.ABTFilterResult",__constructs__:null
	,ABTFilterResultUnknown: {_hx_name:"ABTFilterResultUnknown",_hx_index:0,__enum__:"apptimize.filter.ABTFilterResult",toString:$estr}
	,ABTFilterResultFalse: {_hx_name:"ABTFilterResultFalse",_hx_index:1,__enum__:"apptimize.filter.ABTFilterResult",toString:$estr}
	,ABTFilterResultTrue: {_hx_name:"ABTFilterResultTrue",_hx_index:2,__enum__:"apptimize.filter.ABTFilterResult",toString:$estr}
};
apptimize_filter_ABTFilterResult.__constructs__ = [apptimize_filter_ABTFilterResult.ABTFilterResultUnknown,apptimize_filter_ABTFilterResult.ABTFilterResultFalse,apptimize_filter_ABTFilterResult.ABTFilterResultTrue];
var apptimize_filter_ABTFilterPropertySource = $hxEnums["apptimize.filter.ABTFilterPropertySource"] = { __ename__:"apptimize.filter.ABTFilterPropertySource",__constructs__:null
	,ABTFilterPropertySourceDevice: {_hx_name:"ABTFilterPropertySourceDevice",_hx_index:0,__enum__:"apptimize.filter.ABTFilterPropertySource",toString:$estr}
	,ABTFilterPropertySourceUser: {_hx_name:"ABTFilterPropertySourceUser",_hx_index:1,__enum__:"apptimize.filter.ABTFilterPropertySource",toString:$estr}
	,ABTFilterPropertySourcePrefixed: {_hx_name:"ABTFilterPropertySourcePrefixed",_hx_index:2,__enum__:"apptimize.filter.ABTFilterPropertySource",toString:$estr}
};
apptimize_filter_ABTFilterPropertySource.__constructs__ = [apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceDevice,apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceUser,apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourcePrefixed];
var apptimize_filter_ABTFilterType = $hxEnums["apptimize.filter.ABTFilterType"] = { __ename__:"apptimize.filter.ABTFilterType",__constructs__:null
	,ABTFilterTypeUnknown: {_hx_name:"ABTFilterTypeUnknown",_hx_index:0,__enum__:"apptimize.filter.ABTFilterType",toString:$estr}
	,ABTFilterTypeSimple: {_hx_name:"ABTFilterTypeSimple",_hx_index:1,__enum__:"apptimize.filter.ABTFilterType",toString:$estr}
	,ABTFilterTypeList: {_hx_name:"ABTFilterTypeList",_hx_index:2,__enum__:"apptimize.filter.ABTFilterType",toString:$estr}
	,ABTFilterTypeSet: {_hx_name:"ABTFilterTypeSet",_hx_index:3,__enum__:"apptimize.filter.ABTFilterType",toString:$estr}
	,ABTFilterTypeCompound: {_hx_name:"ABTFilterTypeCompound",_hx_index:4,__enum__:"apptimize.filter.ABTFilterType",toString:$estr}
	,ABTFilterTypePropertyless: {_hx_name:"ABTFilterTypePropertyless",_hx_index:5,__enum__:"apptimize.filter.ABTFilterType",toString:$estr}
	,ABTFilterTypeNamed: {_hx_name:"ABTFilterTypeNamed",_hx_index:6,__enum__:"apptimize.filter.ABTFilterType",toString:$estr}
};
apptimize_filter_ABTFilterType.__constructs__ = [apptimize_filter_ABTFilterType.ABTFilterTypeUnknown,apptimize_filter_ABTFilterType.ABTFilterTypeSimple,apptimize_filter_ABTFilterType.ABTFilterTypeList,apptimize_filter_ABTFilterType.ABTFilterTypeSet,apptimize_filter_ABTFilterType.ABTFilterTypeCompound,apptimize_filter_ABTFilterType.ABTFilterTypePropertyless,apptimize_filter_ABTFilterType.ABTFilterTypeNamed];
var apptimize_filter_ABTFilterOperator = $hxEnums["apptimize.filter.ABTFilterOperator"] = { __ename__:"apptimize.filter.ABTFilterOperator",__constructs__:null
	,ABTFilterOperatorUnknown: {_hx_name:"ABTFilterOperatorUnknown",_hx_index:0,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorEquals: {_hx_name:"ABTFilterOperatorEquals",_hx_index:1,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorNotEquals: {_hx_name:"ABTFilterOperatorNotEquals",_hx_index:2,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorRegex: {_hx_name:"ABTFilterOperatorRegex",_hx_index:3,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorNotRegex: {_hx_name:"ABTFilterOperatorNotRegex",_hx_index:4,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorGreaterThan: {_hx_name:"ABTFilterOperatorGreaterThan",_hx_index:5,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorGreaterThanOrEqual: {_hx_name:"ABTFilterOperatorGreaterThanOrEqual",_hx_index:6,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorLessThan: {_hx_name:"ABTFilterOperatorLessThan",_hx_index:7,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorLessThanOrEqual: {_hx_name:"ABTFilterOperatorLessThanOrEqual",_hx_index:8,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorInList: {_hx_name:"ABTFilterOperatorInList",_hx_index:9,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorNotInList: {_hx_name:"ABTFilterOperatorNotInList",_hx_index:10,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorIntersection: {_hx_name:"ABTFilterOperatorIntersection",_hx_index:11,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorCompoundOr: {_hx_name:"ABTFilterOperatorCompoundOr",_hx_index:12,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorCompoundAnd: {_hx_name:"ABTFilterOperatorCompoundAnd",_hx_index:13,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorCompoundSingleNot: {_hx_name:"ABTFilterOperatorCompoundSingleNot",_hx_index:14,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorCompoundSingleIsNull: {_hx_name:"ABTFilterOperatorCompoundSingleIsNull",_hx_index:15,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorCompoundSingleIsNotNull: {_hx_name:"ABTFilterOperatorCompoundSingleIsNotNull",_hx_index:16,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorPropertyIsNull: {_hx_name:"ABTFilterOperatorPropertyIsNull",_hx_index:17,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorPropertyIsNotNull: {_hx_name:"ABTFilterOperatorPropertyIsNotNull",_hx_index:18,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorPropertyIsRecognized: {_hx_name:"ABTFilterOperatorPropertyIsRecognized",_hx_index:19,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorPropertyIsNotRecognized: {_hx_name:"ABTFilterOperatorPropertyIsNotRecognized",_hx_index:20,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorOperatorIsRecognized: {_hx_name:"ABTFilterOperatorOperatorIsRecognized",_hx_index:21,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorOperatorIsNotRecognized: {_hx_name:"ABTFilterOperatorOperatorIsNotRecognized",_hx_index:22,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
	,ABTFilterOperatorValueOf: {_hx_name:"ABTFilterOperatorValueOf",_hx_index:23,__enum__:"apptimize.filter.ABTFilterOperator",toString:$estr}
};
apptimize_filter_ABTFilterOperator.__constructs__ = [apptimize_filter_ABTFilterOperator.ABTFilterOperatorUnknown,apptimize_filter_ABTFilterOperator.ABTFilterOperatorEquals,apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotEquals,apptimize_filter_ABTFilterOperator.ABTFilterOperatorRegex,apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotRegex,apptimize_filter_ABTFilterOperator.ABTFilterOperatorGreaterThan,apptimize_filter_ABTFilterOperator.ABTFilterOperatorGreaterThanOrEqual,apptimize_filter_ABTFilterOperator.ABTFilterOperatorLessThan,apptimize_filter_ABTFilterOperator.ABTFilterOperatorLessThanOrEqual,apptimize_filter_ABTFilterOperator.ABTFilterOperatorInList,apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotInList,apptimize_filter_ABTFilterOperator.ABTFilterOperatorIntersection,apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundOr,apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundAnd,apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleNot,apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleIsNull,apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleIsNotNull,apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNull,apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNotNull,apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsRecognized,apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNotRecognized,apptimize_filter_ABTFilterOperator.ABTFilterOperatorOperatorIsRecognized,apptimize_filter_ABTFilterOperator.ABTFilterOperatorOperatorIsNotRecognized,apptimize_filter_ABTFilterOperator.ABTFilterOperatorValueOf];
var apptimize_filter_ABTFilter = function() {
};
$hxClasses["apptimize.filter.ABTFilter"] = apptimize_filter_ABTFilter;
apptimize_filter_ABTFilter.__name__ = "apptimize.filter.ABTFilter";
apptimize_filter_ABTFilter.filterFromJSON = function(json) {
	var filterType = apptimize_filter_ABTFilter.filterForTypeFromJSON(json);
	var classType = apptimize_filter_ABTFilter.classForType(filterType);
	if(classType == null) {
		apptimize_ABTLogger.e("Unable to find filter type: " + Std.string(filterType),{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 110, className : "apptimize.filter.ABTFilter", methodName : "filterFromJSON"});
		return null;
	}
	var abtFilter = Type.createInstance(classType,[]);
	abtFilter.fromJSON(json);
	return abtFilter;
};
apptimize_filter_ABTFilter.classForType = function(filterType) {
	if(filterType == apptimize_filter_ABTFilterType.ABTFilterTypeSimple) {
		return apptimize_filter_ABTSimpleFilter;
	}
	if(filterType == apptimize_filter_ABTFilterType.ABTFilterTypeCompound) {
		return apptimize_filter_ABTCompoundFilter;
	}
	if(filterType == apptimize_filter_ABTFilterType.ABTFilterTypeList) {
		return apptimize_filter_ABTListFilter;
	}
	if(filterType == apptimize_filter_ABTFilterType.ABTFilterTypeSet) {
		return apptimize_filter_ABTSetFilter;
	}
	if(filterType == apptimize_filter_ABTFilterType.ABTFilterTypeNamed) {
		return apptimize_filter_ABTNamedFilterProxy;
	}
	return apptimize_filter_ABTUnknownFilter;
};
apptimize_filter_ABTFilter.filterForTypeFromJSON = function(json) {
	var abtOperator = apptimize_filter_ABTFilter.operatorFromString(Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyOperator));
	var type = apptimize_filter_ABTFilter.typeFromOperator(abtOperator);
	return type;
};
apptimize_filter_ABTFilter.operatorFromString = function(string) {
	if("=" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorEquals;
	}
	if("!=" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotEquals;
	}
	if("regex" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorRegex;
	}
	if("not_regex" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotRegex;
	}
	if(">" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorGreaterThan;
	}
	if(">=" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorGreaterThanOrEqual;
	}
	if("<" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorLessThan;
	}
	if("<=" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorLessThanOrEqual;
	}
	if("in" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorInList;
	}
	if("not_in" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotInList;
	}
	if("intersection" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorIntersection;
	}
	if("or" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundOr;
	}
	if("and" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundAnd;
	}
	if("not" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleNot;
	}
	if("is_null" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleIsNull;
	}
	if("is_not_null" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleIsNotNull;
	}
	if("is_property_null" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNull;
	}
	if("is_property_not_null" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNotNull;
	}
	if("is_recognized_property" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsRecognized;
	}
	if("is_not_recognized_property" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNotRecognized;
	}
	if("is_recognized_operator" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorOperatorIsRecognized;
	}
	if("is_not_recognized_operator" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorOperatorIsNotRecognized;
	}
	if("value_of" == string) {
		return apptimize_filter_ABTFilterOperator.ABTFilterOperatorValueOf;
	}
	return apptimize_filter_ABTFilterOperator.ABTFilterOperatorUnknown;
};
apptimize_filter_ABTFilter.typeFromOperator = function(abtOperator) {
	switch(abtOperator._hx_index) {
	case 0:
		break;
	case 1:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSimple;
	case 2:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSimple;
	case 3:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSimple;
	case 4:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSimple;
	case 5:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSimple;
	case 6:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSimple;
	case 7:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSimple;
	case 8:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSimple;
	case 9:
		return apptimize_filter_ABTFilterType.ABTFilterTypeList;
	case 10:
		return apptimize_filter_ABTFilterType.ABTFilterTypeList;
	case 11:
		return apptimize_filter_ABTFilterType.ABTFilterTypeSet;
	case 12:
		return apptimize_filter_ABTFilterType.ABTFilterTypeCompound;
	case 13:
		return apptimize_filter_ABTFilterType.ABTFilterTypeCompound;
	case 14:
		return apptimize_filter_ABTFilterType.ABTFilterTypeCompound;
	case 15:
		return apptimize_filter_ABTFilterType.ABTFilterTypeCompound;
	case 16:
		return apptimize_filter_ABTFilterType.ABTFilterTypeCompound;
	case 17:
		return apptimize_filter_ABTFilterType.ABTFilterTypePropertyless;
	case 18:
		return apptimize_filter_ABTFilterType.ABTFilterTypePropertyless;
	case 19:
		return apptimize_filter_ABTFilterType.ABTFilterTypePropertyless;
	case 20:
		return apptimize_filter_ABTFilterType.ABTFilterTypePropertyless;
	case 21:
		return apptimize_filter_ABTFilterType.ABTFilterTypePropertyless;
	case 22:
		return apptimize_filter_ABTFilterType.ABTFilterTypePropertyless;
	case 23:
		return apptimize_filter_ABTFilterType.ABTFilterTypeNamed;
	}
	apptimize_ABTLogger.e("Unknown filter type. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 298, className : "apptimize.filter.ABTFilter", methodName : "typeFromOperator"});
	return apptimize_filter_ABTFilterType.ABTFilterTypeUnknown;
};
apptimize_filter_ABTFilter.prototype = {
	property: null
	,propertySource: null
	,value: null
	,filterType: null
	,filterOperator: null
	,callServerURLKey: null
	,fromJSON: function(json) {
		var jsonProperty = Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyProperty);
		if(jsonProperty != null) {
			this.property = jsonProperty;
			this.propertySource = apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceDevice;
		} else {
			jsonProperty = Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyUserAttribute);
			if(jsonProperty != null) {
				this.property = jsonProperty;
				this.propertySource = apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceUser;
			} else {
				jsonProperty = Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyPrefixedAttribute);
				if(jsonProperty != null) {
					this.property = jsonProperty;
					this.propertySource = apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourcePrefixed;
				}
			}
		}
		this.filterOperator = apptimize_filter_ABTFilter.operatorFromString(Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyOperator));
		this.filterType = apptimize_filter_ABTFilter.filterForTypeFromJSON(json);
		if(this.filterType == apptimize_filter_ABTFilterType.ABTFilterTypeUnknown) {
			apptimize_ABTLogger.w("Unknown filter type: setting value without type checking.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 149, className : "apptimize.filter.ABTFilter", methodName : "fromJSON"});
			this.value = Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyValue);
		}
		this.callServerURLKey = Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyCallURLKey);
	}
	,isSupportedOperator: function(operatorStr) {
		return apptimize_filter_ABTFilter.operatorFromString(operatorStr) != apptimize_filter_ABTFilterOperator.ABTFilterOperatorUnknown;
	}
	,isSupportedProperty: function(env,property,source) {
		var found = null != env.valueForProperty(property,source);
		if(!found) {
			apptimize_ABTLogger.d("Property \"" + property + "\" not found which is expected by a filter.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 166, className : "apptimize.filter.ABTFilter", methodName : "isSupportedProperty"});
		}
		return found;
	}
	,currentDeviceValue: function(env) {
		return env.valueForProperty(this.property,this.propertySource);
	}
	,hasSupportedProperty: function(env) {
		return this.isSupportedProperty(env,this.property,this.propertySource);
	}
	,filterMatchesEnvironment: function(env) {
		apptimize_ABTLogger.e("Unknown filter type. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 181, className : "apptimize.filter.ABTFilter", methodName : "filterMatchesEnvironment"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	,getUrlKeys: function() {
		if(this.callServerURLKey == null) {
			return [];
		}
		return [this.callServerURLKey];
	}
	,__class__: apptimize_filter_ABTFilter
};
var apptimize_filter_ABTSimpleFilter = function() {
	apptimize_filter_ABTFilter.call(this);
};
$hxClasses["apptimize.filter.ABTSimpleFilter"] = apptimize_filter_ABTSimpleFilter;
apptimize_filter_ABTSimpleFilter.__name__ = "apptimize.filter.ABTSimpleFilter";
apptimize_filter_ABTSimpleFilter.__super__ = apptimize_filter_ABTFilter;
apptimize_filter_ABTSimpleFilter.prototype = $extend(apptimize_filter_ABTFilter.prototype,{
	fromJSON: function(json) {
		apptimize_filter_ABTFilter.prototype.fromJSON.call(this,json);
		this.value = Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyValue);
	}
	,filterMatchesEnvironment: function(env) {
		if(!this.hasSupportedProperty(env)) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
		}
		var currentValue = this.currentDeviceValue(env);
		var filterValue = this.value;
		if(currentValue == null || filterValue == null) {
			apptimize_ABTLogger.w("Filter has null value type. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 329, className : "apptimize.filter.ABTSimpleFilter", methodName : "filterMatchesEnvironment"});
			return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
		}
		if(js_Boot.getClass(currentValue) == String) {
			if(Type.typeof(filterValue) == ValueType.TFloat || Type.typeof(filterValue) == ValueType.TInt) {
				return apptimize_filter_ABTFilterUtils.ABTEvaluateNumber(currentValue,this.filterOperator,filterValue);
			}
			if(js_Boot.getClass(filterValue) != String) {
				apptimize_ABTLogger.w("Filter value does not match property type of string. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 340, className : "apptimize.filter.ABTSimpleFilter", methodName : "filterMatchesEnvironment"});
				return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
			}
			if(this.property == "apptimize_version" || this.property == "system_version" || this.property == "app_version" || this.property == "operating_system_version") {
				return apptimize_filter_ABTFilterUtils.ABTEvaluateVersionString(currentValue,this.filterOperator,filterValue);
			}
			return apptimize_filter_ABTFilterUtils.ABTEvaluateString(currentValue,this.filterOperator,filterValue);
		}
		if(Type.typeof(currentValue) == ValueType.TFloat || Type.typeof(currentValue) == ValueType.TInt) {
			if(js_Boot.getClass(filterValue) == String) {
				return apptimize_filter_ABTFilterUtils.ABTEvaluateNumber(currentValue,this.filterOperator,filterValue);
			}
			if(Type.typeof(filterValue) != ValueType.TFloat && Type.typeof(filterValue) != ValueType.TInt) {
				apptimize_ABTLogger.w("Filter value does not match property type of number. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 358, className : "apptimize.filter.ABTSimpleFilter", methodName : "filterMatchesEnvironment"});
				return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
			}
			return apptimize_filter_ABTFilterUtils.ABTEvaluateNumber(currentValue,this.filterOperator,filterValue);
		}
		if(Type.typeof(currentValue) == ValueType.TBool) {
			if(js_Boot.getClass(filterValue) == String) {
				if(filterValue.toLowerCase() == "true") {
					filterValue = true;
				} else if(filterValue.toLowerCase() == "false") {
					filterValue = false;
				}
			}
			return apptimize_filter_ABTFilterUtils.ABTEvaluateBool(currentValue,this.filterOperator,filterValue);
		}
		apptimize_ABTLogger.w("Simple filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 378, className : "apptimize.filter.ABTSimpleFilter", methodName : "filterMatchesEnvironment"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	,__class__: apptimize_filter_ABTSimpleFilter
});
var apptimize_filter_ABTCompoundFilter = function() {
	apptimize_filter_ABTFilter.call(this);
};
$hxClasses["apptimize.filter.ABTCompoundFilter"] = apptimize_filter_ABTCompoundFilter;
apptimize_filter_ABTCompoundFilter.__name__ = "apptimize.filter.ABTCompoundFilter";
apptimize_filter_ABTCompoundFilter.__super__ = apptimize_filter_ABTFilter;
apptimize_filter_ABTCompoundFilter.prototype = $extend(apptimize_filter_ABTFilter.prototype,{
	fromJSON: function(json) {
		apptimize_filter_ABTFilter.prototype.fromJSON.call(this,json);
		var filtersArray = [];
		var dynamicArray = json.value;
		var _g = 0;
		while(_g < dynamicArray.length) {
			var filter = dynamicArray[_g];
			++_g;
			var ff = apptimize_filter_ABTFilter.filterFromJSON(filter);
			filtersArray.push(ff);
		}
		this.value = filtersArray;
	}
	,filterMatchesEnvironment: function(env) {
		var children = this.value;
		if(children.length < 1) {
			apptimize_ABTLogger.w("Compound filter \"" + Std.string(this) + "\" has an empty compound set. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 407, className : "apptimize.filter.ABTCompoundFilter", methodName : "filterMatchesEnvironment"});
			return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundAnd) {
			var result = apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			var _g = 0;
			while(_g < children.length) {
				var filter = children[_g];
				++_g;
				var currentResult = filter.filterMatchesEnvironment(env);
				result = apptimize_filter_ABTFilterUtils.ABTFilterAnd(result,currentResult);
			}
			return result;
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundOr) {
			var result = apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			var _g = 0;
			while(_g < children.length) {
				var filter = children[_g];
				++_g;
				var currentResult = filter.filterMatchesEnvironment(env);
				result = apptimize_filter_ABTFilterUtils.ABTFilterOr(result,currentResult);
			}
			return result;
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleNot && children.length == 1) {
			var child = children[0];
			var result = child.filterMatchesEnvironment(env);
			if(result == apptimize_filter_ABTFilterResult.ABTFilterResultFalse) {
				result = apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else if(result == apptimize_filter_ABTFilterResult.ABTFilterResultTrue) {
				result = apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
			return result;
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleIsNull && children.length == 1) {
			var child = children[0];
			var result = child.filterMatchesEnvironment(env) == apptimize_filter_ABTFilterResult.ABTFilterResultUnknown ? apptimize_filter_ABTFilterResult.ABTFilterResultTrue : apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			return result;
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorCompoundSingleIsNotNull && children.length == 1) {
			var child = children[0];
			if(child.filterMatchesEnvironment(env) != apptimize_filter_ABTFilterResult.ABTFilterResultUnknown) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
		}
		apptimize_ABTLogger.w("Filter \"" + Std.string(this) + "\" has an unsupported compound operator or children count. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 463, className : "apptimize.filter.ABTCompoundFilter", methodName : "filterMatchesEnvironment"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	,getUrlKeys: function() {
		var children = this.value;
		var _g = [];
		var _g_current = 0;
		var _g_array = children;
		while(_g_current < _g_array.length) {
			var x = _g_array[_g_current++];
			_g.push(x.getUrlKeys());
		}
		var _g1 = [];
		var e = $getIterator(_g);
		while(e.hasNext()) {
			var e1 = e.next();
			var x = $getIterator(e1);
			while(x.hasNext()) {
				var x1 = x.next();
				_g1.push(x1);
			}
		}
		var childUrls = Lambda.array(_g1);
		if(this.callServerURLKey == null) {
			return childUrls;
		}
		return [this.callServerURLKey].concat(childUrls);
	}
	,__class__: apptimize_filter_ABTCompoundFilter
});
var apptimize_filter_ABTListFilter = function() {
	apptimize_filter_ABTFilter.call(this);
};
$hxClasses["apptimize.filter.ABTListFilter"] = apptimize_filter_ABTListFilter;
apptimize_filter_ABTListFilter.__name__ = "apptimize.filter.ABTListFilter";
apptimize_filter_ABTListFilter.__super__ = apptimize_filter_ABTFilter;
apptimize_filter_ABTListFilter.prototype = $extend(apptimize_filter_ABTFilter.prototype,{
	fromJSON: function(json) {
		apptimize_filter_ABTFilter.prototype.fromJSON.call(this,json);
		this.value = json.value;
	}
	,filterMatchesEnvironment: function(env) {
		if(!this.hasSupportedProperty(env)) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
		}
		var children = this.value;
		var currentValue = this.currentDeviceValue(env);
		if(currentValue == null) {
			apptimize_ABTLogger.w("Filter \"" + Std.string(this) + "\" is attempting to match against a null device property.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 502, className : "apptimize.filter.ABTListFilter", methodName : "filterMatchesEnvironment"});
			if(children.indexOf(currentValue) > -1) {
				if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorInList) {
					return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
				} else {
					return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
				}
			} else if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorInList) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			}
		}
		var inList = false;
		var _g = 0;
		while(_g < children.length) {
			var childValue = children[_g];
			++_g;
			if(js_Boot.getClass(currentValue) == String) {
				inList = inList || apptimize_filter_ABTFilterUtils.ABTEvaluateString(currentValue,apptimize_filter_ABTFilterOperator.ABTFilterOperatorEquals,childValue) == apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				inList = inList || apptimize_filter_ABTFilterUtils.ABTEvaluateNumber(currentValue,apptimize_filter_ABTFilterOperator.ABTFilterOperatorEquals,childValue) == apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			}
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotInList) {
			if(!inList) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
		}
		if(inList) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	,__class__: apptimize_filter_ABTListFilter
});
var apptimize_filter_ABTSetFilter = function() {
	apptimize_filter_ABTFilter.call(this);
};
$hxClasses["apptimize.filter.ABTSetFilter"] = apptimize_filter_ABTSetFilter;
apptimize_filter_ABTSetFilter.__name__ = "apptimize.filter.ABTSetFilter";
apptimize_filter_ABTSetFilter.__super__ = apptimize_filter_ABTFilter;
apptimize_filter_ABTSetFilter.prototype = $extend(apptimize_filter_ABTFilter.prototype,{
	fromJSON: function(json) {
		apptimize_filter_ABTFilter.prototype.fromJSON.call(this,json);
		var values = [];
		var dynamicArray = json.value;
		var _g = 0;
		while(_g < dynamicArray.length) {
			var val = dynamicArray[_g];
			++_g;
			values.push(val);
		}
		this.value = values;
	}
	,filterMatchesEnvironment: function(env) {
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	,__class__: apptimize_filter_ABTSetFilter
});
var apptimize_filter_ABTUnknownFilter = function() {
	apptimize_filter_ABTFilter.call(this);
};
$hxClasses["apptimize.filter.ABTUnknownFilter"] = apptimize_filter_ABTUnknownFilter;
apptimize_filter_ABTUnknownFilter.__name__ = "apptimize.filter.ABTUnknownFilter";
apptimize_filter_ABTUnknownFilter.__super__ = apptimize_filter_ABTFilter;
apptimize_filter_ABTUnknownFilter.prototype = $extend(apptimize_filter_ABTFilter.prototype,{
	fromJSON: function(json) {
		apptimize_filter_ABTFilter.prototype.fromJSON.call(this,json);
	}
	,filterMatchesEnvironment: function(env) {
		apptimize_ABTLogger.e("Unknown filter requested. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 599, className : "apptimize.filter.ABTUnknownFilter", methodName : "filterMatchesEnvironment"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	,__class__: apptimize_filter_ABTUnknownFilter
});
var apptimize_filter_ABTPropertylessFilter = function() {
	apptimize_filter_ABTFilter.call(this);
};
$hxClasses["apptimize.filter.ABTPropertylessFilter"] = apptimize_filter_ABTPropertylessFilter;
apptimize_filter_ABTPropertylessFilter.__name__ = "apptimize.filter.ABTPropertylessFilter";
apptimize_filter_ABTPropertylessFilter.__super__ = apptimize_filter_ABTFilter;
apptimize_filter_ABTPropertylessFilter.prototype = $extend(apptimize_filter_ABTFilter.prototype,{
	fromJSON: function(json) {
		apptimize_filter_ABTFilter.prototype.fromJSON.call(this,json);
		this.value = Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyValue);
	}
	,filterMatchesEnvironment: function(env) {
		var filterValue = this.value;
		if(filterValue == null || js_Boot.getClass(filterValue) != String) {
			apptimize_ABTLogger.w("Property-less filter requires a string value. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 619, className : "apptimize.filter.ABTPropertylessFilter", methodName : "filterMatchesEnvironment"});
			return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
		}
		var filterString = filterValue;
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNull) {
			var currentValue = env.valueForProperty(filterString,apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceDevice);
			if(currentValue == null) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNotNull) {
			var currentValue = env.valueForProperty(filterString,apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceDevice);
			if(currentValue != null) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsRecognized) {
			if(this.isSupportedProperty(env,filterString,apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceDevice) == true) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorPropertyIsNotRecognized) {
			if(this.isSupportedProperty(env,filterString,apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceDevice) == false) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorOperatorIsRecognized) {
			if(this.isSupportedOperator(filterString) == true) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
		}
		if(this.filterOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorOperatorIsNotRecognized) {
			if(this.isSupportedOperator(filterString) == false) {
				return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
			} else {
				return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
			}
		}
		apptimize_ABTLogger.w("Property-less filter attempted with an invalid operator. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 651, className : "apptimize.filter.ABTPropertylessFilter", methodName : "filterMatchesEnvironment"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	,__class__: apptimize_filter_ABTPropertylessFilter
});
var apptimize_filter_ABTNamedFilterProxy = function() {
	apptimize_filter_ABTFilter.call(this);
};
$hxClasses["apptimize.filter.ABTNamedFilterProxy"] = apptimize_filter_ABTNamedFilterProxy;
apptimize_filter_ABTNamedFilterProxy.__name__ = "apptimize.filter.ABTNamedFilterProxy";
apptimize_filter_ABTNamedFilterProxy.__super__ = apptimize_filter_ABTFilter;
apptimize_filter_ABTNamedFilterProxy.prototype = $extend(apptimize_filter_ABTFilter.prototype,{
	namedFilter: null
	,fromJSON: function(json) {
		apptimize_filter_ABTFilter.prototype.fromJSON.call(this,json);
		this.namedFilter = Reflect.field(json,apptimize_filter_ABTFilter.kABTFilterKeyNamedFilter);
	}
	,filterMatchesEnvironment: function(env) {
		return env.namedFilterResult(this.namedFilter);
	}
	,__class__: apptimize_filter_ABTNamedFilterProxy
});
var apptimize_filter_ABTFilterUtils = function() { };
$hxClasses["apptimize.filter.ABTFilterUtils"] = apptimize_filter_ABTFilterUtils;
apptimize_filter_ABTFilterUtils.__name__ = "apptimize.filter.ABTFilterUtils";
apptimize_filter_ABTFilterUtils.ABTFilterAnd = function(left,right) {
	if(left == apptimize_filter_ABTFilterResult.ABTFilterResultTrue && right == apptimize_filter_ABTFilterResult.ABTFilterResultUnknown) {
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	if(left == apptimize_filter_ABTFilterResult.ABTFilterResultTrue && right == apptimize_filter_ABTFilterResult.ABTFilterResultFalse) {
		return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
	}
	if(left == apptimize_filter_ABTFilterResult.ABTFilterResultUnknown && right == apptimize_filter_ABTFilterResult.ABTFilterResultFalse) {
		return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
	}
	return left;
};
apptimize_filter_ABTFilterUtils.ABTFilterOr = function(left,right) {
	if(left == apptimize_filter_ABTFilterResult.ABTFilterResultUnknown && right == apptimize_filter_ABTFilterResult.ABTFilterResultFalse) {
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	if(left == apptimize_filter_ABTFilterResult.ABTFilterResultTrue && right == apptimize_filter_ABTFilterResult.ABTFilterResultFalse) {
		return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
	}
	if(left == apptimize_filter_ABTFilterResult.ABTFilterResultTrue && right == apptimize_filter_ABTFilterResult.ABTFilterResultUnknown) {
		return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
	}
	return right;
};
apptimize_filter_ABTFilterUtils.ABTEvaluateString = function(left,abtOperator,right) {
	var leftString = "";
	var rightString = "";
	if(left == null || right == null) {
		apptimize_ABTLogger.w("String comparison attempted with null string. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 703, className : "apptimize.filter.ABTFilterUtils", methodName : "ABTEvaluateString"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	if(js_Boot.getClass(left) == String) {
		leftString = left;
	}
	if(js_Boot.getClass(right) == String) {
		rightString = right;
	}
	leftString = leftString.toLowerCase();
	rightString = rightString.toLowerCase();
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorEquals) {
		if(leftString == rightString) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotEquals) {
		if(leftString != rightString) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	apptimize_ABTLogger.w("String comparison attempted with an invalid operator. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 723, className : "apptimize.filter.ABTFilterUtils", methodName : "ABTEvaluateString"});
	return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
};
apptimize_filter_ABTFilterUtils.ABTEvaluateBool = function(left,abtOperator,right) {
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorEquals) {
		if(left == right) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotEquals) {
		if(left != right) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	apptimize_ABTLogger.w("Bool comparison attempted with an invalid operator. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 732, className : "apptimize.filter.ABTFilterUtils", methodName : "ABTEvaluateBool"});
	return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
};
apptimize_filter_ABTFilterUtils.ABTEvaluateNumber = function(left,abtOperator,right) {
	var leftFloat;
	var rightFloat;
	if(left == null || right == null) {
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	if(js_Boot.getClass(left) == String) {
		leftFloat = parseFloat(left);
	} else {
		leftFloat = left;
	}
	if(js_Boot.getClass(right) == String) {
		rightFloat = parseFloat(right);
	} else {
		rightFloat = right;
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorEquals) {
		if(leftFloat == rightFloat) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotEquals) {
		if(leftFloat != rightFloat) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorGreaterThan) {
		if(leftFloat > rightFloat) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorGreaterThanOrEqual) {
		if(leftFloat >= rightFloat) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorLessThan) {
		if(leftFloat < rightFloat) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorLessThanOrEqual) {
		if(leftFloat <= rightFloat) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	apptimize_ABTLogger.w("Number comparison attempted with an invalid operator. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 764, className : "apptimize.filter.ABTFilterUtils", methodName : "ABTEvaluateNumber"});
	return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
};
apptimize_filter_ABTFilterUtils.ABTEvaluateVersionString = function(left,abtOperator,right) {
	if(left == null || left == "") {
		left = "0";
	}
	if(right == null || right == "") {
		right = "0";
	}
	if(js_Boot.getClass(left) != String || js_Boot.getClass(right) != String) {
		apptimize_ABTLogger.w("Unable to compare versions as values are not strings. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 782, className : "apptimize.filter.ABTFilterUtils", methodName : "ABTEvaluateVersionString"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	var leftString = left;
	var rightString = right;
	var leftComponents = leftString.split(".");
	var rightComponents = rightString.split(".");
	var leftLength = leftComponents.length;
	if(leftLength < 3) {
		var _g = leftLength;
		var _g1 = 3;
		while(_g < _g1) {
			var i = _g++;
			leftComponents.push("0");
		}
	}
	var rightLength = rightComponents.length;
	if(rightLength < 3) {
		var _g = rightLength;
		var _g1 = 3;
		while(_g < _g1) {
			var i = _g++;
			rightComponents.push("0");
		}
	}
	leftString = leftComponents.join(".");
	rightString = rightComponents.join(".");
	var leftVersion;
	var rightVersion;
	try {
		leftVersion = thx_semver_Version.stringToVersion(leftString);
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		apptimize_ABTLogger.w("Unable to validate left (current) version: " + leftString + ". Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 822, className : "apptimize.filter.ABTFilterUtils", methodName : "ABTEvaluateVersionString"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	try {
		rightVersion = thx_semver_Version.stringToVersion(rightString);
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		apptimize_ABTLogger.w("Unable to validate right (filter) version: " + rightString + ". Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 828, className : "apptimize.filter.ABTFilterUtils", methodName : "ABTEvaluateVersionString"});
		return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorEquals) {
		if(thx_semver_Version.equals(leftVersion,rightVersion)) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorNotEquals) {
		if(!thx_semver_Version.equals(leftVersion,rightVersion)) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorGreaterThan) {
		if(thx_semver_Version.greaterThan(leftVersion,rightVersion)) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorGreaterThanOrEqual) {
		if(thx_semver_Version.greaterThanOrEqual(leftVersion,rightVersion)) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorLessThan) {
		if(thx_semver_Version.lessThan(leftVersion,rightVersion)) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	if(abtOperator == apptimize_filter_ABTFilterOperator.ABTFilterOperatorLessThanOrEqual) {
		if(thx_semver_Version.lessThanOrEqual(leftVersion,rightVersion)) {
			return apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		} else {
			return apptimize_filter_ABTFilterResult.ABTFilterResultFalse;
		}
	}
	apptimize_ABTLogger.w("Version comparison attempted with an invalid operator. Filter match is unknown.",{ fileName : "src/apptimize/filter/ABTFilter.hx", lineNumber : 840, className : "apptimize.filter.ABTFilterUtils", methodName : "ABTEvaluateVersionString"});
	return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
};
var apptimize_filter_ABTFilterEnvParams = function(userId,anonId,customAttrs,appkey,appProps,internalProps) {
	this.userID = userId;
	this.anonID = anonId;
	this.internalProps = internalProps;
	this.customAttrs = customAttrs;
	this.appkey = appkey;
	this.appProps = appProps;
};
$hxClasses["apptimize.filter.ABTFilterEnvParams"] = apptimize_filter_ABTFilterEnvParams;
apptimize_filter_ABTFilterEnvParams.__name__ = "apptimize.filter.ABTFilterEnvParams";
apptimize_filter_ABTFilterEnvParams.prototype = {
	userID: null
	,anonID: null
	,customAttrs: null
	,appProps: null
	,appkey: null
	,internalProps: null
	,__class__: apptimize_filter_ABTFilterEnvParams
};
var apptimize_filter_ABTFilterEnvironment = function(params,urlTemplates,valueLists,sequenceNumber,namedFilters,namedFilterResults) {
	this.userID = params.userID;
	this.anonID = params.anonID;
	this.customProperties = new apptimize_support_properties_ABTCustomProperties();
	this.secondaryValueUrlTemplates = urlTemplates;
	this.secondaryValueLists = valueLists;
	this.applicationProperties = params.appProps;
	this.internalProperties = params.internalProps;
	this.appkey = params.appkey;
	this.sequenceNumber = sequenceNumber;
	if(params.customAttrs != null) {
		this.customProperties.setProperties(params.customAttrs);
	}
	this.customProperties.setPropertyForNamespace("app_key",params.appkey,apptimize_support_properties_CustomPropertyNamespace.ApptimizeLocal);
	this.namedFilters = namedFilters;
	if(this.namedFilters == null) {
		this.namedFilters = [];
	}
	var filterMap = new haxe_ds_StringMap();
	var _g = 0;
	var _g1 = this.namedFilters;
	while(_g < _g1.length) {
		var filter = _g1[_g];
		++_g;
		filterMap.h[filter.filterName] = filter;
	}
	this.namedFilterCalculator = new apptimize_filter_ABTNamedFilterCalculator(filterMap,namedFilterResults,[]);
};
$hxClasses["apptimize.filter.ABTFilterEnvironment"] = apptimize_filter_ABTFilterEnvironment;
apptimize_filter_ABTFilterEnvironment.__name__ = "apptimize.filter.ABTFilterEnvironment";
apptimize_filter_ABTFilterEnvironment.prototype = {
	userID: null
	,anonID: null
	,customProperties: null
	,applicationProperties: null
	,internalProperties: null
	,sequenceNumber: null
	,appkey: null
	,secondaryValueUrlTemplates: null
	,secondaryValueLists: null
	,namedFilters: null
	,namedFilterCalculator: null
	,getUniqueUserID: function() {
		return this.appkey + "_" + this.getUserOrAnonID();
	}
	,getUserOrAnonID: function() {
		if(this.userID != null) {
			return this.userID;
		}
		return this.anonID;
	}
	,getUserID: function() {
		return this.userID;
	}
	,getAnonID: function() {
		return this.anonID;
	}
	,valueForProperty: function(property,source) {
		if(source == apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceDevice) {
			return this.applicationProperties.valueForProperty(property);
		}
		if(source == apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourceUser) {
			return this.customProperties.valueForNamespacedProperty(property,apptimize_support_properties_CustomPropertyNamespace.UserAttribute);
		}
		if(source == apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourcePrefixed) {
			var value = this.customProperties.valueForProperty(property);
			if(value == null) {
				value = this.internalProperties.valueForProperty(property);
			}
			return value;
		}
		return null;
	}
	,namedFilterResult: function(name) {
		return this.namedFilterCalculator.resolve(name,this);
	}
	,secondaryUrlForKey: function(key) {
		if(key == null || key == "") {
			return null;
		}
		var urlTemplate = this.secondaryValueUrlTemplates.h[key];
		if(urlTemplate == null) {
			apptimize_ABTLogger.e("unknown secondary url key " + key,{ fileName : "src/apptimize/filter/ABTFilterEnvironment.hx", lineNumber : 160, className : "apptimize.filter.ABTFilterEnvironment", methodName : "secondaryUrlForKey"});
			return null;
		}
		var url = this.injectPropsInUrlTemplate(urlTemplate);
		if(url == null) {
			return null;
		}
		var paramSep = "&";
		if(url.indexOf("?") == -1) {
			paramSep = "?";
		}
		var fullUrl = "" + url + paramSep + "metadataSequenceNumber=" + this.sequenceNumber;
		return fullUrl;
	}
	,injectPropsInUrlTemplate: function(template) {
		var _gthis = this;
		var regex = new EReg("\\{([^}]+)}","g");
		var missingSome = false;
		var mapped = regex.map(template,function(subregex) {
			var key = subregex.matched(1);
			var value = _gthis.valueForProperty(key,apptimize_filter_ABTFilterPropertySource.ABTFilterPropertySourcePrefixed);
			if(value == null) {
				missingSome = true;
				return "<MISSING:" + key + "}>";
			} else {
				return encodeURIComponent(value);
			}
		});
		if(missingSome) {
			return null;
		}
		return mapped;
	}
	,__class__: apptimize_filter_ABTFilterEnvironment
};
var apptimize_filter_ABTNamedFilterCalculator = function(namedFilters,evaluations,stack) {
	this.allNamedFilters = namedFilters;
	this.evaluationStack = stack;
};
$hxClasses["apptimize.filter.ABTNamedFilterCalculator"] = apptimize_filter_ABTNamedFilterCalculator;
apptimize_filter_ABTNamedFilterCalculator.__name__ = "apptimize.filter.ABTNamedFilterCalculator";
apptimize_filter_ABTNamedFilterCalculator.prototype = {
	allNamedFilters: null
	,evaluationStack: null
	,resolve: function(name,env) {
		var filter = this.allNamedFilters.h[name];
		if(filter == null) {
			apptimize_ABTLogger.e("Failed to resolve filter " + name,{ fileName : "src/apptimize/filter/ABTFilterEnvironment.hx", lineNumber : 230, className : "apptimize.filter.ABTNamedFilterCalculator", methodName : "resolve"});
			return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
		}
		if(this.evaluationStack.indexOf(name) != -1) {
			apptimize_ABTLogger.e("Found a circular reference on resolving " + name,{ fileName : "src/apptimize/filter/ABTFilterEnvironment.hx", lineNumber : 241, className : "apptimize.filter.ABTNamedFilterCalculator", methodName : "resolve"});
			return apptimize_filter_ABTFilterResult.ABTFilterResultUnknown;
		}
		this.evaluationStack.push(name);
		var result = filter.performFilterMatchingWithEnvironment(env).result;
		HxOverrides.remove(this.evaluationStack,name);
		return result;
	}
	,__class__: apptimize_filter_ABTNamedFilterCalculator
};
var apptimize_filter_ABTFilterableObject = function() {
	this.initialize();
};
$hxClasses["apptimize.filter.ABTFilterableObject"] = apptimize_filter_ABTFilterableObject;
apptimize_filter_ABTFilterableObject.__name__ = "apptimize.filter.ABTFilterableObject";
apptimize_filter_ABTFilterableObject.prototype = {
	filters: null
	,filters2: null
	,overridingInclusiveFilters: null
	,matchingFilters: null
	,nonMatchingFilters: null
	,initialize: function() {
		this.filters = [];
		this.filters2 = [];
		this.matchingFilters = [];
		this.nonMatchingFilters = [];
		this.overridingInclusiveFilters = [];
	}
	,performFilterMatchingWithEnvironment: function(env) {
		var ret = { result : apptimize_filter_ABTFilterResult.ABTFilterResultTrue, overriding : false};
		var _g = 0;
		var _g1 = this.filters;
		while(_g < _g1.length) {
			var filter = _g1[_g];
			++_g;
			var match = filter.filterMatchesEnvironment(env);
			ret.result = apptimize_filter_ABTFilterUtils.ABTFilterAnd(ret.result,match);
		}
		var _g = 0;
		var _g1 = this.overridingInclusiveFilters;
		while(_g < _g1.length) {
			var filter = _g1[_g];
			++_g;
			var match = filter.filterMatchesEnvironment(env);
			if(match == apptimize_filter_ABTFilterResult.ABTFilterResultTrue) {
				ret.result = apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
				ret.overriding = true;
			}
		}
		return ret;
	}
	,computeNewOverrideState: function(wasOverrideOnly,matchResult) {
		if(wasOverrideOnly) {
			if(matchResult.overriding) {
				return false;
			}
		} else if(matchResult.result != apptimize_filter_ABTFilterResult.ABTFilterResultTrue) {
			return true;
		}
		return wasOverrideOnly;
	}
	,fromJSON: function(json) {
		this.filters = this.jsonToFilterArray(json.filters);
		this.filters2 = this.jsonToFilterArray(json.filters2);
		this.overridingInclusiveFilters = this.jsonToFilterArray(json.overridingInclusiveFilters);
		if(this.filters2.length > 0) {
			this.filters = this.filters.concat(this.filters2);
		}
	}
	,jsonToFilterArray: function(input) {
		var filterArray = input == null ? [] : input;
		var result = new Array(filterArray.length);
		var _g = 0;
		var _g1 = filterArray.length;
		while(_g < _g1) {
			var i = _g++;
			result[i] = apptimize_filter_ABTFilter.filterFromJSON(filterArray[i]);
		}
		return result;
	}
	,getUrlKeys: function() {
		return this.getLocalUrlKeys().concat(this.getUrlKeysFrom(this.getUrlKeyProviders()));
	}
	,getUrlKeyProviders: function() {
		return [];
	}
	,getUrlKeysFrom: function(items) {
		var _g = [];
		var _g_current = 0;
		var _g_array = items;
		while(_g_current < _g_array.length) {
			var x = _g_array[_g_current++];
			_g.push(x.getUrlKeys());
		}
		var _g1 = [];
		var e = $getIterator(_g);
		while(e.hasNext()) {
			var e1 = e.next();
			var x = $getIterator(e1);
			while(x.hasNext()) {
				var x1 = x.next();
				_g1.push(x1);
			}
		}
		return Lambda.array(_g1);
	}
	,getLocalUrlKeys: function() {
		return this.getUrlKeysFrom(this.filters).concat(this.getUrlKeysFrom(this.overridingInclusiveFilters));
	}
	,asUrlProviders: function(items) {
		var result = new Array(items.length);
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			result[i] = items[i];
		}
		return result;
	}
	,__class__: apptimize_filter_ABTFilterableObject
};
var apptimize_filter_ABTNamedFilter = function(source) {
	apptimize_filter_ABTFilterableObject.call(this);
	this.fromJSON(source);
};
$hxClasses["apptimize.filter.ABTNamedFilter"] = apptimize_filter_ABTNamedFilter;
apptimize_filter_ABTNamedFilter.__name__ = "apptimize.filter.ABTNamedFilter";
apptimize_filter_ABTNamedFilter.__super__ = apptimize_filter_ABTFilterableObject;
apptimize_filter_ABTNamedFilter.prototype = $extend(apptimize_filter_ABTFilterableObject.prototype,{
	filterName: null
	,trueIsSticky: null
	,falseIsSticky: null
	,nullIsSticky: null
	,fromJSON: function(json) {
		apptimize_filter_ABTFilterableObject.prototype.fromJSON.call(this,json);
		this.filterName = Reflect.field(json,apptimize_filter_ABTNamedFilter.kABTNamedFilterKeyFilterName);
		this.trueIsSticky = Reflect.field(json,apptimize_filter_ABTNamedFilter.kABTNamedFilterKeyTrueIsSticky);
		this.falseIsSticky = Reflect.field(json,apptimize_filter_ABTNamedFilter.kABTNamedFilterKeyFalseIsSticky);
		this.nullIsSticky = Reflect.field(json,apptimize_filter_ABTNamedFilter.kABTNamedFilterKeyNullIsSticky);
	}
	,__class__: apptimize_filter_ABTNamedFilter
});
var apptimize_http_ABTHttpResponse = function() {
	this.responseCode = -1;
	this.text = "";
	this.bytes = null;
};
$hxClasses["apptimize.http.ABTHttpResponse"] = apptimize_http_ABTHttpResponse;
apptimize_http_ABTHttpResponse.__name__ = "apptimize.http.ABTHttpResponse";
apptimize_http_ABTHttpResponse.prototype = {
	bytes: null
	,text: null
	,responseCode: null
	,etag: null
	,isSuccess: function() {
		if(this.responseCode != 200) {
			return this.responseCode == 304;
		} else {
			return true;
		}
	}
	,__class__: apptimize_http_ABTHttpResponse
};
var apptimize_http_ABTHttpRequestInterface = function() { };
$hxClasses["apptimize.http.ABTHttpRequestInterface"] = apptimize_http_ABTHttpRequestInterface;
apptimize_http_ABTHttpRequestInterface.__name__ = "apptimize.http.ABTHttpRequestInterface";
apptimize_http_ABTHttpRequestInterface.__isInterface__ = true;
apptimize_http_ABTHttpRequestInterface.prototype = {
	get: null
	,post: null
	,__class__: apptimize_http_ABTHttpRequestInterface
};
var apptimize_http_ABTHttpRequest = function() { };
$hxClasses["apptimize.http.ABTHttpRequest"] = apptimize_http_ABTHttpRequest;
apptimize_http_ABTHttpRequest.__name__ = "apptimize.http.ABTHttpRequest";
apptimize_http_ABTHttpRequest.getRequestInterface = function() {
	return apptimize_http_ABTHttpRequest.getRealRequestInterface();
};
apptimize_http_ABTHttpRequest.getRealRequestInterface = function() {
	return new apptimize_http_ABTHttpRequestJS();
};
apptimize_http_ABTHttpRequest.get = function(url,requestHeaders,successCallback,failureCallback) {
	var requestInterface = apptimize_http_ABTHttpRequest.getRequestInterface();
	requestInterface.get(url,requestHeaders,successCallback,failureCallback);
};
apptimize_http_ABTHttpRequest.post = function(url,data,appKey,successCallback,failureCallback) {
	var requestInterface = apptimize_http_ABTHttpRequest.getRequestInterface();
	requestInterface.post(url,data,appKey,successCallback,failureCallback);
};
var apptimize_http_XMLHttpRequest = require("xhr2");
var apptimize_http_ABTXMLHttpRequestNodeJS = function() {
	apptimize_http_XMLHttpRequest.call(this);
};
$hxClasses["apptimize.http.ABTXMLHttpRequestNodeJS"] = apptimize_http_ABTXMLHttpRequestNodeJS;
apptimize_http_ABTXMLHttpRequestNodeJS.__name__ = "apptimize.http.ABTXMLHttpRequestNodeJS";
apptimize_http_ABTXMLHttpRequestNodeJS.toArrayBuffer = function(bytes) {
	var buffer = new ArrayBuffer(bytes.length);
	var view = new DataView(buffer,0,buffer.byteLength);
	var _g = 0;
	var _g1 = bytes.length;
	while(_g < _g1) {
		var i = _g++;
		view.setUint8(i,bytes.b[i]);
	}
	return buffer;
};
apptimize_http_ABTXMLHttpRequestNodeJS.__super__ = apptimize_http_XMLHttpRequest;
apptimize_http_ABTXMLHttpRequestNodeJS.prototype = $extend(apptimize_http_XMLHttpRequest.prototype,{
	__class__: apptimize_http_ABTXMLHttpRequestNodeJS
});
var apptimize_http_ABTHttpRequestJS = function() {
};
$hxClasses["apptimize.http.ABTHttpRequestJS"] = apptimize_http_ABTHttpRequestJS;
apptimize_http_ABTHttpRequestJS.__name__ = "apptimize.http.ABTHttpRequestJS";
apptimize_http_ABTHttpRequestJS.__interfaces__ = [apptimize_http_ABTHttpRequestInterface];
apptimize_http_ABTHttpRequestJS.prototype = {
	_sentDate: null
	,get: function(url,requestHeaders,successCallback,failureCallback) {
		var _gthis = this;
		var oReq = new apptimize_http_ABTXMLHttpRequestNodeJS();
		this._sentDate = new Date();
		oReq.open("GET",url,true);
		if(requestHeaders != null) {
			var h = requestHeaders.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 header = _g_keys[_g_current++];
				oReq.setRequestHeader(header,requestHeaders.h[header]);
			}
		}
		this._logRequest("GET",url,requestHeaders);
		oReq.responseType = "arraybuffer";
		oReq.onerror = function(e) {
			var httpResponse = new apptimize_http_ABTHttpResponse();
			var response = oReq.response;
			httpResponse.responseCode = oReq.status;
			_gthis._logResponse(url,oReq);
			failureCallback(httpResponse);
		};
		oReq.onload = function(_) {
			var httpResponse = new apptimize_http_ABTHttpResponse();
			var response = oReq.response;
			if(response == null) {
				response = oReq.responseText;
				httpResponse.text = "Unable to parse response on this browser.";
				httpResponse.responseCode = oReq.status;
				_gthis._logResponse(url,oReq,haxe_io_Bytes.ofString(httpResponse.text));
				failureCallback(httpResponse);
				return;
			}
			var byteOutput = _gthis._getDataForResponse(response);
			_gthis._logResponse(url,oReq,byteOutput);
			httpResponse.bytes = byteOutput.b.bufferValue;
			httpResponse.responseCode = oReq.status;
			httpResponse.etag = oReq.getResponseHeader("etag");
			if(httpResponse.isSuccess()) {
				successCallback(httpResponse);
			} else {
				failureCallback(httpResponse);
			}
		};
		oReq.send();
	}
	,post: function(url,data,appKey,successCallback,failureCallback) {
		var _gthis = this;
		var oReq = new apptimize_http_ABTXMLHttpRequestNodeJS();
		this._sentDate = new Date();
		oReq.open("POST",url,true);
		var _g = new haxe_ds_StringMap();
		_g.h["X-App-Key"] = appKey;
		_g.h["Content-Type"] = "application/json; charset=UTF-8";
		var headers = _g;
		var h = headers.h;
		var _g1_h = h;
		var _g1_keys = Object.keys(h);
		var _g1_length = _g1_keys.length;
		var _g1_current = 0;
		while(_g1_current < _g1_length) {
			var name = _g1_keys[_g1_current++];
			oReq.setRequestHeader(name,headers.h[name]);
		}
		this._logRequest("POST",url,headers,data);
		oReq.onerror = function(_) {
			var httpResponse = new apptimize_http_ABTHttpResponse();
			var response = oReq.response;
			httpResponse.responseCode = oReq.status;
			_gthis._logResponse(url,oReq);
			failureCallback(httpResponse);
		};
		oReq.onload = function(_) {
			var httpResponse = new apptimize_http_ABTHttpResponse();
			var response = oReq.response;
			if(response == null) {
				response = oReq.responseText;
				httpResponse.text = "Unable to parse response on this browser.";
				httpResponse.responseCode = oReq.status;
				_gthis._logResponse(url,oReq,haxe_io_Bytes.ofString(httpResponse.text));
				failureCallback(httpResponse);
				return;
			}
			var byteOutput = _gthis._getDataForResponse(response);
			_gthis._logResponse(url,oReq,byteOutput);
			httpResponse.bytes = byteOutput.b.bufferValue;
			httpResponse.responseCode = oReq.status;
			if(httpResponse.isSuccess()) {
				successCallback(httpResponse);
			} else {
				failureCallback(httpResponse);
			}
		};
		oReq.send(apptimize_http_ABTXMLHttpRequestNodeJS.toArrayBuffer(data));
	}
	,_logRequest: function(type,url,headers,body) {
		if(!apptimize_http_ABTNetworkLogger.shouldLog()) {
			return;
		}
		var stringHeaders = headers == null ? "[]" : haxe_ds_StringMap.stringify(headers.h);
		var bodyString = body == null ? "" : body.toString();
		apptimize_http_ABTNetworkLogger.logRequest(type,url,stringHeaders,bodyString);
	}
	,_logResponse: function(url,response,body) {
		if(!apptimize_http_ABTNetworkLogger.shouldLog()) {
			return;
		}
		var duration = new Date().getTime() - this._sentDate.getTime();
		var bodyString = body == null ? "" : body.toString();
		apptimize_http_ABTNetworkLogger.logResponse(url,duration,response.getAllResponseHeaders().toString(),bodyString);
	}
	,_getDataForResponse: function(response) {
		if(typeof(response) == "string") {
			return haxe_io_Bytes.ofString(response);
		}
		var this1 = new Uint8Array(response);
		var bytes = this1;
		var byteOutput = new haxe_io_Bytes(new ArrayBuffer(bytes.length));
		var _g = 0;
		var _g1 = bytes.length;
		while(_g < _g1) {
			var i = _g++;
			byteOutput.b[i] = bytes[i];
		}
		return byteOutput;
	}
	,__class__: apptimize_http_ABTHttpRequestJS
};
var apptimize_http_ABTNetworkLogger = function() { };
$hxClasses["apptimize.http.ABTNetworkLogger"] = apptimize_http_ABTNetworkLogger;
apptimize_http_ABTNetworkLogger.__name__ = "apptimize.http.ABTNetworkLogger";
apptimize_http_ABTNetworkLogger.shouldLog = function() {
	return apptimize_ABTLogger.logLevel == apptimize_ABTLogger.LOG_LEVEL_VERBOSE;
};
apptimize_http_ABTNetworkLogger.logRequest = function(type,url,headers,body) {
	apptimize_ABTLogger.v("URL Request " + type + " " + url + "\nHeaders: " + Std.string(headers) + "\nBody: " + body,{ fileName : "src/apptimize/http/ABTNetworkLogger.hx", lineNumber : 9, className : "apptimize.http.ABTNetworkLogger", methodName : "logRequest"});
};
apptimize_http_ABTNetworkLogger.logResponse = function(url,duration,headers,body) {
	apptimize_ABTLogger.v("URL Response " + url + "\nHeaders: " + Std.string(headers) + "\nBody: " + body + "\nResponse Time(ms): " + duration,{ fileName : "src/apptimize/http/ABTNetworkLogger.hx", lineNumber : 13, className : "apptimize.http.ABTNetworkLogger", methodName : "logResponse"});
};
var apptimize_models_ABTAlteration = function() {
	apptimize_filter_ABTFilterableObject.call(this);
};
$hxClasses["apptimize.models.ABTAlteration"] = apptimize_models_ABTAlteration;
apptimize_models_ABTAlteration.__name__ = "apptimize.models.ABTAlteration";
apptimize_models_ABTAlteration.alterationFromJSON = function(json,variant) {
	var classType = apptimize_models_ABTAlteration.classForType(json.type);
	var instance = Type.createInstance(classType,[]);
	instance.initialize();
	instance.fromJSON(json);
	instance._variant = variant;
	return instance;
};
apptimize_models_ABTAlteration.classForType = function(type) {
	if("block" == type) {
		return apptimize_models_ABTBlockAlteration;
	}
	return apptimize_models_ABTValueAlteration;
};
apptimize_models_ABTAlteration.__super__ = apptimize_filter_ABTFilterableObject;
apptimize_models_ABTAlteration.prototype = $extend(apptimize_filter_ABTFilterableObject.prototype,{
	_variant: null
	,_key: null
	,fromJSON: function(json) {
		apptimize_filter_ABTFilterableObject.prototype.fromJSON.call(this,json);
	}
	,selectAlterationsIntoArray: function(env,target,overrideOnly) {
		var match = this.performFilterMatchingWithEnvironment(env);
		var canSelect = match.overriding || !overrideOnly;
		var selected = canSelect && match.result == apptimize_filter_ABTFilterResult.ABTFilterResultTrue;
		if(selected) {
			apptimize_ABTLogger.v("Selecting alteration \"" + this.getKey() + "\" for variant \"" + this.getVariant().getVariantName() + "\" for user " + env.getUserOrAnonID() + ".",{ fileName : "src/apptimize/models/ABTAlteration.hx", lineNumber : 50, className : "apptimize.models.ABTAlteration", methodName : "selectAlterationsIntoArray"});
			target.push(this);
		}
	}
	,getKey: function() {
		return this._key;
	}
	,getVariant: function() {
		return this._variant;
	}
	,__class__: apptimize_models_ABTAlteration
});
var apptimize_models_ABTBlockAlteration = function() {
	apptimize_models_ABTAlteration.call(this);
};
$hxClasses["apptimize.models.ABTBlockAlteration"] = apptimize_models_ABTBlockAlteration;
apptimize_models_ABTBlockAlteration.__name__ = "apptimize.models.ABTBlockAlteration";
apptimize_models_ABTBlockAlteration.__super__ = apptimize_models_ABTAlteration;
apptimize_models_ABTBlockAlteration.prototype = $extend(apptimize_models_ABTAlteration.prototype,{
	methodName: null
	,fromJSON: function(json) {
		apptimize_models_ABTAlteration.prototype.fromJSON.call(this,json);
		this._key = json.key;
		this.methodName = json.methodName;
	}
	,__class__: apptimize_models_ABTBlockAlteration
});
var apptimize_models_ABTValueAlteration = function() {
	apptimize_models_ABTAlteration.call(this);
};
$hxClasses["apptimize.models.ABTValueAlteration"] = apptimize_models_ABTValueAlteration;
apptimize_models_ABTValueAlteration.__name__ = "apptimize.models.ABTValueAlteration";
apptimize_models_ABTValueAlteration.__super__ = apptimize_models_ABTAlteration;
apptimize_models_ABTValueAlteration.prototype = $extend(apptimize_models_ABTAlteration.prototype,{
	_value: null
	,_type: null
	,_nestedType: null
	,_useDefaultValue: null
	,fromJSON: function(json) {
		apptimize_models_ABTAlteration.prototype.fromJSON.call(this,json);
		this._key = json.key;
		this._value = json.value;
		this._type = json.type;
		this._nestedType = json.nestedType;
		this._useDefaultValue = json.useDefaultValue;
		if(this._value != null && this._type == "dictionary") {
			this._value = apptimize_util_ABTUtilDictionary.dynamicToNativeDictionary(this._value);
		}
	}
	,useDefaultValue: function() {
		return this._useDefaultValue;
	}
	,getValue: function() {
		return this._value;
	}
	,getType: function() {
		return this._type;
	}
	,getNestedType: function() {
		return this._nestedType;
	}
	,__class__: apptimize_models_ABTValueAlteration
});
var apptimize_models_ABTJSONObject = function() { };
$hxClasses["apptimize.models.ABTJSONObject"] = apptimize_models_ABTJSONObject;
apptimize_models_ABTJSONObject.__name__ = "apptimize.models.ABTJSONObject";
var apptimize_models_ABTMetadata = function() {
	this._alterationCache = new apptimize_util_ABTLRUCache(apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.ALTERATION_CACHE_SIZE_KEY));
	this._namedFiltersEvaluations = new haxe_ds_StringMap();
};
$hxClasses["apptimize.models.ABTMetadata"] = apptimize_models_ABTMetadata;
apptimize_models_ABTMetadata.__name__ = "apptimize.models.ABTMetadata";
apptimize_models_ABTMetadata.loadFromString = function(content) {
	var m = new apptimize_models_ABTMetadata();
	m._load_data(content);
	return m;
};
apptimize_models_ABTMetadata.prototype = {
	_jsonData: null
	,_seedGroups: null
	,_hotfixes: null
	,_alterationCache: null
	,_namedFilters: null
	,_namedFiltersEvaluations: null
	,_etag: null
	,_secondaryValues: null
	,copyPersistentValues: function(source) {
		if(source == null) {
			return;
		}
		if(source._namedFiltersEvaluations != null) {
			this._namedFiltersEvaluations = haxe_ds_StringMap.createCopy(source._namedFiltersEvaluations.h);
		}
	}
	,makeEnvironment: function(params,sdkParams) {
		var valueLists = this._secondaryValues;
		var _g = new haxe_ds_StringMap();
		var value = this.getGroupsUrlTemplate("lpilot_targeting_id");
		_g.h["groupsApiUrl"] = value;
		var value = this.getGroupsUrlTemplate("m_cohort_id");
		_g.h["cohortsApiUrl"] = value;
		var templates = _g;
		if(sdkParams != null && sdkParams.callServerUrls != null) {
			templates = sdkParams.callServerUrls;
		}
		return new apptimize_filter_ABTFilterEnvironment(params,templates,valueLists,this.getSequenceNumber(),this._namedFilters,this._namedFiltersEvaluations);
	}
	,getGroupsUrlTemplate: function(param) {
		var groupsBaseUrl = apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY);
		var groupsFullUrl = groupsBaseUrl + "/api/pilot-groups/?appKey={lapp_key}&pilotTargetingId={" + param + "}";
		return groupsFullUrl;
	}
	,_load_data: function(content) {
		this._alterationCache = new apptimize_util_ABTLRUCache(apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.ALTERATION_CACHE_SIZE_KEY));
		this._jsonData = new haxe_format_JsonParser(content).doParse();
		this.reprocessJson();
	}
	,reprocessJson: function() {
		if(this._jsonData == null) {
			throw haxe_Exception.thrown("Unable to process metadata");
		}
		this._seedGroups = [];
		if(this._jsonData.seedGroups != null) {
			var _g = 0;
			var _g1 = this._jsonData.seedGroups;
			while(_g < _g1.length) {
				var sg = _g1[_g];
				++_g;
				this._seedGroups.push(new apptimize_models_ABTSeedGroup(sg));
			}
		}
		this._hotfixes = [];
		if(this._jsonData.hotfixes != null) {
			var _g = 0;
			var _g1 = this._jsonData.hotfixes;
			while(_g < _g1.length) {
				var hf = _g1[_g];
				++_g;
				this._hotfixes.push(new apptimize_models_ABTHotfixVariant(hf));
			}
		}
		apptimize_ABTLogger.i("JSONNamedFilters: " + Std.string(this._jsonData.namedFilters),{ fileName : "src/apptimize/models/ABTMetadata.hx", lineNumber : 199, className : "apptimize.models.ABTMetadata", methodName : "reprocessJson"});
		this._namedFilters = [];
		if(this._jsonData.namedFilters != null) {
			var _g = 0;
			var _g1 = this._jsonData.namedFilters;
			while(_g < _g1.length) {
				var item = _g1[_g];
				++_g;
				this._namedFilters.push(new apptimize_filter_ABTNamedFilter(item));
			}
		}
	}
	,uncachedSelectAlterationsIntoArray: function(env,checkCache) {
		if(checkCache == null) {
			checkCache = true;
		}
		var alterations = [];
		var _g = 0;
		var _g1 = this._seedGroups;
		while(_g < _g1.length) {
			var seedgroup = _g1[_g];
			++_g;
			seedgroup.selectAlterationsIntoArray(env,alterations,false);
		}
		var _g = 0;
		var _g1 = this._hotfixes;
		while(_g < _g1.length) {
			var hotfix = _g1[_g];
			++_g;
			hotfix.selectAlterationsIntoArray(env,alterations,false);
		}
		return alterations;
	}
	,selectAlterationsIntoArray: function(env) {
		var alterations = this.uncachedSelectAlterationsIntoArray(env,false);
		this.metadataProcessed(env,alterations);
		return alterations;
	}
	,extractNeededSecondaryUrls: function(env) {
		var keys = [];
		var _g = 0;
		var _g1 = this._seedGroups;
		while(_g < _g1.length) {
			var seedgroup = _g1[_g];
			++_g;
			keys = keys.concat(seedgroup.getUrlKeys());
		}
		var _g = 0;
		var _g1 = this._hotfixes;
		while(_g < _g1.length) {
			var hotfix = _g1[_g];
			++_g;
			keys = keys.concat(hotfix.getUrlKeys());
		}
		var ret = [];
		var map_h = Object.create(null);
		var _g = 0;
		while(_g < keys.length) {
			var key = keys[_g];
			++_g;
			if(!Object.prototype.hasOwnProperty.call(map_h,key)) {
				var value = env.secondaryUrlForKey(key);
				map_h[key] = value;
				if(value != null) {
					ret.push(value);
				}
			}
		}
		return ret;
	}
	,extractSdkParameters: function(env) {
		var ret = new apptimize_models_ABTSdkParameters(null);
		if(this._seedGroups != null) {
			var _g = 0;
			var _g1 = this._seedGroups;
			while(_g < _g1.length) {
				var seedGroup = _g1[_g];
				++_g;
				seedGroup.applySdkParameters(ret,env);
			}
		}
		return ret;
	}
	,metadataProcessed: function(env,alterations) {
		var metadataProcessedEntry = new apptimize_models_results_ABTResultEntryMetadataProcessed(env,this.getSequenceNumber(),this.getVariantsCyclesPhases(alterations));
		apptimize_ABTDataStore.sharedInstance().addResultLogEntry(env,metadataProcessedEntry);
	}
	,getVariantsCyclesPhases: function(alterations) {
		var variantsCyclesPhases = new haxe_ds_IntMap();
		var _g = 0;
		while(_g < alterations.length) {
			var alteration = alterations[_g];
			++_g;
			var variant = alteration.getVariant();
			var phase = variant.getPhase();
			var variantStickyString = "v" + variant.getVariantID() + "_" + variant.getCycle();
			var tmp;
			if(js_Boot.getClass(variant) != apptimize_models_ABTHotfixVariant) {
				var key = variant.getVariantID();
				tmp = !variantsCyclesPhases.h.hasOwnProperty(key);
			} else {
				tmp = false;
			}
			if(tmp) {
				var k = variant.getVariantID();
				var v = { v : variant.getVariantID(), c : variant.getCycle(), p : phase};
				variantsCyclesPhases.h[k] = v;
			}
		}
		return Lambda.array(variantsCyclesPhases);
	}
	,getMetaData: function() {
		return this._jsonData;
	}
	,getSequenceNumber: function() {
		return this._jsonData.sequenceNumber;
	}
	,getCheckinUrls: function() {
		return this._jsonData.checkinUrls;
	}
	,getAppKey: function() {
		return this._jsonData.appKey;
	}
	,getEtag: function() {
		return this._etag;
	}
	,setEtag: function(etag) {
		this._etag = etag;
	}
	,setSecondaryValues: function(values) {
		this._secondaryValues = values;
	}
	,getSecondaryValues: function() {
		return this._secondaryValues;
	}
	,getDisabledVersions: function() {
		var disableAll = Reflect.field(this._jsonData,"disableAllVersions");
		var disableVersions = Reflect.field(this._jsonData,"disabledCrossPlatformVersions");
		var ret = [];
		if(disableAll) {
			ret.push(apptimize_Apptimize.getApptimizeSDKVersion());
		}
		if(disableVersions != null) {
			ret = ret.concat(this._jsonData.disabledCrossPlatformVersions);
		}
		return ret;
	}
	,hxSerialize: function(s) {
		this.serializeV1(s);
		s.serialize(this._secondaryValues);
	}
	,serializeV1: function(s) {
		s.serialize(haxe_format_JsonPrinter.print(this._jsonData,null,null));
		s.serialize(this._etag);
	}
	,hxUnserialize: function(u) {
		this._load_data(u.unserialize());
		this._etag = u.unserialize();
		try {
			this._secondaryValues = u.unserialize();
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			this._secondaryValues = null;
		}
		this._namedFiltersEvaluations = new haxe_ds_StringMap();
	}
	,__class__: apptimize_models_ABTMetadata
};
var apptimize_models_ABTRange = function(json) {
	this.fromJSON(json);
};
$hxClasses["apptimize.models.ABTRange"] = apptimize_models_ABTRange;
apptimize_models_ABTRange.__name__ = "apptimize.models.ABTRange";
apptimize_models_ABTRange.prototype = {
	start: null
	,end: null
	,fromJSON: function(json) {
		this.start = json[0];
		this.end = json[1];
	}
	,__class__: apptimize_models_ABTRange
};
var apptimize_models_ABTRangeGroup = function(group) {
	apptimize_filter_ABTFilterableObject.call(this);
	this.fromJSON(group);
};
$hxClasses["apptimize.models.ABTRangeGroup"] = apptimize_models_ABTRangeGroup;
apptimize_models_ABTRangeGroup.__name__ = "apptimize.models.ABTRangeGroup";
apptimize_models_ABTRangeGroup.__super__ = apptimize_filter_ABTFilterableObject;
apptimize_models_ABTRangeGroup.prototype = $extend(apptimize_filter_ABTFilterableObject.prototype,{
	ranges: null
	,sdkParameters: null
	,seedGroups: null
	,variants: null
	,fromJSON: function(group) {
		apptimize_filter_ABTFilterableObject.prototype.fromJSON.call(this,group);
		var rangeGroup = group;
		this.ranges = [];
		if(rangeGroup.ranges != null) {
			var _g = 0;
			var _g1 = rangeGroup.ranges;
			while(_g < _g1.length) {
				var range = _g1[_g];
				++_g;
				this.ranges.push(new apptimize_models_ABTRange(range));
			}
		}
		this.seedGroups = [];
		if(rangeGroup.seedGroups != null) {
			var _g = 0;
			var _g1 = rangeGroup.seedGroups;
			while(_g < _g1.length) {
				var sg = _g1[_g];
				++_g;
				this.seedGroups.push(new apptimize_models_ABTSeedGroup(sg));
			}
		}
		this.variants = [];
		if(rangeGroup.variants != null) {
			var _g = 0;
			var _g1 = rangeGroup.variants;
			while(_g < _g1.length) {
				var variant = _g1[_g];
				++_g;
				this.variants.push(new apptimize_models_ABTVariant(variant));
			}
		}
		if(Object.prototype.hasOwnProperty.call(group,"sdkParameters")) {
			this.sdkParameters = new apptimize_models_ABTSdkParameters(group.sdkParameters);
		}
	}
	,selectAlterationsIntoArray: function(env,target,overrideOnly) {
		var match = this.performFilterMatchingWithEnvironment(env);
		if(match.result != apptimize_filter_ABTFilterResult.ABTFilterResultTrue) {
			return;
		}
		var newOverrideOnly = this.computeNewOverrideState(overrideOnly,match);
		var _g = 0;
		var _g1 = this.variants;
		while(_g < _g1.length) {
			var variant = _g1[_g];
			++_g;
			variant.selectAlterationsIntoArray(env,target,newOverrideOnly);
		}
		var _g = 0;
		var _g1 = this.seedGroups;
		while(_g < _g1.length) {
			var seedgroup = _g1[_g];
			++_g;
			seedgroup.selectAlterationsIntoArray(env,target,newOverrideOnly);
		}
	}
	,isSelectedBySeed: function(seed) {
		var _g = 0;
		var _g1 = this.ranges;
		while(_g < _g1.length) {
			var range = _g1[_g];
			++_g;
			if(seed >= range.start && seed < range.end) {
				return true;
			}
		}
		return false;
	}
	,getUrlKeyProviders: function() {
		return this.asUrlProviders(this.seedGroups).concat(this.asUrlProviders(this.variants));
	}
	,applySdkParameters: function(to,env) {
		if(this.sdkParameters != null) {
			to.mergeOther(this.sdkParameters);
		}
		var _g = 0;
		var _g1 = this.seedGroups;
		while(_g < _g1.length) {
			var seedGroup = _g1[_g];
			++_g;
			seedGroup.applySdkParameters(to,env);
		}
	}
	,__class__: apptimize_models_ABTRangeGroup
});
var apptimize_models_ABTSdkParameters = function(json) {
	this.minPostFrequencyMs = null;
	this.callServerUrls = null;
	if(json != null) {
		this.fromJSON(json);
	}
};
$hxClasses["apptimize.models.ABTSdkParameters"] = apptimize_models_ABTSdkParameters;
apptimize_models_ABTSdkParameters.__name__ = "apptimize.models.ABTSdkParameters";
apptimize_models_ABTSdkParameters.prototype = {
	minPostFrequencyMs: null
	,callServerUrls: null
	,fromJSON: function(json) {
		var temp = Reflect.field(json,"minPostFrequencyMs");
		if(temp != null) {
			this.minPostFrequencyMs = temp;
		}
		temp = Reflect.field(json,"callServerUrls");
		if(temp != null) {
			this.callServerUrls = apptimize_util_ABTUtilDictionary.dynamicObjectToStringMap(temp);
		}
	}
	,mergeOther: function(other) {
		if(other.minPostFrequencyMs != null) {
			this.minPostFrequencyMs = other.minPostFrequencyMs;
		}
		if(other.callServerUrls != null) {
			this.callServerUrls = other.callServerUrls;
		}
	}
	,__class__: apptimize_models_ABTSdkParameters
};
var apptimize_models_ABTSeed = function(seed) {
	this.fromDef(seed);
};
$hxClasses["apptimize.models.ABTSeed"] = apptimize_models_ABTSeed;
apptimize_models_ABTSeed.__name__ = "apptimize.models.ABTSeed";
apptimize_models_ABTSeed.prototype = {
	type: null
	,value: null
	,fromDef: function(seed) {
		this.type = seed.type;
		this.value = seed.value;
	}
	,computedSeedMaterial: function(env,forceLegacyEncoding) {
		if(this.type == "guid") {
			if(env.getUserID() != null && forceLegacyEncoding == false) {
				return apptimize_util_ABTHash.Sha1(haxe_io_Bytes.ofString(env.getUserID()));
			} else {
				var base = haxe_io_Bytes.ofString("0123456789abcdef");
				var uniqueId = env.getUserID() == null ? env.getAnonID() : env.getUserID();
				var resultStr = StringTools.replace(uniqueId,"-","").toLowerCase();
				try {
					if(resultStr.length == 32) {
						return apptimize_util_ABTHash.Sha1(new haxe_crypto_BaseCode(base).decodeBytes(haxe_io_Bytes.ofString(resultStr)));
					}
				} catch( _g ) {
					haxe_NativeStackTrace.lastError = _g;
					if(typeof(haxe_Exception.caught(_g).unwrap()) == "string") {
						apptimize_ABTLogger.w("Invalid GUID supplied - treating as string ID:" + resultStr,{ fileName : "src/apptimize/models/ABTSeed.hx", lineNumber : 38, className : "apptimize.models.ABTSeed", methodName : "computedSeedMaterial"});
					} else {
						throw _g;
					}
				}
				return apptimize_util_ABTHash.Sha1(haxe_io_Bytes.ofString(uniqueId));
			}
		} else if(this.value != null) {
			return apptimize_util_ABTHash.Sha1(haxe_io_Bytes.ofString(this.value));
		} else {
			apptimize_ABTLogger.e("Unable to calculate seed for supplied user ID of type: " + this.type + ".",{ fileName : "src/apptimize/models/ABTSeed.hx", lineNumber : 46, className : "apptimize.models.ABTSeed", methodName : "computedSeedMaterial"});
			return null;
		}
	}
	,__class__: apptimize_models_ABTSeed
};
var apptimize_models_ABTSeedGroup = function(group) {
	apptimize_filter_ABTFilterableObject.call(this);
	this.fromJSON(group);
};
$hxClasses["apptimize.models.ABTSeedGroup"] = apptimize_models_ABTSeedGroup;
apptimize_models_ABTSeedGroup.__name__ = "apptimize.models.ABTSeedGroup";
apptimize_models_ABTSeedGroup.__super__ = apptimize_filter_ABTFilterableObject;
apptimize_models_ABTSeedGroup.prototype = $extend(apptimize_filter_ABTFilterableObject.prototype,{
	rangeGroups: null
	,seeds: null
	,fromJSON: function(group) {
		apptimize_filter_ABTFilterableObject.prototype.fromJSON.call(this,group);
		var jsonSeedGroup = group;
		this.rangeGroups = [];
		if(jsonSeedGroup.rangeGroups != null) {
			var _g = 0;
			var _g1 = jsonSeedGroup.rangeGroups;
			while(_g < _g1.length) {
				var range = _g1[_g];
				++_g;
				this.rangeGroups.push(new apptimize_models_ABTRangeGroup(range));
			}
		}
		this.seeds = [];
		if(jsonSeedGroup.seeds != null) {
			var _g = 0;
			var _g1 = jsonSeedGroup.seeds;
			while(_g < _g1.length) {
				var seed = _g1[_g];
				++_g;
				this.seeds.push(new apptimize_models_ABTSeed(seed));
			}
		}
	}
	,computedSeedMaterial: function(env,forceLegacyEncoding) {
		var buffer = new haxe_io_BytesBuffer();
		var _g = 0;
		var _g1 = this.seeds;
		while(_g < _g1.length) {
			var seed = _g1[_g];
			++_g;
			var b = seed.computedSeedMaterial(env,forceLegacyEncoding);
			buffer.addBytes(b,0,b.length);
		}
		return apptimize_util_ABTHash.Sha1(buffer.getBytes());
	}
	,seed: function(env) {
		var shouldEnforceLegacyEncoding = this.shouldForceLegacyEncoding(env);
		var data = this.computedSeedMaterial(env,shouldEnforceLegacyEncoding);
		var len = data.length;
		if(len < 4) {
			apptimize_ABTLogger.e("User ID length too short for seed: " + len + ".",{ fileName : "src/apptimize/models/ABTSeedGroup.hx", lineNumber : 65, className : "apptimize.models.ABTSeedGroup", methodName : "seed"});
			return 0;
		}
		var l = len - 4;
		var seed = data.b[l + 3] | data.b[l + 2] << 8 | data.b[l + 1] << 16 | data.b[l] << 24;
		seed &= 1073741823;
		if(shouldEnforceLegacyEncoding) {
			apptimize_ABTLogger.v("Using Legacy seed for user: " + env.getAnonID() + ":" + env.getUserID() + ": " + seed + ".",{ fileName : "src/apptimize/models/ABTSeedGroup.hx", lineNumber : 78, className : "apptimize.models.ABTSeedGroup", methodName : "seed"});
		} else {
			apptimize_ABTLogger.v("Got seed for user: " + env.getAnonID() + ":" + env.getUserID() + ": " + seed + ".",{ fileName : "src/apptimize/models/ABTSeedGroup.hx", lineNumber : 80, className : "apptimize.models.ABTSeedGroup", methodName : "seed"});
		}
		return seed;
	}
	,selectAlterationsIntoArray: function(env,target,overrideOnly) {
		var match = this.performFilterMatchingWithEnvironment(env);
		if(match.result != apptimize_filter_ABTFilterResult.ABTFilterResultTrue) {
			return;
		}
		var newOverrideOnly = this.computeNewOverrideState(overrideOnly,match);
		var seed = this.seed(env);
		apptimize_ABTLogger.v("Calculated seed for user " + env.getAnonID() + ":" + env.getUserID() + ": " + seed + ".",{ fileName : "src/apptimize/models/ABTSeedGroup.hx", lineNumber : 97, className : "apptimize.models.ABTSeedGroup", methodName : "selectAlterationsIntoArray"});
		var _g = 0;
		var _g1 = this.rangeGroups;
		while(_g < _g1.length) {
			var rangeGroup = _g1[_g];
			++_g;
			if(rangeGroup.isSelectedBySeed(seed)) {
				rangeGroup.selectAlterationsIntoArray(env,target,newOverrideOnly);
			} else {
				rangeGroup.selectAlterationsIntoArray(env,target,true);
			}
		}
	}
	,getUrlKeyProviders: function() {
		return this.asUrlProviders(this.rangeGroups);
	}
	,applySdkParameters: function(to,env) {
		var match = this.performFilterMatchingWithEnvironment(env);
		if(match.result == apptimize_filter_ABTFilterResult.ABTFilterResultTrue) {
			var seed = this.seed(env);
			var _g = 0;
			var _g1 = this.rangeGroups;
			while(_g < _g1.length) {
				var rangeGroup = _g1[_g];
				++_g;
				if(rangeGroup.isSelectedBySeed(seed)) {
					rangeGroup.applySdkParameters(to,env);
				}
			}
		}
	}
	,shouldForceLegacyEncoding: function(env) {
		var shouldForceEncoding = false;
		var hasExperiment = false;
		var experimentValue = 0;
		var _g = 0;
		var _g1 = this.seeds;
		while(_g < _g1.length) {
			var seed = _g1[_g];
			++_g;
			if("constant" == seed.type && ("experiment" == seed.value || "feature flag" == seed.value || "feature config" == seed.value)) {
				hasExperiment = true;
			} else if(hasExperiment && experimentValue == 0) {
				var constValue = Std.parseInt(seed.value);
				if(constValue != null) {
					experimentValue = constValue;
				}
			}
		}
		var maxSeed = apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY);
		if(hasExperiment && experimentValue < maxSeed) {
			shouldForceEncoding = true;
		}
		return shouldForceEncoding;
	}
	,__class__: apptimize_models_ABTSeedGroup
});
var apptimize_models_ABTVariant = function(variant) {
	apptimize_filter_ABTFilterableObject.call(this);
	this.fromJSON(variant);
};
$hxClasses["apptimize.models.ABTVariant"] = apptimize_models_ABTVariant;
apptimize_models_ABTVariant.__name__ = "apptimize.models.ABTVariant";
apptimize_models_ABTVariant.__super__ = apptimize_filter_ABTFilterableObject;
apptimize_models_ABTVariant.prototype = $extend(apptimize_filter_ABTFilterableObject.prototype,{
	alterations: null
	,alterations2: null
	,codeBlockName: null
	,experimentId: null
	,experimentName: null
	,experimentType: null
	,startTime: null
	,variantId: null
	,variantName: null
	,cycle: null
	,phase: null
	,fromJSON: function(obj) {
		apptimize_filter_ABTFilterableObject.prototype.fromJSON.call(this,obj);
		var variant = obj;
		this.alterations = [];
		this.alterations2 = [];
		var _g = 0;
		var _g1 = variant.alterations;
		while(_g < _g1.length) {
			var alteration = _g1[_g];
			++_g;
			this.alterations.push(apptimize_models_ABTAlteration.alterationFromJSON(alteration,this));
		}
		this.codeBlockName = variant.codeBlockName;
		this.variantId = variant.variantId;
		this.experimentId = variant.experimentId;
		if(js_Boot.getClass(this) != apptimize_models_ABTHotfixVariant) {
			this.experimentName = variant.experimentName;
			this.experimentType = variant.experimentType;
			this.startTime = variant.startTime;
			this.variantName = variant.variantName;
			this.cycle = variant.cycle;
			this.phase = variant.phase;
		}
		if(Object.prototype.hasOwnProperty.call(variant,"alterations2") && variant.alterations2 != null) {
			var _g = 0;
			var _g1 = variant.alterations2;
			while(_g < _g1.length) {
				var alteration = _g1[_g];
				++_g;
				this.alterations2.push(apptimize_models_ABTAlteration.alterationFromJSON(alteration,this));
			}
			this.alterations = this.alterations.concat(this.alterations2);
		}
	}
	,selectAlterationsIntoArray: function(env,target,overrideOnly) {
		var match = this.performFilterMatchingWithEnvironment(env);
		if(match.result != apptimize_filter_ABTFilterResult.ABTFilterResultTrue) {
			return;
		}
		var newOverrideOnly = this.computeNewOverrideState(overrideOnly,match);
		var _g = 0;
		var _g1 = this.alterations;
		while(_g < _g1.length) {
			var alteration = _g1[_g];
			++_g;
			alteration.selectAlterationsIntoArray(env,target,newOverrideOnly);
		}
	}
	,getVariantID: function() {
		return this.variantId;
	}
	,getVariantName: function() {
		return this.variantName;
	}
	,getExperimentID: function() {
		return this.experimentId;
	}
	,getExperimentName: function() {
		return this.experimentName;
	}
	,getExperimentType: function() {
		return this.experimentType;
	}
	,getCodeBlockName: function() {
		return this.codeBlockName;
	}
	,getPhase: function() {
		return this.phase;
	}
	,getCycle: function() {
		return this.cycle;
	}
	,getUrlKeyProviders: function() {
		return this.asUrlProviders(this.alterations);
	}
	,__class__: apptimize_models_ABTVariant
});
var apptimize_models_ABTHotfixVariant = function(variant) {
	apptimize_models_ABTVariant.call(this,variant);
};
$hxClasses["apptimize.models.ABTHotfixVariant"] = apptimize_models_ABTHotfixVariant;
apptimize_models_ABTHotfixVariant.__name__ = "apptimize.models.ABTHotfixVariant";
apptimize_models_ABTHotfixVariant.__super__ = apptimize_models_ABTVariant;
apptimize_models_ABTHotfixVariant.prototype = $extend(apptimize_models_ABTVariant.prototype,{
	hotfixName: null
	,fromJSON: function(obj) {
		apptimize_models_ABTVariant.prototype.fromJSON.call(this,obj);
		var variant = obj;
		this.hotfixName = variant.hotfixName;
	}
	,getHotfixName: function() {
		return this.hotfixName;
	}
	,__class__: apptimize_models_ABTHotfixVariant
});
var apptimize_models_results_ABTResultEntry = function(env) {
	apptimize_models_results_ABTResultEntry.RESULT_ENTRY_CREATION_LOCK.acquire();
	try {
		this._id = this._getNextSequenceNumber();
		this._deviceTimestamp = haxe_Int64Helper.fromFloat(new Date().getTime());
		this._monotonicTimestamp = this._getMonotonicTimestamp(this._deviceTimestamp);
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_models_results_ABTResultEntry.RESULT_ENTRY_CREATION_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_models_results_ABTResultEntry.RESULT_ENTRY_CREATION_LOCK.release();
	this._prefixedAttributes = new haxe_ds_StringMap();
	if(env != null && env.customProperties.availableProperties != null) {
		env.customProperties.addJSONProperties(this._prefixedAttributes);
	}
	apptimize_support_properties_ABTInternalProperties.sharedInstance().addJSONProperties(this._prefixedAttributes);
	env.applicationProperties.addJSONProperties(this._prefixedAttributes);
};
$hxClasses["apptimize.models.results.ABTResultEntry"] = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntry.__name__ = "apptimize.models.results.ABTResultEntry";
apptimize_models_results_ABTResultEntry.__super__ = apptimize_models_ABTJSONObject;
apptimize_models_results_ABTResultEntry.prototype = $extend(apptimize_models_ABTJSONObject.prototype,{
	_id: null
	,_monotonicTimestamp: null
	,_deviceTimestamp: null
	,_userAttributes: null
	,_prefixedAttributes: null
	,_getNextSequenceNumber: function() {
		var sequenceString = apptimize_support_persistence_ABTPersistence.loadString(apptimize_support_persistence_ABTPersistence.kResultEntrySequenceKey);
		var this1 = new haxe__$Int64__$_$_$Int64(0,0);
		var sequence = this1;
		if(sequenceString != null) {
			sequence = haxe_Int64Helper.parseString(sequenceString);
		}
		var ret = sequence;
		var this1 = new haxe__$Int64__$_$_$Int64(sequence.high,sequence.low);
		sequence = this1;
		var ret = sequence.low++;
		sequence.low = sequence.low | 0;
		if(sequence.low == 0) {
			var ret = sequence.high++;
			sequence.high = sequence.high | 0;
		}
		apptimize_support_persistence_ABTPersistence.saveString(apptimize_support_persistence_ABTPersistence.kResultEntrySequenceKey,haxe_Int64.toString(sequence));
		return sequence;
	}
	,_getMonotonicTimestamp: function(deviceTime) {
		var timestamp = deviceTime;
		var this1 = new haxe__$Int64__$_$_$Int64(0,0);
		var lastTimestamp = this1;
		var lastTimestampString = apptimize_support_persistence_ABTPersistence.loadString(apptimize_support_persistence_ABTPersistence.kResultEntryTimestampKey);
		if(lastTimestampString != null) {
			lastTimestamp = haxe_Int64Helper.parseString(lastTimestampString);
		}
		var v = lastTimestamp.high - deviceTime.high | 0;
		if(v == 0) {
			v = haxe_Int32.ucompare(lastTimestamp.low,deviceTime.low);
		}
		if((lastTimestamp.high < 0 ? deviceTime.high < 0 ? v : -1 : deviceTime.high >= 0 ? v : 1) >= 0) {
			var b_high = 0;
			var b_low = 1;
			var high = lastTimestamp.high + b_high | 0;
			var low = lastTimestamp.low + b_low | 0;
			if(haxe_Int32.ucompare(low,lastTimestamp.low) < 0) {
				var ret = high++;
				high = high | 0;
			}
			var this1 = new haxe__$Int64__$_$_$Int64(high,low);
			timestamp = this1;
		}
		apptimize_support_persistence_ABTPersistence.saveString(apptimize_support_persistence_ABTPersistence.kResultEntryTimestampKey,haxe_Int64.toString(timestamp));
		return timestamp;
	}
	,JSONRepresentation: function() {
		var _g = new haxe_ds_StringMap();
		var value = apptimize_util_ABTInt64Utils.toPreprocessedString(this._id);
		_g.h["ei"] = value;
		var value = apptimize_util_ABTInt64Utils.toPreprocessedString(this._monotonicTimestamp);
		_g.h["mt"] = value;
		var value = apptimize_util_ABTInt64Utils.toPreprocessedString(this._deviceTimestamp);
		_g.h["dt"] = value;
		var value = apptimize_util_ABTUtilDictionary.filterNullValues(this._prefixedAttributes);
		_g.h["pa"] = value;
		var jsonDict = _g;
		if(this._userAttributes != null) {
			var v = apptimize_util_ABTUtilDictionary.filterNullValues(this._userAttributes);
			jsonDict.h["ua"] = v;
		}
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_util_ABTInt64Utils._serializeInt64(this._id,s);
		apptimize_util_ABTInt64Utils._serializeInt64(this._monotonicTimestamp,s);
		apptimize_util_ABTInt64Utils._serializeInt64(this._deviceTimestamp,s);
		s.serialize(this._userAttributes);
		s.serialize(this._prefixedAttributes);
	}
	,hxUnserialize: function(u) {
		this._id = apptimize_util_ABTInt64Utils._deserializeInt64(u);
		this._monotonicTimestamp = apptimize_util_ABTInt64Utils._deserializeInt64(u);
		this._deviceTimestamp = apptimize_util_ABTInt64Utils._deserializeInt64(u);
		this._userAttributes = u.unserialize();
		this._prefixedAttributes = u.unserialize();
	}
	,__class__: apptimize_models_results_ABTResultEntry
});
var apptimize_models_results_ABTResultEntryVariantShown = function(env,variantID,cycle,phase) {
	this._type = "v";
	apptimize_models_results_ABTResultEntry.call(this,env);
	this._variantID = variantID;
	this._cycle = cycle;
	this._phase = phase;
};
$hxClasses["apptimize.models.results.ABTResultEntryVariantShown"] = apptimize_models_results_ABTResultEntryVariantShown;
apptimize_models_results_ABTResultEntryVariantShown.__name__ = "apptimize.models.results.ABTResultEntryVariantShown";
apptimize_models_results_ABTResultEntryVariantShown.__super__ = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntryVariantShown.prototype = $extend(apptimize_models_results_ABTResultEntry.prototype,{
	_type: null
	,_variantID: null
	,_cycle: null
	,_phase: null
	,JSONRepresentation: function() {
		var jsonDict = apptimize_models_results_ABTResultEntry.prototype.JSONRepresentation.call(this);
		var v = this._type;
		jsonDict.h["ty"] = v;
		var v = this._variantID;
		jsonDict.h["v"] = v;
		var _g = new haxe_ds_StringMap();
		_g.h["v"] = this._variantID;
		_g.h["c"] = this._cycle;
		_g.h["p"] = this._phase;
		var v = _g;
		jsonDict.h["vp"] = v;
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_models_results_ABTResultEntry.prototype.hxSerialize.call(this,s);
		s.serialize(this._type);
		s.serialize(this._variantID);
		s.serialize(this._cycle);
		s.serialize(this._phase);
	}
	,hxUnserialize: function(u) {
		apptimize_models_results_ABTResultEntry.prototype.hxUnserialize.call(this,u);
		this._type = u.unserialize();
		this._variantID = u.unserialize();
		this._cycle = u.unserialize();
		this._phase = u.unserialize();
	}
	,__class__: apptimize_models_results_ABTResultEntryVariantShown
});
var apptimize_models_results_ABTResultEntryEvent = function(env,name,source,attributes) {
	this._type = "ee";
	apptimize_models_results_ABTResultEntry.call(this,env);
	this._name = name;
	this._source = source;
	this._attributes = attributes;
};
$hxClasses["apptimize.models.results.ABTResultEntryEvent"] = apptimize_models_results_ABTResultEntryEvent;
apptimize_models_results_ABTResultEntryEvent.__name__ = "apptimize.models.results.ABTResultEntryEvent";
apptimize_models_results_ABTResultEntryEvent.__super__ = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntryEvent.prototype = $extend(apptimize_models_results_ABTResultEntry.prototype,{
	_type: null
	,_name: null
	,_source: null
	,_attributes: null
	,JSONRepresentation: function() {
		var jsonDict = apptimize_models_results_ABTResultEntry.prototype.JSONRepresentation.call(this);
		var v = this._type;
		jsonDict.h["ty"] = v;
		var v = this._name;
		jsonDict.h["n"] = v;
		var v = this._source;
		jsonDict.h["s"] = v;
		var v = this._attributes;
		jsonDict.h["a"] = v;
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_models_results_ABTResultEntry.prototype.hxSerialize.call(this,s);
		s.serialize(this._type);
		s.serialize(this._name);
		s.serialize(this._source);
		s.serialize(this._attributes);
	}
	,hxUnserialize: function(u) {
		apptimize_models_results_ABTResultEntry.prototype.hxUnserialize.call(this,u);
		this._type = u.unserialize();
		this._name = u.unserialize();
		this._source = u.unserialize();
		this._attributes = u.unserialize();
	}
	,__class__: apptimize_models_results_ABTResultEntryEvent
});
var apptimize_models_results_ABTResultEntryMetadataProcessed = function(env,sequence,enrolledVariantsCyclesPhases) {
	this._type = "md";
	apptimize_models_results_ABTResultEntry.call(this,env);
	this._metadataSequenceNumber = sequence;
	this._enrolledVariantsCyclesPhases = enrolledVariantsCyclesPhases;
	this._enrolledVariantIDs = [];
	var _g = 0;
	var _g1 = this._enrolledVariantsCyclesPhases;
	while(_g < _g1.length) {
		var variantCyclePhase = _g1[_g];
		++_g;
		this._enrolledVariantIDs.push(variantCyclePhase.v);
	}
};
$hxClasses["apptimize.models.results.ABTResultEntryMetadataProcessed"] = apptimize_models_results_ABTResultEntryMetadataProcessed;
apptimize_models_results_ABTResultEntryMetadataProcessed.__name__ = "apptimize.models.results.ABTResultEntryMetadataProcessed";
apptimize_models_results_ABTResultEntryMetadataProcessed.__super__ = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntryMetadataProcessed.prototype = $extend(apptimize_models_results_ABTResultEntry.prototype,{
	_type: null
	,_metadataSequenceNumber: null
	,_enrolledVariantsCyclesPhases: null
	,_enrolledVariantIDs: null
	,JSONRepresentation: function() {
		var jsonDict = apptimize_models_results_ABTResultEntry.prototype.JSONRepresentation.call(this);
		if(this._enrolledVariantsCyclesPhases.length > 0) {
			var v = this._enrolledVariantsCyclesPhases;
			jsonDict.h["vp"] = v;
		}
		var v = this._enrolledVariantIDs;
		jsonDict.h["v"] = v;
		var v = this._metadataSequenceNumber;
		jsonDict.h["s"] = v;
		var v = this._type;
		jsonDict.h["ty"] = v;
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_models_results_ABTResultEntry.prototype.hxSerialize.call(this,s);
		s.serialize(this._type);
		s.serialize(this._metadataSequenceNumber);
		s.serialize(this._enrolledVariantIDs);
		s.serialize(this._enrolledVariantsCyclesPhases);
	}
	,hxUnserialize: function(u) {
		apptimize_models_results_ABTResultEntry.prototype.hxUnserialize.call(this,u);
		this._type = u.unserialize();
		this._metadataSequenceNumber = u.unserialize();
		this._enrolledVariantIDs = u.unserialize();
		this._enrolledVariantsCyclesPhases = u.unserialize();
	}
	,__class__: apptimize_models_results_ABTResultEntryMetadataProcessed
});
var apptimize_models_results_ABTResultEntryAttributesChanged = function(env,enrolledVariantsCyclesPhases) {
	this._type = "ac";
	apptimize_models_results_ABTResultEntry.call(this,env);
	this._enrolledVariantsCyclesPhases = enrolledVariantsCyclesPhases;
	this._enrolledVariantIDs = [];
	var _g = 0;
	var _g1 = this._enrolledVariantsCyclesPhases;
	while(_g < _g1.length) {
		var variantCyclePhase = _g1[_g];
		++_g;
		this._enrolledVariantIDs.push(variantCyclePhase.v);
	}
};
$hxClasses["apptimize.models.results.ABTResultEntryAttributesChanged"] = apptimize_models_results_ABTResultEntryAttributesChanged;
apptimize_models_results_ABTResultEntryAttributesChanged.__name__ = "apptimize.models.results.ABTResultEntryAttributesChanged";
apptimize_models_results_ABTResultEntryAttributesChanged.__super__ = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntryAttributesChanged.prototype = $extend(apptimize_models_results_ABTResultEntry.prototype,{
	_type: null
	,_enrolledVariantsCyclesPhases: null
	,_enrolledVariantIDs: null
	,JSONRepresentation: function() {
		var jsonDict = apptimize_models_results_ABTResultEntry.prototype.JSONRepresentation.call(this);
		var v = this._type;
		jsonDict.h["ty"] = v;
		var v = this._enrolledVariantIDs;
		jsonDict.h["v"] = v;
		if(this._enrolledVariantsCyclesPhases.length > 0) {
			var v = this._enrolledVariantsCyclesPhases;
			jsonDict.h["vp"] = v;
		}
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_models_results_ABTResultEntry.prototype.hxSerialize.call(this,s);
		s.serialize(this._type);
		s.serialize(this._enrolledVariantIDs);
		s.serialize(this._enrolledVariantsCyclesPhases);
	}
	,hxUnserialize: function(u) {
		apptimize_models_results_ABTResultEntry.prototype.hxUnserialize.call(this,u);
		this._type = u.unserialize();
		this._enrolledVariantIDs = u.unserialize();
		this._enrolledVariantsCyclesPhases = u.unserialize();
	}
	,__class__: apptimize_models_results_ABTResultEntryAttributesChanged
});
var apptimize_models_results_ABTResultEntryUserEnd = function(env,nextUserID) {
	this._type = "ue";
	apptimize_models_results_ABTResultEntry.call(this,env);
	this._nextUserID = nextUserID;
};
$hxClasses["apptimize.models.results.ABTResultEntryUserEnd"] = apptimize_models_results_ABTResultEntryUserEnd;
apptimize_models_results_ABTResultEntryUserEnd.__name__ = "apptimize.models.results.ABTResultEntryUserEnd";
apptimize_models_results_ABTResultEntryUserEnd.__super__ = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntryUserEnd.prototype = $extend(apptimize_models_results_ABTResultEntry.prototype,{
	_type: null
	,_nextUserID: null
	,JSONRepresentation: function() {
		var jsonDict = apptimize_models_results_ABTResultEntry.prototype.JSONRepresentation.call(this);
		var v = this._type;
		jsonDict.h["ty"] = v;
		var v = this._nextUserID;
		jsonDict.h["n"] = v;
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_models_results_ABTResultEntry.prototype.hxSerialize.call(this,s);
		s.serialize(this._type);
		s.serialize(this._nextUserID);
	}
	,hxUnserialize: function(u) {
		apptimize_models_results_ABTResultEntry.prototype.hxUnserialize.call(this,u);
		this._type = u.unserialize();
		this._nextUserID = u.unserialize();
	}
	,__class__: apptimize_models_results_ABTResultEntryUserEnd
});
var apptimize_models_results_ABTResultEntryUserStart = function(env,previousUserID) {
	this._type = "us";
	apptimize_models_results_ABTResultEntry.call(this,env);
	this._previousUserID = previousUserID;
};
$hxClasses["apptimize.models.results.ABTResultEntryUserStart"] = apptimize_models_results_ABTResultEntryUserStart;
apptimize_models_results_ABTResultEntryUserStart.__name__ = "apptimize.models.results.ABTResultEntryUserStart";
apptimize_models_results_ABTResultEntryUserStart.__super__ = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntryUserStart.prototype = $extend(apptimize_models_results_ABTResultEntry.prototype,{
	_type: null
	,_previousUserID: null
	,JSONRepresentation: function() {
		var jsonDict = apptimize_models_results_ABTResultEntry.prototype.JSONRepresentation.call(this);
		var v = this._type;
		jsonDict.h["ty"] = v;
		var v = this._previousUserID;
		jsonDict.h["p"] = v;
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_models_results_ABTResultEntry.prototype.hxSerialize.call(this,s);
		s.serialize(this._type);
		s.serialize(this._previousUserID);
	}
	,hxUnserialize: function(u) {
		apptimize_models_results_ABTResultEntry.prototype.hxUnserialize.call(this,u);
		this._type = u.unserialize();
		this._previousUserID = u.unserialize();
	}
	,__class__: apptimize_models_results_ABTResultEntryUserStart
});
var apptimize_models_results_ABTResultEntrySuccessfullyPosted = function(timestampFromServer,firstEntryID,lastEntryID) {
	var this1 = new haxe__$Int64__$_$_$Int64(0,0);
	this._lastEntryID = this1;
	var this1 = new haxe__$Int64__$_$_$Int64(0,0);
	this._firstEntryID = this1;
	var this1 = new haxe__$Int64__$_$_$Int64(0,0);
	this._timestampFromServer = this1;
	this._type = "sp";
	apptimize_models_results_ABTResultEntry.call(this,null);
	this._timestampFromServer = timestampFromServer;
	this._firstEntryID = firstEntryID;
	this._lastEntryID = lastEntryID;
};
$hxClasses["apptimize.models.results.ABTResultEntrySuccessfullyPosted"] = apptimize_models_results_ABTResultEntrySuccessfullyPosted;
apptimize_models_results_ABTResultEntrySuccessfullyPosted.__name__ = "apptimize.models.results.ABTResultEntrySuccessfullyPosted";
apptimize_models_results_ABTResultEntrySuccessfullyPosted.__super__ = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntrySuccessfullyPosted.prototype = $extend(apptimize_models_results_ABTResultEntry.prototype,{
	_type: null
	,_timestampFromServer: null
	,_firstEntryID: null
	,_lastEntryID: null
	,JSONRepresentation: function() {
		var jsonDict = apptimize_models_results_ABTResultEntry.prototype.JSONRepresentation.call(this);
		var v = this._type;
		jsonDict.h["ty"] = v;
		var v = apptimize_util_ABTInt64Utils.toPreprocessedString(this._timestampFromServer);
		jsonDict.h["t"] = v;
		var v = apptimize_util_ABTInt64Utils.toPreprocessedString(this._firstEntryID);
		jsonDict.h["f"] = v;
		var v = apptimize_util_ABTInt64Utils.toPreprocessedString(this._lastEntryID);
		jsonDict.h["l"] = v;
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_models_results_ABTResultEntry.prototype.hxSerialize.call(this,s);
		s.serialize(this._type);
		apptimize_util_ABTInt64Utils._serializeInt64(this._timestampFromServer,s);
		apptimize_util_ABTInt64Utils._serializeInt64(this._firstEntryID,s);
		apptimize_util_ABTInt64Utils._serializeInt64(this._lastEntryID,s);
	}
	,hxUnserialize: function(u) {
		apptimize_models_results_ABTResultEntry.prototype.hxUnserialize.call(this,u);
		this._type = u.unserialize();
		this._timestampFromServer = apptimize_util_ABTInt64Utils._deserializeInt64(u);
		this._firstEntryID = apptimize_util_ABTInt64Utils._deserializeInt64(u);
		this._lastEntryID = apptimize_util_ABTInt64Utils._deserializeInt64(u);
	}
	,__class__: apptimize_models_results_ABTResultEntrySuccessfullyPosted
});
var apptimize_models_results_ABTResultEntryDataTypeLimitReached = function(currentEntryCount) {
	var this1 = new haxe__$Int64__$_$_$Int64(0,0);
	this._currentEntryCount = this1;
	this._type = "dl";
	apptimize_models_results_ABTResultEntry.call(this,null);
	this._currentEntryCount = currentEntryCount;
};
$hxClasses["apptimize.models.results.ABTResultEntryDataTypeLimitReached"] = apptimize_models_results_ABTResultEntryDataTypeLimitReached;
apptimize_models_results_ABTResultEntryDataTypeLimitReached.__name__ = "apptimize.models.results.ABTResultEntryDataTypeLimitReached";
apptimize_models_results_ABTResultEntryDataTypeLimitReached.__super__ = apptimize_models_results_ABTResultEntry;
apptimize_models_results_ABTResultEntryDataTypeLimitReached.prototype = $extend(apptimize_models_results_ABTResultEntry.prototype,{
	_type: null
	,_currentEntryCount: null
	,JSONRepresentation: function() {
		var jsonDict = apptimize_models_results_ABTResultEntry.prototype.JSONRepresentation.call(this);
		var v = this._type;
		jsonDict.h["ty"] = v;
		var v = apptimize_util_ABTInt64Utils.toPreprocessedString(this._currentEntryCount);
		jsonDict.h["c"] = v;
		return jsonDict;
	}
	,hxSerialize: function(s) {
		apptimize_models_results_ABTResultEntry.prototype.hxSerialize.call(this,s);
		s.serialize(this._type);
		apptimize_util_ABTInt64Utils._serializeInt64(this._currentEntryCount,s);
	}
	,hxUnserialize: function(u) {
		apptimize_models_results_ABTResultEntry.prototype.hxUnserialize.call(this,u);
		this._type = u.unserialize();
		this._currentEntryCount = apptimize_util_ABTInt64Utils._deserializeInt64(u);
	}
	,__class__: apptimize_models_results_ABTResultEntryDataTypeLimitReached
});
var apptimize_models_results_ABTResultLog = function(env) {
	if(env != null) {
		this.userID = env.userID;
		this.anonID = env.anonID;
		this.appkey = env.appkey;
		this.uniqueID = env.getUniqueUserID();
	}
	this.entries = [];
};
$hxClasses["apptimize.models.results.ABTResultLog"] = apptimize_models_results_ABTResultLog;
apptimize_models_results_ABTResultLog.__name__ = "apptimize.models.results.ABTResultLog";
apptimize_models_results_ABTResultLog.prototype = {
	entries: null
	,userID: null
	,anonID: null
	,appkey: null
	,uniqueID: null
	,logEntry: function(entry) {
		this.entries.push(entry);
	}
	,entryCount: function() {
		return this.entries.length;
	}
	,getAppKey: function() {
		return this.appkey;
	}
	,getUniqueUserKey: function() {
		return this.uniqueID;
	}
	,toJSON: function() {
		var json = new haxe_ds_StringMap();
		var jsonEntries = [];
		var _g = 0;
		var _g1 = this.entries;
		while(_g < _g1.length) {
			var entry = _g1[_g];
			++_g;
			jsonEntries.push(entry.JSONRepresentation());
		}
		var v = "v4";
		json.h["type"] = v;
		var v = this.getAppKey();
		json.h["a"] = v;
		var v = apptimize_ABTDataStore.getServerGUID();
		json.h["g"] = v;
		var currentDate = new Date();
		var nowMs = haxe_Int64Helper.fromFloat(new Date().getTime());
		var v = apptimize_util_ABTInt64Utils.toPreprocessedString(nowMs);
		json.h["c"] = v;
		var v = jsonEntries;
		json.h["e"] = v;
		var v = "Cross Platform " + apptimize_Apptimize.getApptimizeSDKVersion();
		json.h["v"] = v;
		if(this.userID != null) {
			var v = this.userID;
			json.h["u"] = v;
		}
		return apptimize_util_ABTJSONUtils.stringify(json);
	}
	,__class__: apptimize_models_results_ABTResultLog
};
var pako = require("pako");
var apptimize_support_initialize_ABTPlatformInitialize = function() { };
$hxClasses["apptimize.support.initialize.ABTPlatformInitialize"] = apptimize_support_initialize_ABTPlatformInitialize;
apptimize_support_initialize_ABTPlatformInitialize.__name__ = "apptimize.support.initialize.ABTPlatformInitialize";
apptimize_support_initialize_ABTPlatformInitialize.initialize = function() {
	apptimize_support_persistence_ABTPersistence.saveString(apptimize_support_persistence_ABTPersistence.kApptimizeVersionKey,apptimize_Apptimize.getApptimizeSDKVersion());
	apptimize_support_initialize_ABTPlatformInitialize._isThreadingEnabled = apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.THREADING_ENABLED_KEY);
	apptimize_api_ABTMetadataPoller.startPolling();
	apptimize_support_initialize_ABTPlatformInitialize.hookShutdown(apptimize_support_initialize_ABTPlatformInitialize._isThreadingEnabled);
};
apptimize_support_initialize_ABTPlatformInitialize.hookShutdown = function(isThreaded) {
	if(!apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.AUTOMATIC_SHUTDOWN_HOOK)) {
		apptimize_ABTLogger.v("Process exits will not be handled to persist Apptimize library state across server restarts.",{ fileName : "src/apptimize/support/initialize/ABTPlatformInitialize.hx", lineNumber : 119, className : "apptimize.support.initialize.ABTPlatformInitialize", methodName : "hookShutdown"});
		return;
	}
	process.on("SIGINT",apptimize_support_initialize_ABTPlatformInitialize.shutdownHook);
	process.on("SIGTERM",apptimize_support_initialize_ABTPlatformInitialize.shutdownHook);
};
apptimize_support_initialize_ABTPlatformInitialize.shutdownPlatform = function() {
	apptimize_api_ABTMetadataPoller.stopPolling();
};
apptimize_support_initialize_ABTPlatformInitialize.shutdownHook = function() {
	apptimize_ApptimizeInternal.shutdown();
};
var apptimize_support_persistence_ABTPersistentInterface = function() { };
$hxClasses["apptimize.support.persistence.ABTPersistentInterface"] = apptimize_support_persistence_ABTPersistentInterface;
apptimize_support_persistence_ABTPersistentInterface.__name__ = "apptimize.support.persistence.ABTPersistentInterface";
apptimize_support_persistence_ABTPersistentInterface.prototype = {
	save: function(key,value,latency,compress) {
		if(compress == null) {
			compress = false;
		}
		if(latency == null) {
			latency = 0;
		}
		throw haxe_Exception.thrown("ABTPersistentInterface.save not implemented");
	}
	,load: function(key,latency,callback) {
		if(latency == null) {
			latency = 0;
		}
		throw haxe_Exception.thrown("ABTPersistentInterface.load not implemented");
	}
	,clear: function(latency) {
		if(latency == null) {
			latency = 2;
		}
	}
	,saveObject: function(key,value,latency,compress) {
		if(compress == null) {
			compress = false;
		}
		if(latency == null) {
			latency = 0;
		}
		var serializer = new haxe_Serializer();
		serializer.serialize(value);
		serializer.serialize(apptimize_Apptimize.getApptimizeSDKVersion());
		this.save(key,serializer.toString(),latency,compress);
	}
	,loadObject: function(key,latency,callback) {
		if(latency == null) {
			latency = 0;
		}
		var _gthis = this;
		var result = null;
		var processObject = function(key,serializedObject) {
			if(serializedObject != null) {
				try {
					var unserializer = new haxe_Unserializer(serializedObject);
					result = unserializer.unserialize();
					if(result != null && _gthis.hasDidUnserialize(result)) {
						result.didUnserialize();
					}
				} catch( _g ) {
					haxe_NativeStackTrace.lastError = _g;
					var unknown = haxe_Exception.caught(_g).unwrap();
					apptimize_ABTLogger.e("Error deserializing \"" + key + "\" from persistent storage. Error: " + Std.string(unknown),{ fileName : "src/apptimize/support/persistence/ABTPersistence.hx", lineNumber : 50, className : "apptimize.support.persistence.ABTPersistentInterface", methodName : "loadObject"});
				}
				if(callback != null) {
					callback(key,result);
					return result;
				}
			}
			if(callback != null) {
				callback(key,null);
			}
			return result;
		};
		if(callback != null) {
			return this.load(key,latency,processObject);
		} else {
			var serializedObject = this.load(key,latency,callback);
			return processObject(key,serializedObject);
		}
	}
	,sync: function(key,fromLatency,toLatency,callback) {
		var onCallback = function(key,value) {
			if(callback != null) {
				callback(key,value);
			}
		};
		this.loadObject(key,fromLatency,onCallback);
	}
	,hasDidUnserialize: function(obj) {
		return obj.didUnserialize != null;
	}
	,__class__: apptimize_support_persistence_ABTPersistentInterface
};
var apptimize_support_persistence_ABTPICacheStorage = function() {
	this.cacheMap = new haxe_ds_StringMap();
};
$hxClasses["apptimize.support.persistence.ABTPICacheStorage"] = apptimize_support_persistence_ABTPICacheStorage;
apptimize_support_persistence_ABTPICacheStorage.__name__ = "apptimize.support.persistence.ABTPICacheStorage";
apptimize_support_persistence_ABTPICacheStorage.__super__ = apptimize_support_persistence_ABTPersistentInterface;
apptimize_support_persistence_ABTPICacheStorage.prototype = $extend(apptimize_support_persistence_ABTPersistentInterface.prototype,{
	cacheMap: null
	,save: function(key,value,latency,compress) {
		if(compress == null) {
			compress = false;
		}
		if(latency == null) {
			latency = 0;
		}
		if(value != null) {
			this.cacheMap.h[key] = value;
		} else {
			var _this = this.cacheMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
	}
	,saveObject: function(key,value,latency,compress) {
		if(compress == null) {
			compress = false;
		}
		if(latency == null) {
			latency = 0;
		}
		if(value != null) {
			this.cacheMap.h[key] = value;
		} else {
			var _this = this.cacheMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
	}
	,loadObject: function(key,latency,callback) {
		if(latency == null) {
			latency = 0;
		}
		var value = this.cacheMap.h[key];
		if(callback != null) {
			callback(key,value);
		}
		return value;
	}
	,load: function(key,latency,callback) {
		if(latency == null) {
			latency = 0;
		}
		var value = this.cacheMap.h[key];
		if(callback != null) {
			callback(key,value);
		}
		return value;
	}
	,clear: function(latency) {
		if(latency == null) {
			latency = 0;
		}
		this.cacheMap = new haxe_ds_StringMap();
	}
	,sync: function(key,fromLatency,toLatency,callback) {
		if(callback != null) {
			callback(key,this.load(key));
		}
	}
	,__class__: apptimize_support_persistence_ABTPICacheStorage
});
var apptimize_support_persistence_ABTPINodejsFileSystemStorage = function() {
	this._extension = ".data";
	this._localStoragePath = "data/apptimize/";
	if(apptimize_support_persistence_ABTPINodejsFileSystemStorage.isFileSystemSupported()) {
		try {
			js_node_Fs.statSync(this._localStoragePath);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			try {
				js_node_Fs.mkdirSync("data");
			} catch( _g1 ) {
				apptimize_ABTLogger.v("Creating local storage directory: " + this._localStoragePath,{ fileName : "src/apptimize/support/persistence/ABTPINodejsFileSystemStorage.hx", lineNumber : 21, className : "apptimize.support.persistence.ABTPINodejsFileSystemStorage", methodName : "new"});
			}
			js_node_Fs.mkdirSync(this._localStoragePath);
		}
	} else {
		apptimize_ABTLogger.c("Attempted to create ABTPINodejsFileSystemStorage object but file system is not supported!",{ fileName : "src/apptimize/support/persistence/ABTPINodejsFileSystemStorage.hx", lineNumber : 26, className : "apptimize.support.persistence.ABTPINodejsFileSystemStorage", methodName : "new"});
	}
	this._keys = [];
};
$hxClasses["apptimize.support.persistence.ABTPINodejsFileSystemStorage"] = apptimize_support_persistence_ABTPINodejsFileSystemStorage;
apptimize_support_persistence_ABTPINodejsFileSystemStorage.__name__ = "apptimize.support.persistence.ABTPINodejsFileSystemStorage";
apptimize_support_persistence_ABTPINodejsFileSystemStorage.isFileSystemSupported = function() {
	try {
		js_node_Fs.statSync(".");
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return false;
	}
	return true;
};
apptimize_support_persistence_ABTPINodejsFileSystemStorage.__super__ = apptimize_support_persistence_ABTPersistentInterface;
apptimize_support_persistence_ABTPINodejsFileSystemStorage.prototype = $extend(apptimize_support_persistence_ABTPersistentInterface.prototype,{
	_localStoragePath: null
	,_extension: null
	,_keys: null
	,_dataFromDisk: function(path,localPath) {
		if(localPath == null) {
			localPath = "";
		}
		var filePath = localPath + path + this._extension;
		try {
			var content = js_node_Fs.readFileSync(filePath,"utf8");
			return content;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			apptimize_ABTLogger.v("File not found: " + filePath + ". Unable to load data from disk.",{ fileName : "src/apptimize/support/persistence/ABTPINodejsFileSystemStorage.hx", lineNumber : 46, className : "apptimize.support.persistence.ABTPINodejsFileSystemStorage", methodName : "_dataFromDisk"});
		}
		return null;
	}
	,_deleteFile: function(key,localPath) {
		if(localPath == null) {
			localPath = "";
		}
		var filePath = localPath + key + this._extension;
		try {
			js_node_Fs.unlinkSync(filePath);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			apptimize_ABTLogger.v("File not found: " + filePath + ". Unable to delete.",{ fileName : "src/apptimize/support/persistence/ABTPINodejsFileSystemStorage.hx", lineNumber : 57, className : "apptimize.support.persistence.ABTPINodejsFileSystemStorage", methodName : "_deleteFile"});
		}
	}
	,save: function(key,value,latency,compress) {
		if(compress == null) {
			compress = false;
		}
		if(latency == null) {
			latency = 0;
		}
		var filePath = this._localStoragePath + key + this._extension;
		if(value != null) {
			try {
				js_node_Fs.writeFileSync(filePath,value,"utf8");
				this._keys.push(key);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				apptimize_ABTLogger.w("Unable to write to file: " + filePath + ". Error: " + Std.string(e),{ fileName : "src/apptimize/support/persistence/ABTPINodejsFileSystemStorage.hx", lineNumber : 69, className : "apptimize.support.persistence.ABTPINodejsFileSystemStorage", methodName : "save"});
			}
		} else {
			this._deleteFile(key,this._localStoragePath);
			HxOverrides.remove(this._keys,key);
		}
	}
	,load: function(key,latency,callback) {
		if(latency == null) {
			latency = 0;
		}
		var result = this._dataFromDisk(key,this._localStoragePath);
		if(callback != null) {
			callback(key,result);
		}
		return result;
	}
	,clear: function(latency) {
		if(latency == null) {
			latency = 3;
		}
		var _g = 0;
		var _g1 = this._keys;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			this._deleteFile(key,this._localStoragePath);
		}
		this._keys = [];
	}
	,__class__: apptimize_support_persistence_ABTPINodejsFileSystemStorage
});
var apptimize_support_persistence_ABTPISmartStorage = function(lowLatencyStorage,highLatencyStorage) {
	this._lowLatencyStorage = lowLatencyStorage;
	this._highLatencyStorage = highLatencyStorage;
};
$hxClasses["apptimize.support.persistence.ABTPISmartStorage"] = apptimize_support_persistence_ABTPISmartStorage;
apptimize_support_persistence_ABTPISmartStorage.__name__ = "apptimize.support.persistence.ABTPISmartStorage";
apptimize_support_persistence_ABTPISmartStorage.__super__ = apptimize_support_persistence_ABTPersistentInterface;
apptimize_support_persistence_ABTPISmartStorage.prototype = $extend(apptimize_support_persistence_ABTPersistentInterface.prototype,{
	_lowLatencyStorage: null
	,_highLatencyStorage: null
	,save: function(key,value,latency,compress) {
		if(compress == null) {
			compress = false;
		}
		if(latency == null) {
			latency = 0;
		}
		this.storageForLatency(latency).save(key,value,latency);
	}
	,load: function(key,latency,callback) {
		if(latency == null) {
			latency = 0;
		}
		return this.storageForLatency(latency).load(key,latency,callback);
	}
	,saveObject: function(key,value,latency,compress) {
		if(compress == null) {
			compress = false;
		}
		if(latency == null) {
			latency = 0;
		}
		this.storageForLatency(latency).saveObject(key,value,latency);
	}
	,loadObject: function(key,latency,callback) {
		if(latency == null) {
			latency = 0;
		}
		return this.storageForLatency(latency).loadObject(key,latency,callback);
	}
	,storageForLatency: function(latency) {
		if(latency == apptimize_support_persistence_ABTPersistence.LOW_LATENCY) {
			return this._lowLatencyStorage;
		}
		return this._highLatencyStorage;
	}
	,clear: function(latency) {
		if(latency == null) {
			latency = 2;
		}
		if(latency == apptimize_support_persistence_ABTPersistence.LOW_LATENCY || latency == apptimize_support_persistence_ABTPersistence.ALL_LATENCY) {
			this._lowLatencyStorage.clear(latency);
		}
		if(latency == apptimize_support_persistence_ABTPersistence.HIGH_LATENCY || latency == apptimize_support_persistence_ABTPersistence.ALL_LATENCY) {
			this._highLatencyStorage.clear(latency);
		}
	}
	,sync: function(key,fromLatency,toLatency,callback) {
		var _gthis = this;
		var onCallback = function(key,value) {
			_gthis.saveObject(key,value,toLatency);
			if(fromLatency == apptimize_support_persistence_ABTPersistence.HIGH_LATENCY && _gthis.deleteHighLatencyOnSync()) {
				_gthis.save(key,null,fromLatency);
			}
			if(callback != null) {
				callback(key,value);
			}
		};
		this.loadObject(key,fromLatency,onCallback);
	}
	,deleteHighLatencyOnSync: function() {
		return true;
	}
	,__class__: apptimize_support_persistence_ABTPISmartStorage
});
var apptimize_support_persistence_ABTPersistence = function() { };
$hxClasses["apptimize.support.persistence.ABTPersistence"] = apptimize_support_persistence_ABTPersistence;
apptimize_support_persistence_ABTPersistence.__name__ = "apptimize.support.persistence.ABTPersistence";
apptimize_support_persistence_ABTPersistence.getPersistentInterface = function() {
	if(apptimize_support_persistence_ABTPersistence._persistentInterface == null) {
		if(apptimize_support_properties_ABTConfigProperties.sharedInstance().isPropertyAvailable(apptimize_support_properties_ABTConfigProperties.STORAGE_TYPE_KEY)) {
			if(apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.STORAGE_TYPE_KEY) == "memory") {
				apptimize_support_persistence_ABTPersistence._persistentInterface = new apptimize_support_persistence_ABTPICacheStorage();
				return apptimize_support_persistence_ABTPersistence._persistentInterface;
			}
		}
		apptimize_support_persistence_ABTPersistence._persistentInterface = new apptimize_support_persistence_ABTPISmartStorage(new apptimize_support_persistence_ABTPICacheStorage(),new apptimize_support_persistence_ABTPINodejsFileSystemStorage());
	}
	return apptimize_support_persistence_ABTPersistence._persistentInterface;
};
apptimize_support_persistence_ABTPersistence.shutdown = function() {
	apptimize_support_persistence_ABTPersistence._persistentInterface = null;
};
apptimize_support_persistence_ABTPersistence.loadFromHighLatency = function(callback) {
	var keys = [apptimize_support_persistence_ABTPersistence.kMetadataKey,apptimize_support_persistence_ABTPersistence.kUserIDKey,apptimize_support_persistence_ABTPersistence.kAnonymousGuidKey,apptimize_support_persistence_ABTPersistence.kCustomPropertiesKey,apptimize_support_persistence_ABTPersistence.kInternalPropertiesKey,apptimize_support_persistence_ABTPersistence.kResultLogsKey,apptimize_support_persistence_ABTPersistence.kResultPostsKey,apptimize_support_persistence_ABTPersistence.kResultEntrySequenceKey,apptimize_support_persistence_ABTPersistence.kResultEntryTimestampKey,apptimize_support_persistence_ABTPersistence.kApptimizeVersionKey,apptimize_support_persistence_ABTPersistence.kLockAccessKey,apptimize_support_persistence_ABTPersistence.kPostManagementKey,apptimize_support_persistence_ABTPersistence.kResultLastSubmitTimeKey,apptimize_support_persistence_ABTPersistence.kMetadataLastCheckTimeKey,apptimize_support_persistence_ABTPersistence.kResultPostsListKey];
	var syncedKeys = keys.slice();
	var onSync = function(key,value) {
		HxOverrides.remove(syncedKeys,key);
		if(syncedKeys.length == 0) {
			callback();
		}
	};
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.acquire();
	try {
		var _g = 0;
		while(_g < keys.length) {
			var key = keys[_g];
			++_g;
			apptimize_support_persistence_ABTPersistence.getPersistentInterface().sync(key,apptimize_support_persistence_ABTPersistence.HIGH_LATENCY,apptimize_support_persistence_ABTPersistence.LOW_LATENCY,onSync);
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
};
apptimize_support_persistence_ABTPersistence.saveToHighLatency = function() {
	var keys = [apptimize_support_persistence_ABTPersistence.kMetadataKey,apptimize_support_persistence_ABTPersistence.kUserIDKey,apptimize_support_persistence_ABTPersistence.kAnonymousGuidKey,apptimize_support_persistence_ABTPersistence.kCustomPropertiesKey,apptimize_support_persistence_ABTPersistence.kInternalPropertiesKey,apptimize_support_persistence_ABTPersistence.kResultLogsKey,apptimize_support_persistence_ABTPersistence.kResultPostsKey,apptimize_support_persistence_ABTPersistence.kResultEntrySequenceKey,apptimize_support_persistence_ABTPersistence.kResultEntryTimestampKey,apptimize_support_persistence_ABTPersistence.kApptimizeVersionKey,apptimize_support_persistence_ABTPersistence.kLockAccessKey,apptimize_support_persistence_ABTPersistence.kPostManagementKey,apptimize_support_persistence_ABTPersistence.kResultLastSubmitTimeKey,apptimize_support_persistence_ABTPersistence.kMetadataLastCheckTimeKey,apptimize_support_persistence_ABTPersistence.kResultPostsListKey];
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.acquire();
	try {
		var _g = 0;
		while(_g < keys.length) {
			var key = keys[_g];
			++_g;
			apptimize_support_persistence_ABTPersistence.getPersistentInterface().sync(key,apptimize_support_persistence_ABTPersistence.LOW_LATENCY,apptimize_support_persistence_ABTPersistence.HIGH_LATENCY);
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
};
apptimize_support_persistence_ABTPersistence.clear = function() {
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.acquire();
	try {
		apptimize_support_persistence_ABTPersistence.getPersistentInterface().clear(apptimize_support_persistence_ABTPersistence.ALL_LATENCY);
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
};
apptimize_support_persistence_ABTPersistence.saveString = function(key,value,latency,compress) {
	if(compress == null) {
		compress = false;
	}
	if(latency == null) {
		latency = 0;
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.acquire();
	try {
		try {
			apptimize_support_persistence_ABTPersistence.getPersistentInterface().save(key,value,latency,compress);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var unknown = haxe_Exception.caught(_g).unwrap();
			if(!apptimize_support_persistence_ABTPersistence._isFlushing) {
				apptimize_ABTLogger.e("Unable to store \"" + key + "\" to persistent storage. Submitting all pending results data. Error: " + Std.string(unknown),{ fileName : "src/apptimize/support/persistence/ABTPersistence.hx", lineNumber : 215, className : "apptimize.support.persistence.ABTPersistence", methodName : "saveString"});
			}
			apptimize_support_persistence_ABTPersistence.flushTracking();
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
};
apptimize_support_persistence_ABTPersistence.saveObject = function(key,value,latency,compress) {
	if(compress == null) {
		compress = false;
	}
	if(latency == null) {
		latency = 0;
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.acquire();
	try {
		try {
			apptimize_support_persistence_ABTPersistence.getPersistentInterface().saveObject(key,value,latency,compress);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var unknown = haxe_Exception.caught(_g).unwrap();
			if(!apptimize_support_persistence_ABTPersistence._isFlushing) {
				apptimize_ABTLogger.e("Unable to store \"" + key + "\" to persistent storage. Submitting all pending results data. Error: " + Std.string(unknown),{ fileName : "src/apptimize/support/persistence/ABTPersistence.hx", lineNumber : 229, className : "apptimize.support.persistence.ABTPersistence", methodName : "saveObject"});
			}
			apptimize_support_persistence_ABTPersistence.flushTracking();
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
};
apptimize_support_persistence_ABTPersistence.flushTracking = function() {
	if(apptimize_support_persistence_ABTPersistence._isFlushing) {
		return;
	}
	apptimize_support_persistence_ABTPersistence._isFlushing = true;
	try {
		apptimize_Apptimize.flushTracking();
		apptimize_support_persistence_ABTPersistence._isFlushing = false;
	} catch( _g ) {
		var er = haxe_Exception.caught(_g);
		apptimize_support_persistence_ABTPersistence._isFlushing = false;
		apptimize_ABTLogger.e("Error on flushing pending results data " + Std.string(er),{ fileName : "src/apptimize/support/persistence/ABTPersistence.hx", lineNumber : 247, className : "apptimize.support.persistence.ABTPersistence", methodName : "flushTracking"});
	}
};
apptimize_support_persistence_ABTPersistence.loadString = function(key,latency) {
	if(latency == null) {
		latency = 0;
	}
	var result = null;
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.acquire();
	try {
		try {
			result = apptimize_support_persistence_ABTPersistence.getPersistentInterface().load(key,latency);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var unknown = haxe_Exception.caught(_g).unwrap();
			apptimize_ABTLogger.e("Unable to retrieve \"" + key + "\" from persistent storage. Error: " + Std.string(unknown),{ fileName : "src/apptimize/support/persistence/ABTPersistence.hx", lineNumber : 261, className : "apptimize.support.persistence.ABTPersistence", methodName : "loadString"});
			return null;
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
	return result;
};
apptimize_support_persistence_ABTPersistence.loadObject = function(key,latency) {
	if(latency == null) {
		latency = 0;
	}
	var obj = null;
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.acquire();
	try {
		try {
			obj = apptimize_support_persistence_ABTPersistence.getPersistentInterface().loadObject(key,latency,null);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var unknown = haxe_Exception.caught(_g).unwrap();
			apptimize_ABTLogger.e("Unable to retrieve \"" + key + "\" from persistent storage. Error: " + Std.string(unknown),{ fileName : "src/apptimize/support/persistence/ABTPersistence.hx", lineNumber : 274, className : "apptimize.support.persistence.ABTPersistence", methodName : "loadObject"});
			return null;
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
		throw haxe_Exception.thrown(e);
	}
	apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK.release();
	return obj;
};
var apptimize_support_properties_ABTProperties = function() {
	this.PROPERTYLOCK = apptimize_util_ABTDataLock.getNewLock("property_lock");
	this.availableProperties = new haxe_ds_StringMap();
	this.PROPERTYLOCK.acquire();
	try {
		this.availableProperties = new haxe_ds_StringMap();
		this.setPropertyDefaults();
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		this.PROPERTYLOCK.release();
		throw haxe_Exception.thrown(e);
	}
	this.PROPERTYLOCK.release();
};
$hxClasses["apptimize.support.properties.ABTProperties"] = apptimize_support_properties_ABTProperties;
apptimize_support_properties_ABTProperties.__name__ = "apptimize.support.properties.ABTProperties";
apptimize_support_properties_ABTProperties.prototype = {
	availableProperties: null
	,PROPERTYLOCK: null
	,setPropertyDefaults: function() {
	}
	,isPropertyAvailable: function(propertyName) {
		var property = null;
		this.PROPERTYLOCK.acquire();
		try {
			property = this.availableProperties.h[propertyName];
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.PROPERTYLOCK.release();
			throw haxe_Exception.thrown(e);
		}
		this.PROPERTYLOCK.release();
		return property != null;
	}
	,valueForProperty: function(propertyName) {
		var property = null;
		this.PROPERTYLOCK.acquire();
		try {
			property = this.availableProperties.h[propertyName];
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.PROPERTYLOCK.release();
			throw haxe_Exception.thrown(e);
		}
		this.PROPERTYLOCK.release();
		return property;
	}
	,setProperty: function(key,value) {
		this.PROPERTYLOCK.acquire();
		try {
			this.availableProperties.h[key] = value;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.PROPERTYLOCK.release();
			throw haxe_Exception.thrown(e);
		}
		this.PROPERTYLOCK.release();
	}
	,setProperties: function(stringMap) {
		var h = stringMap.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.setProperty(key,stringMap.h[key]);
		}
	}
	,__class__: apptimize_support_properties_ABTProperties
};
var apptimize_support_properties_ABTApplicationProperties = function() {
	apptimize_support_properties_ABTProperties.call(this);
};
$hxClasses["apptimize.support.properties.ABTApplicationProperties"] = apptimize_support_properties_ABTApplicationProperties;
apptimize_support_properties_ABTApplicationProperties.__name__ = "apptimize.support.properties.ABTApplicationProperties";
apptimize_support_properties_ABTApplicationProperties.sharedInstance = function() {
	if(apptimize_support_properties_ABTApplicationProperties._instance == null) {
		apptimize_support_properties_ABTApplicationProperties._instance = new apptimize_support_properties_ABTApplicationProperties();
	}
	return apptimize_support_properties_ABTApplicationProperties._instance;
};
apptimize_support_properties_ABTApplicationProperties.getPlatformVersion = function() {
	return apptimize_support_properties_ABTApplicationProperties.formatPlatformVersion(eval("process.version"));
};
apptimize_support_properties_ABTApplicationProperties.formatPlatformVersion = function(systemVersion) {
	return systemVersion.substr(1,systemVersion.length - 1);
};
apptimize_support_properties_ABTApplicationProperties.__super__ = apptimize_support_properties_ABTProperties;
apptimize_support_properties_ABTApplicationProperties.prototype = $extend(apptimize_support_properties_ABTProperties.prototype,{
	setPropertyDefaults: function() {
		var this1 = this.availableProperties;
		var v = apptimize_Apptimize.getApptimizeSDKVersion();
		this1.h["apptimize_version"] = v;
		var this1 = this.availableProperties;
		var v = apptimize_Apptimize.getApptimizeSDKPlatform();
		this1.h["apptimize_platform"] = v;
		var v = null;
		this.availableProperties.h["app_version"] = v;
		var v = null;
		this.availableProperties.h["app_name"] = v;
		var this1 = this.availableProperties;
		var v = apptimize_support_properties_ABTApplicationProperties.getPlatformVersion();
		this1.h["system_version"] = v;
	}
	,addJSONProperties: function(jsonProperties) {
		var h = this.availableProperties.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 v = this.availableProperties.h[key];
			jsonProperties.h[apptimize_support_properties_ABTApplicationProperties._sigilForApplicationNamespace + key] = v;
		}
	}
	,__class__: apptimize_support_properties_ABTApplicationProperties
});
var apptimize_support_properties_ABTConfigProperties = function() {
	apptimize_support_properties_ABTProperties.call(this);
};
$hxClasses["apptimize.support.properties.ABTConfigProperties"] = apptimize_support_properties_ABTConfigProperties;
apptimize_support_properties_ABTConfigProperties.__name__ = "apptimize.support.properties.ABTConfigProperties";
apptimize_support_properties_ABTConfigProperties.sharedInstance = function() {
	if(apptimize_support_properties_ABTConfigProperties._instance == null) {
		apptimize_support_properties_ABTConfigProperties._instance = new apptimize_support_properties_ABTConfigProperties();
	}
	return apptimize_support_properties_ABTConfigProperties._instance;
};
apptimize_support_properties_ABTConfigProperties.__super__ = apptimize_support_properties_ABTProperties;
apptimize_support_properties_ABTConfigProperties.prototype = $extend(apptimize_support_properties_ABTProperties.prototype,{
	setPropertyDefaults: function() {
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.META_DATA_URL_LL_KEY] = "https://md-ll.apptimize.com/api/metadata/v4/";
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.META_DATA_URL_HL_KEY] = "https://md-hl.apptimize.com/api/metadata/v4/";
		var v = null;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY] = v;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.REFRESH_META_DATA_ON_SETUP] = false;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.LOG_LEVEL_KEY] = "LOG_LEVEL_WARN";
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.FOREGROUND_PERIOD_MS_KEY] = 10000;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.RESULT_POST_DELAY_MS_KEY] = 60000;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.ALTERATION_CACHE_SIZE_KEY] = 10;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.RESULTS_CACHE_SIZE_KEY] = 10;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.MAXIMUM_RESULT_ENTRIES_KEY] = 1000;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.MAXIMUM_PENDING_RESULTS_KEY] = 1000;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.METADATA_POLLING_INTERVAL_MS_KEY] = 600000;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.MAXIMUM_RESULT_POST_FAILURE_KEY] = 3;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.MAXIMUM_RESULT_POST_SENDER_TIMEOUT_MS_KEY] = 3000;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.METADATA_POLLING_BACKGROUND_INTERVAL_MS_KEY] = 86400000;
		var v = null;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.STORAGE_TYPE_KEY] = v;
		var v = null;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.APPTIMIZE_ENVIRONMENT_KEY] = v;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.AUTOMATIC_SHUTDOWN_HOOK] = true;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY] = "https://mapi.apptimize.com";
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.LOCAL_DISK_STORAGE_PATH_KEY] = "data/apptimize/";
		var v = null;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.REACT_NATIVE_STORAGE_KEY] = v;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY] = 137900;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.THREADING_ENABLED_KEY] = false;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.RESULT_POST_THREAD_POOL_SIZE_KEY] = 1;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.EXCEPTIONS_ENABLED_KEY] = false;
		this.availableProperties.h[apptimize_support_properties_ABTConfigProperties.COMPRESS_PERSISTENCE_STORE_KEY] = false;
	}
	,__class__: apptimize_support_properties_ABTConfigProperties
});
var apptimize_support_properties_CustomPropertyNamespace = $hxEnums["apptimize.support.properties.CustomPropertyNamespace"] = { __ename__:"apptimize.support.properties.CustomPropertyNamespace",__constructs__:null
	,UserAttribute: {_hx_name:"UserAttribute",_hx_index:0,__enum__:"apptimize.support.properties.CustomPropertyNamespace",toString:$estr}
	,ApptimizeLocal: {_hx_name:"ApptimizeLocal",_hx_index:1,__enum__:"apptimize.support.properties.CustomPropertyNamespace",toString:$estr}
	,ApptimizeInternal: {_hx_name:"ApptimizeInternal",_hx_index:2,__enum__:"apptimize.support.properties.CustomPropertyNamespace",toString:$estr}
	,Mixpanel: {_hx_name:"Mixpanel",_hx_index:3,__enum__:"apptimize.support.properties.CustomPropertyNamespace",toString:$estr}
};
apptimize_support_properties_CustomPropertyNamespace.__constructs__ = [apptimize_support_properties_CustomPropertyNamespace.UserAttribute,apptimize_support_properties_CustomPropertyNamespace.ApptimizeLocal,apptimize_support_properties_CustomPropertyNamespace.ApptimizeInternal,apptimize_support_properties_CustomPropertyNamespace.Mixpanel];
var apptimize_support_properties_ABTCustomProperties = function() {
	apptimize_support_properties_ABTProperties.call(this);
};
$hxClasses["apptimize.support.properties.ABTCustomProperties"] = apptimize_support_properties_ABTCustomProperties;
apptimize_support_properties_ABTCustomProperties.__name__ = "apptimize.support.properties.ABTCustomProperties";
apptimize_support_properties_ABTCustomProperties.__super__ = apptimize_support_properties_ABTProperties;
apptimize_support_properties_ABTCustomProperties.prototype = $extend(apptimize_support_properties_ABTProperties.prototype,{
	setPropertyDefaults: function() {
	}
	,setProperty: function(key,value) {
		this.setPropertyForNamespace(key,value,apptimize_support_properties_CustomPropertyNamespace.UserAttribute);
	}
	,setPropertyForNamespace: function(key,value,namespace) {
		apptimize_support_properties_ABTProperties.prototype.setProperty.call(this,this.sigilForNamespace(namespace) + key,value);
	}
	,sigilForNamespace: function(namespace) {
		switch(namespace._hx_index) {
		case 0:
			return "%";
		case 1:
			return "l";
		case 2:
			return "^";
		case 3:
			return "m";
		}
	}
	,valueForNamespacedProperty: function(propertyName,namespace) {
		return apptimize_support_properties_ABTProperties.prototype.valueForProperty.call(this,this.sigilForNamespace(namespace) + propertyName);
	}
	,addJSONProperties: function(jsonProperties) {
		var h = this.availableProperties.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(key.charAt(0) != this.sigilForNamespace(apptimize_support_properties_CustomPropertyNamespace.ApptimizeLocal)) {
				var v = this.availableProperties.h[key];
				jsonProperties.h[key] = v;
			}
		}
	}
	,__class__: apptimize_support_properties_ABTCustomProperties
});
var apptimize_support_properties_ABTInternalProperties = function() {
	apptimize_support_properties_ABTCustomProperties.call(this);
};
$hxClasses["apptimize.support.properties.ABTInternalProperties"] = apptimize_support_properties_ABTInternalProperties;
apptimize_support_properties_ABTInternalProperties.__name__ = "apptimize.support.properties.ABTInternalProperties";
apptimize_support_properties_ABTInternalProperties.sharedInstance = function() {
	if(apptimize_support_properties_ABTInternalProperties._instance == null) {
		apptimize_support_properties_ABTInternalProperties._instance = new apptimize_support_properties_ABTInternalProperties();
	}
	return apptimize_support_properties_ABTInternalProperties._instance;
};
apptimize_support_properties_ABTInternalProperties.__super__ = apptimize_support_properties_ABTCustomProperties;
apptimize_support_properties_ABTInternalProperties.prototype = $extend(apptimize_support_properties_ABTCustomProperties.prototype,{
	isPropertyAvailable: function(propertyName) {
		this._loadProperties();
		return apptimize_support_properties_ABTCustomProperties.prototype.isPropertyAvailable.call(this,propertyName);
	}
	,valueForProperty: function(propertyName) {
		this._loadProperties();
		return this.availableProperties.h[propertyName];
	}
	,setProperty: function(key,value) {
		this.setPropertyForNamespace(key,value,apptimize_support_properties_CustomPropertyNamespace.ApptimizeInternal);
	}
	,_loadProperties: function() {
		if(this.availableProperties == null) {
			this.availableProperties = new haxe_ds_StringMap();
		}
	}
	,_saveProperties: function() {
	}
	,setPropertyForNamespace: function(key,value,namespace) {
		this._loadProperties();
		apptimize_support_properties_ABTCustomProperties.prototype.setPropertyForNamespace.call(this,key,value,namespace);
		this._saveProperties();
	}
	,valueForNamespacedProperty: function(propertyName,namespace) {
		this._loadProperties();
		return apptimize_support_properties_ABTCustomProperties.prototype.valueForNamespacedProperty.call(this,propertyName,namespace);
	}
	,__class__: apptimize_support_properties_ABTInternalProperties
});
var apptimize_util_ABTDispatchTask = function(task,delay) {
	this.task = task;
	this.startTimestampMs = new Date().getTime() + delay;
};
$hxClasses["apptimize.util.ABTDispatchTask"] = apptimize_util_ABTDispatchTask;
apptimize_util_ABTDispatchTask.__name__ = "apptimize.util.ABTDispatchTask";
apptimize_util_ABTDispatchTask.prototype = {
	task: null
	,startTimestampMs: null
	,__class__: apptimize_util_ABTDispatchTask
};
var apptimize_util_ABTException = function() { };
$hxClasses["apptimize.util.ABTException"] = apptimize_util_ABTException;
apptimize_util_ABTException.__name__ = "apptimize.util.ABTException";
apptimize_util_ABTException.throwException = function(message) {
	if(apptimize_support_properties_ABTConfigProperties.sharedInstance().valueForProperty(apptimize_support_properties_ABTConfigProperties.EXCEPTIONS_ENABLED_KEY)) {
		throw haxe_Exception.thrown(message);
	}
};
var apptimize_util_ABTHash = function() { };
$hxClasses["apptimize.util.ABTHash"] = apptimize_util_ABTHash;
apptimize_util_ABTHash.__name__ = "apptimize.util.ABTHash";
apptimize_util_ABTHash.Sha1 = function(obj) {
	return haxe_crypto_Sha1.make(obj);
};
var apptimize_util_ABTInt64Utils = function() { };
$hxClasses["apptimize.util.ABTInt64Utils"] = apptimize_util_ABTInt64Utils;
apptimize_util_ABTInt64Utils.__name__ = "apptimize.util.ABTInt64Utils";
apptimize_util_ABTInt64Utils.toPreprocessedString = function(number) {
	return "wideInt_" + haxe_Int64.toString(number) + "_wideInt";
};
apptimize_util_ABTInt64Utils._serializeInt64 = function(value,s) {
	s.serialize(value.high);
	s.serialize(value.low);
};
apptimize_util_ABTInt64Utils._deserializeInt64 = function(u) {
	var this1 = new haxe__$Int64__$_$_$Int64(u.unserialize(),u.unserialize());
	return this1;
};
var apptimize_util_ABTJSONUtils = function() { };
$hxClasses["apptimize.util.ABTJSONUtils"] = apptimize_util_ABTJSONUtils;
apptimize_util_ABTJSONUtils.__name__ = "apptimize.util.ABTJSONUtils";
apptimize_util_ABTJSONUtils.stringify = function(json) {
	var jsonString = haxe_format_JsonPrinter.print(json,null,null);
	jsonString = StringTools.replace(jsonString,"\"wideInt_","");
	jsonString = StringTools.replace(jsonString,"_wideInt\"","");
	return jsonString;
};
var apptimize_util_ABTLRUCache = function(cacheSize) {
	this.cacheLock = apptimize_util_ABTDataLock.getNewLock("ABTLRUCache_lock");
	this._cacheSize = cacheSize;
	this.clear();
};
$hxClasses["apptimize.util.ABTLRUCache"] = apptimize_util_ABTLRUCache;
apptimize_util_ABTLRUCache.__name__ = "apptimize.util.ABTLRUCache";
apptimize_util_ABTLRUCache.prototype = {
	_cacheSize: null
	,_list: null
	,_map: null
	,cacheLock: null
	,clear: function(callback,dispatchQueue) {
		this.cacheLock.acquire();
		try {
			if(callback != null) {
				var _g = 0;
				var _g1 = this._list;
				while(_g < _g1.length) {
					var id = _g1[_g];
					++_g;
					var value = [this._map.h[id]];
					var task = (function(value) {
						return function() {
							callback(value[0]);
						};
					})(value);
					if(dispatchQueue != null) {
						dispatchQueue.dispatch(task,0);
					} else {
						apptimize_util_ABTDispatch.dispatchImmediately(task);
					}
				}
			}
			this._list = [];
			this._map = new haxe_ds_StringMap();
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.cacheLock.release();
			throw haxe_Exception.thrown(e);
		}
		this.cacheLock.release();
	}
	,hasKey: function(key) {
		var result = false;
		this.cacheLock.acquire();
		try {
			result = this._map.h[key] != null;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.cacheLock.release();
			throw haxe_Exception.thrown(e);
		}
		this.cacheLock.release();
		return result;
	}
	,getValue: function(key) {
		var result = null;
		this.cacheLock.acquire();
		try {
			if(this.hasKey(key)) {
				result = this._map.h[key];
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.cacheLock.release();
			throw haxe_Exception.thrown(e);
		}
		this.cacheLock.release();
		return result;
	}
	,remove: function(key,callback,dispatchQueue) {
		this.cacheLock.acquire();
		try {
			if(!this.hasKey(key)) {
				return;
			}
			if(callback != null) {
				var value = this._map.h[key];
				var task = function() {
					callback(value);
				};
				if(dispatchQueue != null) {
					dispatchQueue.dispatch(task,0);
				} else {
					apptimize_util_ABTDispatch.dispatchImmediately(task);
				}
			}
			HxOverrides.remove(this._list,key);
			var _this = this._map;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.cacheLock.release();
			throw haxe_Exception.thrown(e);
		}
		this.cacheLock.release();
	}
	,insert: function(key,value,callback,dispatchQueue) {
		this.cacheLock.acquire();
		try {
			if(this.hasKey(key)) {
				this._map.h[key] = value;
				HxOverrides.remove(this._list,key);
				this._list.push(key);
			} else {
				this._map.h[key] = value;
				this._list.push(key);
				if(this._list.length > this._cacheSize) {
					var id = this._list.shift();
					if(callback != null) {
						var value = this._map.h[id];
						var task = function() {
							callback(value);
						};
						if(dispatchQueue != null) {
							dispatchQueue.dispatch(task,0);
						} else {
							apptimize_util_ABTDispatch.dispatchImmediately(task);
						}
					}
					var _this = this._map;
					if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
						delete(_this.h[id]);
					}
				}
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.cacheLock.release();
			throw haxe_Exception.thrown(e);
		}
		this.cacheLock.release();
	}
	,hxSerialize: function(s) {
		var _g = new haxe_ds_StringMap();
		_g.h["_cacheSize"] = this._cacheSize;
		_g.h["_list"] = this._list;
		_g.h["_map"] = this._map;
		var values = _g;
		s.serialize(values);
	}
	,hxUnserialize: function(u) {
		var deserialized = u.unserialize();
		this._cacheSize = deserialized.h["_cacheSize"];
		this._list = deserialized.h["_list"];
		this._map = deserialized.h["_map"];
		this.initMissingFields();
	}
	,didUnserialize: function() {
		this.initMissingFields();
	}
	,initMissingFields: function() {
		if(this.cacheLock == null) {
			this.cacheLock = apptimize_util_ABTDataLock.getNewLock("ABTLRUCache_lock");
		}
	}
	,__class__: apptimize_util_ABTLRUCache
};
var apptimize_util_ABTTypes = function() { };
$hxClasses["apptimize.util.ABTTypes"] = apptimize_util_ABTTypes;
apptimize_util_ABTTypes.__name__ = "apptimize.util.ABTTypes";
apptimize_util_ABTTypes.isString = function(string) {
	var _g = Type.typeof(string);
	if(_g._hx_index == 6) {
		var c = _g.c;
		if(c.__name__ == "String") {
			return true;
		} else {
			return false;
		}
	} else {
		return false;
	}
};
var apptimize_util_ArrayType = $hxEnums["apptimize.util.ArrayType"] = { __ename__:"apptimize.util.ArrayType",__constructs__:null
	,Int: {_hx_name:"Int",_hx_index:0,__enum__:"apptimize.util.ArrayType",toString:$estr}
	,Bool: {_hx_name:"Bool",_hx_index:1,__enum__:"apptimize.util.ArrayType",toString:$estr}
	,Double: {_hx_name:"Double",_hx_index:2,__enum__:"apptimize.util.ArrayType",toString:$estr}
	,String: {_hx_name:"String",_hx_index:3,__enum__:"apptimize.util.ArrayType",toString:$estr}
	,VariantInfo: {_hx_name:"VariantInfo",_hx_index:4,__enum__:"apptimize.util.ArrayType",toString:$estr}
	,WinnerVariantInfo: {_hx_name:"WinnerVariantInfo",_hx_index:5,__enum__:"apptimize.util.ArrayType",toString:$estr}
};
apptimize_util_ArrayType.__constructs__ = [apptimize_util_ArrayType.Int,apptimize_util_ArrayType.Bool,apptimize_util_ArrayType.Double,apptimize_util_ArrayType.String,apptimize_util_ArrayType.VariantInfo,apptimize_util_ArrayType.WinnerVariantInfo];
var apptimize_util_ABTUtilArray = function() { };
$hxClasses["apptimize.util.ABTUtilArray"] = apptimize_util_ABTUtilArray;
apptimize_util_ABTUtilArray.__name__ = "apptimize.util.ABTUtilArray";
apptimize_util_ABTUtilArray.toNativeArray = function(haxeArray,type) {
	return haxeArray;
};
var apptimize_util_ABTUtilDictionary = function() { };
$hxClasses["apptimize.util.ABTUtilDictionary"] = apptimize_util_ABTUtilDictionary;
apptimize_util_ABTUtilDictionary.__name__ = "apptimize.util.ABTUtilDictionary";
apptimize_util_ABTUtilDictionary.dynamicToNativeDictionary = function(dynamicMap) {
	var jsDict = { };
	var dict = dynamicMap;
	if(Type.typeof(dict) == ValueType.TObject) {
		dict = apptimize_util_ABTUtilDictionary.dynamicObjectToStringMap(dynamicMap);
	}
	if(dict != null) {
		var h = dict.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++];
			jsDict[key] = dict.h[key];
		}
	}
	return jsDict;
};
apptimize_util_ABTUtilDictionary.nativeObjectToStringMap = function(nativeMap) {
	if(Type.typeof(nativeMap) == ValueType.TObject) {
		return apptimize_util_ABTUtilDictionary.dynamicObjectToStringMap(nativeMap);
	}
	if(js_Boot.getClass(nativeMap) == haxe_ds_StringMap) {
		return nativeMap;
	}
	return apptimize_util_ABTUtilDictionary.dynamicMapToStringMap(nativeMap);
};
apptimize_util_ABTUtilDictionary.dynamicObjectToStringMap = function(object) {
	var map = new haxe_ds_StringMap();
	var fields = Reflect.fields(object);
	var _g = 0;
	while(_g < fields.length) {
		var field = fields[_g];
		++_g;
		var value = Reflect.getProperty(object,field);
		map.h[field] = value;
	}
	return map;
};
apptimize_util_ABTUtilDictionary.dynamicMapToStringMap = function(map) {
	var stringMap = new haxe_ds_StringMap();
	var dict = map;
	var _g = 0;
	var _g1 = Reflect.fields(dict);
	while(_g < _g1.length) {
		var key = _g1[_g];
		++_g;
		stringMap.h[key] = dict[key];
	}
	return stringMap;
};
apptimize_util_ABTUtilDictionary.filterNullValues = function(map) {
	var result = new haxe_ds_StringMap();
	var h = map.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 value = map.h[key];
		if(value != null) {
			result.h[key] = value;
		}
	}
	return result;
};
var apptimize_util_ABTUtilGzip = function() { };
$hxClasses["apptimize.util.ABTUtilGzip"] = apptimize_util_ABTUtilGzip;
apptimize_util_ABTUtilGzip.__name__ = "apptimize.util.ABTUtilGzip";
apptimize_util_ABTUtilGzip.jsonSignatureLength = function(bytes) {
	var b = haxe_io_Bytes.ofData(bytes);
	var len = b.b[0] << 8 | b.b[1];
	return len;
};
apptimize_util_ABTUtilGzip.decompressBytes = function(bytes) {
	var arrayBuffer = haxe_io_UInt8Array.fromBytes(bytes);
	var result = null;
	try {
		result = pako.inflate(arrayBuffer,{ gzip : true});
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var err = haxe_Exception.caught(_g).unwrap();
		apptimize_ABTLogger.e("Error decompressing data " + Std.string(err),{ fileName : "src/apptimize/util/ABTUtilGzip.hx", lineNumber : 45, className : "apptimize.util.ABTUtilGzip", methodName : "decompressBytes"});
		return null;
	}
	return haxe_io_Bytes.ofData(result.buffer);
};
apptimize_util_ABTUtilGzip.decompress = function(bytes) {
	var bds = haxe_io_Bytes.ofData(bytes);
	var len = apptimize_util_ABTUtilGzip.jsonSignatureLength(bytes);
	var dataLength = bds.length;
	var sigLength = len + 2;
	var zippedLength = dataLength - sigLength;
	var orig = haxe_io_Bytes.ofData(bytes);
	var bd = orig.sub(sigLength,zippedLength);
	return apptimize_util_ABTUtilGzip.decompressBytes(bd);
};
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();
	}
	,__shiftStack: function() {
		this.__skipStack++;
	}
	,get_message: function() {
		return this.message;
	}
	,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_stack:"get_stack",get_message:"get_message"}
});
var haxe_Int32 = {};
haxe_Int32.ucompare = function(a,b) {
	if(a < 0) {
		if(b < 0) {
			return ~b - ~a | 0;
		} else {
			return 1;
		}
	}
	if(b < 0) {
		return -1;
	} else {
		return a - b | 0;
	}
};
var haxe_Int64 = {};
haxe_Int64.toString = function(this1) {
	var i = this1;
	var b_high = 0;
	var b_low = 0;
	if(i.high == b_high && i.low == b_low) {
		return "0";
	}
	var str = "";
	var neg = false;
	if(i.high < 0) {
		neg = true;
	}
	var this1 = new haxe__$Int64__$_$_$Int64(0,10);
	var ten = this1;
	while(true) {
		var b_high = 0;
		var b_low = 0;
		if(!(i.high != b_high || i.low != b_low)) {
			break;
		}
		var r = haxe_Int64.divMod(i,ten);
		if(r.modulus.high < 0) {
			var x = r.modulus;
			var high = ~x.high;
			var low = ~x.low + 1 | 0;
			if(low == 0) {
				var ret = high++;
				high = high | 0;
			}
			var this_high = high;
			var this_low = low;
			str = this_low + str;
			var x1 = r.quotient;
			var high1 = ~x1.high;
			var low1 = ~x1.low + 1 | 0;
			if(low1 == 0) {
				var ret1 = high1++;
				high1 = high1 | 0;
			}
			var this1 = new haxe__$Int64__$_$_$Int64(high1,low1);
			i = this1;
		} else {
			str = r.modulus.low + str;
			i = r.quotient;
		}
	}
	if(neg) {
		str = "-" + str;
	}
	return str;
};
haxe_Int64.divMod = function(dividend,divisor) {
	if(divisor.high == 0) {
		switch(divisor.low) {
		case 0:
			throw haxe_Exception.thrown("divide by zero");
		case 1:
			var this1 = new haxe__$Int64__$_$_$Int64(dividend.high,dividend.low);
			var this2 = new haxe__$Int64__$_$_$Int64(0,0);
			return { quotient : this1, modulus : this2};
		}
	}
	var divSign = dividend.high < 0 != divisor.high < 0;
	var modulus;
	if(dividend.high < 0) {
		var high = ~dividend.high;
		var low = ~dividend.low + 1 | 0;
		if(low == 0) {
			var ret = high++;
			high = high | 0;
		}
		var this1 = new haxe__$Int64__$_$_$Int64(high,low);
		modulus = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(dividend.high,dividend.low);
		modulus = this1;
	}
	if(divisor.high < 0) {
		var high = ~divisor.high;
		var low = ~divisor.low + 1 | 0;
		if(low == 0) {
			var ret = high++;
			high = high | 0;
		}
		var this1 = new haxe__$Int64__$_$_$Int64(high,low);
		divisor = this1;
	}
	var this1 = new haxe__$Int64__$_$_$Int64(0,0);
	var quotient = this1;
	var this1 = new haxe__$Int64__$_$_$Int64(0,1);
	var mask = this1;
	while(!(divisor.high < 0)) {
		var v = haxe_Int32.ucompare(divisor.high,modulus.high);
		var cmp = v != 0 ? v : haxe_Int32.ucompare(divisor.low,modulus.low);
		var b = 1;
		b &= 63;
		if(b == 0) {
			var this1 = new haxe__$Int64__$_$_$Int64(divisor.high,divisor.low);
			divisor = this1;
		} else if(b < 32) {
			var this2 = new haxe__$Int64__$_$_$Int64(divisor.high << b | divisor.low >>> 32 - b,divisor.low << b);
			divisor = this2;
		} else {
			var this3 = new haxe__$Int64__$_$_$Int64(divisor.low << b - 32,0);
			divisor = this3;
		}
		var b1 = 1;
		b1 &= 63;
		if(b1 == 0) {
			var this4 = new haxe__$Int64__$_$_$Int64(mask.high,mask.low);
			mask = this4;
		} else if(b1 < 32) {
			var this5 = new haxe__$Int64__$_$_$Int64(mask.high << b1 | mask.low >>> 32 - b1,mask.low << b1);
			mask = this5;
		} else {
			var this6 = new haxe__$Int64__$_$_$Int64(mask.low << b1 - 32,0);
			mask = this6;
		}
		if(cmp >= 0) {
			break;
		}
	}
	while(true) {
		var b_high = 0;
		var b_low = 0;
		if(!(mask.high != b_high || mask.low != b_low)) {
			break;
		}
		var v = haxe_Int32.ucompare(modulus.high,divisor.high);
		if((v != 0 ? v : haxe_Int32.ucompare(modulus.low,divisor.low)) >= 0) {
			var this1 = new haxe__$Int64__$_$_$Int64(quotient.high | mask.high,quotient.low | mask.low);
			quotient = this1;
			var high = modulus.high - divisor.high | 0;
			var low = modulus.low - divisor.low | 0;
			if(haxe_Int32.ucompare(modulus.low,divisor.low) < 0) {
				var ret = high--;
				high = high | 0;
			}
			var this2 = new haxe__$Int64__$_$_$Int64(high,low);
			modulus = this2;
		}
		var b = 1;
		b &= 63;
		if(b == 0) {
			var this3 = new haxe__$Int64__$_$_$Int64(mask.high,mask.low);
			mask = this3;
		} else if(b < 32) {
			var this4 = new haxe__$Int64__$_$_$Int64(mask.high >>> b,mask.high << 32 - b | mask.low >>> b);
			mask = this4;
		} else {
			var this5 = new haxe__$Int64__$_$_$Int64(0,mask.high >>> b - 32);
			mask = this5;
		}
		var b1 = 1;
		b1 &= 63;
		if(b1 == 0) {
			var this6 = new haxe__$Int64__$_$_$Int64(divisor.high,divisor.low);
			divisor = this6;
		} else if(b1 < 32) {
			var this7 = new haxe__$Int64__$_$_$Int64(divisor.high >>> b1,divisor.high << 32 - b1 | divisor.low >>> b1);
			divisor = this7;
		} else {
			var this8 = new haxe__$Int64__$_$_$Int64(0,divisor.high >>> b1 - 32);
			divisor = this8;
		}
	}
	if(divSign) {
		var high = ~quotient.high;
		var low = ~quotient.low + 1 | 0;
		if(low == 0) {
			var ret = high++;
			high = high | 0;
		}
		var this1 = new haxe__$Int64__$_$_$Int64(high,low);
		quotient = this1;
	}
	if(dividend.high < 0) {
		var high = ~modulus.high;
		var low = ~modulus.low + 1 | 0;
		if(low == 0) {
			var ret = high++;
			high = high | 0;
		}
		var this1 = new haxe__$Int64__$_$_$Int64(high,low);
		modulus = this1;
	}
	return { quotient : quotient, modulus : modulus};
};
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_Int64Helper = function() { };
$hxClasses["haxe.Int64Helper"] = haxe_Int64Helper;
haxe_Int64Helper.__name__ = "haxe.Int64Helper";
haxe_Int64Helper.parseString = function(sParam) {
	var base_high = 0;
	var base_low = 10;
	var this1 = new haxe__$Int64__$_$_$Int64(0,0);
	var current = this1;
	var this1 = new haxe__$Int64__$_$_$Int64(0,1);
	var multiplier = this1;
	var sIsNegative = false;
	var s = StringTools.trim(sParam);
	if(s.charAt(0) == "-") {
		sIsNegative = true;
		s = s.substring(1,s.length);
	}
	var len = s.length;
	var _g = 0;
	var _g1 = len;
	while(_g < _g1) {
		var i = _g++;
		var digitInt = HxOverrides.cca(s,len - 1 - i) - 48;
		if(digitInt < 0 || digitInt > 9) {
			throw haxe_Exception.thrown("NumberFormatError");
		}
		if(digitInt != 0) {
			var digit_high = digitInt >> 31;
			var digit_low = digitInt;
			if(sIsNegative) {
				var mask = 65535;
				var al = multiplier.low & mask;
				var ah = multiplier.low >>> 16;
				var bl = digit_low & mask;
				var bh = digit_low >>> 16;
				var p00 = haxe_Int32._mul(al,bl);
				var p10 = haxe_Int32._mul(ah,bl);
				var p01 = haxe_Int32._mul(al,bh);
				var p11 = haxe_Int32._mul(ah,bh);
				var low = p00;
				var high = (p11 + (p01 >>> 16) | 0) + (p10 >>> 16) | 0;
				p01 <<= 16;
				low = low + p01 | 0;
				if(haxe_Int32.ucompare(low,p01) < 0) {
					var ret = high++;
					high = high | 0;
				}
				p10 <<= 16;
				low = low + p10 | 0;
				if(haxe_Int32.ucompare(low,p10) < 0) {
					var ret1 = high++;
					high = high | 0;
				}
				high = high + (haxe_Int32._mul(multiplier.low,digit_high) + haxe_Int32._mul(multiplier.high,digit_low) | 0) | 0;
				var b_high = high;
				var b_low = low;
				var high1 = current.high - b_high | 0;
				var low1 = current.low - b_low | 0;
				if(haxe_Int32.ucompare(current.low,b_low) < 0) {
					var ret2 = high1--;
					high1 = high1 | 0;
				}
				var this1 = new haxe__$Int64__$_$_$Int64(high1,low1);
				current = this1;
				if(!(current.high < 0)) {
					throw haxe_Exception.thrown("NumberFormatError: Underflow");
				}
			} else {
				var mask1 = 65535;
				var al1 = multiplier.low & mask1;
				var ah1 = multiplier.low >>> 16;
				var bl1 = digit_low & mask1;
				var bh1 = digit_low >>> 16;
				var p001 = haxe_Int32._mul(al1,bl1);
				var p101 = haxe_Int32._mul(ah1,bl1);
				var p011 = haxe_Int32._mul(al1,bh1);
				var p111 = haxe_Int32._mul(ah1,bh1);
				var low2 = p001;
				var high2 = (p111 + (p011 >>> 16) | 0) + (p101 >>> 16) | 0;
				p011 <<= 16;
				low2 = low2 + p011 | 0;
				if(haxe_Int32.ucompare(low2,p011) < 0) {
					var ret3 = high2++;
					high2 = high2 | 0;
				}
				p101 <<= 16;
				low2 = low2 + p101 | 0;
				if(haxe_Int32.ucompare(low2,p101) < 0) {
					var ret4 = high2++;
					high2 = high2 | 0;
				}
				high2 = high2 + (haxe_Int32._mul(multiplier.low,digit_high) + haxe_Int32._mul(multiplier.high,digit_low) | 0) | 0;
				var b_high1 = high2;
				var b_low1 = low2;
				var high3 = current.high + b_high1 | 0;
				var low3 = current.low + b_low1 | 0;
				if(haxe_Int32.ucompare(low3,current.low) < 0) {
					var ret5 = high3++;
					high3 = high3 | 0;
				}
				var this2 = new haxe__$Int64__$_$_$Int64(high3,low3);
				current = this2;
				if(current.high < 0) {
					throw haxe_Exception.thrown("NumberFormatError: Overflow");
				}
			}
		}
		var mask2 = 65535;
		var al2 = multiplier.low & mask2;
		var ah2 = multiplier.low >>> 16;
		var bl2 = base_low & mask2;
		var bh2 = base_low >>> 16;
		var p002 = haxe_Int32._mul(al2,bl2);
		var p102 = haxe_Int32._mul(ah2,bl2);
		var p012 = haxe_Int32._mul(al2,bh2);
		var p112 = haxe_Int32._mul(ah2,bh2);
		var low4 = p002;
		var high4 = (p112 + (p012 >>> 16) | 0) + (p102 >>> 16) | 0;
		p012 <<= 16;
		low4 = low4 + p012 | 0;
		if(haxe_Int32.ucompare(low4,p012) < 0) {
			var ret6 = high4++;
			high4 = high4 | 0;
		}
		p102 <<= 16;
		low4 = low4 + p102 | 0;
		if(haxe_Int32.ucompare(low4,p102) < 0) {
			var ret7 = high4++;
			high4 = high4 | 0;
		}
		high4 = high4 + (haxe_Int32._mul(multiplier.low,base_high) + haxe_Int32._mul(multiplier.high,base_low) | 0) | 0;
		var this3 = new haxe__$Int64__$_$_$Int64(high4,low4);
		multiplier = this3;
	}
	return current;
};
haxe_Int64Helper.fromFloat = function(f) {
	if(isNaN(f) || !isFinite(f)) {
		throw haxe_Exception.thrown("Number is NaN or Infinite");
	}
	var noFractions = f - f % 1;
	if(noFractions > 9007199254740991) {
		throw haxe_Exception.thrown("Conversion overflow");
	}
	if(noFractions < -9007199254740991) {
		throw haxe_Exception.thrown("Conversion underflow");
	}
	var this1 = new haxe__$Int64__$_$_$Int64(0,0);
	var result = this1;
	var neg = noFractions < 0;
	var rest = neg ? -noFractions : noFractions;
	var i = 0;
	while(rest >= 1) {
		var curr = rest % 2;
		rest /= 2;
		if(curr >= 1) {
			var a_high = 0;
			var a_low = 1;
			var b = i;
			b &= 63;
			var b1;
			if(b == 0) {
				var this1 = new haxe__$Int64__$_$_$Int64(a_high,a_low);
				b1 = this1;
			} else if(b < 32) {
				var this2 = new haxe__$Int64__$_$_$Int64(a_high << b | a_low >>> 32 - b,a_low << b);
				b1 = this2;
			} else {
				var this3 = new haxe__$Int64__$_$_$Int64(a_low << b - 32,0);
				b1 = this3;
			}
			var high = result.high + b1.high | 0;
			var low = result.low + b1.low | 0;
			if(haxe_Int32.ucompare(low,result.low) < 0) {
				var ret = high++;
				high = high | 0;
			}
			var this4 = new haxe__$Int64__$_$_$Int64(high,low);
			result = this4;
		}
		++i;
	}
	if(neg) {
		var high = ~result.high;
		var low = ~result.low + 1 | 0;
		if(low == 0) {
			var ret = high++;
			high = high | 0;
		}
		var this1 = new haxe__$Int64__$_$_$Int64(high,low);
		result = this1;
	}
	return result;
};
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.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) {
					var this1 = new Array(haxe_Serializer.BASE64.length);
					b64 = this1;
					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.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.prototype = {
	buf: null
	,pos: null
	,length: null
	,cache: null
	,scache: null
	,resolver: null
	,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_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_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.prototype = {
	length: null
	,b: null
	,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));
	}
	,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);
	}
	,__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_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
	,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_Sha1 = function() {
};
$hxClasses["haxe.crypto.Sha1"] = haxe_crypto_Sha1;
haxe_crypto_Sha1.__name__ = "haxe.crypto.Sha1";
haxe_crypto_Sha1.make = function(b) {
	var h = new haxe_crypto_Sha1().doEncode(haxe_crypto_Sha1.bytes2blks(b));
	var out = new haxe_io_Bytes(new ArrayBuffer(20));
	var p = 0;
	out.b[p++] = h[0] >>> 24;
	out.b[p++] = h[0] >> 16 & 255;
	out.b[p++] = h[0] >> 8 & 255;
	out.b[p++] = h[0] & 255;
	out.b[p++] = h[1] >>> 24;
	out.b[p++] = h[1] >> 16 & 255;
	out.b[p++] = h[1] >> 8 & 255;
	out.b[p++] = h[1] & 255;
	out.b[p++] = h[2] >>> 24;
	out.b[p++] = h[2] >> 16 & 255;
	out.b[p++] = h[2] >> 8 & 255;
	out.b[p++] = h[2] & 255;
	out.b[p++] = h[3] >>> 24;
	out.b[p++] = h[3] >> 16 & 255;
	out.b[p++] = h[3] >> 8 & 255;
	out.b[p++] = h[3] & 255;
	out.b[p++] = h[4] >>> 24;
	out.b[p++] = h[4] >> 16 & 255;
	out.b[p++] = h[4] >> 8 & 255;
	out.b[p++] = h[4] & 255;
	return out;
};
haxe_crypto_Sha1.bytes2blks = function(b) {
	var nblk = (b.length + 8 >> 6) + 1;
	var blks = [];
	var _g = 0;
	var _g1 = nblk * 16;
	while(_g < _g1) {
		var i = _g++;
		blks[i] = 0;
	}
	var _g = 0;
	var _g1 = b.length;
	while(_g < _g1) {
		var i = _g++;
		var p = i >> 2;
		blks[p] |= b.b[i] << 24 - ((i & 3) << 3);
	}
	var i = b.length;
	var p = i >> 2;
	blks[p] |= 128 << 24 - ((i & 3) << 3);
	blks[nblk * 16 - 1] = b.length * 8;
	return blks;
};
haxe_crypto_Sha1.prototype = {
	doEncode: function(x) {
		var w = [];
		var a = 1732584193;
		var b = -271733879;
		var c = -1732584194;
		var d = 271733878;
		var e = -1009589776;
		var i = 0;
		while(i < x.length) {
			var olda = a;
			var oldb = b;
			var oldc = c;
			var oldd = d;
			var olde = e;
			var j = 0;
			while(j < 80) {
				if(j < 16) {
					w[j] = x[i + j];
				} else {
					var num = w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16];
					w[j] = num << 1 | num >>> 31;
				}
				var t = (a << 5 | a >>> 27) + this.ft(j,b,c,d) + e + w[j] + this.kt(j);
				e = d;
				d = c;
				c = b << 30 | b >>> 2;
				b = a;
				a = t;
				++j;
			}
			a += olda;
			b += oldb;
			c += oldc;
			d += oldd;
			e += olde;
			i += 16;
		}
		return [a,b,c,d,e];
	}
	,ft: function(t,b,c,d) {
		if(t < 20) {
			return b & c | ~b & d;
		}
		if(t < 40) {
			return b ^ c ^ d;
		}
		if(t < 60) {
			return b & c | b & d | c & d;
		}
		return b ^ c ^ d;
	}
	,kt: function(t) {
		if(t < 20) {
			return 1518500249;
		}
		if(t < 40) {
			return 1859775393;
		}
		if(t < 60) {
			return -1894007588;
		}
		return -899497514;
	}
	,__class__: haxe_crypto_Sha1
};
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
	,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];
		}};
	}
	,__class__: haxe_ds_IntMap
};
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++;
	}
	,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;
	}
	,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;
	}
	,__class__: haxe_ds_List
};
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_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;
	}
	,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);
	}
	,__class__: haxe_ds_ObjectMap
};
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;
				while(true) {
					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;
					}
					if(end) {
						break;
					}
				}
				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);
			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
	,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_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_UInt8Array = {};
haxe_io_UInt8Array.fromBytes = function(bytes,bytePos,length) {
	if(bytePos == null) {
		bytePos = 0;
	}
	if(length == null) {
		length = bytes.length - bytePos;
	}
	return new Uint8Array(bytes.b.bufferValue,bytePos,length);
};
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 hx_concurrent_ConcurrentException = function(cause) {
	this.cause = cause;
	this.causeStackTrace = haxe_CallStack.exceptionStack();
};
$hxClasses["hx.concurrent.ConcurrentException"] = hx_concurrent_ConcurrentException;
hx_concurrent_ConcurrentException.__name__ = "hx.concurrent.ConcurrentException";
hx_concurrent_ConcurrentException.prototype = {
	cause: null
	,causeStackTrace: null
	,toString: function() {
		var sb_b = "";
		sb_b += "rethrown exception:\n";
		sb_b += "  ";
		sb_b += "--------------------\n";
		sb_b += "  ";
		sb_b += "| Exception : ";
		sb_b += Std.string(this.cause);
		sb_b += "\n";
		var _g = 0;
		var _g1 = haxe_CallStack.toString(this.causeStackTrace).split("\n");
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			if(item == "") {
				continue;
			}
			sb_b += "  ";
			sb_b += Std.string(StringTools.replace(item,"Called from","| at"));
			sb_b += "\n";
		}
		sb_b += "  ";
		sb_b += "--------------------";
		return sb_b;
	}
	,__class__: hx_concurrent_ConcurrentException
};
var hx_concurrent_Future = function() { };
$hxClasses["hx.concurrent.Future"] = hx_concurrent_Future;
hx_concurrent_Future.__name__ = "hx.concurrent.Future";
hx_concurrent_Future.__isInterface__ = true;
var hx_concurrent_FutureResult = $hxEnums["hx.concurrent.FutureResult"] = { __ename__:"hx.concurrent.FutureResult",__constructs__:null
	,VALUE: ($_=function(result,time,future) { return {_hx_index:0,result:result,time:time,future:future,__enum__:"hx.concurrent.FutureResult",toString:$estr}; },$_._hx_name="VALUE",$_.__params__ = ["result","time","future"],$_)
	,FAILURE: ($_=function(ex,time,future) { return {_hx_index:1,ex:ex,time:time,future:future,__enum__:"hx.concurrent.FutureResult",toString:$estr}; },$_._hx_name="FAILURE",$_.__params__ = ["ex","time","future"],$_)
	,PENDING: ($_=function(future) { return {_hx_index:2,future:future,__enum__:"hx.concurrent.FutureResult",toString:$estr}; },$_._hx_name="PENDING",$_.__params__ = ["future"],$_)
};
hx_concurrent_FutureResult.__constructs__ = [hx_concurrent_FutureResult.VALUE,hx_concurrent_FutureResult.FAILURE,hx_concurrent_FutureResult.PENDING];
var hx_concurrent_AbstractFuture = function() {
	this.sync = new hx_concurrent_lock_RLock();
	this.completionListeners = [];
	this.result = hx_concurrent_FutureResult.PENDING(this);
};
$hxClasses["hx.concurrent.AbstractFuture"] = hx_concurrent_AbstractFuture;
hx_concurrent_AbstractFuture.__name__ = "hx.concurrent.AbstractFuture";
hx_concurrent_AbstractFuture.__interfaces__ = [hx_concurrent_Future];
hx_concurrent_AbstractFuture.prototype = {
	completionListeners: null
	,sync: null
	,result: null
	,isComplete: function() {
		var _g = this.result;
		if(_g._hx_index == 2) {
			var _g1 = _g.future;
			return false;
		} else {
			return true;
		}
	}
	,__class__: hx_concurrent_AbstractFuture
};
var hx_concurrent_CompletableFuture = function() {
	hx_concurrent_AbstractFuture.call(this);
};
$hxClasses["hx.concurrent.CompletableFuture"] = hx_concurrent_CompletableFuture;
hx_concurrent_CompletableFuture.__name__ = "hx.concurrent.CompletableFuture";
hx_concurrent_CompletableFuture.__super__ = hx_concurrent_AbstractFuture;
hx_concurrent_CompletableFuture.prototype = $extend(hx_concurrent_AbstractFuture.prototype,{
	complete: function(result,overwriteResult) {
		if(overwriteResult == null) {
			overwriteResult = false;
		}
		var _gthis = this;
		return this.sync.execute(function() {
			if(overwriteResult || !_gthis.isComplete()) {
				var _g = result;
				switch(_g._hx_index) {
				case 0:
					var value = _g.v;
					_gthis.result = hx_concurrent_FutureResult.VALUE(value,Date.now(),_gthis);
					break;
				case 1:
					var ex = _g.v;
					_gthis.result = hx_concurrent_FutureResult.FAILURE(ex,Date.now(),_gthis);
					break;
				}
				var _g = 0;
				var _g1 = _gthis.completionListeners;
				while(_g < _g1.length) {
					var listener = _g1[_g];
					++_g;
					try {
						listener(_gthis.result);
					} catch( _g2 ) {
						var ex = haxe_Exception.caught(_g2);
						haxe_Log.trace(ex,{ fileName : "hx/concurrent/Future.hx", lineNumber : 117, className : "hx.concurrent.CompletableFuture", methodName : "complete"});
					}
				}
				return true;
			}
			return false;
		});
	}
	,__class__: hx_concurrent_CompletableFuture
});
var hx_concurrent_Service = function() { };
$hxClasses["hx.concurrent.Service"] = hx_concurrent_Service;
hx_concurrent_Service.__name__ = "hx.concurrent.Service";
hx_concurrent_Service.__isInterface__ = true;
var hx_concurrent_ServiceState = $hxEnums["hx.concurrent.ServiceState"] = { __ename__:"hx.concurrent.ServiceState",__constructs__:null
	,STARTING: {_hx_name:"STARTING",_hx_index:0,__enum__:"hx.concurrent.ServiceState",toString:$estr}
	,RUNNING: {_hx_name:"RUNNING",_hx_index:1,__enum__:"hx.concurrent.ServiceState",toString:$estr}
	,STOPPING: {_hx_name:"STOPPING",_hx_index:2,__enum__:"hx.concurrent.ServiceState",toString:$estr}
	,STOPPED: {_hx_name:"STOPPED",_hx_index:3,__enum__:"hx.concurrent.ServiceState",toString:$estr}
};
hx_concurrent_ServiceState.__constructs__ = [hx_concurrent_ServiceState.STARTING,hx_concurrent_ServiceState.RUNNING,hx_concurrent_ServiceState.STOPPING,hx_concurrent_ServiceState.STOPPED];
var hx_concurrent_ServiceBase = function() {
	this._stateLock = new hx_concurrent_lock_RLock();
	this.state = hx_concurrent_ServiceState.STOPPED;
	this.id = hx_concurrent_ServiceBase._ids.incrementAndGet();
	haxe_Log.trace("[" + Std.string(this) + "] instantiated.",{ fileName : "hx/concurrent/Service.hx", lineNumber : 53, className : "hx.concurrent.ServiceBase", methodName : "new"});
};
$hxClasses["hx.concurrent.ServiceBase"] = hx_concurrent_ServiceBase;
hx_concurrent_ServiceBase.__name__ = "hx.concurrent.ServiceBase";
hx_concurrent_ServiceBase.__interfaces__ = [hx_concurrent_Service];
hx_concurrent_ServiceBase.prototype = {
	id: null
	,state: null
	,set_state: function(s) {
		switch(s._hx_index) {
		case 0:
			haxe_Log.trace("[" + Std.string(this) + "] is starting...",{ fileName : "hx/concurrent/Service.hx", lineNumber : 42, className : "hx.concurrent.ServiceBase", methodName : "set_state"});
			break;
		case 1:
			haxe_Log.trace("[" + Std.string(this) + "] is running.",{ fileName : "hx/concurrent/Service.hx", lineNumber : 43, className : "hx.concurrent.ServiceBase", methodName : "set_state"});
			break;
		case 2:
			haxe_Log.trace("[" + Std.string(this) + "] is stopping...",{ fileName : "hx/concurrent/Service.hx", lineNumber : 44, className : "hx.concurrent.ServiceBase", methodName : "set_state"});
			break;
		case 3:
			haxe_Log.trace("[" + Std.string(this) + "] is stopped.",{ fileName : "hx/concurrent/Service.hx", lineNumber : 45, className : "hx.concurrent.ServiceBase", methodName : "set_state"});
			break;
		}
		return this.state = s;
	}
	,_stateLock: null
	,start: function() {
		var _gthis = this;
		this._stateLock.execute(function() {
			switch(_gthis.state._hx_index) {
			case 0:
				break;
			case 1:
				break;
			case 2:
				throw haxe_Exception.thrown("Service [" + Std.string(_gthis) + "] is currently stopping!");
			case 3:
				_gthis.set_state(hx_concurrent_ServiceState.STARTING);
				_gthis.onStart();
				_gthis.set_state(hx_concurrent_ServiceState.RUNNING);
				break;
			}
		});
	}
	,onStart: function() {
	}
	,toString: function() {
		var c = js_Boot.getClass(this);
		return c.__name__ + "#" + this.id;
	}
	,__class__: hx_concurrent_ServiceBase
	,__properties__: {set_state:"set_state"}
};
var hx_concurrent_collection_CopyOnWriteArray = {};
hx_concurrent_collection_CopyOnWriteArray._new = function(initialValues) {
	var this1 = new hx_concurrent_collection__$CopyOnWriteArray_CopyOnWriteArrayImpl();
	if(initialValues != null) {
		this1.addAll(initialValues);
	}
	return this1;
};
var hx_concurrent_collection__$CopyOnWriteArray_CopyOnWriteArrayImpl = function() {
	this._sync = new hx_concurrent_lock_RLock();
	this._items = [];
};
$hxClasses["hx.concurrent.collection._CopyOnWriteArray.CopyOnWriteArrayImpl"] = hx_concurrent_collection__$CopyOnWriteArray_CopyOnWriteArrayImpl;
hx_concurrent_collection__$CopyOnWriteArray_CopyOnWriteArrayImpl.__name__ = "hx.concurrent.collection._CopyOnWriteArray.CopyOnWriteArrayImpl";
hx_concurrent_collection__$CopyOnWriteArray_CopyOnWriteArrayImpl.__interfaces__ = [hx_concurrent_collection_OrderedCollection];
hx_concurrent_collection__$CopyOnWriteArray_CopyOnWriteArrayImpl.prototype = {
	_items: null
	,_sync: null
	,addAll: function(coll) {
		var _gthis = this;
		this._sync.execute(function() {
			var items = null;
			var _g = coll;
			switch(_g._hx_index) {
			case 0:
				var coll1 = _g.v;
				items = _gthis._items.slice();
				var i = coll1.iterator();
				while(i.hasNext()) {
					var i1 = i.next();
					items.push(i1);
				}
				break;
			case 1:
				var arr = _g.v;
				items = _gthis._items.concat(arr);
				break;
			case 2:
				var list = _g.v;
				items = _gthis._items.slice();
				var _g_head = list.h;
				while(_g_head != null) {
					var val = _g_head.item;
					_g_head = _g_head.next;
					var i = val;
					items.push(i);
				}
				break;
			}
			_gthis._items = items;
		});
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this._items);
	}
	,__class__: hx_concurrent_collection__$CopyOnWriteArray_CopyOnWriteArrayImpl
};
var hx_concurrent_executor_Schedule = $hxEnums["hx.concurrent.executor.Schedule"] = { __ename__:"hx.concurrent.executor.Schedule",__constructs__:null
	,ONCE: ($_=function(initialDelayMS) { return {_hx_index:0,initialDelayMS:initialDelayMS,__enum__:"hx.concurrent.executor.Schedule",toString:$estr}; },$_._hx_name="ONCE",$_.__params__ = ["initialDelayMS"],$_)
	,FIXED_DELAY: ($_=function(intervalMS,initialDelayMS) { return {_hx_index:1,intervalMS:intervalMS,initialDelayMS:initialDelayMS,__enum__:"hx.concurrent.executor.Schedule",toString:$estr}; },$_._hx_name="FIXED_DELAY",$_.__params__ = ["intervalMS","initialDelayMS"],$_)
	,FIXED_RATE: ($_=function(intervalMS,initialDelayMS) { return {_hx_index:2,intervalMS:intervalMS,initialDelayMS:initialDelayMS,__enum__:"hx.concurrent.executor.Schedule",toString:$estr}; },$_._hx_name="FIXED_RATE",$_.__params__ = ["intervalMS","initialDelayMS"],$_)
	,HOURLY: ($_=function(minute,second) { return {_hx_index:3,minute:minute,second:second,__enum__:"hx.concurrent.executor.Schedule",toString:$estr}; },$_._hx_name="HOURLY",$_.__params__ = ["minute","second"],$_)
	,DAILY: ($_=function(hour,minute,second) { return {_hx_index:4,hour:hour,minute:minute,second:second,__enum__:"hx.concurrent.executor.Schedule",toString:$estr}; },$_._hx_name="DAILY",$_.__params__ = ["hour","minute","second"],$_)
	,WEEKLY: ($_=function(day,hour,minute,second) { return {_hx_index:5,day:day,hour:hour,minute:minute,second:second,__enum__:"hx.concurrent.executor.Schedule",toString:$estr}; },$_._hx_name="WEEKLY",$_.__params__ = ["day","hour","minute","second"],$_)
};
hx_concurrent_executor_Schedule.__constructs__ = [hx_concurrent_executor_Schedule.ONCE,hx_concurrent_executor_Schedule.FIXED_DELAY,hx_concurrent_executor_Schedule.FIXED_RATE,hx_concurrent_executor_Schedule.HOURLY,hx_concurrent_executor_Schedule.DAILY,hx_concurrent_executor_Schedule.WEEKLY];
var hx_concurrent_executor_Executor = function() {
	this.completionListeners = hx_concurrent_collection_CopyOnWriteArray._new();
	hx_concurrent_ServiceBase.call(this);
};
$hxClasses["hx.concurrent.executor.Executor"] = hx_concurrent_executor_Executor;
hx_concurrent_executor_Executor.__name__ = "hx.concurrent.executor.Executor";
hx_concurrent_executor_Executor.create = function(maxConcurrent,autostart) {
	if(autostart == null) {
		autostart = true;
	}
	if(maxConcurrent == null) {
		maxConcurrent = 1;
	}
	return new hx_concurrent_executor_TimerExecutor(autostart);
};
hx_concurrent_executor_Executor.__super__ = hx_concurrent_ServiceBase;
hx_concurrent_executor_Executor.prototype = $extend(hx_concurrent_ServiceBase.prototype,{
	completionListeners: null
	,notifyResult: function(result) {
		var listener_current = 0;
		var listener_array = this.completionListeners._items;
		while(listener_current < listener_array.length) {
			var listener = listener_array[listener_current++];
			try {
				listener(result);
			} catch( _g ) {
				var ex = haxe_Exception.caught(_g);
				haxe_Log.trace(ex,{ fileName : "hx/concurrent/executor/Executor.hx", lineNumber : 49, className : "hx.concurrent.executor.Executor", methodName : "notifyResult"});
			}
		}
		if(this.completionListeners._items.length == 0) {
			if(result._hx_index == 1) {
				var _g = result.time;
				var _g = result.future;
				var ex = result.ex;
				haxe_Log.trace(ex,{ fileName : "hx/concurrent/executor/Executor.hx", lineNumber : 52, className : "hx.concurrent.executor.Executor", methodName : "notifyResult"});
			}
		}
	}
	,submit: null
	,__class__: hx_concurrent_executor_Executor
});
var hx_concurrent_executor_TaskFuture = function() { };
$hxClasses["hx.concurrent.executor.TaskFuture"] = hx_concurrent_executor_TaskFuture;
hx_concurrent_executor_TaskFuture.__name__ = "hx.concurrent.executor.TaskFuture";
hx_concurrent_executor_TaskFuture.__isInterface__ = true;
hx_concurrent_executor_TaskFuture.__interfaces__ = [hx_concurrent_Future];
var hx_concurrent_executor_AbstractTaskFuture = function(executor,task,schedule) {
	this.isStopped = false;
	hx_concurrent_CompletableFuture.call(this);
	this._executor = executor;
	this._task = task;
	this.schedule = hx_concurrent_executor_ScheduleTools.assertValid(schedule);
};
$hxClasses["hx.concurrent.executor.AbstractTaskFuture"] = hx_concurrent_executor_AbstractTaskFuture;
hx_concurrent_executor_AbstractTaskFuture.__name__ = "hx.concurrent.executor.AbstractTaskFuture";
hx_concurrent_executor_AbstractTaskFuture.__interfaces__ = [hx_concurrent_executor_TaskFuture];
hx_concurrent_executor_AbstractTaskFuture.__super__ = hx_concurrent_CompletableFuture;
hx_concurrent_executor_AbstractTaskFuture.prototype = $extend(hx_concurrent_CompletableFuture.prototype,{
	schedule: null
	,isStopped: null
	,_executor: null
	,_task: null
	,__class__: hx_concurrent_executor_AbstractTaskFuture
});
var hx_concurrent_executor_ScheduleTools = function() { };
$hxClasses["hx.concurrent.executor.ScheduleTools"] = hx_concurrent_executor_ScheduleTools;
hx_concurrent_executor_ScheduleTools.__name__ = "hx.concurrent.executor.ScheduleTools";
hx_concurrent_executor_ScheduleTools.applyDefaults = function(schedule) {
	switch(schedule._hx_index) {
	case 0:
		var initialDelayMS = schedule.initialDelayMS;
		if(initialDelayMS == null) {
			return hx_concurrent_executor_Schedule.ONCE(0);
		}
		break;
	case 1:
		var intervalMS = schedule.intervalMS;
		var initialDelayMS = schedule.initialDelayMS;
		if(initialDelayMS == null) {
			return hx_concurrent_executor_Schedule.FIXED_DELAY(intervalMS,0);
		}
		break;
	case 2:
		var intervalMS = schedule.intervalMS;
		var initialDelayMS = schedule.initialDelayMS;
		if(initialDelayMS == null) {
			return hx_concurrent_executor_Schedule.FIXED_RATE(intervalMS,0);
		}
		break;
	case 3:
		var minute = schedule.minute;
		var second = schedule.second;
		if(minute == null || second == null) {
			return hx_concurrent_executor_Schedule.HOURLY(minute == null ? 0 : minute,second == null ? 0 : second);
		}
		break;
	case 4:
		var hour = schedule.hour;
		var minute = schedule.minute;
		var second = schedule.second;
		if(hour == null || minute == null || second == null) {
			return hx_concurrent_executor_Schedule.DAILY(hour == null ? 0 : hour,minute == null ? 0 : minute,second == null ? 0 : second);
		}
		break;
	case 5:
		var day = schedule.day;
		var hour = schedule.hour;
		var minute = schedule.minute;
		var second = schedule.second;
		if(day == null || hour == null || minute == null || second == null) {
			return hx_concurrent_executor_Schedule.WEEKLY(day == null ? 0 : day,hour == null ? 0 : hour,minute == null ? 0 : minute,second == null ? 0 : second);
		}
		break;
	}
	return schedule;
};
hx_concurrent_executor_ScheduleTools.assertValid = function(schedule) {
	schedule = hx_concurrent_executor_ScheduleTools.applyDefaults(schedule);
	switch(schedule._hx_index) {
	case 0:
		var initialDelayMS = schedule.initialDelayMS;
		if(initialDelayMS < 0) {
			throw haxe_Exception.thrown("[Schedule.ONCE.initialDelayMS] must be >= 0");
		}
		break;
	case 1:
		var intervalMS = schedule.intervalMS;
		var initialDelayMS = schedule.initialDelayMS;
		if(intervalMS <= 0) {
			throw haxe_Exception.thrown("[Schedule.FIXED_DELAY.intervalMS] must be > 0");
		}
		if(initialDelayMS == null || initialDelayMS < 0) {
			throw haxe_Exception.thrown("[Schedule.FIXED_DELAY.initialDelayMS] must be >= 0");
		}
		break;
	case 2:
		var intervalMS = schedule.intervalMS;
		var initialDelayMS = schedule.initialDelayMS;
		if(intervalMS <= 0) {
			throw haxe_Exception.thrown("[Schedule.FIXED_RATE.intervalMS] must be > 0");
		}
		if(initialDelayMS < 0) {
			throw haxe_Exception.thrown("[Schedule.FIXED_RATE.initialDelayMS] must be >= 0");
		}
		break;
	case 3:
		var minute = schedule.minute;
		var second = schedule.second;
		if(minute == null || minute < 0) {
			throw haxe_Exception.thrown("[Schedule.DAILY.minute] must be between >= 0 and <= 59");
		}
		if(second == null || second < 0) {
			throw haxe_Exception.thrown("[Schedule.DAILY.second] must be between >= 0 and <= 59");
		}
		break;
	case 4:
		var hour = schedule.hour;
		var minute = schedule.minute;
		var second = schedule.second;
		if(hour == null || hour < 0) {
			throw haxe_Exception.thrown("[Schedule.DAILY.hour] must be between >= 0 and <= 23");
		}
		if(minute == null || minute < 0) {
			throw haxe_Exception.thrown("[Schedule.DAILY.minute] must be between >= 0 and <= 59");
		}
		if(second == null || second < 0) {
			throw haxe_Exception.thrown("[Schedule.DAILY.second] must be between >= 0 and <= 59");
		}
		break;
	case 5:
		var day = schedule.day;
		var hour = schedule.hour;
		var minute = schedule.minute;
		var second = schedule.second;
		if(hour == null || hour < 0) {
			throw haxe_Exception.thrown("[Schedule.WEEKLY.hour] must be between >= 0 and <= 23");
		}
		if(minute == null || minute < 0) {
			throw haxe_Exception.thrown("[Schedule.WEEKLY.minute] must be between >= 0 and <= 59");
		}
		if(second == null || second < 0) {
			throw haxe_Exception.thrown("[Schedule.WEEKLY.second] must be between >= 0 and <= 59");
		}
		break;
	}
	return schedule;
};
hx_concurrent_executor_ScheduleTools.firstRunAt = function(schedule) {
	schedule = hx_concurrent_executor_ScheduleTools.assertValid(schedule);
	switch(schedule._hx_index) {
	case 0:
		var initialDelayMS = schedule.initialDelayMS;
		return Date.now() + initialDelayMS;
	case 1:
		var intervalMS = schedule.intervalMS;
		var initialDelayMS = schedule.initialDelayMS;
		return Date.now() + initialDelayMS;
	case 2:
		var intervalMS = schedule.intervalMS;
		var initialDelayMS = schedule.initialDelayMS;
		return Date.now() + initialDelayMS;
	case 3:
		var minute = schedule.minute;
		var second = schedule.second;
		var nowMS = Date.now();
		var now = new Date(nowMS);
		var runAtSecondOfHour = minute * 60 + second;
		var elapsedSecondsThisHour = now.getMinutes() * 60 + now.getSeconds();
		return nowMS + (runAtSecondOfHour - elapsedSecondsThisHour) * 1000 + (elapsedSecondsThisHour > runAtSecondOfHour ? 3600000 : 0);
	case 4:
		var hour = schedule.hour;
		var minute = schedule.minute;
		var second = schedule.second;
		var nowMS = Date.now();
		var now = new Date(nowMS);
		var runAtSecondOfDay = hour * 60 * 60 + minute * 60 + second;
		var elapsedSecondsToday = now.getHours() * 60 * 60 + now.getMinutes() * 60 + now.getSeconds();
		return nowMS + (runAtSecondOfDay - elapsedSecondsToday) * 1000 + (elapsedSecondsToday > runAtSecondOfDay ? 86400000 : 0);
	case 5:
		var day = schedule.day;
		var hour = schedule.hour;
		var minute = schedule.minute;
		var second = schedule.second;
		var nowMS = Date.now();
		var now = new Date(nowMS);
		var runAtSecondOfDay = hour * 60 * 60 + minute * 60 + second;
		var elapsedSecondsToday = now.getHours() * 60 * 60 + now.getMinutes() * 60 + now.getSeconds();
		var dayIndex = day;
		if(dayIndex == now.getDay()) {
			return nowMS + (runAtSecondOfDay - elapsedSecondsToday) * 1000 + (elapsedSecondsToday > runAtSecondOfDay ? 604800000 : 0);
		} else if(now.getDate() < dayIndex) {
			return nowMS + (runAtSecondOfDay - elapsedSecondsToday) * 1000 + 86400000 * (dayIndex - now.getDate());
		} else {
			return nowMS + (runAtSecondOfDay - elapsedSecondsToday) * 1000 + 86400000 * (7 - (dayIndex - now.getDate()));
		}
		break;
	}
};
var hx_concurrent_executor_TimerExecutor = function(autostart) {
	if(autostart == null) {
		autostart = true;
	}
	this._scheduledTasks = [];
	hx_concurrent_executor_Executor.call(this);
	if(autostart) {
		this.start();
	}
};
$hxClasses["hx.concurrent.executor.TimerExecutor"] = hx_concurrent_executor_TimerExecutor;
hx_concurrent_executor_TimerExecutor.__name__ = "hx.concurrent.executor.TimerExecutor";
hx_concurrent_executor_TimerExecutor.__super__ = hx_concurrent_executor_Executor;
hx_concurrent_executor_TimerExecutor.prototype = $extend(hx_concurrent_executor_Executor.prototype,{
	_scheduledTasks: null
	,submit: function(task,schedule) {
		var _gthis = this;
		var schedule1 = schedule == null ? hx_concurrent_executor_Executor.NOW_ONCE : schedule;
		return this._stateLock.execute(function() {
			if(_gthis.state != hx_concurrent_ServiceState.RUNNING) {
				throw haxe_Exception.thrown("Cannot accept new tasks. Executor is not in state [RUNNING] but [" + Std.string(_gthis.state) + "].");
			}
			var i = _gthis._scheduledTasks.length;
			while(i-- > 0) if(_gthis._scheduledTasks[i].isStopped) {
				_gthis._scheduledTasks.splice(i,1);
			}
			var future = new hx_concurrent_executor__$TimerExecutor_TaskFutureImpl(_gthis,task,schedule1);
			if(schedule1._hx_index == 0) {
				var _g = schedule1.initialDelayMS;
				if(_g == null) {
					_gthis._scheduledTasks.push(future);
				} else if(_g != 0) {
					_gthis._scheduledTasks.push(future);
				}
			} else {
				_gthis._scheduledTasks.push(future);
			}
			return future;
		});
	}
	,__class__: hx_concurrent_executor_TimerExecutor
});
var hx_concurrent_executor__$TimerExecutor_TaskFutureImpl = function(executor,task,schedule) {
	hx_concurrent_executor_AbstractTaskFuture.call(this,executor,task,schedule);
	var initialDelay = hx_concurrent_executor_ScheduleTools.firstRunAt(this.schedule) - Date.now() | 0;
	if(initialDelay < 0) {
		initialDelay = 0;
	}
	haxe_Timer.delay($bind(this,this.run),initialDelay);
};
$hxClasses["hx.concurrent.executor._TimerExecutor.TaskFutureImpl"] = hx_concurrent_executor__$TimerExecutor_TaskFutureImpl;
hx_concurrent_executor__$TimerExecutor_TaskFutureImpl.__name__ = "hx.concurrent.executor._TimerExecutor.TaskFutureImpl";
hx_concurrent_executor__$TimerExecutor_TaskFutureImpl.__super__ = hx_concurrent_executor_AbstractTaskFuture;
hx_concurrent_executor__$TimerExecutor_TaskFutureImpl.prototype = $extend(hx_concurrent_executor_AbstractTaskFuture.prototype,{
	_timer: null
	,run: function() {
		if(this.isStopped) {
			return;
		}
		if(this._timer == null) {
			var t = null;
			var _g = this.schedule;
			switch(_g._hx_index) {
			case 2:
				var _g1 = _g.initialDelayMS;
				var intervalMS = _g.intervalMS;
				t = new haxe_Timer(intervalMS);
				t.run = $bind(this,this.run);
				break;
			case 3:
				var _g1 = _g.minute;
				var _g1 = _g.second;
				t = new haxe_Timer(3600000);
				t.run = $bind(this,this.run);
				break;
			case 4:
				var _g1 = _g.hour;
				var _g1 = _g.minute;
				var _g1 = _g.second;
				t = new haxe_Timer(86400000);
				t.run = $bind(this,this.run);
				break;
			case 5:
				var _g1 = _g.day;
				var _g1 = _g.hour;
				var _g1 = _g.minute;
				var _g1 = _g.second;
				t = new haxe_Timer(604800000);
				t.run = $bind(this,this.run);
				break;
			default:
			}
			this._timer = t;
		}
		var fnResult;
		try {
			var _g = this._task;
			switch(_g._hx_index) {
			case 0:
				var functionWithReturnValue = _g.v;
				var this1 = hx_concurrent_internal__$Either2__$Either2.a(functionWithReturnValue());
				fnResult = this1;
				break;
			case 1:
				var functionWithoutReturnValue = _g.v;
				functionWithoutReturnValue();
				fnResult = null;
				break;
			}
		} catch( _g ) {
			var ex = haxe_Exception.caught(_g);
			var this1 = hx_concurrent_internal__$Either2__$Either2.b(new hx_concurrent_ConcurrentException(ex));
			fnResult = this1;
		}
		var _g = this.schedule;
		switch(_g._hx_index) {
		case 0:
			var _g1 = _g.initialDelayMS;
			this.isStopped = true;
			break;
		case 1:
			var _g1 = _g.initialDelayMS;
			var intervalMS = _g.intervalMS;
			this._timer = haxe_Timer.delay($bind(this,this.run),intervalMS);
			break;
		default:
		}
		this.complete(fnResult,true);
		this._executor.notifyResult(this.result);
	}
	,__class__: hx_concurrent_executor__$TimerExecutor_TaskFutureImpl
});
var hx_concurrent_internal__$Either2__$Either2 = $hxEnums["hx.concurrent.internal._Either2._Either2"] = { __ename__:"hx.concurrent.internal._Either2._Either2",__constructs__:null
	,a: ($_=function(v) { return {_hx_index:0,v:v,__enum__:"hx.concurrent.internal._Either2._Either2",toString:$estr}; },$_._hx_name="a",$_.__params__ = ["v"],$_)
	,b: ($_=function(v) { return {_hx_index:1,v:v,__enum__:"hx.concurrent.internal._Either2._Either2",toString:$estr}; },$_._hx_name="b",$_.__params__ = ["v"],$_)
};
hx_concurrent_internal__$Either2__$Either2.__constructs__ = [hx_concurrent_internal__$Either2__$Either2.a,hx_concurrent_internal__$Either2__$Either2.b];
var hx_concurrent_internal__$Either3__$Either3 = $hxEnums["hx.concurrent.internal._Either3._Either3"] = { __ename__:"hx.concurrent.internal._Either3._Either3",__constructs__:null
	,a: ($_=function(v) { return {_hx_index:0,v:v,__enum__:"hx.concurrent.internal._Either3._Either3",toString:$estr}; },$_._hx_name="a",$_.__params__ = ["v"],$_)
	,b: ($_=function(v) { return {_hx_index:1,v:v,__enum__:"hx.concurrent.internal._Either3._Either3",toString:$estr}; },$_._hx_name="b",$_.__params__ = ["v"],$_)
	,c: ($_=function(v) { return {_hx_index:2,v:v,__enum__:"hx.concurrent.internal._Either3._Either3",toString:$estr}; },$_._hx_name="c",$_.__params__ = ["v"],$_)
};
hx_concurrent_internal__$Either3__$Either3.__constructs__ = [hx_concurrent_internal__$Either3__$Either3.a,hx_concurrent_internal__$Either3__$Either3.b,hx_concurrent_internal__$Either3__$Either3.c];
var hx_concurrent_lock_Acquirable = function() { };
$hxClasses["hx.concurrent.lock.Acquirable"] = hx_concurrent_lock_Acquirable;
hx_concurrent_lock_Acquirable.__name__ = "hx.concurrent.lock.Acquirable";
hx_concurrent_lock_Acquirable.__isInterface__ = true;
var hx_concurrent_lock_AbstractAcquirable = function() { };
$hxClasses["hx.concurrent.lock.AbstractAcquirable"] = hx_concurrent_lock_AbstractAcquirable;
hx_concurrent_lock_AbstractAcquirable.__name__ = "hx.concurrent.lock.AbstractAcquirable";
hx_concurrent_lock_AbstractAcquirable.__interfaces__ = [hx_concurrent_lock_Acquirable];
hx_concurrent_lock_AbstractAcquirable.prototype = {
	release: null
	,acquire: null
	,execute: function(func,swallowExceptions) {
		if(swallowExceptions == null) {
			swallowExceptions = false;
		}
		var ex = null;
		var result = null;
		this.acquire();
		try {
			result = func();
		} catch( _g ) {
			var e = haxe_Exception.caught(_g);
			ex = new hx_concurrent_ConcurrentException(e);
		}
		this.release();
		if(!swallowExceptions && ex != null) {
			throw haxe_Exception.thrown(ex.toString());
		}
		return result;
	}
	,__class__: hx_concurrent_lock_AbstractAcquirable
};
var hx_concurrent_lock_RLock = function() {
	this._holderEntranceCount = 0;
	this._holder = null;
};
$hxClasses["hx.concurrent.lock.RLock"] = hx_concurrent_lock_RLock;
hx_concurrent_lock_RLock.__name__ = "hx.concurrent.lock.RLock";
hx_concurrent_lock_RLock.__super__ = hx_concurrent_lock_AbstractAcquirable;
hx_concurrent_lock_RLock.prototype = $extend(hx_concurrent_lock_AbstractAcquirable.prototype,{
	_holder: null
	,_holderEntranceCount: null
	,acquire: function() {
		this._holder = hx_concurrent_thread_Threads.get_current();
		this._holderEntranceCount++;
	}
	,release: function() {
		if(this._holder == hx_concurrent_thread_Threads.get_current()) {
			this._holderEntranceCount--;
			if(this._holderEntranceCount == 0) {
				this._holder = null;
			}
		} else if(this._holder != null && this._holder != hx_concurrent_thread_Threads.get_current()) {
			throw haxe_Exception.thrown("Lock was aquired by another thread!");
		} else {
			throw haxe_Exception.thrown("Lock was not aquired by any thread!");
		}
	}
	,__class__: hx_concurrent_lock_RLock
});
var hx_concurrent_thread_Threads = function() { };
$hxClasses["hx.concurrent.thread.Threads"] = hx_concurrent_thread_Threads;
hx_concurrent_thread_Threads.__name__ = "hx.concurrent.thread.Threads";
hx_concurrent_thread_Threads.__properties__ = {get_current:"get_current"};
hx_concurrent_thread_Threads.get_current = function() {
	return "MainThread";
};
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.__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 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 js_node_Fs = require("fs");
var thx_semver_Version = {};
thx_semver_Version.stringToVersion = function(s) {
	if(!thx_semver_Version.VERSION.match(s)) {
		throw haxe_Exception.thrown("Invalid SemVer format for \"" + s + "\"");
	}
	var major = Std.parseInt(thx_semver_Version.VERSION.matched(1));
	var minor = Std.parseInt(thx_semver_Version.VERSION.matched(2));
	var patch = Std.parseInt(thx_semver_Version.VERSION.matched(3));
	var pre = thx_semver_Version.parseIdentifiers(thx_semver_Version.VERSION.matched(4));
	var build = thx_semver_Version.parseIdentifiers(thx_semver_Version.VERSION.matched(5));
	var this1 = { version : [major,minor,patch], pre : pre, build : build};
	return this1;
};
thx_semver_Version.equals = function(this1,other) {
	if(this1.version[0] != other.version[0] || this1.version[1] != other.version[1] || this1.version[2] != other.version[2]) {
		return false;
	}
	return thx_semver_Version.equalsIdentifiers(this1.pre,other.pre);
};
thx_semver_Version.greaterThan = function(this1,other) {
	if(this1.pre.length > 0 && other.pre.length > 0) {
		if(this1.version[0] == other.version[0] && this1.version[1] == other.version[1] && this1.version[2] == other.version[2]) {
			return thx_semver_Version.greaterThanIdentifiers(this1.pre,other.pre);
		} else {
			return false;
		}
	} else if(other.pre.length > 0) {
		if(this1.version[0] != other.version[0]) {
			return this1.version[0] > other.version[0];
		}
		if(this1.version[1] != other.version[1]) {
			return this1.version[1] > other.version[1];
		}
		if(this1.version[2] != other.version[2]) {
			return this1.version[2] > other.version[2];
		}
		if(this1.pre.length > 0) {
			return thx_semver_Version.greaterThanIdentifiers(this1.pre,other.pre);
		} else {
			return true;
		}
	} else if(this1.pre.length <= 0) {
		if(this1.version[0] != other.version[0]) {
			return this1.version[0] > other.version[0];
		}
		if(this1.version[1] != other.version[1]) {
			return this1.version[1] > other.version[1];
		}
		if(this1.version[2] != other.version[2]) {
			return this1.version[2] > other.version[2];
		}
		return thx_semver_Version.greaterThanIdentifiers(this1.pre,other.pre);
	} else {
		return false;
	}
};
thx_semver_Version.greaterThanOrEqual = function(this1,other) {
	if(!thx_semver_Version.equals(this1,other)) {
		return thx_semver_Version.greaterThan(this1,other);
	} else {
		return true;
	}
};
thx_semver_Version.lessThan = function(this1,other) {
	return !thx_semver_Version.greaterThanOrEqual(this1,other);
};
thx_semver_Version.lessThanOrEqual = function(this1,other) {
	return !thx_semver_Version.greaterThan(this1,other);
};
thx_semver_Version.parseIdentifiers = function(s) {
	var _this = (null == s ? "" : s).split(".");
	var f = thx_semver_Version.sanitize;
	var result = new Array(_this.length);
	var _g = 0;
	var _g1 = _this.length;
	while(_g < _g1) {
		var i = _g++;
		result[i] = f(_this[i]);
	}
	var _g = [];
	var _g1 = 0;
	var _g2 = result;
	while(_g1 < _g2.length) {
		var v = _g2[_g1];
		++_g1;
		if(v != "") {
			_g.push(v);
		}
	}
	var _this = _g;
	var f = thx_semver_Version.parseIdentifier;
	var result = new Array(_this.length);
	var _g = 0;
	var _g1 = _this.length;
	while(_g < _g1) {
		var i = _g++;
		result[i] = f(_this[i]);
	}
	return result;
};
thx_semver_Version.parseIdentifier = function(s) {
	var i = Std.parseInt(s);
	if(null == i) {
		return thx_semver_Identifier.StringId(s);
	} else {
		return thx_semver_Identifier.IntId(i);
	}
};
thx_semver_Version.equalsIdentifiers = function(a,b) {
	if(a.length != b.length) {
		return false;
	}
	var _g = 0;
	var _g1 = a.length;
	while(_g < _g1) {
		var i = _g++;
		var _g2 = a[i];
		var _g3 = b[i];
		switch(_g2._hx_index) {
		case 0:
			if(_g3._hx_index == 0) {
				var b1 = _g3.value;
				var a1 = _g2.value;
				if(a1 != b1) {
					return false;
				}
			}
			break;
		case 1:
			if(_g3._hx_index == 1) {
				var b2 = _g3.value;
				var a2 = _g2.value;
				if(a2 != b2) {
					return false;
				}
			}
			break;
		default:
		}
	}
	return true;
};
thx_semver_Version.greaterThanIdentifiers = function(a,b) {
	var _g = 0;
	var _g1 = a.length;
	while(_g < _g1) {
		var i = _g++;
		var _g2 = a[i];
		var _g3 = b[i];
		switch(_g2._hx_index) {
		case 0:
			var _g4 = _g2.value;
			switch(_g3._hx_index) {
			case 0:
				var _g5 = _g3.value;
				var b1 = _g5;
				var a1 = _g4;
				if(a1 == b1) {
					continue;
				} else {
					var b2 = _g5;
					var a2 = _g4;
					if(a2 > b2) {
						return true;
					} else {
						return false;
					}
				}
				break;
			case 1:
				var _g6 = _g3.value;
				return true;
			default:
				return false;
			}
			break;
		case 1:
			var _g7 = _g2.value;
			if(_g3._hx_index == 1) {
				var _g8 = _g3.value;
				var b3 = _g8;
				var a3 = _g7;
				if(a3 == b3) {
					continue;
				} else {
					var b4 = _g8;
					var a4 = _g7;
					if(a4 > b4) {
						return true;
					} else {
						return false;
					}
				}
			} else {
				return false;
			}
			break;
		default:
			return false;
		}
	}
	return false;
};
thx_semver_Version.sanitize = function(s) {
	return s.replace(thx_semver_Version.SANITIZER.r,"");
};
var thx_semver_Identifier = $hxEnums["thx.semver.Identifier"] = { __ename__:"thx.semver.Identifier",__constructs__:null
	,StringId: ($_=function(value) { return {_hx_index:0,value:value,__enum__:"thx.semver.Identifier",toString:$estr}; },$_._hx_name="StringId",$_.__params__ = ["value"],$_)
	,IntId: ($_=function(value) { return {_hx_index:1,value:value,__enum__:"thx.semver.Identifier",toString:$estr}; },$_._hx_name="IntId",$_.__params__ = ["value"],$_)
};
thx_semver_Identifier.__constructs__ = [thx_semver_Identifier.StringId,thx_semver_Identifier.IntId];
function $getIterator(o) { if( o instanceof Array ) return new haxe_iterators_ArrayIterator(o); else return o.iterator(); }
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;
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); }
String.prototype.__class__ = $hxClasses["String"] = String;
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 = { };
haxe_ds_ObjectMap.count = 0;
js_Boot.__toStr = ({ }).toString;
if(ArrayBuffer.prototype.slice == null) {
	ArrayBuffer.prototype.slice = js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl;
}
apptimize_util_ABTDataLock.SYSTEM_DATA_LOCK = apptimize_util_ABTDataLock.getNewLock("system_data_lock");
apptimize_util_ABTDataLock.METADATA_LOCK = apptimize_util_ABTDataLock.getNewLock("meta_data_lock");
apptimize_util_ABTDataLock.CHECK_TIME_LOCK = apptimize_util_ABTDataLock.getNewLock("last_check_time_lock");
apptimize_util_ABTDataLock.INITIALIZATION = apptimize_util_ABTDataLock.getNewLock("initialize_lock");
apptimize_ABTDataStore.resultsLock = apptimize_util_ABTDataLock.getNewLock("datastore_results_lock");
apptimize_ABTLogger.LOG_LEVEL_VERBOSE = 0;
apptimize_ABTLogger.LOG_LEVEL_DEBUG = 1;
apptimize_ABTLogger.LOG_LEVEL_INFO = 2;
apptimize_ABTLogger.LOG_LEVEL_WARN = 3;
apptimize_ABTLogger.LOG_LEVEL_ERROR = 4;
apptimize_ABTLogger.LOG_LEVEL_NONE = 5;
apptimize_ABTLogger.logLevel = apptimize_ABTLogger.LOG_LEVEL_VERBOSE;
apptimize_ABTLogger.useTraceForLogging = false;
apptimize_ApptimizeInternal.kABTEventSourceApptimize = "a";
apptimize_ApptimizeInternal.kABTValueEventKey = "value";
apptimize_ApptimizeInternal._state = 0;
apptimize_api_ABTApiResultsPost.MAX_FAILURE_DELAY_MS = 60000;
apptimize_api_ABTApiResultsPost.DEFAULT_FAILURE_DELAY_MS = 1000;
apptimize_api_ABTApiResultsPost._failureDelayMs = (function($this) {
	var $r;
	var val = apptimize_api_ABTApiResultsPost.DEFAULT_FAILURE_DELAY_MS;
	if(val == null) {
		val = 0;
	}
	var this1 = new hx_concurrent_atomic__$AtomicInt_AtomicIntImpl(val);
	$r = this1;
	return $r;
}(this));
apptimize_api_ABTApiResultsPost._pendingMap = new haxe_ds_StringMap();
apptimize_api_ABTApiResultsPost._pendingResults = hx_concurrent_collection_SynchronizedLinkedList._new();
apptimize_api_ABTApiResultsPost._postDispatch = new apptimize_util_ABTDispatch("Results Post Dispatch Queue");
apptimize_api_ABTApiResultsPost._loadedPending = false;
apptimize_api_ABTApiResultsPost.PENDING_LOCK = apptimize_util_ABTDataLock.getNewLock("pending_results_key");
apptimize_filter_ABTFilter.kABTFilterKeyValue = "value";
apptimize_filter_ABTFilter.kABTFilterKeyType = "type";
apptimize_filter_ABTFilter.kABTFilterKeyProperty = "property";
apptimize_filter_ABTFilter.kABTFilterKeyOperator = "operator";
apptimize_filter_ABTFilter.kABTFilterKeyPropertySource = "propertySource";
apptimize_filter_ABTFilter.kABTFilterKeyCallServerInputs = "callServerInputs";
apptimize_filter_ABTFilter.kABTFilterKeyCallURLKey = "callServerUrlKey";
apptimize_filter_ABTFilter.kABTFilterKeyUserAttribute = "userAttribute";
apptimize_filter_ABTFilter.kABTFilterKeyPrefixedAttribute = "prefixedAttribute";
apptimize_filter_ABTFilter.kABTFilterKeyNamedFilter = "namedFilter";
apptimize_filter_ABTFilterUtils.__meta__ = { statics : { ABTEvaluateString : { 'static' : null}, ABTEvaluateBool : { 'static' : null}, ABTEvaluateNumber : { 'static' : null}}};
apptimize_filter_ABTNamedFilter.kABTNamedFilterKeyFilterName = "filterName";
apptimize_filter_ABTNamedFilter.kABTNamedFilterKeyTrueIsSticky = "trueIsSticky";
apptimize_filter_ABTNamedFilter.kABTNamedFilterKeyFalseIsSticky = "falseIsSticky";
apptimize_filter_ABTNamedFilter.kABTNamedFilterKeyNullIsSticky = "nullIsSticky";
apptimize_models_results_ABTResultEntry.RESULT_ENTRY_CREATION_LOCK = apptimize_util_ABTDataLock.getNewLock("result_entry_creation_lock_key");
apptimize_support_persistence_ABTPersistence.LOW_LATENCY = 0;
apptimize_support_persistence_ABTPersistence.HIGH_LATENCY = 1;
apptimize_support_persistence_ABTPersistence.ALL_LATENCY = 2;
apptimize_support_persistence_ABTPersistence.kMetadataKey = "METADATA_KEY";
apptimize_support_persistence_ABTPersistence.kUserIDKey = "USER_ID_KEY";
apptimize_support_persistence_ABTPersistence.kAnonymousGuidKey = "ANONYMOUS_GUID_KEY";
apptimize_support_persistence_ABTPersistence.kCustomPropertiesKey = "CUSTOM_PROPERTIES_KEY";
apptimize_support_persistence_ABTPersistence.kInternalPropertiesKey = "INTERNAL_PROPERTIES_KEY";
apptimize_support_persistence_ABTPersistence.kResultLogsKey = "RESULT_LOGS_KEY";
apptimize_support_persistence_ABTPersistence.kResultPostsKey = "RESULT_POSTS_KEY";
apptimize_support_persistence_ABTPersistence.kResultPostsListKey = "RESULT_POSTS_LIST_KEY";
apptimize_support_persistence_ABTPersistence.kResultEntrySequenceKey = "RESULT_ENTRY_SEQUENCE_KEY";
apptimize_support_persistence_ABTPersistence.kResultEntryTimestampKey = "RESULT_ENTRY_TIMESTAMP_KEY";
apptimize_support_persistence_ABTPersistence.kApptimizeVersionKey = "APPTIMIZE_VERSION_KEY";
apptimize_support_persistence_ABTPersistence.kLockAccessKey = "LOCK_ACCESS_KEY";
apptimize_support_persistence_ABTPersistence.kPostManagementKey = "POST_MANAGEMENT_KEY";
apptimize_support_persistence_ABTPersistence.kResultLastSubmitTimeKey = "RESULT_LAST_SUBMIT_TIME_KEY";
apptimize_support_persistence_ABTPersistence.kMetadataLastCheckTimeKey = "METADATA_LAST_CHECK_TIME_KEY";
apptimize_support_persistence_ABTPersistence.kDisabledVersions = "DISABLED_VERSIONS_KEY";
apptimize_support_persistence_ABTPersistence._isFlushing = false;
apptimize_support_properties_ABTApplicationProperties._sigilForApplicationNamespace = "$";
apptimize_support_properties_ABTConfigProperties.META_DATA_URL_KEY = "meta_data_url";
apptimize_support_properties_ABTConfigProperties.META_DATA_URL_LL_KEY = "meta_data_ll_url";
apptimize_support_properties_ABTConfigProperties.META_DATA_URL_HL_KEY = "meta_data_hl_url";
apptimize_support_properties_ABTConfigProperties.LOG_LEVEL_KEY = "log_level";
apptimize_support_properties_ABTConfigProperties.FOREGROUND_PERIOD_MS_KEY = "foreground_period_ms";
apptimize_support_properties_ABTConfigProperties.RESULT_POST_DELAY_MS_KEY = "result_post_delay_ms";
apptimize_support_properties_ABTConfigProperties.THREADING_ENABLED_KEY = "threading_enabled";
apptimize_support_properties_ABTConfigProperties.RESULT_POST_THREAD_POOL_SIZE_KEY = "result_post_thread_pool_size";
apptimize_support_properties_ABTConfigProperties.ALTERATION_CACHE_SIZE_KEY = "alteration_cache_size";
apptimize_support_properties_ABTConfigProperties.RESULTS_CACHE_SIZE_KEY = "results_cache_size";
apptimize_support_properties_ABTConfigProperties.MAXIMUM_RESULT_ENTRIES_KEY = "maximum_result_entries";
apptimize_support_properties_ABTConfigProperties.MAXIMUM_PENDING_RESULTS_KEY = "maximum_pending_results";
apptimize_support_properties_ABTConfigProperties.METADATA_POLLING_INTERVAL_MS_KEY = "metadata_polling_interval_ms";
apptimize_support_properties_ABTConfigProperties.METADATA_POLLING_BACKGROUND_INTERVAL_MS_KEY = "metadata_polling_background_interval_ms";
apptimize_support_properties_ABTConfigProperties.EXCEPTIONS_ENABLED_KEY = "exceptions_enabled";
apptimize_support_properties_ABTConfigProperties.MAXIMUM_RESULT_POST_FAILURE_KEY = "maximum_result_failures";
apptimize_support_properties_ABTConfigProperties.MAXIMUM_RESULT_POST_SENDER_TIMEOUT_MS_KEY = "maximum_result_post_sender_timeout_ms";
apptimize_support_properties_ABTConfigProperties.STORAGE_TYPE_KEY = "storage_type";
apptimize_support_properties_ABTConfigProperties.AUTOMATIC_SHUTDOWN_HOOK = "automatic_shutdown_hook";
apptimize_support_properties_ABTConfigProperties.APPTIMIZE_ENVIRONMENT_KEY = "apptimize_environment";
apptimize_support_properties_ABTConfigProperties.APPTIMIZE_MAXEXP_SEED_KEY = "apptimize_maxseed";
apptimize_support_properties_ABTConfigProperties.APPTIMIZE_REGION_KEY = "apptimize_region";
apptimize_support_properties_ABTConfigProperties.COMPRESS_PERSISTENCE_STORE_KEY = "compress_persistence_store";
apptimize_support_properties_ABTConfigProperties.GROUPS_BASE_URL_KEY = "groups_base_url";
apptimize_support_properties_ABTConfigProperties.REACT_NATIVE_STORAGE_KEY = "react_native_storage";
apptimize_support_properties_ABTConfigProperties.REFRESH_META_DATA_ON_SETUP = "refresh_metadata_on_setup";
apptimize_support_properties_ABTConfigProperties.LOCAL_DISK_STORAGE_PATH_KEY = "local_disk_storage_path";
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%:";
hx_concurrent_ServiceBase._ids = (function($this) {
	var $r;
	var this1 = new hx_concurrent_atomic__$AtomicInt_AtomicIntImpl(0);
	$r = this1;
	return $r;
}(this));
hx_concurrent_executor_Executor.NOW_ONCE = hx_concurrent_executor_Schedule.ONCE(0);
thx_semver_Version.VERSION = new EReg("^(\\d+)\\.(\\d+)\\.(\\d+)(?:[-]([a-z0-9.-]+))?(?:[+]([a-z0-9.-]+))?$","i");
thx_semver_Version.SANITIZER = new EReg("[^0-9A-Za-z-]","g");
})(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);
