There are a couple of ways to look at President Trump’s unraveling foreign policy initiatives: They were flawed, wholly unrealistic from the get-go, or, alternatively, a chaotic administration, infighting and an erratic president made hash out of attainable goals. In the past week or so Trump has suffered major setbacks on three of the most critical foreign policy challenges he faces — China, North Korea and Iran.

On China, after considerable bipartisan blowback, Trump now denies that he made a deal to let China telecom ZTE, a violator of U.S. sanctions law, off the hook. Democrats and Republicans alike view the denial with extreme skepticism. Even Sen. Marco Rubio (R-Fla.), not known for challenging the president, blasted out an irate tweet. (“Sadly #China is out-negotiating the administration & winning the trade talks right now. They have avoided tariffs & got a #ZTE deal without giving up anything meaningful in return by using N.Korea talks & agriculture issues as leverage. This is #NotWinning.”) Treasury Secretary Steven Mnuchin tried to duck harsh questioning from members of the Senate Appropriations subcommittee on financial services, which further aggravated lawmakers. Meanwhile, Trump has apparently folded his tent on the trade war with China, demonstrating once again that the best tactic against the president is to call his bluff. Trump’s promise to get tough with China and strike better deals, a key part of his campaign pitch, seems unattainable at this point. Even he acknowledged as such in a Wednesday morning tweet: “Our Trade Deal with China is moving along nicely, but in the end we will probably have to use a different structure in that this will be too hard to get done and to verify results after completion.” Apparently he is not a strong dealmaker at all.

With regard to North Korea, a sensible approach of maximum pressure on Pyongyang might have paid dividends over the long run. Instead, Trump’s bellicose rhetoric prompted South Korea to indulge in its brand of starry-eyed diplomacy, the result of which was a shiny prize for the narcissistic president, an historic summit with North Korea. The administration (or at least Trump) became convinced that our hard line had driven North Korea to the table. CNBC’s John Harwood quotes Korea expert Robert Kelly at Pusan University as saying, “It is an open secret in Korea that this was just flattering Trump to prevent him from starting a war. No one actually believes it. Trump actually drove South Korea to the table, not North Korea.”

Someone in the administration must have convinced Trump that “denuclearization” as we define it is not a realistic outcome from the summit. Trump accordingly is now furiously backpedaling, suggesting the summit may not happen or would be delayed. Given how poorly informed and prepared Trump is, and how he hungers for any deal he can call a win, a delay in the summit would be a godsend for the United States.

Former ambassador Eric S. Edelman tells me, “It seems that the president’s impulsiveness led him to agree to the original South Korean-transmitted ‘invitation’ to meet with Kim Jong Un that was at least partly the product of Seoul’s own effort at wish fulfillment in the face of contrary advice from his own advisers.” He adds, “It seems like reality is now catching up, which highlights the dangers of foreign policy by impulse to begin with.”

Then there is Iran. There, too, policy was driven by a single, emotional impulse: “The Iran deal is bad. The worst! Get rid of it.” There was never a serious consideration — because Trump had his heart set on one outcome only — as to whether we would be better off in the deal, still with support for allies and pressing for joint effort on nonnuclear items, or outside the deal, with the threat to sanction our own allies if they remained in the deal. Israeli Prime Minister Benjamin Netanyahu expertly played Trump, although he too never presented a realistic explanation for why leaving the deal would get us a better one.

Secretary of State Mike Pompeo’s high-octane speech laying out a laundry list of demands seemed to be a thinly disguised plea for Iranian regime change (for which he has no coherent strategy, either). Edelman doesn’t “necessarily object to withdrawing from the JCPOA per se,” but that approach, he says, would have required “a strategy and policy to execute the strategy, and so far I am see scant signs of either.”

The net result has been to stoke anti-American animosity in the European Union, whose officials benefit from standing up to Trump. (The Post notes that a “reason for Europe’s resurgence could be a string of verbal attacks against Europe coming out of the White House. Trump’s threats over defense spending, the Iran deal and trade tariffs have snubbed European governments, but they now also serve are the prime example why the E.U. is needed, officials here say.”) Iran shows no interest in negotiating a worse deal for itself, especially with Russia, China and the E.U. willing to stick with the deal and continue business there.

It should be noted that a great deal of the blame for the ill-conceived Iran gambit lies with firebrand senators who have egged Trump on and with outside foreign policy voices giving cover to Trump’s outlandish rhetoric and unattainable goals. Trump does not think beyond the momentary impulse to satisfy his base as well as his own anti-Obama animus; U.S. senators and self-styled hawkish foreign policy gurus have no such excuse. A campaign line (Rip up the Iran deal!) does not make for a foreign policy strategy; there has been a glaring lack of recognition that objecting to a deal before it is made does not mean scuttling it makes sense after the deal is made, when circumstances have changed and one has a paucity of good alternatives.

There is a good argument to be made that modest foreign policy goals could have been attained with measured, focused and realistic goals competently executed. The Joint Comprehensive Plan of Action was flawed. We could, for example, have forged agreement with the E.U. to sanction Iran for its missile program while remaining in the JCPOA. We could have reversed President Barack Obama’s disastrous inaction on Syria, putting pressure on its Tehran patrons.

On China, we could have focused on an entirely legitimate complaint regarding China’s theft of our intellectual property (and its bully tactics to extract it from companies wanting to do business there). Instead, our maximalist demands based on a misplaced concern over the trade deficit made any satisfactory deal virtually impossible.

As for North Korea, a more credulous and experienced president would have lowered the rhetoric, sidestepped the trap of a summit invitation and ratcheted up economic and diplomatic pressure. We would have engaged in some real soul-searching as to whether it is possible to strip North Korea of its entire nuclear weapons program.

There is no guarantee that any of those more modest efforts would have succeeded. Nevertheless, they would have at the very least preserved U.S. credibility, held together our alliances and maintained our clout. Trump has managed to fritter away all those — while failing spectacularly to improve upon his predecessor’s foreign policy. By any definition, he is losing.