const SHIPPING_ADAPTER_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("@open-mercato/shipping-carriers/adapter-registry");
function getAdapterRegistry() {
  const globalScope = globalThis;
  if (!globalScope[SHIPPING_ADAPTER_REGISTRY_KEY]) {
    globalScope[SHIPPING_ADAPTER_REGISTRY_KEY] = /* @__PURE__ */ new Map();
  }
  return globalScope[SHIPPING_ADAPTER_REGISTRY_KEY];
}
function registerShippingAdapter(adapter) {
  const adapterRegistry = getAdapterRegistry();
  adapterRegistry.set(adapter.providerKey, adapter);
  return () => adapterRegistry.delete(adapter.providerKey);
}
function getShippingAdapter(providerKey) {
  return getAdapterRegistry().get(providerKey);
}
function listShippingAdapters() {
  return Array.from(getAdapterRegistry().values());
}
function clearShippingAdapters() {
  getAdapterRegistry().clear();
}
export {
  clearShippingAdapters,
  getShippingAdapter,
  listShippingAdapters,
  registerShippingAdapter
};
//# sourceMappingURL=adapter-registry.js.map
