What the diagram is saying in the left part of the TPES is that:
Total primary energy supply is the sum of production and imports, plus or minus stock changes, minus exports and international bunker storage wikipedia
i.e. TPES is the total energy from the mined minerals (coal), and pumped fuel (oil) that is converted to other sources of energy.
The right ...