local function p(p)return coroutine.wrap(function()local A=1 while true do for p,l in p:GetCurrentPage()do coroutine.yield(l,A)end if p.IsFinished then break end p:AdvanceToNextPageAsync()A+=1 end end)end return p
--!strict
local function PageIterator(pages)
	return coroutine.wrap(function()
		local pageNumber = 1

		while true do
			for _, item in pages:GetCurrentPage() do
				coroutine.yield(item, pageNumber)
			end

			if pages.IsFinished then
				break
			end

			pages:AdvanceToNextPageAsync()
			pageNumber += 1
		end
	end)
end

return PageIterator
