import { defineComponent, getCurrentInstance, createCommentVNode } from 'vue';
import BaiduMapImageryProvider from './BaiduMapImageryProvider.mjs';
import '../../../composables/index.mjs';
import { url, rectangle, ellipsoid, tileDiscardPolicy, credit, minimumLevel, maximumLevel } from '../../../utils/cesium-props.mjs';
import { kebabCase } from '../../../utils/util.mjs';
import useProviders from '../../../composables/use-providers/index.mjs';

var ProviderImageryBaidumap = defineComponent({
  name: "VcProviderImageryBaidumap",
  props: {
    ...url,
    ...rectangle,
    ...ellipsoid,
    ...tileDiscardPolicy,
    ...credit,
    ...minimumLevel,
    ...maximumLevel,
    protocol: {
      type: String,
      default: "http"
    },
    projectionTransforms: {
      type: [Boolean, Object],
      default: () => {
        return {
          from: "BD09",
          to: "WGS84"
        };
      }
    },
    bdStyle: {
      type: String,
      default: "dark"
    }
  },
  emits: ["beforeLoad", "ready", "destroyed", "readyPromise"],
  setup(props, ctx) {
    const instance = getCurrentInstance();
    instance.cesiumClass = "BaiduMapImageryProvider";
    const providersState = useProviders(props, ctx, instance);
    if (providersState === void 0) {
      return;
    }
    instance.createCesiumObject = async () => {
      Cesium.BaiduMapImageryProvider = Cesium.BaiduMapImageryProvider || BaiduMapImageryProvider;
      if (providersState.unwatchFns.length === 0) {
        providersState.setPropsWatcher(true);
      }
      const options = providersState.transformProps(props);
      return new Cesium.BaiduMapImageryProvider(options);
    };
    return () => {
      var _a;
      return createCommentVNode(kebabCase(((_a = instance.proxy) == null ? void 0 : _a.$options.name) || ""));
    };
  }
});

export { ProviderImageryBaidumap as default };
//# sourceMappingURL=index.mjs.map
