local c={}c.__index=c function c.LoadProfileAsync(W,c,e,b)if W._profile_template==nil then error("\091\080\114\111\102\105\108\101\083\101\114\118\105\099\101\093\058 \080\114\111\102\105\108\101 \116\101\109\112\108\097\116\101 \110\111\116 \115\101\116 - \080\114\111\102\105\108\101\083\116\111\114\101\058\076\111\097\100\080\114\111\102\105\108\101\065\115\121\110\099\040\041 \108\111\099\107\101\100 \102\111\114 \116\104\105\115 \080\114\111\102\105\108\101\083\116\111\114\101")end if type(c)~="\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\107\101\121 \109\117\115\116 \098\101 \097 \115\116\114\105\110\103")elseif string.len(c)==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\107\101\121")end if type(e)~="\102\117\110\099\116\105\111\110"and(e~="\070\111\114\099\101\076\111\097\100"and e~="\083\116\101\097\108")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 \110\111\116\095\114\101\108\101\097\115\101\100\095\104\097\110\100\108\101\114")end if ProfileService.ServiceLocked==true then return nil end WaitForPendingProfileStore(W)local i=b==UseMockTag for e,b in ipairs(ActiveProfileStores)do if b._profile_store_name==W._profile_store_name then local e=i==true and b._mock_loaded_profiles or b._loaded_profiles if e[c]~=nil then error("\091\080\114\111\102\105\108\101\083\101\114\118\105\099\101\093\058 \080\114\111\102\105\108\101 \111\102 \080\114\111\102\105\108\101\083\116\111\114\101 \""..(W._profile_store_name..("\" \119\105\116\104 \107\101\121 \""..(c.."\" \105\115 \097\108\114\101\097\100\121 \108\111\097\100\101\100 \105\110 \116\104\105\115 \115\101\115\115\105\111\110"))))end end end ActiveProfileLoadJobs=ActiveProfileLoadJobs+1 local Q=e=="\070\111\114\099\101\076\111\097\100"local n=0 local P=Q local u=false local s=e=="\083\116\101\097\108"while ProfileService.ServiceLocked==false do local b=i==true and W._mock_profile_load_jobs or W._profile_load_jobs local j local w=LoadIndex+1 LoadIndex=w local X=b[c]if X~=nil then X[1]=w while X[2]==nil do Madwork.HeartbeatWait()end if X[1]==w then j=X[2]b[c]=nil else return nil end else X={w,nil}b[c]=X X[2]=StandardProfileUpdateAsyncDataStore(W,c,{ExistingProfileHandle=function(c)if ProfileService.ServiceLocked==false then local e=c.MetaData.ActiveSession local b=c.MetaData.ForceLoadSession if e==nil then c.MetaData.ActiveSession={PlaceId,JobId}c.MetaData.ForceLoadSession=nil elseif type(e)=="\116\097\098\108\101"then if IsThisSession(e)==false then local e=c.MetaData.LastUpdate if e~=nil then if os.time()-e>SETTINGS.AssumeDeadSessionLock then c.MetaData.ActiveSession={PlaceId,JobId}c.MetaData.ForceLoadSession=nil return end end if u==true or s==true then local e=false if b~=nil then e=IsThisSession(b)end if e==true or s==true then c.MetaData.ActiveSession={PlaceId,JobId}c.MetaData.ForceLoadSession=nil end elseif P==true then c.MetaData.ForceLoadSession={PlaceId;JobId}end else c.MetaData.ForceLoadSession=nil end end end end;MissingProfileHandle=function(c)c.Data=DeepCopyTable(W._profile_template)c.MetaData={ProfileCreateTime=os.time();SessionLoadCount=0,ActiveSession={PlaceId,JobId},ForceLoadSession=nil;MetaTags={}}end,EditProfile=function(c)if ProfileService.ServiceLocked==false then local e=c.MetaData.ActiveSession if e~=nil and IsThisSession(e)==true then c.MetaData.SessionLoadCount=c.MetaData.SessionLoadCount+1 c.MetaData.LastUpdate=os.time()end end end},i)if X[1]==w then j=X[2]b[c]=nil else return nil end end if j~=nil then local b=j.MetaData.ActiveSession if type(b)=="\116\097\098\108\101"then if IsThisSession(b)==true then j.MetaData.MetaTagsLatest=DeepCopyTable(j.MetaData.MetaTags)local e={_updates_latest=j.GlobalUpdates;_pending_update_lock={},_pending_update_clear={};_new_active_update_listeners={},_new_locked_update_listeners={},_profile=nil}setmetatable(e,GlobalUpdates)local b={Data=j.Data,MetaData=j.MetaData,GlobalUpdates=e,_profile_store=W;_profile_key=c,_release_listeners={},_load_timestamp=os.clock();_is_user_mock=i}setmetatable(b,Profile)e._profile=b if next(W._loaded_profiles)==nil and next(W._mock_loaded_profiles)==nil then table.insert(ActiveProfileStores,W)end if i==true then W._mock_loaded_profiles[c]=b else W._loaded_profiles[c]=b end AddProfileToAutoSave(b)if ProfileService.ServiceLocked==true then SaveProfileAsync(b,true)b=nil end ActiveProfileLoadJobs=ActiveProfileLoadJobs-1 return b else if Q==true then local c=j.MetaData.ForceLoadSession local e=false if c~=nil then e=IsThisSession(c)end if e==true then if P==false then n=n+1 if n==SETTINGS.ForceLoadMaxSteps then u=true end end Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay)else ActiveProfileLoadJobs=ActiveProfileLoadJobs-1 return nil end P=false elseif s==true then Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay)else local c=e(b[1],b[2])if c=="\082\101\112\101\097\116"then Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay)elseif c=="\067\097\110\099\101\108"then ActiveProfileLoadJobs=ActiveProfileLoadJobs-1 return nil elseif c=="\070\111\114\099\101\076\111\097\100"then Q=true P=true Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay)elseif c=="\083\116\101\097\108"then s=true Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay)else 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 \114\101\116\117\114\110 \102\114\111\109 \110\111\116\095\114\101\108\101\097\115\101\100\095\104\097\110\100\108\101\114")end end end else ActiveProfileLoadJobs=ActiveProfileLoadJobs-1 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 \065\099\116\105\118\101\083\101\115\115\105\111\110 \118\097\108\117\101 \105\110 \080\114\111\102\105\108\101\046\077\101\116\097\068\097\116\097 - \070\097\116\097\108 \099\111\114\114\117\112\116\105\111\110")end else Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay)end end ActiveProfileLoadJobs=ActiveProfileLoadJobs-1 return nil end function c.GlobalUpdateProfileAsync(W,c,e,b)if type(c)~="\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 \073\110\118\097\108\105\100 \112\114\111\102\105\108\101\095\107\101\121")elseif string.len(c)==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\107\101\121")end if type(e)~="\102\117\110\099\116\105\111\110"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 \117\112\100\097\116\101\095\104\097\110\100\108\101\114")end if ProfileService.ServiceLocked==true then return nil end WaitForPendingProfileStore(W)while ProfileService.ServiceLocked==false do local i=StandardProfileUpdateAsyncDataStore(W,c,{ExistingProfileHandle=nil;MissingProfileHandle=nil,EditProfile=function(c)local b={_updates_latest=c.GlobalUpdates;_update_handler_mode=true}setmetatable(b,GlobalUpdates)e(b)end},b==UseMockTag)if i~=nil then local c={_updates_latest=i.GlobalUpdates}setmetatable(c,GlobalUpdates)return c else Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay)end end return nil end function c.ViewProfileAsync(b,c,e)if type(c)~="\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 \073\110\118\097\108\105\100 \112\114\111\102\105\108\101\095\107\101\121")elseif string.len(c)==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\107\101\121")end if ProfileService.ServiceLocked==true then return nil end WaitForPendingProfileStore(b)while ProfileService.ServiceLocked==false do local W=StandardProfileUpdateAsyncDataStore(b,c,{ExistingProfileHandle=nil,MissingProfileHandle=nil;EditProfile=nil},e==UseMockTag)if W~=nil then local e={_updates_latest=W.GlobalUpdates,_profile=nil}setmetatable(e,GlobalUpdates)local i={Data=W.Data;MetaData=W.MetaData,GlobalUpdates=e;_profile_store=b,_profile_key=c,_view_mode=true,_load_timestamp=os.clock()}setmetatable(i,Profile)e._profile=i return i else Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay)end end return nil end function c.WipeProfileAsync(b,c,e)if type(c)~="\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 \073\110\118\097\108\105\100 \112\114\111\102\105\108\101\095\107\101\121")elseif string.len(c)==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\107\101\121")end if ProfileService.ServiceLocked==true then return false end WaitForPendingProfileStore(b)return StandardProfileUpdateAsyncDataStore(b,c,{WipeProfile=true},e==UseMockTag)end


