The goal is the shortest contiguous substring of source that contains every character of pattern with at least the requested multiplicity. The multiplicity condition is important: pattern "aab" requires two a characters and one b, not merely the set {a, b}. If there is no valid window, the answer is an empty string. I will also return an empty string for an empty pattern, because no characters are required.

A sliding window seems appropriate. Extending the right endpoint can only add available characters, while moving the left endpoint removes them. Once a window becomes valid, I can shrink it until removing one more character would make it invalid. Recording the shortest valid window encountered during that process should find the global optimum, because every possible right endpoint is eventually examined.

My first version tracks a Counter for the current window and directly checks all required counts each time. It is easy to read, though its repeated validity test is more expensive than necessary.

```python
from collections import Counter


def minimum_cover(source, pattern):
    if not pattern:
        return ""
    needed = Counter(pattern)
    present = Counter()
    left = 0
    best = None
    for right, character in enumerate(source):
        present[character] += 1
        while all(present[c] >= amount for c, amount in needed.items()):
            if best is None or right - left + 1 < best[1] - best[0]:
                best = (left, right + 1)
            present[source[left]] -= 1
            left += 1
    return "" if best is None else source[best[0]:best[1]]
```

This draft uses an exclusive end in best, so best[1] - best[0] is the stored length. The current length is right - left + 1, which matches the assignment of right + 1 as the exclusive end. That consistency matters because mixing inclusive and exclusive endpoints can make a correct search return a substring missing its final character. I will keep the same output representation in the optimized form.

Actually, I do not need to recompute the all expression after each boundary change. I can track how many individual pattern characters are still missing, counting duplicates separately. A balance dictionary starts with the required counts. Adding a source character decreases its balance. If its old balance was positive, that occurrence filled one missing requirement, so missing decreases. A negative balance means the window has surplus occurrences, and those extras should not reduce missing below zero.

Let me check the removal direction before writing the final code. Removing a character increases its balance. If the new balance becomes positive, the window has just fallen below the required number of that character, so missing increases. If the new balance stays zero or negative, the removed occurrence was surplus, and validity is unchanged. Testing the new value after incrementing is the cleanest way to express that transition.

Characters absent from pattern deserve attention. A Counter returns zero for an absent key, and decrementing it makes the balance negative. Such characters do not reduce missing when they enter. When they later leave, their balance returns towards zero but does not become positive, so they do not increase missing either. This means the same update code can handle required and irrelevant characters without separate membership branches.

For example, with pattern "aab" the initial balances are a:2 and b:1, with missing three. Reading the first a reduces missing to two; reading another a reduces it to one; reading a third a produces a surplus without changing missing. Reading b makes missing zero. During shrinking, the first a can leave safely because a remains balanced at zero. Removing the next a makes its balance positive and missing one, so shrinking stops. The remaining valid candidate had exactly two a characters and one b.

There is a potential concern about shrinking past the right endpoint. With a nonempty pattern, a valid window must contain at least one required character. Each removal eventually creates a missing requirement, so the inner loop stops before it attempts to remove from an empty window. The empty-pattern guard is therefore part of the algorithm's control logic, not just a convenient return value. Without it, missing would start at zero and the shrinking loop would have no requirement to break it.

I will prefer the earliest window when several have the same minimum length. The update uses a strict comparison, and right endpoints advance from left to right. The first window with a given minimum length consequently remains selected. If a different tie rule were requested, the comparison could change, but no extra sorting or postprocessing is needed for this convention. The function returns a substring rather than indices, so the chosen tie is observable when equal-length candidates have different contents.

Now for completeness of the search. Suppose an optimal window ends at a particular right endpoint. When that endpoint is processed, either the current left pointer is no later than the optimal left, or an earlier valid window has already allowed it to move further. In the first case, shrinking visits a valid window at least as short as the proposed optimum before validity breaks. In the second case, a previously recorded window is already no longer. Thus no optimum is skipped by allowing the left pointer to advance monotonically.

I briefly considered resetting left after every recorded window, but that would revisit characters and lose the linear-time argument. The current balances fully describe what remains inside the moving window; there is no reason to restart. Each character enters once through the right endpoint and leaves at most once through the left endpoint. Counter updates are constant-time for ordinary characters, so the aggregate work of the nested loops is linear rather than quadratic.

The final function restates the same sliding-window idea with the missing-count transition made explicit:

A source shorter than pattern cannot cover all multiplicities, and the untouched sentinel produces an empty result. An exact match returns the full source. Irrelevant prefixes are discarded once a valid cover appears, while surplus copies of a required character can be discarded until its balance reaches zero. Time is O(len(source) + len(pattern)), and dictionary storage is proportional to the distinct characters encountered. This final version preserves duplicates, handles absent covers, and finishes with the requested substring.

```python
from collections import Counter


def minimum_cover(source, pattern):
    """Return the earliest shortest substring covering pattern's counts."""
    if not pattern:
        return ""
    balance = Counter(pattern)
    missing = len(pattern)
    left = 0
    best_start = 0
    best_length = len(source) + 1
    for right, character in enumerate(source):
        if balance[character] > 0:
            missing -= 1
        balance[character] -= 1
        while missing == 0:
            length = right - left + 1
            if length < best_length:
                best_start, best_length = left, length
            departing = source[left]
            balance[departing] += 1
            left += 1
            if balance[departing] > 0:
                missing += 1
    if best_length > len(source):
        return ""
    return source[best_start:best_start + best_length]
```
