Powered by a solid triumph in California, Hillary Clinton declared victory in her yearlong battle for the heart of the Democratic party, seizing her place in history and setting out on the difficult task of fusing a fractured party to confront Donald Trump.