I could be confused, but it seems like send_document should take a `Dom.element Dom.document t`, not a `Dom.element Dom.document`.