local ProfileStore = {
	--[[
		Mock = {},
	
		_profile_store_name = "", -- [string] -- DataStore name
		_profile_template = {}, -- [table]
		_global_data_store = global_data_store, -- [GlobalDataStore] -- Object returned by DataStoreService:GetDataStore(_profile_store_name)
		
		_loaded_profiles = {[profile_key] = Profile, ...},
		_profile_load_jobs = {[profile_key] = {load_id, loaded_data}, ...},
		
		_mock_loaded_profiles = {[profile_key] = Profile, ...},
		_mock_profile_load_jobs = {[profile_key] = {load_id, loaded_data}, ...},
	--]]
}
ProfileStore.__index = ProfileStore

function ProfileStore:LoadProfileAsync(profile_key, not_released_handler, _use_mock) --> [Profile / nil] not_released_handler(place_id, game_job_id)
	if self._profile_template == nil then
		error("[ProfileService]: Profile template not set - ProfileStore:LoadProfileAsync() locked for this ProfileStore")
	end
	if type(profile_key) ~= "string" then
		error("[ProfileService]: profile_key must be a string")
	elseif string.len(profile_key) == 0 then
		error("[ProfileService]: Invalid profile_key")
	end
	if type(not_released_handler) ~= "function" and not_released_handler ~= "ForceLoad" and not_released_handler ~= "Steal" then
		error("[ProfileService]: Invalid not_released_handler")
	end

	if ProfileService.ServiceLocked == true then
		return nil
	end

	WaitForPendingProfileStore(self)

	local is_user_mock = _use_mock == UseMockTag

	-- Check if profile with profile_key isn't already loaded in this session:
	for _, profile_store in ipairs(ActiveProfileStores) do
		if profile_store._profile_store_name == self._profile_store_name then
			local loaded_profiles = is_user_mock == true and profile_store._mock_loaded_profiles or profile_store._loaded_profiles
			if loaded_profiles[profile_key] ~= nil then
				error("[ProfileService]: Profile of ProfileStore \"" .. self._profile_store_name .. "\" with key \"" .. profile_key .. "\" is already loaded in this session")
				-- Are you using Profile:Release() properly?
			end
		end
	end

	ActiveProfileLoadJobs = ActiveProfileLoadJobs + 1
	local force_load = not_released_handler == "ForceLoad"
	local force_load_steps = 0
	local request_force_load = force_load -- First step of ForceLoad
	local steal_session = false -- Second step of ForceLoad
	local aggressive_steal = not_released_handler == "Steal" -- Developer invoked steal
	while ProfileService.ServiceLocked == false do
		-- Load profile:
		-- SPECIAL CASE - If LoadProfileAsync is called for the same key before another LoadProfileAsync finishes,
		-- yoink the DataStore return for the new call. The older call will return nil. This would prevent very rare
		-- game breaking errors where a player rejoins the server super fast.
		local profile_load_jobs = is_user_mock == true and self._mock_profile_load_jobs or self._profile_load_jobs
		local loaded_data
		local load_id = LoadIndex + 1
		LoadIndex = load_id
		local profile_load_job = profile_load_jobs[profile_key] -- {load_id, loaded_data}
		if profile_load_job ~= nil then
			profile_load_job[1] = load_id -- Yoink load job
			while profile_load_job[2] == nil do -- Wait for job to finish
				Madwork.HeartbeatWait()
			end
			if profile_load_job[1] == load_id then -- Load job hasn't been double-yoinked
				loaded_data = profile_load_job[2]
				profile_load_jobs[profile_key] = nil
			else
				return nil
			end
		else
			profile_load_job = {load_id, nil}
			profile_load_jobs[profile_key] = profile_load_job
			profile_load_job[2] = StandardProfileUpdateAsyncDataStore(
				self,
				profile_key,
				{
					ExistingProfileHandle = function(latest_data)
						if ProfileService.ServiceLocked == false then
							local active_session = latest_data.MetaData.ActiveSession
							local force_load_session = latest_data.MetaData.ForceLoadSession
							-- IsThisSession(active_session)
							if active_session == nil then
								latest_data.MetaData.ActiveSession = {PlaceId, JobId}
								latest_data.MetaData.ForceLoadSession = nil
							elseif type(active_session) == "table" then
								if IsThisSession(active_session) == false then
									local last_update = latest_data.MetaData.LastUpdate
									if last_update ~= nil then
										if os.time() - last_update > SETTINGS.AssumeDeadSessionLock then
											latest_data.MetaData.ActiveSession = {PlaceId, JobId}
											latest_data.MetaData.ForceLoadSession = nil
											return
										end
									end
									if steal_session == true or aggressive_steal == true then
										local force_load_uninterrupted = false
										if force_load_session ~= nil then
											force_load_uninterrupted = IsThisSession(force_load_session)
										end
										if force_load_uninterrupted == true or aggressive_steal == true then
											latest_data.MetaData.ActiveSession = {PlaceId, JobId}
											latest_data.MetaData.ForceLoadSession = nil
										end
									elseif request_force_load == true then
										latest_data.MetaData.ForceLoadSession = {PlaceId, JobId}
									end
								else
									latest_data.MetaData.ForceLoadSession = nil
								end
							end
						end
					end,
					MissingProfileHandle = function(latest_data)
						latest_data.Data = DeepCopyTable(self._profile_template)
						latest_data.MetaData = {
							ProfileCreateTime = os.time(),
							SessionLoadCount = 0,
							ActiveSession = {PlaceId, JobId},
							ForceLoadSession = nil,
							MetaTags = {},

						}
					end,
					EditProfile = function(latest_data)
						if ProfileService.ServiceLocked == false then
							local active_session = latest_data.MetaData.ActiveSession
							if active_session ~= nil and IsThisSession(active_session) == true then
								latest_data.MetaData.SessionLoadCount = latest_data.MetaData.SessionLoadCount + 1
								latest_data.MetaData.LastUpdate = os.time()
							end
						end
					end,
				},
				is_user_mock
			)
			if profile_load_job[1] == load_id then -- Load job hasn't been yoinked
				loaded_data = profile_load_job[2]
				profile_load_jobs[profile_key] = nil
			else
				return nil -- Load job yoinked
			end
		end
		-- Handle load_data:
		if loaded_data ~= nil then
			local active_session = loaded_data.MetaData.ActiveSession
			if type(active_session) == "table" then
				if IsThisSession(active_session) == true then
					-- Special component in MetaTags:
					loaded_data.MetaData.MetaTagsLatest = DeepCopyTable(loaded_data.MetaData.MetaTags)
					-- Case #1: Profile is now taken by this session:
					-- Create Profile object:
					local global_updates_object = {
						_updates_latest = loaded_data.GlobalUpdates,
						_pending_update_lock = {},
						_pending_update_clear = {},

						_new_active_update_listeners = {},
						_new_locked_update_listeners = {},

						_profile = nil,
					}
					setmetatable(global_updates_object, GlobalUpdates)
					local profile = {
						Data = loaded_data.Data,
						MetaData = loaded_data.MetaData,
						GlobalUpdates = global_updates_object,

						_profile_store = self,
						_profile_key = profile_key,

						_release_listeners = {},

						_load_timestamp = os.clock(),

						_is_user_mock = is_user_mock,
					}
					setmetatable(profile, Profile)
					global_updates_object._profile = profile
					-- Referencing Profile object in ProfileStore:
					if next(self._loaded_profiles) == nil and next(self._mock_loaded_profiles) == nil then -- ProfileStore object was inactive
						table.insert(ActiveProfileStores, self)
					end
					if is_user_mock == true then
						self._mock_loaded_profiles[profile_key] = profile
					else
						self._loaded_profiles[profile_key] = profile
					end
					-- Adding profile to AutoSaveList;
					AddProfileToAutoSave(profile)
					-- Special case - finished loading profile, but session is shutting down:
					if ProfileService.ServiceLocked == true then
						SaveProfileAsync(profile, true) -- Release profile and yield until the DataStore call is finished
						profile = nil -- nil will be returned by this call
					end
					-- Return Profile object:
					ActiveProfileLoadJobs = ActiveProfileLoadJobs - 1
					return profile
				else
					-- Case #2: Profile is taken by some other session:
					if force_load == true then
						local force_load_session = loaded_data.MetaData.ForceLoadSession
						local force_load_uninterrupted = false
						if force_load_session ~= nil then
							force_load_uninterrupted = IsThisSession(force_load_session)
						end
						if force_load_uninterrupted == true then
							if request_force_load == false then
								force_load_steps = force_load_steps + 1
								if force_load_steps == SETTINGS.ForceLoadMaxSteps then
									steal_session = true
								end
							end
							Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay) -- Let the cycle repeat again after a delay
						else
							-- Another session tried to force load this profile:
							ActiveProfileLoadJobs = ActiveProfileLoadJobs - 1
							return nil
						end
						request_force_load = false -- Only request a force load once
					elseif aggressive_steal == true then
						Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay) -- Let the cycle repeat again after a delay
					else
						local handler_result = not_released_handler(active_session[1], active_session[2])
						if handler_result == "Repeat" then
							Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay) -- Let the cycle repeat again after a delay
						elseif handler_result == "Cancel" then
							ActiveProfileLoadJobs = ActiveProfileLoadJobs - 1
							return nil
						elseif handler_result == "ForceLoad" then
							force_load = true
							request_force_load = true
							Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay) -- Let the cycle repeat again after a delay
						elseif handler_result == "Steal" then
							aggressive_steal = true
							Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay) -- Let the cycle repeat again after a delay
						else
							error("[ProfileService]: Invalid return from not_released_handler")
						end
					end
				end
			else
				ActiveProfileLoadJobs = ActiveProfileLoadJobs - 1
				error("[ProfileService]: Invalid ActiveSession value in Profile.MetaData - Fatal corruption") -- It's unlikely this will ever fire
			end
		else
			Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay) -- Let the cycle repeat again after a delay
		end
	end
	ActiveProfileLoadJobs = ActiveProfileLoadJobs - 1
	return nil -- If loop breaks return nothing
