Observation and measurements of the production of prompt and non-prompt (Formula presented.) mesons in association with a (Formula presented.) boson in (Formula presented.) collisions at (Formula presented.) with the ATLAS detector