function ProfileService.GetProfileStore(g,o)if type(g)~="\115\116\114\105\110\103"then error("\091\080\114\111\102\105\108\101\083\101\114\118\105\099\101\093\058 \112\114\111\102\105\108\101\095\115\116\111\114\101\095\110\097\109\101 \109\117\115\116 \098\101 \097 \115\116\114\105\110\103")elseif string.len(g)==0 then error("\091\080\114\111\102\105\108\101\083\101\114\118\105\099\101\093\058 \073\110\118\097\108\105\100 \112\114\111\102\105\108\101\095\115\116\111\114\101\095\110\097\109\101")end if type(o)~="\116\097\098\108\101"then error("\091\080\114\111\102\105\108\101\083\101\114\118\105\099\101\093\058 \073\110\118\097\108\105\100 \112\114\111\102\105\108\101\095\116\101\109\112\108\097\116\101")end local B B={Mock={LoadProfileAsync=function(g,o,u)return B:LoadProfileAsync(o,u,UseMockTag)end;GlobalUpdateProfileAsync=function(g,o,u)return B:GlobalUpdateProfileAsync(o,u,UseMockTag)end;ViewProfileAsync=function(g,o)return B:ViewProfileAsync(o,UseMockTag)end;WipeProfileAsync=function(g,o)return B:WipeProfileAsync(o,UseMockTag)end};_profile_store_name=g,_profile_template=o,_global_data_store=nil,_loaded_profiles={},_profile_load_jobs={};_mock_loaded_profiles={},_mock_profile_load_jobs={},_is_pending=false}if IsLiveCheckActive==true then B._is_pending=true;(coroutine.wrap(function()WaitForLiveAccessCheck()if UseMockDataStore==false then B._global_data_store=DataStoreService:GetDataStore(g)end B._is_pending=false end))()else if UseMockDataStore==false then B._global_data_store=DataStoreService:GetDataStore(g)end end setmetatable(B,ProfileStore)return B end


function ProfileService.GetProfileStore(profile_store_name, profile_template) --> [ProfileStore]
	if type(profile_store_name) ~= "string" then
		error("[ProfileService]: profile_store_name must be a string")
	elseif string.len(profile_store_name) == 0 then
		error("[ProfileService]: Invalid profile_store_name")
	end

	if type(profile_template) ~= "table" then
		error("[ProfileService]: Invalid profile_template")
	end

	local profile_store
	profile_store = {
		Mock = {
			LoadProfileAsync = function(_, profile_key, not_released_handler)
				return profile_store:LoadProfileAsync(profile_key, not_released_handler, UseMockTag)
			end,
			GlobalUpdateProfileAsync = function(_, profile_key, update_handler)
				return profile_store:GlobalUpdateProfileAsync(profile_key, update_handler, UseMockTag)
			end,
			ViewProfileAsync = function(_, profile_key)
				return profile_store:ViewProfileAsync(profile_key, UseMockTag)
			end,
			WipeProfileAsync = function(_, profile_key)
				return profile_store:WipeProfileAsync(profile_key, UseMockTag)
			end
		},

		_profile_store_name = profile_store_name,
		_profile_template = profile_template,
		_global_data_store = nil,
		_loaded_profiles = {},
		_profile_load_jobs = {},
		_mock_loaded_profiles = {},
		_mock_profile_load_jobs = {},
		_is_pending = false,
	}
	if IsLiveCheckActive == true then
		profile_store._is_pending = true
		coroutine.wrap(function()
			WaitForLiveAccessCheck()
			if UseMockDataStore == false then
				profile_store._global_data_store = DataStoreService:GetDataStore(profile_store_name)
			end
			profile_store._is_pending = false
		end)()
	else
		if UseMockDataStore == false then
			profile_store._global_data_store = DataStoreService:GetDataStore(profile_store_name)
		end
	end
	setmetatable(profile_store, ProfileStore)
	return profile_store
end