end

function ProfileStore:GlobalUpdateProfileAsync(profile_key, update_handler, _use_mock) --> [GlobalUpdates / nil] (update_handler(GlobalUpdates))
	if type(profile_key) ~= "string" then
		error("[ProfileService]: Invalid profile_key")
	elseif string.len(profile_key) == 0 then
		error("[ProfileService]: Invalid profile_key")
	end
	if type(update_handler) ~= "function" then
		error("[ProfileService]: Invalid update_handler")
	end

	if ProfileService.ServiceLocked == true then
		return nil
	end

	WaitForPendingProfileStore(self)

	while ProfileService.ServiceLocked == false do
		-- Updating profile:
		local loaded_data = StandardProfileUpdateAsyncDataStore(
			self,
			profile_key,
			{
				ExistingProfileHandle = nil,
				MissingProfileHandle = nil,
				EditProfile = function(latest_data)
					-- Running update_handler:
					local global_updates_object = {
						_updates_latest = latest_data.GlobalUpdates,
						_update_handler_mode = true,
					}
					setmetatable(global_updates_object, GlobalUpdates)
					update_handler(global_updates_object)
				end,
			},
			_use_mock == UseMockTag
		)
		-- Handling loaded_data:
		if loaded_data ~= nil then
			-- Return GlobalUpdates object (Update successful):
			local global_updates_object = {
				_updates_latest = loaded_data.GlobalUpdates,
			}
			setmetatable(global_updates_object, GlobalUpdates)
			return global_updates_object
		else
			Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay) -- Let the cycle repeat again
		end
	end
	return nil -- Return nothing (Update unsuccessful)
