Universal imaging of material functionality through nanoscale tracking of energy flow