"""AIS Watchkeeper — QGIS plugin entry point (package: ais_nmea_source).

Copyright (C) 2026 W.D. de Pooter

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version. This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details. You should have received a copy of the GNU General Public License
along with this program (see the bundled LICENSE file); if not, see
<https://www.gnu.org/licenses/>.

Bundled third-party libraries retain their own licenses — see THIRD_PARTY_NOTICES.md.
"""
from . import vendor
vendor.setup()  # make bundled libs importable before any submodule loads


def classFactory(iface):
    """Load AisNmeaSourcePlugin. Called by QGIS when the plugin is enabled."""
    # Apply the Qt5/Qt6 enum-promotion shim FIRST, before any GUI module imports,
    # so unscoped enum spellings resolve on QGIS 4 / PyQt6. No-op on QGIS 3.
    from . import ais_qt_compat                          # noqa: F401
    from .ais_source_plugin import AisNmeaSourcePlugin
    return AisNmeaSourcePlugin(iface)