end

function ProfileStore:ViewProfileAsync(profile_key, _use_mock) --> [Profile / nil]
	if type(profile_key) ~= "string" then
		error("[ProfileService]: Invalid profile_key")
	elseif string.len(profile_key) == 0 then
		error("[ProfileService]: Invalid profile_key")
	end

	if ProfileService.ServiceLocked == true then
		return nil
	end

	WaitForPendingProfileStore(self)

	while ProfileService.ServiceLocked == false do
		-- Load profile:
		local loaded_data = StandardProfileUpdateAsyncDataStore(
			self,
			profile_key,
			{
				ExistingProfileHandle = nil,
				MissingProfileHandle = nil,
				EditProfile = nil,
			},
			_use_mock == UseMockTag
		)
		-- Handle load_data:
		if loaded_data ~= nil then
			-- Create Profile object:
			local global_updates_object = {
				_updates_latest = loaded_data.GlobalUpdates,
				_profile = nil,
			}
			setmetatable(global_updates_object, GlobalUpdates)
			local profile = {
				Data = loaded_data.Data,
				MetaData = loaded_data.MetaData,
				GlobalUpdates = global_updates_object,

				_profile_store = self,
				_profile_key = profile_key,

				_view_mode = true,

				_load_timestamp = os.clock(),
			}
			setmetatable(profile, Profile)
			global_updates_object._profile = profile
			-- Returning Profile object:
			return profile
		else
			Madwork.HeartbeatWait(SETTINGS.LoadProfileRepeatDelay) -- Let the cycle repeat again after a delay
		end
	end
	return nil -- If loop breaks return nothing
end

function ProfileStore:WipeProfileAsync(profile_key, _use_mock) --> is_wipe_successful [bool]
	if type(profile_key) ~= "string" then
		error("[ProfileService]: Invalid profile_key")
	elseif string.len(profile_key) == 0 then
		error("[ProfileService]: Invalid profile_key")
	end

	if ProfileService.ServiceLocked == true then
		return false
	end

	WaitForPendingProfileStore(self)

	return StandardProfileUpdateAsyncDataStore(
		self,
		profile_key,
		{
			WipeProfile = true
		},
		_use_mock == UseMockTag
	)
end
