So it goes as Republicans contend with the prospect of Mr. Trump, with his hater’s agenda, becoming the party’s standard-bearer. Some of the party leaders are far from uncomfortable with that idea. In fact, a growing swath of the party leadership now seems determined to embrace Mr. Trump. And Mr. Trump calls Reince Priebus, the Republican National Committee chairman, regularly to chat about the election. Yes, the election that Mr. Trump says is “rigged” by the “establishment” that Mr. Priebus leads.

“I’ve just never seen us so thoroughly screwed up,” says a Republican operative with roots in the Reagan administration. Another party official said, “Maybe we really do need time in the wilderness to figure out what we don’t get about our own voters.”

Democrats would be foolish to gloat about this G.O.P. mess. The Democratic Party has also been caught by surprise by the anger of middle-class voters it thought it could rely on, even while failing to move meaningful legislation on college affordability, gun control, the minimum wage and better care for veterans. The Democratic leadership is also too often captive to its own elites. Though they practically invented the ideal of campaign finance reform, Democratic politicians, including Hillary Clinton, now at times seem tone-deaf to public anger while they take vast amounts of money from industries with business before the federal government. The Democratic Party has long considered itself the institutional champion of the poor, unemployed and indebted. Now, for many young voters who flock to Bernie Sanders, that is a falsehood.

Yes, the Republican leadership’s oscillation from avoidance to accommodation of Donald Trump is almost funny. But nobody in Washington should be laughing, because his rise carries a grim lesson for all.