"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.navigate = navigate;
exports.navigationRef = void 0;
exports.onNavigationReady = onNavigationReady;
exports.onSdkReady = onSdkReady;
var _native = require("@react-navigation/native");
const navigationRef = exports.navigationRef = (0, _native.createNavigationContainerRef)();
let notification = null;
let isSdkReady = false;
function navigate(name, params) {
  if (navigationRef.isReady() && isSdkReady) {
    navigationRef.navigate(name, params);
  } else {
    notification = {
      name,
      params
    };
  }
}
function onNavigationReady() {
  if (notification && navigationRef.isReady() && isSdkReady) {
    navigationRef.navigate(notification.name, notification.params);
    notification = null;
  }
}
function onSdkReady() {
  isSdkReady = true;
  if (notification && navigationRef.isReady()) {
    navigationRef.navigate(notification.name, notification.params);
    notification = null;
  }
}
//# sourceMappingURL=navigation.js.map