import { CAppBridge } from "@elliemae/pui-app-bridge";
import { getLogger } from "../logger.js";
let appBridge = null;
const getAppBridge = async () => {
  if (!appBridge) {
    const logger = getLogger();
    const version = window.emui?.version || "latest";
    appBridge = new CAppBridge({
      logger,
      version,
      // eslint-disable-next-line no-underscore-dangle
      appConfigBaseUrl: window?.emui?._ASSET_PATH
    });
    await appBridge.init();
  }
  return appBridge;
};
export {
  getAppBridge
};
