function Blend.AccelTween(o,w)local A=Blend.toPropertyObservable(o)or Rx.of(o)local e=Blend.toNumberObservable(w)local function Q(o,w)local A=AccelTween.new()if w then A.p=w A.t=w A.v=0 end if e then o:GiveTask(e:Subscribe(function(o)assert(type(o)=="\110\117\109\098\101\114","\066\097\100 \118\097\108\117\101")A.a=o end))end return A end return Observable.new(function(o)local w local e=Maid.new()local l,W=StepUtils.bindToRenderStep(function()o:Fire(w.p)return w.rtime>0 end)e:GiveTask(W)e:GiveTask(A:Subscribe(function(o)w=w or Q(e,o)w.t=o l()end))return e end)end

function Blend.AccelTween(source, acceleration)
	local sourceObservable = Blend.toPropertyObservable(source) or Rx.of(source)
	local accelerationObservable = Blend.toNumberObservable(acceleration)

	local function createAccelTween(maid, initialValue)
		local accelTween = AccelTween.new()

		if initialValue then
			accelTween.p = initialValue
			accelTween.t = initialValue
			accelTween.v = 0
		end

		if accelerationObservable then
			maid:GiveTask(accelerationObservable:Subscribe(function(value)
				assert(type(value) == "number", "Bad value")
				accelTween.a = value
			end))
		end

		return accelTween
	end

	-- TODO: Centralize and cache
	return Observable.new(function(sub)
		local accelTween
		local maid = Maid.new()

		local startAnimate, stopAnimate = StepUtils.bindToRenderStep(function()
			sub:Fire(accelTween.p)
			return accelTween.rtime > 0
		end)

		maid:GiveTask(stopAnimate)
		maid:GiveTask(sourceObservable:Subscribe(function(value)
			accelTween = accelTween or createAccelTween(maid, value)
			accelTween.t = value
			startAnimate()
		end))

		return maid
	end)
end
