<reasoning_content>
*   Goal: Implement priority-based job scheduling in a `JobQueue` class.
    *   Requirements:
        1.  `add_job(name, data, priority=0)`: Add a job with a priority.
        2.  Priority order: Higher number = Higher priority (0: Normal, 1: High, 2: Critical).
        3.  Tie-breaking: Jobs with the same priority must be FIFO (First-In-First-Out).
        4.  `get_next_job() -> tuple[str, dict] | None`: Return the highest priority job or None.
    *   Implementation detail: Since priority is higher value = higher priority, and FIFO is needed for equal priorities, a Priority Queue (heap) is the standard way to do this.
    *   Heap logic:
        *   Python's `heapq` is a min-heap.
        *   To get "higher number = higher priority", we can store priority as negative values (e.g., -2 for Critical, -1 for High, 0 for Normal).
        *   To ensure FIFO for same priorities, we need a sequence counter.

    *   Class `JobQueue`.
    *   Store jobs in a list (heap).
    *   Use `heapq` module.
    *   Need a `counter` to handle FIFO.
    *   `add_job` method.
    *   `get_next_job` method.

    *   `queue = JobQueue()`
    *   `queue.add_job("normal", ..., priority=0)` -> heap entry: `(0, 0, "normal", {...})` (assuming counter starts at 0)
    *   `queue.add_job("critical", ..., priority=2)` -> heap entry: `(-2, 1, "critical", {...})`
    *   `queue.add_job("high", ..., priority=1)` -> heap entry: `(-1, 2, "high", {...})`
    *   `get_next_job()` -> `heapq.heappop` returns `(-2, 1, "critical", {...})`. Wait, the result should be `("critical", {...})`.

    Wait, if I use negative priority:
    - Critical (2) becomes -2.
    - High (1) becomes -1.
    - Normal (0) becomes 0.
    Min-heap will pick -2 first. This is correct.

    Wait, let's double check the priority levels.
    0: Normal
    1: High
    2: Critical
    Higher priority jobs = processed before lower priority.
    So 2 comes before 1, 1 comes before 0.
    Min-heap picks smallest value.
    So if I store them as negative numbers:
    -2 < -1 < 0.
    Yes, -2 is popped first.

    *   Requirement: "Jobs with the same priority should maintain FIFO order".
    *   Heap entry: `(negative_priority, insertion_order, name, data)`.
    *   Since `insertion_order` increments with every `add_job`, the heap will naturally pick the lower counter value for identical priorities.

    ```python
    import heapq

    class JobQueue:
        def __init__(self):
            self.queue = []
            self.counter = 0

        def add_job(self, name: str, data: dict, priority: int = 0):
            # Use negative priority because heapq is a min-heap
            # and higher priority numbers should come out first.
            heapq.heappush(self.queue, (-priority, self.counter, name, data))
            self.counter += 1

        def get_next_job(self) -> tuple[str, dict] | None:
            if not self.queue:
                return None
            priority_neg, count, name, data = heapq.heappop(self.queue)
            return (name, data)
    ```

    *   `add_job` accepts optional `priority` (default=0)? Yes.
    *   Higher priority jobs processed before lower? Yes (-2 < -1 < 0).
    *   Same priority = FIFO? Yes (counter).
    *   `get_next_job` returns tuple? Yes.

    One small detail: The requirement says `tuple[str, dict]`.
    The `priority` is an integer.

    Let's write the final code.

    ```python
    import heapq

    class JobQueue:
        def __init__(self):
            self._queue = []
            self._counter = 0

        def add_job(self, name: str, data: dict, priority: int = 0):
            # Use negative priority to make it a max-priority queue using a min-heap
            # Include counter to maintain FIFO order for same priority
            heapq.heappush(self._queue, (-priority, self._counter, name, data))
            self._counter += 1

        def get_next_job(self) -> tuple[str, dict] | None:
            if not self._queue:
                return None
            _, _, name, data = heapq.heappop(self._queue)
            return (name, data)
    ```

    Wait, should I include the `import heapq`? Yes.
    Should I include the Example? No, just the code.

    Wait, look at the signature `get_next_job() -> tuple[str, dict] | None`.
    Python 3.10+ syntax for `|` is fine.

    Let's double check if higher priority means higher number.
    "Priority levels: 0: Normal, 1: High, 2: Critical".
    Yes, 2 is higher than 0.
    So `(-2, ...)` will be smaller than `(0, ...)`.
    `heapq.heappop` returns the smallest.
    So `-2` (Critical) comes first. Correct.
</reasoning_content>

<content>
```python
import heapq

class JobQueue:
    def __init__(self):
        self._queue = []
        self._counter = 0

    def add_job(self, name: str, data: dict, priority: int = 0):
        # heapq is a min-heap. To treat higher numbers as higher priority,
        # we store the priority as a negative value.
        # We include a counter to ensure FIFO order for jobs with the same priority.
        heapq.heappush(self._queue, (-priority, self._counter, name, data))
        self._counter += 1

    def get_next_job(self) -> tuple[str, dict] | None:
        if not self._queue:
            return None
        
        priority_neg, count, name, data = heapq.heappop(self._queue)
        return (name, data)
```
</content>