{"version":3,"file":"index.min.cjs","names":["CREATE_VIEWER_INJECTION_KEY: InjectionKey<Readonly<ShallowRef<Viewer | undefined>>>","Viewer","list: T[]","oldList: T[] | undefined","added: T[]","canvasCoord: Cartesian2","scene: Scene","mode: 'pickPosition' | 'globePick' | 'auto'","position: Cartesian3","scene: Scene","val?: T","val: any","val: unknown","val: string","condition: boolean","error: any","left: any","right: any","position?: CommonCoord","options: ToCoordOptions<T, Alt>","longitude: number","latitude: number","height: number | undefined","Cartesian3","Cartographic","degrees: number","dmsCode: string","position: CommonCoord","dms: DMSCoord","value: MaybeProperty","Material","options: CesiumMaterialConstructorOptions<U>","type: string","material: CesiumMaterialConstructorOptions<any>","pick: any","graphic: any | any[]","value: any","value: MaybeProperty<T>","time?: JulianDate","value?: MaybePropertyOrGetter<T>","CallbackProperty","ConstantProperty","scope: any","field: string","maybeProperty?: MaybePropertyOrGetter<T>","readonly?: boolean","removeOwnerListener: VoidFunction | undefined","readonly","scope: Scope","key: keyof Scope","options: CreateCesiumAttributeOptions","obj: any","value","previousListener: VoidFunction | undefined","property: Property","previous?: any","options: CreateCesiumPropertyOptions","callback: ThrottleCallback<T>","restList: T[]","position?: CommonCoord","Cartesian3","Cartographic","position?: CommonCoord","Cartesian3","Cartographic","fn: T","source: MaybeRefOrAsyncGetter<T>","options: ToPromiseValueOptions","value: T","event: Arrayable<Event<FN> | undefined> | Arrayable<MaybeRefOrGetter<Event<FN> | undefined>> | MaybeRefOrGetter<Arrayable<Event<FN> | undefined>>","listener: FN","options: UseCesiumEventListenerOptions","event","options: UseCameraStateOptions","height: number","options: UseCesiumFpsOptions","addFn: (i: T, ...args: AddArgs) => isPromise extends true ? Promise<T> : T","removeFn: (i: T, ...args: RemoveArgs) => RemoveReturn","removeScopeArgs: RemoveArgs","add: any","instance: T","predicate: EffcetRemovePredicate<T>","dataSources?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>","options: UseDataSourceOptions","options: UseDataSourceScopeOptions","dataSource: T","dataSource: CesiumDataSource","destroy?: boolean","target?: MaybeComputedElementRef","position?: MaybeRefOrGetter<CommonCoord | undefined>","options: UseElementOverlayOptions","x","y","data?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>","options: UseEntityOptions","options: UseEntityScopeOptions","entity: T","entity: Entity","windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>","options: UseScenePickOptions","type?: MaybeRefOrGetter<T | undefined>","inputAction?: (event: ScreenSpaceEvent<T>) => any","options: UseScreenSpaceEventHandlerOptions","ScreenSpaceEventHandler","listener: (params: GraphicDragEvent) => void","cameraLocked","pick: unknown","startPosition: Cartesian2","endPosition: Cartesian2","ScreenSpaceEventType","pick","motionEvent","listener: (params: GraphicHoverEvent) => void","pick: unknown","startPosition: Cartesian2","endPosition: Cartesian2","hovering: boolean","ScreenSpaceEventType","pick","motionEvent","EVENT_TYPE_RECORD: Record<PositionedEventType, PositiondScreenSpaceEventType>","ScreenSpaceEventType","type: PositionedEventType","listener: (params: GraphicPositionedEvent) => void","GLOBAL_GRAPHIC_SYMBOL: GlobalGraphicSymbol","POSITIONED_EVENT_TYPES: PositionedEventType[]","graphic: CesiumGraphic | 'global'","type: GraphicEventType","listener: AnyFn","_graphic: CesiumGraphic | GlobalGraphicSymbol","options: AddGraphicEventOptions","event: GraphicDragEvent","type: GraphicEventType | 'all'","data?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>","options: UseImageryLayerOptions","options: UseImageryLayerScopeOptions","imageryLayer: T","index?: number","imageryLayer: ImageryLayer","destroy?: boolean","data?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>","options: UsePostProcessStageOptions","options: UsePostProcessStageScopeOptions","postProcessStage: T","postProcessStage: PostProcessStage","data?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>","options: UsePrimitiveOptions","options: UsePrimitiveScopeOptions","primitive: T","primitive: any","options: UseScaleBarOptions","Cartesian2","EllipsoidGeodesic","windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>","options: UseSceneDrillPickOptions"],"sources":["../createViewer/index.ts","../utils/arrayDiff.ts","../utils/canvasCoordToCartesian.ts","../utils/cartesianToCanvasCoord.ts","../utils/is.ts","../utils/cesiumEquals.ts","../utils/toCoord.ts","../utils/convertDMS.ts","../utils/isCesiumConstant.ts","../utils/material.ts","../utils/pick.ts","../utils/property.ts","../utils/throttle.ts","../utils/toCartesian3.ts","../utils/toCartographic.ts","../utils/tryRun.ts","../toPromiseValue/index.ts","../useCesiumEventListener/index.ts","../useViewer/index.ts","../useCameraState/index.ts","../useCesiumFps/index.ts","../useCollectionScope/index.ts","../useDataSource/index.ts","../useDataSourceScope/index.ts","../useElementOverlay/index.ts","../useEntity/index.ts","../useEntityScope/index.ts","../useScenePick/index.ts","../useScreenSpaceEventHandler/index.ts","../useGraphicEvent/useDrag.ts","../useGraphicEvent/useHover.ts","../useGraphicEvent/usePositioned.ts","../useGraphicEvent/index.ts","../useImageryLayer/index.ts","../useImageryLayerScope/index.ts","../usePostProcessStage/index.ts","../usePostProcessStageScope/index.ts","../usePrimitive/index.ts","../usePrimitiveScope/index.ts","../useScaleBar/index.ts","../useSceneDrillPick/index.ts"],"sourcesContent":["import type { MaybeComputedElementRef } from '@vueuse/core';\nimport type { EffectScope, InjectionKey, MaybeRef, ShallowRef } from 'vue';\nimport { tryOnScopeDispose, useMutationObserver } from '@vueuse/core';\nimport { Viewer } from 'cesium';\nimport { computed, getCurrentScope, markRaw, provide, shallowReadonly, shallowRef, toRaw, toValue, watchEffect } from 'vue';\n\n/**\n * @internal\n */\nexport const CREATE_VIEWER_INJECTION_KEY: InjectionKey<Readonly<ShallowRef<Viewer | undefined>>> = Symbol('CREATE_VIEWER_INJECTION_KEY');\n\n/**\n * @internal\n */\nexport const CREATE_VIEWER_COLLECTION = new WeakMap<EffectScope, Readonly<ShallowRef<Viewer | undefined>>>();\n\n/**\n * Pass in an existing Viewer instance,\n * which can be accessed by the current component and its descendant components using {@link useViewer}\n *\n * When the Viewer instance referenced by this overloaded function becomes invalid, it will not trigger destruction.\n */\nexport function createViewer(\n  viewer: MaybeRef<Viewer | undefined>,\n): Readonly<ShallowRef<Viewer | undefined>>;\n\n/**\n * Initialize a Viewer instance, which can be accessed by the\n * current component and its descendant components using {@link useViewer}.\n *\n * The Viewer instance created by this overloaded function will automatically be destroyed when it becomes invalid.\n *\n * @param element - The DOM element or ID that will contain the widget\n * @param options - @see {Viewer.ConstructorOptions}\n */\nexport function createViewer(\n  element?: MaybeComputedElementRef,\n  options?: Viewer.ConstructorOptions,\n): Readonly<ShallowRef<Viewer | undefined>>;\n\nexport function createViewer(...args: any) {\n  const viewer = shallowRef<Viewer>();\n  const readonlyViewer = shallowReadonly(viewer);\n\n  provide(CREATE_VIEWER_INJECTION_KEY, readonlyViewer);\n\n  const scope = getCurrentScope();\n  if (scope) {\n    CREATE_VIEWER_COLLECTION.set(scope, readonlyViewer);\n  }\n\n  const canvas = computed(() => viewer.value?.canvas);\n\n  // Watch for the canvas being removed from the DOM\n  useMutationObserver(document?.body, () => {\n    if (canvas.value && !document?.body.contains(canvas.value)) {\n      viewer.value = undefined;\n    }\n  }, {\n    childList: true,\n    subtree: true,\n  });\n\n  watchEffect((onCleanup) => {\n    const [arg1, arg2] = args;\n    const value = toRaw(toValue(arg1));\n    if (value instanceof Viewer) {\n      viewer.value = markRaw(value);\n    }\n    else if (value) {\n      const element = value;\n      const options = arg2;\n      viewer.value = new Viewer(element, options);\n      onCleanup(() => !viewer.value?.isDestroyed() && viewer.value?.destroy());\n    }\n    else {\n      viewer.value = undefined;\n    }\n  });\n\n  tryOnScopeDispose(() => {\n    viewer.value = undefined;\n  });\n\n  return computed(() => {\n    return viewer.value?.isDestroyed() ? undefined : viewer.value;\n  });\n}\n","export interface ArrayDiffRetrun<T> {\n  added: T[];\n  removed: T[];\n}\n\n/**\n * 计算两个数组的差异，返回新增和删除的元素\n */\nexport function arrayDiff<T>(\n  list: T[],\n  oldList: T[] | undefined,\n): ArrayDiffRetrun<T> {\n  const oldListSet = new Set(oldList);\n  const added: T[] = list.filter(obj => !oldListSet.has(obj));\n  const newListSet = new Set(list);\n  const removed = oldList?.filter(obj => !newListSet.has(obj)) ?? [];\n  return { added, removed };\n}\n","import type { Cartesian2, Cartesian3, Scene } from 'cesium';\nimport { Ellipsoid } from 'cesium';\n\n/**\n * Convert canvas coordinates to Cartesian coordinates\n *\n * @param canvasCoord Canvas coordinates\n * @param scene Cesium.Scene instance\n * @param mode optional values are 'pickPosition' | 'globePick' | 'auto' | 'noHeight'  @default 'auto'\n *\n * `pickPosition`: Use scene.pickPosition for conversion, which can be used for picking models, oblique photography, etc.\n * However, if depth detection is not enabled (globe.depthTestAgainstTerrain=false), picking terrain or inaccurate issues may occur\n *\n * `globePick`: Use camera.getPickRay for conversion, which cannot be used for picking models or oblique photography,\n * but can be used for picking terrain. If terrain does not exist, the picked elevation is 0\n *\n * `auto`: Automatically determine which picking content to return\n *\n * Calculation speed comparison: globePick > auto >= pickPosition\n */\nexport function canvasCoordToCartesian(\n  canvasCoord: Cartesian2,\n  scene: Scene,\n  mode: 'pickPosition' | 'globePick' | 'auto' = 'auto',\n): Cartesian3 | undefined {\n  if (mode === 'pickPosition') {\n    return scene.pickPosition(canvasCoord);\n  }\n  else if (mode === 'globePick') {\n    const ray = scene.camera.getPickRay(canvasCoord);\n    return ray && scene.globe.pick(ray, scene);\n  }\n  else {\n    // depth test\n    if (scene.globe.depthTestAgainstTerrain) {\n      return scene.pickPosition(canvasCoord);\n    }\n    const position1 = scene.pickPosition(canvasCoord);\n    const ray = scene.camera.getPickRay(canvasCoord);\n    const position2 = ray && scene.globe.pick(ray, scene);\n    if (!position1) {\n      return position2;\n    }\n    const height1 = (position1 && Ellipsoid.WGS84.cartesianToCartographic(position1).height) ?? 0;\n    const height2 = (position2 && Ellipsoid.WGS84.cartesianToCartographic(position2).height) ?? 0;\n    return height1 < height2 ? position1 : position2;\n  }\n}\n","import type { Cartesian2, Cartesian3, Scene } from 'cesium';\n\n/**\n * Convert Cartesian coordinates to canvas coordinates\n *\n * @param position Cartesian coordinates\n * @param scene Cesium.Scene instance\n */\nexport function cartesianToCanvasCoord(position: Cartesian3, scene: Scene): Cartesian2 {\n  return scene.cartesianToCanvasCoordinates(position);\n}\n","import type { AnyFn } from './types';\n\nconst toString = Object.prototype.toString;\n\nexport function isDef<T = any>(val?: T): val is T {\n  return typeof val !== 'undefined';\n}\n\nexport function isBoolean(val: any): val is boolean {\n  return typeof val === 'boolean';\n}\n\nexport function isFunction<T extends AnyFn>(val: any): val is T {\n  return typeof val === 'function';\n}\n\nexport function isNumber(val: any): val is number {\n  return typeof val === 'number';\n}\n\nexport function isString(val: unknown): val is string {\n  return typeof val === 'string';\n}\n\nexport function isObject(val: any): val is object {\n  return toString.call(val) === '[object Object]';\n}\n\nexport function isWindow(val: any): val is Window {\n  return typeof window !== 'undefined' && toString.call(val) === '[object Window]';\n}\n\nexport function isPromise<T extends Promise<any>>(val: any): val is T {\n  return !!val && (typeof val === 'object' || typeof val === 'function') && typeof (val as any).then === 'function';\n}\n\nexport function isElement<T extends Element>(val: any): val is T {\n  return !!(val && val.nodeName && val.nodeType === 1);\n}\n\nexport const isArray = Array.isArray;\n\nexport function isBase64(val: string): boolean {\n  // eslint-disable-next-line regexp/no-unused-capturing-group, regexp/no-super-linear-backtracking\n  const reg = /^\\s*data:([a-z]+\\/[\\d+.a-z-]+(;[a-z-]+=[\\da-z-]+)?)?(;base64)?,([\\s\\w!$%&'()*+,./:;=?@~-]*?)\\s*$/i;\n  return reg.test(val);\n}\n\nexport function assertError(condition: boolean, error: any) {\n  if (condition) {\n    throw new Error(error);\n  }\n}\n","import { isFunction } from './is';\n\n/**\n * Determines if two Cesium objects are equal.\n *\n * This function not only judges whether the instances are equal,\n * but also judges the equals method in the example.\n *\n * @param left The first Cesium object\n * @param right The second Cesium object\n * @returns Returns true if the two Cesium objects are equal, otherwise false\n */\nexport function cesiumEquals(left: any, right: any): boolean {\n  return left === right || (isFunction(left?.equals) && left.equals(right)) || (isFunction(right?.equals) && right.equals(left));\n}\n","import type { CommonCoord, CoordArray, CoordArray_ALT, CoordObject, CoordObject_ALT } from './types';\nimport { Cartesian3, Cartographic, Ellipsoid, Math } from 'cesium';\n\ninterface ToCoordOptions<T extends 'Array' | 'Object', Alt extends boolean> {\n  /**\n   * Return type\n   * @default 'Array'\n   */\n  type?: T;\n\n  /**\n   * Whether to return altitude information\n   */\n  alt?: Alt;\n\n}\n\nexport type ToCoordReturn<T extends 'Array' | 'Object', Alt extends boolean>\n = T extends 'Array'\n   ? Alt extends true\n     ? CoordArray_ALT\n     : CoordArray\n   : Alt extends true\n     ? CoordObject_ALT\n     : CoordObject;\n\n/**\n * Converts coordinates to an array or object in the specified format.\n *\n * @param position The coordinate to be converted, which can be a Cartesian3, Cartographic, array, or object.\n * @param options Conversion options, including conversion type and whether to include altitude information.\n * @returns The converted coordinate, which may be an array or object. If the input position is empty, undefined is returned.\n *\n * @template T Conversion type, optional values are 'Array' or 'Object', @default 'Array'.\n * @template Alt Whether to include altitude information, default is false\n */\nexport function toCoord<T extends 'Array' | 'Object' = 'Array', Alt extends boolean = false>(\n  position?: CommonCoord,\n  options: ToCoordOptions<T, Alt> = {},\n): ToCoordReturn<T, Alt> | undefined {\n  if (!position) {\n    return undefined;\n  }\n\n  const { type = 'Array', alt = false } = options;\n\n  let longitude: number, latitude: number, height: number | undefined;\n\n  if (position instanceof Cartesian3) {\n    const cartographic = Ellipsoid.WGS84.cartesianToCartographic(position);\n    longitude = Math.toDegrees(cartographic.longitude);\n    latitude = Math.toDegrees(cartographic.latitude);\n    height = cartographic.height;\n  }\n  else if (position instanceof Cartographic) {\n    const cartographic = position;\n    longitude = Math.toDegrees(cartographic.longitude);\n    latitude = Math.toDegrees(cartographic.latitude);\n    height = cartographic.height;\n  }\n  else if (Array.isArray(position)) {\n    longitude = Math.toDegrees(position[0]);\n    latitude = Math.toDegrees(position[1]);\n    height = position[2];\n  }\n  else {\n    longitude = (position.longitude);\n    latitude = (position.latitude);\n    height = (position as any).height;\n  }\n\n  if (type === 'Array') {\n    return alt ? [longitude, latitude, height] as any : [longitude, latitude] as any;\n  }\n  else {\n    return alt ? { longitude, latitude, height } as any : { longitude, latitude } as any;\n  }\n}\n","import type { CommonCoord, CoordArray_ALT } from './types';\nimport { toCoord } from './toCoord';\n\nexport type DMSCoord = [longitude: string, latitude: string, height?: number];\n\n/**\n * Convert degrees to DMS (Degrees Minutes Seconds) format string\n *\n * @param degrees The angle value\n * @param precision The number of decimal places to retain for the seconds, defaults to 3\n * @returns A DMS formatted string in the format: degrees° minutes′ seconds″\n */\nexport function dmsEncode(degrees: number, precision = 3): string {\n  const str = `${degrees}`;\n  let i = str.indexOf('.');\n  const d = i < 0 ? str : str.slice(0, Math.max(0, i));\n  let m = '0';\n  let s = '0';\n  if (i > 0) {\n    m = `0${str.slice(Math.max(0, i))}`;\n    m = `${+m * 60}`;\n    i = m.indexOf('.');\n    if (i > 0) {\n      s = `0${m.slice(Math.max(0, i))}`;\n      m = m.slice(0, Math.max(0, i));\n      s = `${+s * 60}`;\n      i = s.indexOf('.');\n      s = s.slice(0, Math.max(0, i + 4));\n      s = (+s).toFixed(precision);\n    }\n  }\n  return `${Math.abs(+d)}°${+m}′${+s}″`;\n}\n\n/**\n * Decode a DMS (Degrees Minutes Seconds) formatted string to a decimal angle value\n *\n * @param dmsCode DMS formatted string, e.g. \"120°30′45″N\"\n * @returns The decoded decimal angle value, or 0 if decoding fails\n */\nexport function dmsDecode(dmsCode: string) {\n  const [dd, msStr] = dmsCode.split('°') ?? [];\n  const [mm, sStr] = msStr?.split('′') ?? [];\n  const ss = sStr?.split('″')[0];\n\n  const d = Number(dd) || 0;\n  const m = (Number(mm) || 0) / 60;\n  const s = (Number(ss) || 0) / 60 / 60;\n  const degrees = d + m + s;\n  if (degrees === 0) {\n    return 0;\n  }\n  else {\n    let res = degrees;\n    // South, West are negative numbers\n    if (['W', 'w', 'S', 's'].includes(dmsCode[dmsCode.length - 1]!)) {\n      res = -res;\n    }\n    return res;\n  }\n}\n\n/**\n * Convert latitude and longitude coordinates to degrees-minutes-seconds format\n *\n * @param position The latitude and longitude coordinates\n * @param precision The number of decimal places to retain for 'seconds', default is 3\n * @returns Returns the coordinates in degrees-minutes-seconds format, or undefined if the conversion fails\n */\nexport function degreesToDms(position: CommonCoord, precision = 3): DMSCoord | undefined {\n  const coord = toCoord(position, { alt: true });\n  if (!coord) {\n    return;\n  }\n  const [longitude, latitude, height] = coord;\n  const x = dmsEncode(longitude, precision);\n  const y = dmsEncode(latitude, precision);\n  return [`${x}${longitude > 0 ? 'E' : 'W'}`, `${y}${latitude > 0 ? 'N' : 'S'}`, height];\n}\n\n/**\n * Convert DMS (Degrees Minutes Seconds) format to decimal degrees for latitude and longitude coordinates\n *\n * @param dms The latitude or longitude coordinate in DMS format\n * @returns Returns the coordinate in decimal degrees format, or undefined if the conversion fails\n */\nexport function dmsToDegrees(dms: DMSCoord): CoordArray_ALT | undefined {\n  const [x, y, height] = dms;\n  const longitude = dmsDecode(x);\n  const latitude = dmsDecode(y);\n  return [longitude, latitude, (Number(height)) || 0];\n}\n","import type { MaybeProperty } from './property';\nimport { defined } from 'cesium';\n\n/**\n * Determines if the Cesium property is a constant.\n *\n * @param value Cesium property\n */\nexport function isCesiumConstant(value: MaybeProperty): boolean {\n  return !defined(value) || !!value.isConstant;\n}\n","import type { Event, JulianDate, MaterialProperty, TextureMagnificationFilter, TextureMinificationFilter } from 'cesium';\n\nimport { Material } from 'cesium';\n\n/**\n * Cesium.Material.fabric parameters\n */\nexport interface CesiumMaterialFabricOptions<U> {\n  /**\n   * Used to declare what material the fabric object will ultimately generate. If it's an official built-in one, use the official built-in one directly; otherwise, create a custom material and cache it.\n   */\n  type: string;\n  /**\n   * Can nest another level of child fabric to form a composite material\n   */\n  materials?: Material;\n  /**\n   * glsl code\n   */\n  source?: string;\n  components?: {\n    diffuse?: string;\n    alpha?: string;\n  };\n  /**\n   * Pass variables to glsl code\n   */\n  uniforms?: U & Record<string, any>;\n}\n\n/**\n * Cesium.Material parameters\n */\nexport interface CesiumMaterialConstructorOptions<U> {\n  /**\n   * Strict mode\n   */\n  strict?: boolean;\n  /**\n   * translucent\n   */\n  translucent?: boolean | ((...params: any[]) => any);\n  /**\n   * Minification filter\n   */\n  minificationFilter?: TextureMinificationFilter;\n  /**\n   * Magnification filter\n   */\n  magnificationFilter?: TextureMagnificationFilter;\n  /**\n   * Matrix configuration\n   */\n  fabric: CesiumMaterialFabricOptions<U>;\n}\n\n/**\n * Only as a type fix for `Cesium.Material`\n */\nexport class CesiumMaterial<U> extends Material {\n  constructor(options: CesiumMaterialConstructorOptions<U>) {\n    super(options);\n  }\n\n  /**\n   * Matrix configuration\n   */\n  declare fabric: CesiumMaterialFabricOptions<U>;\n}\n\n/**\n * Only as a type fix for `Cesium.MaterialProperty`\n */\nexport interface CesiumMaterialProperty<V> extends MaterialProperty {\n  get isConstant(): boolean;\n\n  get definitionChanged(): Event<(scope: this, field: string, value: any, previous: any) => void>;\n\n  getType: (time: JulianDate) => string;\n\n  getValue: (time: JulianDate, result?: V) => V;\n\n  equals: (other?: any) => boolean;\n}\n\n/**\n * Get material from cache, alias of `Material._materialCache.getMaterial`\n */\nexport function getMaterialCache<T extends Material = CesiumMaterial<any>>(type: string): T | undefined {\n  return (Material as any)._materialCache.getMaterial(type);\n}\n\n/**\n * Add material to Cesium's material cache, alias of `Material._materialCache.addMaterial`\n */\nexport function addMaterialCache(type: string, material: CesiumMaterialConstructorOptions<any>): void {\n  return (Material as any)._materialCache.addMaterial(type, material);\n}\n","/**\n * Analyze the result of Cesium's `scene.pick` and convert it to an array format\n */\nexport function resolvePick(pick: any = {}): any[] {\n  const { primitive, id, primitiveCollection, collection } = pick;\n  const entityCollection = (id && id.entityCollection) || null;\n  const dataSource = (entityCollection && entityCollection.owner) || null;\n  const ids = Array.isArray(id) ? id : [id].filter(Boolean); // When aggregating entities, ensure id is an array and filter out falsy values\n  return [\n    ...ids,\n    primitive,\n    primitiveCollection,\n    collection,\n    entityCollection,\n    dataSource,\n  ].filter(e => !!e);\n}\n\n/**\n * Determine if the given array of graphics is hit by Cesium's `scene.pick`\n *\n * @param pick The `scene.pick` object used for matching\n * @param graphic An array of graphics to check for hits\n */\nexport function pickHitGraphic(pick: any, graphic: any | any[]): boolean {\n  if (!Array.isArray(graphic) || !graphic.length) {\n    return false;\n  }\n  const elements = resolvePick(pick);\n  if (!elements.length) {\n    return false;\n  }\n  return elements.some(element => graphic.includes(element));\n}\n","import type { Event, JulianDate, Property } from 'cesium';\nimport { CallbackProperty, ConstantProperty, defined } from 'cesium';\nimport { isFunction } from './is';\n\nexport type MaybeProperty<T = any> = T | { getValue: (time?: JulianDate) => T };\n\nexport type MaybePropertyOrGetter<T = any> = MaybeProperty<T> | (() => T);\n\n/**\n * Is Cesium.Property\n * @param value - The target object\n */\nexport function isProperty(value: any): value is Property {\n  return value && isFunction(value.getValue);\n}\n\n/**\n * Converts a value that may be a Property into its target value, @see {toProperty} for the reverse operation\n * ```typescript\n * toPropertyValue('val') //=> 'val'\n * toPropertyValue(new ConstantProperty('val')) //=> 'val'\n * toPropertyValue(new CallbackProperty(()=>'val')) //=> 'val'\n * ```\n *\n * @param value - The value to convert\n */\nexport function toPropertyValue<T = unknown>(value: MaybeProperty<T>, time?: JulianDate): T {\n  return isProperty(value) ? value.getValue(time as any) : value as any;\n}\n\nexport type PropertyCallback<T = any> = (time: JulianDate, result?: T) => T;\n\n/**\n * Converts a value that may be a Property into a Property object, @see {toPropertyValue} for the reverse operation\n *\n * @param value - The property value or getter to convert, can be undefined or null\n * @param isConstant - The second parameter for converting to CallbackProperty\n * @returns Returns the converted Property object, if value is undefined or null, returns undefined\n */\nexport function toProperty<T>(value?: MaybePropertyOrGetter<T>, isConstant = false): Property {\n  return isProperty(value)\n    ? value\n    : isFunction(value)\n      ? (new CallbackProperty(value, isConstant) as any)\n      : new ConstantProperty(value);\n}\n\n/**\n * Create a Cesium property key\n *\n * @param scope The host object\n * @param field The property name\n * @param maybeProperty Optional property or getter\n * @param readonly Whether the property is read-only\n */\nexport function createPropertyField<T>(\n  scope: any,\n  field: string,\n  maybeProperty?: MaybePropertyOrGetter<T>,\n  readonly?: boolean,\n) {\n  let removeOwnerListener: VoidFunction | undefined;\n  // 自身内部变化时也触发载体的`definitionChanged`\n  // Trigger the carrier's `definitionChanged` when its own internal state changes\n  const ownerBinding = (value: any) => {\n    removeOwnerListener?.();\n    if (defined(value?.definitionChanged)) {\n      removeOwnerListener = value?.definitionChanged?.addEventListener(() => {\n        scope.definitionChanged.raiseEvent(scope, field, value, value);\n      });\n    }\n  };\n\n  const privateField = `_${field}`;\n  const property = toProperty(maybeProperty);\n  scope[privateField] = property;\n  ownerBinding(property);\n\n  if (readonly) {\n    Object.defineProperty(scope, field, {\n      get() {\n        return scope[privateField];\n      },\n    });\n  }\n  else {\n    Object.defineProperty(scope, field, {\n      get() {\n        return scope[privateField];\n      },\n      set(value) {\n        const previous = scope[privateField];\n        if (scope[privateField] !== value) {\n          scope[privateField] = value;\n          ownerBinding(value);\n          if (defined(scope.definitionChanged)) {\n            scope.definitionChanged.raiseEvent(scope, field, value, previous);\n          }\n        }\n      },\n    });\n  }\n}\n\nexport interface CreateCesiumAttributeOptions {\n  readonly?: boolean;\n  toProperty?: boolean;\n  /**\n   * The event name that triggers the change\n   * @default 'definitionChanged'\n   */\n  changedEventKey?: string;\n\n  shallowClone?: boolean;\n}\n\nexport function createCesiumAttribute<Scope extends object>(\n  scope: Scope,\n  key: keyof Scope,\n  value: any,\n  options: CreateCesiumAttributeOptions = {},\n) {\n  const allowToProperty = !!options.toProperty;\n  const shallowClone = !!options.shallowClone;\n  const changedEventKey = options.changedEventKey || 'definitionChanged';\n  const changedEvent = Reflect.get(scope, changedEventKey) as Event;\n  const privateKey = `_${String(key)}`;\n  const attribute = allowToProperty ? toProperty(value) : value;\n  Reflect.set(scope, privateKey, attribute);\n\n  const obj: any = {\n    get() {\n      const value = Reflect.get(scope, privateKey);\n      if (shallowClone) {\n        return Array.isArray(value) ? [...value] : { ...value };\n      }\n      else {\n        return value;\n      }\n    },\n  };\n\n  let previousListener: VoidFunction | undefined;\n\n  const serial = (property: Property, previous?: any) => {\n    previousListener?.();\n    previousListener = property?.definitionChanged?.addEventListener(() => {\n      changedEvent?.raiseEvent.bind(changedEvent)(scope, key, property, previous);\n    });\n  };\n\n  if (!options.readonly) {\n    // 初始化是父子级绑定监听\n    if (allowToProperty && isProperty(value)) {\n      serial(value);\n    }\n\n    obj.set = (value: any) => {\n      if (allowToProperty && !isProperty(value)) {\n        throw new Error(`The value of ${String(key)} must be a Cesium.Property object`);\n      }\n      const previous = Reflect.get(scope, privateKey);\n\n      if (previous !== value) {\n        Reflect.set(scope, privateKey, value);\n        changedEvent?.raiseEvent.bind(changedEvent)(scope, key, value, previous);\n        if (allowToProperty) {\n          // 重新绑定监听\n          serial(value);\n        }\n      }\n    };\n  }\n\n  Object.defineProperty(scope, key, obj);\n}\n\nexport interface CreateCesiumPropertyOptions {\n  readonly?: boolean;\n  /**\n   * The event name that triggers the change\n   * @default 'definitionChanged'\n   */\n  changedEventKey?: string;\n}\nexport function createCesiumProperty<Scope extends object>(\n  scope: Scope,\n  key: keyof Scope,\n  value: any,\n  options: CreateCesiumPropertyOptions = {},\n) {\n  return createCesiumAttribute(scope, key, value, { ...options, toProperty: true });\n}\n","import { promiseTimeout } from '@vueuse/core';\n\nexport type ThrottleCallback<T extends any[]> = (...rest: T) => void;\n\n/**\n * Throttle function, which limits the frequency of execution of the function\n *\n * @param callback raw function\n * @param delay Throttled delay duration (ms)\n * @param trailing Trigger callback function after last call @default true\n * @param leading Trigger the callback function immediately on the first call @default false\n * @returns Throttle function\n */\nexport function throttle<T extends any[]>(\n  callback: ThrottleCallback<T>,\n  delay = 100,\n  trailing = true,\n  leading = false,\n): ThrottleCallback<T> {\n  const restList: T[] = [];\n  let tracked = false;\n  const trigger = async () => {\n    await promiseTimeout(delay);\n    tracked = false;\n    if (leading) {\n      try {\n        callback(...restList[0]);\n      }\n      catch (error) {\n        console.error(error);\n      }\n    }\n    if (trailing && (!leading || restList.length > 1)) {\n      try {\n        callback(...restList[restList.length - 1]!);\n      }\n      catch (error) {\n        console.error(error);\n      }\n    }\n    restList.length = 0;\n  };\n\n  return (...rest: T) => {\n    if (restList.length < 2) {\n      restList.push(rest);\n    }\n    else {\n      restList[1] = rest;\n    }\n\n    if (!tracked) {\n      tracked = true;\n      trigger();\n    }\n  };\n}\n","import type { CommonCoord } from './types';\nimport { Cartesian3, Cartographic, Ellipsoid } from 'cesium';\n\n/**\n * Converts position to a coordinate point in the Cartesian coordinate system\n *\n * @param position Position information, which can be a Cartesian coordinate point (Cartesian3), a geographic coordinate point (Cartographic), an array, or an object containing WGS84 latitude, longitude, and height information\n * @returns The converted Cartesian coordinate point. If the input parameter is invalid, undefined is returned\n */\nexport function toCartesian3(position?: CommonCoord): Cartesian3 | undefined {\n  if (!position) {\n    return undefined;\n  }\n  if (position instanceof Cartesian3) {\n    return position.clone();\n  }\n  else if (position instanceof Cartographic) {\n    return Ellipsoid.WGS84.cartographicToCartesian(position);\n  }\n  else if (Array.isArray(position)) {\n    return Cartesian3.fromDegrees(position[0], position[1], position[2]);\n  }\n  else {\n    return Cartesian3.fromDegrees(position.longitude, position.latitude, (position as any).height);\n  }\n}\n","import type { CommonCoord } from './types';\nimport { Cartesian3, Cartographic, Ellipsoid } from 'cesium';\n\n/**\n * Converts a position to a Cartographic coordinate point\n *\n * @param position Position information, which can be a Cartesian3 coordinate point, a Cartographic coordinate point, an array, or an object containing WGS84 longitude, latitude, and height information\n * @returns The converted Cartographic coordinate point, or undefined if the input parameter is invalid\n */\nexport function toCartographic(position?: CommonCoord): Cartographic | undefined {\n  if (!position) {\n    return undefined;\n  }\n  if (position instanceof Cartesian3) {\n    return Ellipsoid.WGS84.cartesianToCartographic(position);\n  }\n  else if (position instanceof Cartographic) {\n    return position.clone();\n  }\n  else if (Array.isArray(position)) {\n    return Cartographic.fromDegrees(position[0], position[1], position[2]);\n  }\n  else {\n    return Cartographic.fromDegrees(position.longitude, position.latitude, (position as any).height);\n  }\n}\n","import type { AnyFn } from './types';\n\n/**\n * Safely execute the provided function without throwing errors,\n * essentially a simple wrapper around a `try...catch...` block\n */\nexport function tryRun<T extends AnyFn>(fn: T): T {\n  return ((...args: any[]) => {\n    try {\n      return fn?.(...args);\n    }\n    catch (error) {\n      console.error(error);\n    }\n  }) as T;\n}\n","import type { MaybeRef } from 'vue';\nimport { toRaw, toValue } from 'vue';\nimport { isFunction, isPromise } from '../utils';\n\nexport type OnAsyncGetterCancel = (onCancel: () => void) => void;\n\nexport type MaybeAsyncGetter<T> = () => (Promise<T> | T);\nexport type MaybeRefOrAsyncGetter<T> = MaybeRef<T> | MaybeAsyncGetter<T>;\n\nexport interface ToPromiseValueOptions {\n  /**\n   * Determines whether the source should be unwrapped to its raw value.\n   * @default true\n   */\n  raw?: boolean;\n}\n\n/**\n * Similar to Vue's built-in `toValue`, but capable of handling asynchronous functions, thus returning a `await value`.\n *\n * Used in conjunction with VueUse's `computedAsync`.\n *\n * @param source The source value, which can be a reactive reference or an asynchronous getter.\n * @param options Conversion options\n *\n * @example\n * ```ts\n *\n * const data = computedAsync(async ()=> {\n *  return await toPromiseValue(promiseRef)\n * })\n *\n * ```\n */\nexport async function toPromiseValue<T>(source: MaybeRefOrAsyncGetter<T>, options: ToPromiseValueOptions = {}): Promise<T> {\n  try {\n    const { raw = true } = options;\n    let value: T;\n\n    if (isFunction(source)) {\n      value = await source();\n    }\n    else {\n      const result = toValue(source);\n      value = isPromise(result) ? await result : result;\n    }\n    return raw ? toRaw(value) : value;\n  }\n  catch (error) {\n    console.error(error);\n    throw error;\n  }\n}\n","import type { Arrayable, FunctionArgs } from '@vueuse/core';\nimport type { Event } from 'cesium';\nimport type { MaybeRefOrGetter, WatchStopHandle } from 'vue';\nimport { tryOnScopeDispose } from '@vueuse/core';\nimport { toRef, toValue, watchEffect } from 'vue';\n\nexport interface UseCesiumEventListenerOptions {\n  /**\n   * Whether to active the event listener.\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean>;\n}\n\n/**\n * Easily use the `addEventListener` in `Cesium.Event` instances,\n * when the dependent data changes or the component is unmounted,\n * the listener function will automatically reload or destroy.\n */\nexport function useCesiumEventListener<FN extends FunctionArgs<any[]>>(\n  event: Arrayable<Event<FN> | undefined> | Arrayable<MaybeRefOrGetter<Event<FN> | undefined>> | MaybeRefOrGetter<Arrayable<Event<FN> | undefined>>,\n  listener: FN,\n  options: UseCesiumEventListenerOptions = {},\n): WatchStopHandle {\n  const isActive = toRef(options.isActive ?? true);\n\n  const cleanup = watchEffect((onCleanup) => {\n    const _event = toValue(event);\n    const events = Array.isArray(_event) ? _event : [_event];\n    if (events) {\n      if (events.length && isActive.value) {\n        const stopFns = events.map((event) => {\n          const e = toValue(event);\n          return e?.addEventListener(listener, e);\n        });\n        onCleanup(() => stopFns.forEach(stop => stop?.()));\n      }\n    }\n  });\n\n  tryOnScopeDispose(cleanup.stop);\n  return cleanup.stop;\n}\n","import type { Viewer } from 'cesium';\nimport type { ShallowRef } from 'vue';\nimport { getCurrentScope, inject } from 'vue';\nimport { CREATE_VIEWER_COLLECTION, CREATE_VIEWER_INJECTION_KEY } from '../createViewer';\n\n/**\n * Obtain the `Viewer` instance injected through `createViewer` in the current component or its ancestor components.\n *\n * note:\n * - If `createViewer` and `useViewer` are called in the same component, the `Viewer` instance injected by `createViewer` will be used preferentially.\n * - When calling `createViewer` and `useViewer` in the same component, `createViewer` should be called before `useViewer`.\n */\nexport function useViewer(): Readonly<ShallowRef<Viewer | undefined>> {\n  const scope = getCurrentScope();\n  const instanceViewer = scope ? CREATE_VIEWER_COLLECTION.get(scope) : undefined;\n  if (instanceViewer) {\n    return instanceViewer;\n  }\n  else {\n    const injectViewer = inject(CREATE_VIEWER_INJECTION_KEY);\n    if (!injectViewer) {\n      throw new Error(\n        'The `Viewer` instance injected by `createViewer` '\n        + 'was not found in the current component or its '\n        + 'ancestor components. Have you called `createViewer`?',\n      );\n    }\n    return injectViewer;\n  }\n}\n","import type { Camera, Cartesian3, Cartographic, Rectangle } from 'cesium';\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport { refThrottled } from '@vueuse/core';\nimport { computed, shallowRef, toValue, watch } from 'vue';\nimport { useCesiumEventListener } from '../useCesiumEventListener';\nimport { useViewer } from '../useViewer';\n\nexport interface UseCameraStateOptions {\n  /**\n   * The camera to use\n   * @default useViewer().value.scene.camera\n   */\n  camera?: MaybeRefOrGetter<Camera | undefined>;\n\n  /**\n   * Camera event type to watch\n   * @default `changed`\n   */\n  event?: MaybeRefOrGetter<'changed' | 'moveStart' | 'moveEnd'>;\n\n  /**\n   * Throttled delay duration (ms)\n   * @default 8\n   */\n  delay?: number;\n}\n\nexport interface UseCameraStateRetrun {\n  camera: ComputedRef<Camera | undefined>;\n\n  /**\n   * The position of the camera.\n   */\n  position: ComputedRef<Cartesian3 | undefined>;\n\n  /**\n   * The view direction of the camera.\n   */\n  direction: ComputedRef<Cartesian3 | undefined>;\n\n  /**\n   * The up direction of the camera.\n   */\n  up: ComputedRef<Cartesian3 | undefined>;\n\n  /**\n   * The right direction of the camera.\n   */\n  right: ComputedRef<Cartesian3 | undefined>;\n\n  /**\n   * Gets the {@link Cartographic} position of the camera, with longitude and latitude\n   * expressed in radians and height in meters.  In 2D and Columbus View, it is possible\n   * for the returned longitude and latitude to be outside the range of valid longitudes\n   * and latitudes when the camera is outside the map.\n   */\n  positionCartographic: ComputedRef<Cartographic | undefined>;\n\n  /**\n   * Gets the position of the camera in world coordinates.\n   */\n  positionWC: ComputedRef<Cartesian3 | undefined>;\n\n  /**\n   * Gets the view direction of the camera in world coordinates.\n   */\n  directionWC: ComputedRef<Cartesian3 | undefined>;\n\n  /**\n   * Gets the up direction of the camera in world coordinates.\n   */\n  upWC: ComputedRef<Cartesian3 | undefined>;\n\n  /**\n   * Gets the right direction of the camera in world coordinates.\n   */\n  rightWC: ComputedRef<Cartesian3 | undefined>;\n\n  /**\n   * Computes the approximate visible rectangle on the ellipsoid.\n   */\n  viewRectangle: ComputedRef<Rectangle | undefined>;\n\n  /**\n   * Gets the camera heading in radians.\n   */\n  heading: ComputedRef<number | undefined>;\n\n  /**\n   * Gets the camera pitch in radians.\n   */\n  pitch: ComputedRef<number | undefined>;\n\n  /**\n   * Gets the camera roll in radians.\n   */\n  roll: ComputedRef<number | undefined>;\n\n  /**\n   * Gets the camera center hierarchy level\n   */\n  level: ComputedRef<number | undefined>;\n\n}\n\n/**\n *  Reactive Cesium Camera state\n */\nexport function useCameraState(options: UseCameraStateOptions = {}): UseCameraStateRetrun {\n  let getCamera = options.camera;\n  if (!getCamera) {\n    const viewer = useViewer();\n    getCamera = () => viewer.value?.scene.camera;\n  }\n\n  const camera = computed(() => toValue(getCamera));\n\n  const event = computed(() => {\n    const eventField = toValue(options.event) || 'changed';\n    return camera.value?.[eventField];\n  });\n\n  const changedSymbol = refThrottled(\n    shallowRef(Symbol('camera change')),\n    options.delay ?? 8,\n    true,\n    false,\n  );\n\n  const setChangedSymbol = () => {\n    changedSymbol.value = Symbol('camera change');\n  };\n\n  watch(camera, () => setChangedSymbol());\n  useCesiumEventListener(event, () => setChangedSymbol());\n\n  return {\n    camera,\n    position: computed(() => changedSymbol.value ? camera.value?.position?.clone() : undefined),\n    direction: computed(() => changedSymbol.value ? camera.value?.direction?.clone() : undefined),\n    up: computed(() => changedSymbol.value ? camera.value?.up?.clone() : undefined),\n    right: computed(() => changedSymbol.value ? camera.value?.right?.clone() : undefined),\n    positionCartographic: computed(() => changedSymbol.value ? camera.value?.positionCartographic?.clone() : undefined),\n    positionWC: computed(() => changedSymbol.value ? camera.value?.positionWC?.clone() : undefined),\n    directionWC: computed(() => changedSymbol.value ? camera.value?.directionWC?.clone() : undefined),\n    upWC: computed(() => changedSymbol.value ? camera.value?.directionWC?.clone() : undefined),\n    rightWC: computed(() => changedSymbol.value ? camera.value?.directionWC?.clone() : undefined),\n    viewRectangle: computed(() => changedSymbol.value ? camera.value?.computeViewRectangle() : undefined),\n    heading: computed(() => changedSymbol.value ? camera.value?.heading : undefined),\n    pitch: computed(() => changedSymbol.value ? camera.value?.pitch : undefined),\n    roll: computed(() => changedSymbol.value ? camera.value?.roll : undefined),\n    level: computed(() =>\n      (changedSymbol.value && camera.value?.positionCartographic?.height)\n        ? computeLevel(camera.value.positionCartographic.height)\n        : undefined),\n  };\n}\n\nconst A = 40487.57;\nconst B = 0.00007096758;\nconst C = 91610.74;\nconst D = -40467.74;\n\n/**\n * Compute the camera level at a given height.\n */\nfunction computeLevel(height: number): number {\n  return D + (A - D) / (1 + (height! / C) ** B);\n}\n","import type { Ref } from 'vue';\nimport { watchThrottled } from '@vueuse/core';\nimport { computed, readonly, ref, shallowRef } from 'vue';\nimport { useCesiumEventListener } from '../useCesiumEventListener';\nimport { useViewer } from '../useViewer';\n\nexport interface UseCesiumFpsOptions {\n  /**\n   * Throttled sampling (ms)\n   * @default 100\n   */\n  delay?: number;\n}\n\nexport interface UseCesiumFpsRetrun {\n  /**\n   * Inter-frame Interval (ms)\n   */\n  interval: Readonly<Ref<number>>;\n\n  /**\n   * Frames Per Second\n   */\n  fps: Readonly<Ref<number>>;\n}\n\n/**\n * Reactive get the frame rate of Cesium\n */\nexport function useCesiumFps(options: UseCesiumFpsOptions = {}): UseCesiumFpsRetrun {\n  const { delay = 100 } = options;\n\n  const viewer = useViewer();\n  const p = shallowRef(performance.now());\n\n  useCesiumEventListener(\n    () => viewer.value?.scene.postRender,\n    () => p.value = performance.now(),\n  );\n\n  const interval = ref(0);\n\n  watchThrottled(p, (value, oldValue) => {\n    interval.value = value - oldValue;\n  }, {\n    throttle: delay,\n  });\n\n  const fps = computed(() => {\n    return 1000 / interval.value;\n  });\n\n  return {\n    interval: readonly(interval),\n    fps,\n  };\n}\n","import type { ShallowReactive } from 'vue';\nimport { tryOnScopeDispose } from '@vueuse/core';\nimport { shallowReactive, shallowReadonly } from 'vue';\nimport { isPromise } from '../utils';\n\nexport type EffcetRemovePredicate<T> = (instance: T) => boolean;\n\nexport interface UseCollectionScopeReturn<\n  isPromise extends boolean,\n  T,\n  AddArgs extends any[],\n  RemoveArgs extends any[],\n  RemoveReturn = any,\n> {\n  /**\n   * A `Set` for storing SideEffect instance,\n   * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality\n   */\n  scope: Readonly<ShallowReactive<Set<T>>>;\n\n  /**\n   * Add SideEffect instance\n   */\n  add: (i: T, ...args: AddArgs) => isPromise extends true ? Promise<T> : T;\n\n  /**\n   * Remove specified SideEffect instance\n   */\n  remove: (i: T, ...args: RemoveArgs) => RemoveReturn;\n\n  /**\n   * Remove all SideEffect instance that meets the specified criteria\n   */\n  removeWhere: (predicate: EffcetRemovePredicate<T>, ...args: RemoveArgs) => void;\n\n  /**\n   * Remove all SideEffect instance within current scope\n   */\n  removeScope: (...args: RemoveArgs) => void;\n}\n\n/**\n * Scope the SideEffects of Cesium-related `Collection` and automatically remove them when unmounted.\n * - note: This is a basic function that is intended to be called by other lower-level function\n * @param addFn - add SideEffect function.  eg.`entites.add`\n * @param removeFn - Clean SideEffect function.  eg.`entities.remove`\n * @param removeScopeArgs - The parameters to pass for `removeScope` triggered when the component is unmounted\n */\nexport function useCollectionScope<\n  isPromise extends boolean,\n  T = any,\n  AddArgs extends any[] = any[],\n  RemoveArgs extends any[] = any[],\n  RemoveReturn = any,\n>(\n  addFn: (i: T, ...args: AddArgs) => isPromise extends true ? Promise<T> : T,\n  removeFn: (i: T, ...args: RemoveArgs) => RemoveReturn,\n  removeScopeArgs: RemoveArgs,\n): UseCollectionScopeReturn<isPromise, T, AddArgs, RemoveArgs, RemoveReturn> {\n  const scope = shallowReactive(new Set<T>());\n\n  const add: any = (instance: T, ...args: AddArgs) => {\n    const result = addFn(instance, ...args);\n    // 可能为promise 如dataSource\n    if (isPromise(result)) {\n      return new Promise<T>((resolve, reject) => {\n        result.then((i) => {\n          scope.add(i);\n          resolve(i);\n        }).catch(error => reject(error));\n      });\n    }\n    else {\n      scope.add(result as T);\n      return result;\n    }\n  };\n\n  const remove = (instance: T, ...args: RemoveArgs) => {\n    scope.delete(instance);\n    return removeFn(instance, ...args);\n  };\n\n  const removeWhere = (predicate: EffcetRemovePredicate<T>, ...args: RemoveArgs) => {\n    scope.forEach((instance) => {\n      if (predicate(instance)) {\n        remove(instance, ...args);\n      }\n    });\n  };\n\n  const removeScope = (...args: RemoveArgs) => {\n    scope.forEach((instance) => {\n      remove(instance, ...args);\n    });\n  };\n\n  tryOnScopeDispose(() => removeScope(...removeScopeArgs));\n\n  return {\n    scope: shallowReadonly(scope),\n    add,\n    remove,\n    removeWhere,\n    removeScope,\n  };\n}\n","import type { Arrayable } from '@vueuse/core';\nimport type { DataSourceCollection } from 'cesium';\nimport type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';\nimport type { MaybeRefOrAsyncGetter } from '../toPromiseValue';\nimport type { CesiumDataSource } from '../utils';\nimport { computedAsync } from '@vueuse/core';\nimport { toValue, watchEffect } from 'vue';\nimport { toPromiseValue } from '../toPromiseValue';\nimport { useViewer } from '../useViewer';\n\nexport interface UseDataSourceOptions {\n  /**\n   * The collection of DataSource to be added\n   * @default useViewer().value.dataSources\n   */\n  collection?: DataSourceCollection;\n\n  /**\n   * default value of `isActive`\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean>;\n\n  /**\n   * Ref passed to receive the updated of async evaluation\n   */\n  evaluating?: Ref<boolean>;\n\n  /**\n   * The second parameter passed to the `remove` function\n   *\n   * `dataSources.remove(dataSource,destroyOnRemove)`\n   */\n  destroyOnRemove?: MaybeRefOrGetter<boolean>;\n\n}\n\n/**\n * Add `DataSource` to the `DataSourceCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `DataSource`.\n *\n * overLoaded1: Parameter supports passing in a single value.\n */\nexport function useDataSource<T extends CesiumDataSource = CesiumDataSource>(\n  dataSource?: MaybeRefOrAsyncGetter<T | undefined>,\n  options?: UseDataSourceOptions\n): ComputedRef<T | undefined>;\n\n/**\n * Add `DataSource` to the `DataSourceCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `DataSource`.\n *\n * overLoaded2: Parameter supports passing in an array.\n */\nexport function useDataSource<T extends CesiumDataSource = CesiumDataSource>(\n  dataSources?: MaybeRefOrAsyncGetter<T[] | undefined>,\n  options?: UseDataSourceOptions\n): ComputedRef<T[] | undefined>;\n\nexport function useDataSource<T extends CesiumDataSource>(\n  dataSources?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>,\n  options: UseDataSourceOptions = {},\n) {\n  const {\n    destroyOnRemove,\n    collection,\n    isActive = true,\n    evaluating,\n  } = options;\n\n  const result = computedAsync(\n    () => toPromiseValue(dataSources),\n    undefined,\n    {\n      evaluating,\n    },\n  );\n\n  const viewer = useViewer();\n\n  watchEffect((onCleanup) => {\n    const _isActive = toValue(isActive);\n    if (_isActive) {\n      const list = Array.isArray(result.value) ? [...result.value] : [result.value];\n      const _collection = collection ?? viewer.value?.dataSources;\n      list.forEach(item => (item && _collection?.add(item)));\n      onCleanup(() => {\n        const destroy = toValue(destroyOnRemove);\n        !_collection?.isDestroyed() && list.forEach(dataSource => dataSource && _collection?.remove(dataSource, destroy));\n      });\n    }\n  });\n\n  return result;\n}\n","import type { DataSourceCollection } from 'cesium';\nimport type { MaybeRefOrGetter, ShallowReactive } from 'vue';\nimport type { EffcetRemovePredicate } from '../useCollectionScope';\nimport type { CesiumDataSource } from '../utils';\nimport { computed, toValue } from 'vue';\nimport { useCollectionScope } from '../useCollectionScope';\nimport { useViewer } from '../useViewer';\n\nexport interface UseDataSourceScopeOptions {\n  /**\n   * The collection of DataSource to be added\n   * @default useViewer().value.dataSources\n   */\n  collection?: MaybeRefOrGetter<DataSourceCollection>;\n\n  /**\n   * The second parameter passed to the `remove` function\n   *\n   * `dataSources.remove(dataSource,destroyOnRemove)`\n   */\n  destroyOnRemove?: boolean;\n}\n\nexport interface UseDataSourceScopeRetrun {\n  /**\n   * A `Set` for storing SideEffect instance,\n   * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality\n   */\n  scope: Readonly<ShallowReactive<Set<CesiumDataSource>>>;\n\n  /**\n   * Add SideEffect instance\n   */\n  add: <T extends CesiumDataSource>(dataSource: T) => Promise<T>;\n\n  /**\n   * Remove specified SideEffect instance\n   */\n  remove: (dataSource: CesiumDataSource, destroy?: boolean) => boolean;\n\n  /**\n   * Remove all SideEffect instance that meets the specified criteria\n   */\n  removeWhere: (predicate: EffcetRemovePredicate<CesiumDataSource>, destroy?: boolean) => void;\n\n  /**\n   * Remove all SideEffect instance within current scope\n   */\n  removeScope: (destroy?: boolean) => void;\n}\n\n/**\n * // Scope the SideEffects of `DataSourceCollection` operations and automatically remove them when unmounted\n */\nexport function useDataSourceScope(options: UseDataSourceScopeOptions = {}): UseDataSourceScopeRetrun {\n  const { collection: _collection, destroyOnRemove } = options;\n  const viewer = useViewer();\n\n  const collection = computed(() => {\n    return toValue(_collection) ?? viewer.value?.dataSources;\n  });\n\n  const addFn = <T extends CesiumDataSource>(dataSource: T): Promise<T> => {\n    if (!collection.value) {\n      throw new Error('collection is not defined');\n    }\n    return collection.value.add(dataSource) as Promise<T>;\n  };\n\n  const removeFn = (dataSource: CesiumDataSource, destroy?: boolean) => {\n    return !!collection.value?.remove(dataSource, destroy);\n  };\n\n  const { scope, add, remove, removeWhere, removeScope } = useCollectionScope<true>(addFn, removeFn, [destroyOnRemove]);\n  return {\n    scope,\n    add,\n    remove,\n    removeWhere,\n    removeScope,\n  };\n}\n","import type { MaybeComputedElementRef } from '@vueuse/core';\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport type { CommonCoord } from '../utils';\nimport { useElementBounding } from '@vueuse/core';\nimport { Cartesian2 } from 'cesium';\nimport { computed, shallowRef, toValue, watchEffect } from 'vue';\nimport { useCesiumEventListener } from '../useCesiumEventListener';\nimport { useViewer } from '../useViewer';\nimport { cartesianToCanvasCoord, toCartesian3 } from '../utils';\n\nexport interface UseElementOverlayOptions {\n  /**\n   * Horizontal origin of the target element\n   * @default `center`\n   */\n  horizontal?: MaybeRefOrGetter<'center' | 'left' | 'right' | undefined>;\n\n  /**\n   * Vertical origin of the target element\n   * @default `bottom`\n   */\n  vertical?: MaybeRefOrGetter<'center' | 'bottom' | 'top' | undefined>;\n\n  /**\n   * Pixel offset presented by the target element\n   * @default {x:0,y:0}\n   */\n  offset?: MaybeRefOrGetter<{ x?: number; y?: number } | undefined>;\n\n  /**\n   * The reference element for calculating the position of the target element\n   *  - `true` refer to the browser viewport\n   *  - `false` refer to the Cesium canvas\n   */\n  referenceWindow?: MaybeRefOrGetter<boolean>;\n\n  /**\n   * Whether to apply style to the target element\n   * @default true\n   */\n  applyStyle?: MaybeRefOrGetter<boolean>;\n}\n\nexport interface UseElementOverlayRetrun {\n  /**\n   * Calculation result of the target element's horizontal direction\n   */\n  x: ComputedRef<number>;\n\n  /**\n   * Calculation result of the target element's vertical direction\n   */\n  y: ComputedRef<number>;\n\n  /**\n   * Calculation `css` of the target element\n   */\n  style: ComputedRef<{ left: string; top: string }>;\n}\n\n/**\n * Cesium HtmlElement Overlay\n */\nexport function useElementOverlay(\n  target?: MaybeComputedElementRef,\n  position?: MaybeRefOrGetter<CommonCoord | undefined>,\n  options: UseElementOverlayOptions = {},\n): UseElementOverlayRetrun {\n  const {\n    referenceWindow,\n    horizontal = 'center',\n    vertical = 'bottom',\n    offset = { x: 0, y: 0 },\n  } = options;\n\n  const cartesian3 = computed(() => toCartesian3(toValue(position)));\n\n  const viewer = useViewer();\n  const coord = shallowRef<Cartesian2>();\n\n  useCesiumEventListener(\n    () => viewer.value?.scene.postRender,\n    () => {\n      if (!viewer.value?.scene) {\n        return;\n      }\n      if (!cartesian3.value) {\n        coord.value = undefined;\n      }\n      else {\n        const reslut = cartesianToCanvasCoord(cartesian3.value, viewer.value.scene);\n        coord.value = !Cartesian2.equals(reslut, coord.value) ? reslut : coord.value;\n      }\n    },\n  );\n\n  const canvasBounding = useElementBounding(() => viewer.value?.canvas.parentElement);\n  const targetBounding = useElementBounding(target);\n\n  const finalOffset = computed(() => {\n    const _offset = toValue(offset);\n    let x = _offset?.x ?? 0;\n    const _horizontal = toValue(horizontal);\n    if (_horizontal === 'center') {\n      x -= targetBounding.width.value / 2;\n    }\n    else if (_horizontal === 'right') {\n      x -= targetBounding.width.value;\n    }\n\n    let y = _offset?.y ?? 0;\n    const _vertical = toValue(vertical);\n    if (_vertical === 'center') {\n      y -= targetBounding.height.value / 2;\n    }\n    else if (_vertical === 'bottom') {\n      y -= targetBounding.height.value;\n    }\n\n    return {\n      x,\n      y,\n    };\n  });\n\n  const location = computed(() => {\n    const data = {\n      x: coord.value?.x ?? 0,\n      y: coord.value?.y ?? 0,\n    };\n    if (toValue(referenceWindow)) {\n      data.x += canvasBounding.x.value;\n      data.y += canvasBounding.y.value;\n    }\n    return {\n      x: finalOffset.value.x + data.x,\n      y: finalOffset.value.y + data.y,\n    };\n  });\n\n  const x = computed(() => location.value.x);\n  const y = computed(() => location.value.y);\n\n  const style = computed(() => ({ left: `${x.value?.toFixed(2)}px`, top: `${y.value?.toFixed(2)}px` }));\n\n  watchEffect(() => {\n    const element = toValue(target) as HTMLElement;\n    if (element && toValue(options.applyStyle ?? true)) {\n      element.style?.setProperty?.('left', style.value.left);\n      element.style?.setProperty?.('top', style.value.top);\n    }\n  });\n\n  return {\n    x,\n    y,\n    style,\n  };\n}\n","import type { Arrayable } from '@vueuse/core';\nimport type { Entity, EntityCollection } from 'cesium';\nimport type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';\nimport type { MaybeRefOrAsyncGetter } from '../toPromiseValue';\nimport { computedAsync } from '@vueuse/core';\nimport { toValue, watchEffect } from 'vue';\nimport { toPromiseValue } from '../toPromiseValue';\nimport { useViewer } from '../useViewer';\n\nexport interface UseEntityOptions {\n  /**\n   * The collection of Entity to be added\n   * @default useViewer().value.entities\n   */\n  collection?: EntityCollection;\n\n  /**\n   * default value of `isActive`\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean>;\n\n  /**\n   * Ref passed to receive the updated of async evaluation\n   */\n  evaluating?: Ref<boolean>;\n}\n\n/**\n * Add `Entity` to the `EntityCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `Entity`.\n *\n * overLoaded1: Parameter supports passing in a single value.\n */\nexport function useEntity<T extends Entity = Entity>(\n  entity?: MaybeRefOrAsyncGetter<T | undefined>,\n  options?: UseEntityOptions\n): ComputedRef<T | undefined>;\n\n/**\n * Add `Entity` to the `EntityCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `Entity`.\n *\n * overLoaded2: Parameter supports passing in an array.\n */\nexport function useEntity<T extends Entity = Entity>(\n  entities?: MaybeRefOrAsyncGetter<Array<T | undefined>>,\n  options?: UseEntityOptions\n): ComputedRef<T[] | undefined>;\n\nexport function useEntity<T extends Entity>(\n  data?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>,\n  options: UseEntityOptions = {},\n) {\n  const { collection, isActive = true, evaluating } = options;\n\n  const result = computedAsync(\n    () => toPromiseValue(data),\n    [],\n    {\n      evaluating,\n    },\n  );\n\n  const viewer = useViewer();\n\n  watchEffect((onCleanup) => {\n    const _isActive = toValue(isActive);\n    if (_isActive) {\n      const list = Array.isArray(result.value) ? [...result.value] : [result.value];\n      const _collection = collection ?? viewer.value?.entities;\n      list.forEach(item => (item && _collection?.add(item)));\n      onCleanup(() => {\n        list.forEach(item => item && _collection?.remove(item));\n      });\n    }\n  });\n\n  return result;\n}\n","import type { Entity, EntityCollection } from 'cesium';\nimport type { MaybeRefOrGetter, ShallowReactive } from 'vue';\nimport type { EffcetRemovePredicate } from '../useCollectionScope';\nimport { computed, toValue } from 'vue';\nimport { useCollectionScope } from '../useCollectionScope';\nimport { useViewer } from '../useViewer';\n\nexport interface UseEntityScopeOptions {\n  /**\n   * The collection of Entity to be added\n   * @default useViewer().value.entities\n   */\n  collection?: MaybeRefOrGetter<EntityCollection>;\n}\n\nexport interface UseEntityScopeRetrun {\n  /**\n   * A `Set` for storing SideEffect instance,\n   * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality\n   */\n  scope: Readonly<ShallowReactive<Set<Entity>>>;\n\n  /**\n   * Add SideEffect instance\n   */\n  add: <T extends Entity>(entity: T) => T;\n\n  /**\n   * Remove specified SideEffect instance\n   */\n  remove: (entity: Entity, destroy?: boolean) => boolean;\n\n  /**\n   * Remove all SideEffect instance that meets the specified criteria\n   */\n  removeWhere: (predicate: EffcetRemovePredicate<Entity>, destroy?: boolean) => void;\n\n  /**\n   * Remove all SideEffect instance within current scope\n   */\n  removeScope: (destroy?: boolean) => void;\n}\n\n/**\n * Make `add` and `remove` operations of `EntityCollection` scoped,\n * automatically remove `Entity` instance when component is unmounted.\n */\nexport function useEntityScope(options: UseEntityScopeOptions = {}): UseEntityScopeRetrun {\n  const { collection: _collection } = options;\n  const viewer = useViewer();\n\n  const collection = computed(() => {\n    return toValue(_collection) ?? viewer.value?.entities;\n  });\n\n  const addFn = <T extends Entity>(entity: T): T => {\n    if (!collection.value) {\n      throw new Error('collection is not defined');\n    }\n    if (!collection.value.contains(entity)) {\n      collection.value.add(entity);\n    }\n    return entity;\n  };\n\n  const removeFn = (entity: Entity) => {\n    return !!collection.value?.remove(entity);\n  };\n\n  const { scope, add, remove, removeWhere, removeScope } = useCollectionScope<false>(addFn, removeFn, []);\n  return {\n    scope,\n    add,\n    remove,\n    removeWhere,\n    removeScope,\n  };\n}\n","import type { Cartesian2, Viewer } from 'cesium';\nimport type { MaybeRefOrGetter, ShallowRef } from 'vue';\nimport { refThrottled } from '@vueuse/core';\nimport { computed, shallowRef, toRef, toValue, watchEffect } from 'vue';\nimport { useViewer } from '../useViewer';\n\nexport interface UseScenePickOptions {\n  /**\n   * Whether to active the event listener.\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean>;\n  /**\n   * Throttled sampling (ms)\n   * @default 8\n   */\n  throttled?: number;\n\n  /**\n   * The width of the pick rectangle.\n   * @default 3\n   */\n  width?: MaybeRefOrGetter<number | undefined>;\n\n  /**\n   * The height of the pick rectangle.\n   * @default 3\n   */\n  height?: MaybeRefOrGetter<number | undefined>;\n\n}\n\nconst pickCache = new WeakMap<Viewer, [Cartesian2, any]>();\n\n/**\n * Uses the `scene.pick` function in Cesium's Scene object to perform screen point picking,\n * return a computed property containing the pick result, or undefined if no object is picked.\n *\n * @param windowPosition The screen coordinates of the pick point.\n */\nexport function useScenePick(\n  windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>,\n  options: UseScenePickOptions = {},\n): Readonly<ShallowRef<any | undefined>> {\n  const { width = 3, height = 3, throttled = 8 } = options;\n\n  const isActive = toRef(options.isActive ?? true);\n\n  const viewer = useViewer();\n\n  const position = refThrottled(computed(() => toValue(windowPosition)?.clone()), throttled, false, true);\n\n  const pick = shallowRef<any | undefined>();\n  watchEffect(() => {\n    if (viewer.value && position.value && isActive.value) {\n      const cache = pickCache.get(viewer.value);\n      if (cache && cache[0].equals(position.value)) {\n        pick.value = cache[1];\n      }\n      else {\n        pickCache.set(viewer.value, [position.value.clone(), pick.value]);\n        pick.value = viewer.value?.scene.pick(\n          position.value,\n          toValue(width),\n          toValue(height),\n        );\n      }\n    }\n  });\n  return pick;\n}\n","import type { KeyboardEventModifier, ScreenSpaceEventType } from 'cesium';\nimport type { MaybeRefOrGetter, WatchStopHandle } from 'vue';\nimport { tryOnScopeDispose } from '@vueuse/core';\nimport { ScreenSpaceEventHandler } from 'cesium';\nimport { computed, toRef, toValue, watch, watchEffect } from 'vue';\nimport { useViewer } from '../useViewer';\nimport { isDef } from '../utils';\n\nexport type ScreenSpaceEvent<T extends ScreenSpaceEventType> = {\n  [ScreenSpaceEventType.LEFT_DOWN]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.LEFT_UP]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.LEFT_CLICK]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.LEFT_DOUBLE_CLICK]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.RIGHT_DOWN]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.RIGHT_UP]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.RIGHT_CLICK]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.MIDDLE_DOWN]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.MIDDLE_UP]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.MIDDLE_CLICK]: ScreenSpaceEventHandler.PositionedEvent;\n  [ScreenSpaceEventType.MOUSE_MOVE]: ScreenSpaceEventHandler.MotionEvent;\n  [ScreenSpaceEventType.WHEEL]: number;\n  [ScreenSpaceEventType.PINCH_START]: ScreenSpaceEventHandler.TwoPointEvent;\n  [ScreenSpaceEventType.PINCH_END]: ScreenSpaceEventHandler.TwoPointEvent;\n  [ScreenSpaceEventType.PINCH_MOVE]: ScreenSpaceEventHandler.TwoPointMotionEvent;\n}[T];\n\nexport interface UseScreenSpaceEventHandlerOptions {\n  /**\n   * Modifier key\n   */\n  modifier?: MaybeRefOrGetter<KeyboardEventModifier | undefined>;\n\n  /**\n   * Whether to active the event listener.\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean>;\n}\n\n/**\n * Easily use the `ScreenSpaceEventHandler`,\n * when the dependent data changes or the component is unmounted,\n * the listener function will automatically reload or destroy.\n *\n * @param type Types of mouse event\n * @param inputAction Callback function for listening\n */\nexport function useScreenSpaceEventHandler<T extends ScreenSpaceEventType>(\n  type?: MaybeRefOrGetter<T | undefined>,\n  inputAction?: (event: ScreenSpaceEvent<T>) => any,\n  options: UseScreenSpaceEventHandlerOptions = {},\n): WatchStopHandle {\n  const { modifier } = options;\n  const viewer = useViewer();\n  const isActive = toRef(options.isActive ?? true);\n\n  const handler = computed(() => {\n    if (viewer.value?.cesiumWidget?.canvas) {\n      return new ScreenSpaceEventHandler(viewer.value.cesiumWidget.canvas);\n    }\n  });\n\n  const cleanup1 = watch(handler, (_value, previous) => {\n    viewer.value?.cesiumWidget && previous?.destroy();\n  });\n\n  const cleanup2 = watchEffect((onCleanup) => {\n    const typeValue = toValue(type);\n    const modifierValue = toValue(modifier);\n    const handlerValue = toValue(handler)!;\n    if (!handlerValue || !isActive.value || !inputAction) {\n      return;\n    }\n    if (isDef(typeValue)) {\n      handlerValue.setInputAction(inputAction as any, typeValue, modifierValue);\n      onCleanup(() => handlerValue!.removeInputAction(typeValue, modifierValue));\n    }\n  });\n\n  const stop = () => {\n    cleanup1();\n    cleanup2();\n  };\n\n  tryOnScopeDispose(stop);\n\n  return stop;\n}\n","import type { Cartesian2, ScreenSpaceEventHandler } from 'cesium';\nimport type { WatchStopHandle } from 'vue';\nimport { tryOnScopeDispose } from '@vueuse/core';\nimport { ScreenSpaceEventType } from 'cesium';\nimport { nextTick, ref, shallowRef, watch } from 'vue';\nimport { useScenePick } from '../useScenePick';\nimport { useScreenSpaceEventHandler } from '../useScreenSpaceEventHandler';\nimport { useViewer } from '../useViewer';\nimport { throttle } from '../utils';\n\n/**\n * Parameters for graphic drag events\n */\nexport interface GraphicDragEvent {\n  /**\n   * Event of the motion event\n   */\n  event: ScreenSpaceEventHandler.MotionEvent;\n\n  /**\n   * The graphic object picked by `scene.pick`\n   */\n  pick: any;\n\n  /**\n   * Whether the graphic is currently being dragged.\n   */\n  dragging: boolean;\n\n  /**\n   * Whether to lock the camera, Will automatically resume when you end dragging.\n   */\n  lockCamera: () => void;\n}\n\n/**\n * Use graphic drag events with ease, and remove listener automatically on unmounted.\n */\nexport function useDrag(\n  listener: (params: GraphicDragEvent) => void,\n): WatchStopHandle {\n  const position = shallowRef<Cartesian2>();\n  const pick = useScenePick(position);\n  const motionEvent = shallowRef<ScreenSpaceEventHandler.MotionEvent>();\n  const dragging = ref(false);\n\n  const viewer = useViewer();\n\n  const cameraLocked = ref(false);\n\n  watch(cameraLocked, (cameraLocked) => {\n    viewer.value && (viewer.value.scene.screenSpaceCameraController.enableRotate = !cameraLocked);\n  });\n\n  const lockCamera = () => {\n    cameraLocked.value = true;\n  };\n\n  const execute = (pick: unknown, startPosition: Cartesian2, endPosition: Cartesian2) => {\n    listener({\n      event: {\n        startPosition: startPosition.clone(),\n        endPosition: endPosition.clone(),\n      },\n      pick,\n      dragging: dragging.value,\n      lockCamera,\n    });\n    // reset lockCamera\n    nextTick(() => {\n      if (!dragging.value && cameraLocked.value) {\n        cameraLocked.value = false;\n      }\n    });\n  };\n\n  const stopLeftDownWatch = useScreenSpaceEventHandler(\n    ScreenSpaceEventType.LEFT_DOWN,\n    (event) => {\n      dragging.value = true;\n      position.value = event.position.clone();\n    },\n  );\n\n  const stopMouseMoveWatch = useScreenSpaceEventHandler(\n    ScreenSpaceEventType.MOUSE_MOVE,\n    throttle(({ startPosition, endPosition }) => {\n      motionEvent.value = {\n        startPosition: motionEvent.value?.endPosition.clone() || startPosition.clone(),\n        endPosition: endPosition.clone(),\n      };\n    }, 8, false, true),\n  );\n\n  // dragging\n  watch([pick, motionEvent], ([pick, motionEvent]) => {\n    if (pick && motionEvent) {\n      const { startPosition, endPosition } = motionEvent;\n      dragging.value && execute(pick, startPosition, endPosition);\n    }\n  });\n\n  // drag end\n  const stopLeftUpWatch = useScreenSpaceEventHandler(\n    ScreenSpaceEventType.LEFT_UP,\n    (event) => {\n      dragging.value = false;\n\n      if (pick.value && motionEvent.value) {\n        execute(pick.value, motionEvent.value.endPosition, event.position);\n      }\n      position.value = undefined;\n      motionEvent.value = undefined;\n    },\n  );\n\n  const stop = () => {\n    stopLeftDownWatch();\n    stopMouseMoveWatch();\n    stopLeftUpWatch();\n  };\n\n  tryOnScopeDispose(stop);\n\n  return stop;\n}\n","import type { Cartesian2, ScreenSpaceEventHandler } from 'cesium';\nimport { ScreenSpaceEventType } from 'cesium';\nimport { shallowRef, watch } from 'vue';\nimport { useScenePick } from '../useScenePick';\nimport { useScreenSpaceEventHandler } from '../useScreenSpaceEventHandler';\n\n/**\n * Parameters for graphic hover events\n */\nexport interface GraphicHoverEvent {\n  /**\n   * Event of the motion event\n   */\n  event: ScreenSpaceEventHandler.MotionEvent;\n\n  /**\n   * The graphic object picked by `scene.pick`\n   */\n  pick: any;\n\n  /**\n   * Whether the graphic is currently being hoverged. Returns `true` continuously while hoverging, and `false` once it ends.\n   */\n  hovering: boolean;\n\n}\n\n/**\n * Use graphic hover events with ease, and remove listener automatically on unmounted.\n */\nexport function useHover(\n  listener: (params: GraphicHoverEvent) => void,\n) {\n  const motionEvent = shallowRef<ScreenSpaceEventHandler.MotionEvent>();\n  const pick = useScenePick(() => motionEvent.value?.endPosition);\n\n  const execute = (pick: unknown, startPosition: Cartesian2, endPosition: Cartesian2, hovering: boolean) => {\n    listener({\n      event: {\n        startPosition: startPosition.clone(),\n        endPosition: endPosition.clone(),\n      },\n      pick,\n      hovering,\n    });\n  };\n\n  useScreenSpaceEventHandler(\n    ScreenSpaceEventType.MOUSE_MOVE,\n    ({ startPosition, endPosition }) => {\n      if (!startPosition.equals(motionEvent.value?.startPosition) || !endPosition.equals(motionEvent.value?.endPosition)) {\n        motionEvent.value = { startPosition: startPosition.clone(), endPosition: endPosition.clone() };\n      }\n    },\n  );\n\n  // hovering\n  watch([pick, motionEvent], ([pick, motionEvent]) => {\n    if (pick && motionEvent) {\n      const { startPosition, endPosition } = motionEvent;\n      execute(pick, startPosition, endPosition, true);\n    }\n  });\n\n  // hover end\n  watch(pick, (pick, prevPick) => {\n    if (prevPick && motionEvent.value) {\n      const { startPosition, endPosition } = motionEvent.value;\n      execute(prevPick, startPosition, endPosition, false);\n    }\n  });\n}\n","import type { ScreenSpaceEventHandler } from 'cesium';\nimport { ScreenSpaceEventType } from 'cesium';\nimport { useScreenSpaceEventHandler } from '../useScreenSpaceEventHandler';\nimport { useViewer } from '../useViewer';\n\nexport type PositionedEventType = 'LEFT_DOWN' | 'LEFT_UP' | 'LEFT_CLICK' | 'LEFT_DOUBLE_CLICK' | 'RIGHT_DOWN' | 'RIGHT_UP' | 'RIGHT_CLICK' | 'MIDDLE_DOWN' | 'MIDDLE_UP' | 'MIDDLE_CLICK';\n\n type PositiondScreenSpaceEventType\n   = ScreenSpaceEventType.LEFT_DOWN\n     | ScreenSpaceEventType.LEFT_UP\n     | ScreenSpaceEventType.LEFT_CLICK\n     | ScreenSpaceEventType.LEFT_DOUBLE_CLICK\n     | ScreenSpaceEventType.RIGHT_DOWN\n     | ScreenSpaceEventType.RIGHT_UP\n     | ScreenSpaceEventType.RIGHT_CLICK\n     | ScreenSpaceEventType.MIDDLE_DOWN\n     | ScreenSpaceEventType.MIDDLE_UP\n     | ScreenSpaceEventType.MIDDLE_CLICK;\n\n/**\n * @internal\n */\nconst EVENT_TYPE_RECORD: Record<PositionedEventType, PositiondScreenSpaceEventType> = {\n  LEFT_DOWN: ScreenSpaceEventType.LEFT_DOWN,\n  LEFT_UP: ScreenSpaceEventType.LEFT_UP,\n  LEFT_CLICK: ScreenSpaceEventType.LEFT_CLICK,\n  LEFT_DOUBLE_CLICK: ScreenSpaceEventType.LEFT_DOUBLE_CLICK,\n  RIGHT_DOWN: ScreenSpaceEventType.RIGHT_DOWN,\n  RIGHT_UP: ScreenSpaceEventType.RIGHT_UP,\n  RIGHT_CLICK: ScreenSpaceEventType.RIGHT_CLICK,\n  MIDDLE_DOWN: ScreenSpaceEventType.MIDDLE_DOWN,\n  MIDDLE_UP: ScreenSpaceEventType.MIDDLE_UP,\n  MIDDLE_CLICK: ScreenSpaceEventType.MIDDLE_CLICK,\n};\n\n/**\n * Parameters for graphics click related events\n */\nexport interface GraphicPositionedEvent {\n  /**\n   * Event of the picked area\n   */\n  event: ScreenSpaceEventHandler.PositionedEvent;\n  /**\n   * The graphic object picked by `scene.pick`\n   */\n  pick: any;\n}\n\nexport function usePositioned(\n  type: PositionedEventType,\n  listener: (params: GraphicPositionedEvent) => void,\n) {\n  const screenEvent = EVENT_TYPE_RECORD[type];\n  const viewer = useViewer();\n  useScreenSpaceEventHandler(screenEvent, (event) => {\n    const position = event.position;\n    const pick = viewer.value?.scene.pick(position);\n    pick && position && listener({ event: { position }, pick });\n  });\n}\n","import type { Entity } from 'cesium';\nimport type { AnyFn, Nullable } from '../utils';\nimport type { GraphicDragEvent } from './useDrag';\nimport type { GraphicHoverEvent } from './useHover';\nimport type { GraphicPositionedEvent, PositionedEventType } from './usePositioned';\nimport { ref } from 'vue';\nimport { useViewer } from '../useViewer';\nimport { isDef, isFunction, resolvePick, tryRun } from '../utils';\nimport { useDrag } from './useDrag';\nimport { useHover } from './useHover';\nimport { usePositioned } from './usePositioned';\n\ntype GlobalGraphicSymbol = symbol;\n\nexport type CesiumGraphic = Entity | any;\n\nexport type GraphicEventType = PositionedEventType | 'HOVER' | 'DRAG';\n\nconst GLOBAL_GRAPHIC_SYMBOL: GlobalGraphicSymbol = Symbol('GLOBAL_GRAPHIC_SYMBOL');\n\nconst POSITIONED_EVENT_TYPES: PositionedEventType[] = [\n  'LEFT_DOWN',\n  'LEFT_UP',\n  'LEFT_CLICK',\n  'LEFT_DOUBLE_CLICK',\n  'RIGHT_DOWN',\n  'RIGHT_UP',\n  'RIGHT_CLICK',\n  'MIDDLE_DOWN',\n  'MIDDLE_UP',\n  'MIDDLE_CLICK',\n];\n\nexport type GraphicEventListener<T extends GraphicEventType>\n= T extends 'DRAG' ? (event: GraphicDragEvent) => void\n  : T extends 'HOVER' ? (event: GraphicHoverEvent) => void\n    : (event: GraphicPositionedEvent) => void;\n\nexport type RemoveGraphicEventFn = () => void;\n\nexport interface AddGraphicEventOptions {\n  /**\n   * The cursor style to use when the mouse is over the graphic.\n   * @default 'pointer'\n   */\n  cursor?: Nullable<string> | ((event: GraphicHoverEvent) => Nullable<string>);\n\n  /**\n   * The cursor style to use when the mouse is over the graphic during a drag operation.\n   * @default 'crosshair'\n   */\n  dragCursor?: Nullable<string> | ((event: GraphicHoverEvent) => Nullable<string>);\n}\n\nexport interface UseGraphicEventRetrun {\n  /**\n   * Add a graphic event listener and return a function to remove it.\n   * @param graphic - The graphic object, 'global' indicates the global graphic object.\n   * @param type - The event type, 'all' indicates clearing all events.\n   * @param listener - The event listener function.\n   */\n  addGraphicEvent: <T extends GraphicEventType>(graphic: CesiumGraphic | 'global', type: T, listener: GraphicEventListener<T>, options?: AddGraphicEventOptions) => RemoveGraphicEventFn;\n\n  /**\n   * Remove a graphic event listener.\n   * @param graphic - The graphic object, 'global' indicates the global graphic object.\n   * @param type - The event type, 'all' indicates clearing all events.\n   * @param listener - The event listener function.\n   */\n  removeGraphicEvent: <T extends GraphicEventType>(graphic: CesiumGraphic | 'global', type: T, listener: GraphicEventListener<T>) => void;\n\n  /**\n   * Clear graphic event listeners.\n   * @param graphic - The graphic object.\n   * @param type - The event type, 'all' indicates clearing all events.\n   */\n  clearGraphicEvent: (graphic: CesiumGraphic | 'global', type: GraphicEventType | 'all') => void;\n}\n\n/**\n * Handle graphic event listeners and cursor styles for Cesium graphics.\n * You don't need to overly worry about memory leaks from the function, as it automatically cleans up internally.\n */\nexport function useGraphicEvent(): UseGraphicEventRetrun {\n  const collection = new WeakMap<CesiumGraphic | GlobalGraphicSymbol, Map<GraphicEventType, Set<AnyFn>>>();\n  const cursorCollection = new WeakMap<CesiumGraphic | GlobalGraphicSymbol, Map<GraphicEventType, Map<AnyFn, AnyFn>>>();\n  const dragCursorCollection = new WeakMap<CesiumGraphic | GlobalGraphicSymbol, Map<GraphicEventType, Map<AnyFn, AnyFn>>>();\n\n  const removeGraphicEvent = (graphic: CesiumGraphic | 'global', type: GraphicEventType, listener: AnyFn) => {\n    const _graphic: CesiumGraphic | GlobalGraphicSymbol = graphic === 'global' ? GLOBAL_GRAPHIC_SYMBOL : graphic;\n\n    // Remove the listener for the specified type\n    collection?.get(_graphic)?.get(type)?.delete(listener);\n    cursorCollection?.get(_graphic)?.get(type)?.delete(listener);\n\n    // If the listener set for the specified type is empty, delete that type\n    if (collection?.get(_graphic)?.get(type)?.size === 0) {\n      collection!.get(_graphic)!.delete(type);\n    }\n    // If the event map for the graphic is empty, delete that graphic\n    if (collection.get(_graphic)?.size === 0) {\n      collection.delete(_graphic);\n    }\n    cursorCollection?.get(_graphic)?.get(type)?.delete(listener);\n    if (cursorCollection?.get(_graphic)?.get(type)?.size === 0) {\n      cursorCollection?.get(_graphic)?.delete(type);\n    }\n    if (cursorCollection?.get(_graphic)?.size === 0) {\n      cursorCollection?.delete(_graphic);\n    }\n    dragCursorCollection?.get(_graphic)?.get(type)?.delete(listener);\n\n    // If the listener set for the drag type is empty, delete that type\n    if (dragCursorCollection?.get(_graphic)?.get(type)?.size === 0) {\n      dragCursorCollection?.get(_graphic)?.delete(type);\n    }\n    // If the drag event map for the graphic is empty, delete that graphic\n    if (dragCursorCollection?.get(_graphic)?.size === 0) {\n      dragCursorCollection?.delete(_graphic);\n    }\n  };\n\n  const addGraphicEvent = (graphic: CesiumGraphic | 'global', type: GraphicEventType, listener: AnyFn, options: AddGraphicEventOptions = {}) => {\n    const _graphic: CesiumGraphic | GlobalGraphicSymbol = graphic === 'global' ? GLOBAL_GRAPHIC_SYMBOL : graphic;\n    // Ensure the event map for the graphic exists\n    collection.get(_graphic) ?? collection.set(_graphic, new Map());\n    const eventTypeMap = collection.get(_graphic)!;\n\n    // Ensure the listener set for the specified type exists\n    eventTypeMap.get(type) ?? eventTypeMap.set(type, new Set());\n    const listeners = eventTypeMap.get(type)!;\n\n    listeners.add(listener);\n\n    let { cursor = 'pointer', dragCursor } = options;\n\n    // Handle cursor style for hover events\n    if (isDef(cursor)) {\n      const _cursor = isFunction(cursor) ? cursor : () => cursor;\n      // Ensure the cursor map for the graphic exists\n      cursorCollection.get(_graphic) ?? cursorCollection.set(_graphic, new Map());\n      cursorCollection.get(_graphic)!.get(type) ?? cursorCollection.get(_graphic)!.set(type, new Map());\n      cursorCollection.get(_graphic)!.get(type)!.set(listener, _cursor);\n    }\n\n    // Handle cursor style for drag events\n    if (type === 'DRAG') {\n      dragCursor ??= ((event: GraphicDragEvent) => event?.dragging ? 'crosshair' : undefined) as any;\n    }\n\n    if (isDef(dragCursor)) {\n      const _dragCursor = isFunction(dragCursor) ? dragCursor : () => dragCursor;\n      // Ensure the drag cursor map for the graphic exists\n      dragCursorCollection.get(_graphic) ?? dragCursorCollection.set(_graphic, new Map());\n      dragCursorCollection.get(_graphic)!.get(type) ?? dragCursorCollection.get(_graphic)!.set(type, new Map());\n      dragCursorCollection.get(_graphic)!.get(type)!.set(listener, _dragCursor);\n    }\n\n    return () => removeGraphicEvent(graphic, type, listener);\n  };\n\n  const clearGraphicEvent = (graphic: CesiumGraphic | 'global', type: GraphicEventType | 'all') => {\n    const _graphic: CesiumGraphic | GlobalGraphicSymbol = graphic === 'global' ? GLOBAL_GRAPHIC_SYMBOL : graphic;\n    // Clear all events\n    if (type === 'all') {\n      collection.delete(_graphic);\n      cursorCollection.delete(_graphic);\n      dragCursorCollection.delete(_graphic);\n      return;\n    }\n\n    // Delete the event for the specified type\n    collection.get(_graphic)?.delete(type);\n    if (collection.get(_graphic)?.size === 0) {\n      collection.delete(_graphic);\n    }\n    cursorCollection?.get(_graphic)?.delete(type);\n    dragCursorCollection?.get(_graphic)?.delete(type);\n\n    // If the cursor map for the graphic is empty, delete that graphic\n    if (cursorCollection?.get(_graphic)?.size === 0) {\n      cursorCollection?.delete(_graphic);\n    }\n\n    // If the drag cursor map for the graphic is empty, delete that graphic\n    if (dragCursorCollection?.get(_graphic)?.size === 0) {\n      dragCursorCollection?.delete(_graphic);\n    }\n  };\n\n  for (const type of POSITIONED_EVENT_TYPES) {\n    usePositioned(type, (event) => {\n      const graphics = resolvePick(event.pick);\n      graphics.concat(GLOBAL_GRAPHIC_SYMBOL).forEach((graphic) => {\n        collection.get(graphic)?.get(type)?.forEach(fn => tryRun(fn)?.(event));\n      });\n    });\n  }\n\n  const dragging = ref(false);\n  const viewer = useViewer();\n\n  useHover((event) => {\n    const graphics = resolvePick(event.pick).concat(GLOBAL_GRAPHIC_SYMBOL);\n    graphics.forEach((graphic) => {\n      collection.get(graphic)?.get('HOVER')?.forEach(fn => tryRun(fn)?.(event));\n      if (!dragging.value) {\n        cursorCollection.get(graphic)?.forEach((map) => {\n          map.forEach((fn) => {\n            const cursor = event.hovering ? tryRun(fn)(event) : '';\n            viewer.value?.canvas.style?.setProperty('cursor', cursor);\n          });\n        });\n      }\n    });\n  });\n\n  useDrag((event) => {\n    const graphics = resolvePick(event.pick).concat(GLOBAL_GRAPHIC_SYMBOL);\n    dragging.value = event.dragging;\n\n    graphics.forEach((graphic) => {\n      collection.get(graphic)?.get('DRAG')?.forEach(fn => tryRun(fn)(event));\n      dragCursorCollection.get(graphic)?.forEach((map) => {\n        map.forEach((fn) => {\n          const cursor = event.dragging ? tryRun(fn)(event) : '';\n          viewer.value?.canvas.style?.setProperty('cursor', cursor);\n        });\n      });\n    });\n  });\n\n  return {\n    addGraphicEvent,\n    removeGraphicEvent,\n    clearGraphicEvent,\n  };\n}\n","import type { Arrayable } from '@vueuse/core';\nimport type { ImageryLayer, ImageryLayerCollection } from 'cesium';\nimport type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';\nimport type { MaybeRefOrAsyncGetter } from '../toPromiseValue';\nimport { computedAsync } from '@vueuse/core';\nimport { toValue, watchEffect } from 'vue';\nimport { toPromiseValue } from '../toPromiseValue';\nimport { useViewer } from '../useViewer';\n\nexport interface UseImageryLayerOptions {\n\n  /**\n   * The collection of ImageryLayer to be added\n   * @default useViewer().value.imageryLayers\n   */\n  collection?: ImageryLayerCollection;\n\n  /**\n   * default value of `isActive`\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean>;\n\n  /**\n   * Ref passed to receive the updated of async evaluation\n   */\n  evaluating?: Ref<boolean>;\n\n  /**\n   * The second parameter passed to the `remove` function\n   *\n   * `imageryLayers.remove(layer,destroyOnRemove)`\n   */\n  destroyOnRemove?: MaybeRefOrGetter<boolean>;\n}\n\n/**\n * Add `ImageryLayer` to the `ImageryLayerCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `ImageryLayer`.\n *\n * overLoaded1: Parameter supports passing in a single value.\n */\nexport function useImageryLayer<T extends ImageryLayer = ImageryLayer>(\n  layer?: MaybeRefOrAsyncGetter<T | undefined>,\n  options?: UseImageryLayerOptions\n): ComputedRef<T | undefined>;\n\n/**\n * Add `ImageryLayer` to the `ImageryLayerCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `ImageryLayer`.\n *\n * overLoaded2: Parameter supports passing in an array.\n */\nexport function useImageryLayer<T extends ImageryLayer = ImageryLayer>(\n  layers?: MaybeRefOrAsyncGetter<Array<T | undefined>>,\n  options?: UseImageryLayerOptions\n): ComputedRef<T[] | undefined>;\n\nexport function useImageryLayer<T extends ImageryLayer>(\n  data?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>,\n  options: UseImageryLayerOptions = {},\n) {\n  const {\n    destroyOnRemove,\n    collection,\n    isActive = true,\n    evaluating,\n  } = options;\n\n  const result = computedAsync(\n    () => toPromiseValue(data),\n    [],\n    {\n      evaluating,\n    },\n  );\n\n  const viewer = useViewer();\n\n  watchEffect((onCleanup) => {\n    const _isActive = toValue(isActive);\n    if (_isActive) {\n      const list = Array.isArray(result.value) ? [...result.value] : [result.value];\n      const _collection = collection ?? viewer.value?.imageryLayers;\n      if (collection?.isDestroyed()) {\n        return;\n      }\n      list.forEach((item) => {\n        if (!item) {\n          console.warn('ImageryLayer is undefined');\n          return;\n        }\n        if (item?.isDestroyed()) {\n          console.warn('ImageryLayer is destroyed');\n          return;\n        }\n        _collection?.add(item);\n      });\n      onCleanup(() => {\n        const destroy = toValue(destroyOnRemove);\n        list.forEach(item => item && _collection?.remove(item, destroy));\n      });\n    }\n  });\n\n  return result;\n}\n","import type { ImageryLayer, ImageryLayerCollection } from 'cesium';\nimport type { MaybeRefOrGetter, ShallowReactive } from 'vue';\nimport type { EffcetRemovePredicate } from '../useCollectionScope';\nimport { computed, toValue } from 'vue';\nimport { useCollectionScope } from '../useCollectionScope';\nimport { useViewer } from '../useViewer';\n\nexport interface UseImageryLayerScopeOptions {\n  /**\n   * The collection of ImageryLayer to be added\n   * @default useViewer().value.imageryLayers\n   */\n  collection?: MaybeRefOrGetter<ImageryLayerCollection>;\n\n  /**\n   * The second parameter passed to the `remove` function\n   *\n   * `imageryLayers.remove(imageryLayer,destroyOnRemove)`\n   */\n  destroyOnRemove?: boolean;\n}\n\nexport interface UseImageryLayerScopeRetrun {\n  /**\n   * A `Set` for storing SideEffect instance,\n   * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality\n   */\n  scope: Readonly<ShallowReactive<Set<ImageryLayer>>>;\n\n  /**\n   * Add SideEffect instance\n   */\n  add: <T extends ImageryLayer>(imageryLayer: T) => T;\n\n  /**\n   * Remove specified SideEffect instance\n   */\n  remove: (imageryLayer: ImageryLayer, destroy?: boolean) => boolean;\n\n  /**\n   * Remove all SideEffect instance that meets the specified criteria\n   */\n  removeWhere: (predicate: EffcetRemovePredicate<ImageryLayer>, destroy?: boolean) => void;\n\n  /**\n   * Remove all SideEffect instance within current scope\n   */\n  removeScope: (destroy?: boolean) => void;\n}\n\n/**\n * Make `add` and `remove` operations of `ImageryLayerCollection` scoped,\n * automatically remove `ImageryLayer` instance when component is unmounted.\n */\nexport function useImageryLayerScope(options: UseImageryLayerScopeOptions = {}): UseImageryLayerScopeRetrun {\n  const { collection: _collection, destroyOnRemove } = options;\n  const viewer = useViewer();\n\n  const collection = computed(() => {\n    return toValue(_collection) ?? viewer.value?.imageryLayers;\n  });\n\n  const addFn = <T extends ImageryLayer>(imageryLayer: T, index?: number): T => {\n    if (!collection.value) {\n      throw new Error('collection is not defined');\n    }\n    collection.value.add(imageryLayer, index);\n    return imageryLayer;\n  };\n\n  const removeFn = (imageryLayer: ImageryLayer, destroy?: boolean) => {\n    return !!collection.value?.remove(imageryLayer, destroy);\n  };\n\n  const { scope, add, remove, removeWhere, removeScope } = useCollectionScope<false>(addFn, removeFn, [destroyOnRemove]);\n  return {\n    scope,\n    add,\n    remove,\n    removeWhere,\n    removeScope,\n  };\n}\n","import type { Arrayable } from '@vueuse/core';\nimport type { PostProcessStage, PostProcessStageCollection } from 'cesium';\nimport type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';\nimport type { MaybeRefOrAsyncGetter } from '../toPromiseValue';\nimport { computedAsync } from '@vueuse/core';\nimport { toValue, watchEffect } from 'vue';\nimport { toPromiseValue } from '../toPromiseValue';\nimport { useViewer } from '../useViewer';\n\nexport interface UsePostProcessStageOptions {\n  /**\n   * The collection of PostProcessStage to be added\n   * @default useViewer().scene.postProcessStages\n   */\n  collection?: PostProcessStageCollection;\n\n  /**\n   * default value of `isActive`\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean>;\n\n  /**\n   * Ref passed to receive the updated of async evaluation\n   */\n  evaluating?: Ref<boolean>;\n}\n\n/**\n * Add `PostProcessStage` to the `PostProcessStageCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `PostProcessStage`.\n *\n * overLoaded1: Parameter supports passing in a single value.\n */\nexport function usePostProcessStage<T extends PostProcessStage = PostProcessStage>(\n  stage?: MaybeRefOrAsyncGetter<T | undefined>,\n  options?: UsePostProcessStageOptions\n): ComputedRef<T | undefined>;\n\n/**\n * Add `PostProcessStage` to the `PostProcessStageCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `PostProcessStage`.\n *\n * overLoaded2: Parameter supports passing in an array.\n */\nexport function usePostProcessStage<T extends PostProcessStage = PostProcessStage>(\n  stages?: MaybeRefOrAsyncGetter<Array<T | undefined>>,\n  options?: UsePostProcessStageOptions\n): ComputedRef<T[] | undefined>;\n\nexport function usePostProcessStage<T extends PostProcessStage>(\n  data?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>,\n  options: UsePostProcessStageOptions = {},\n) {\n  const {\n    collection,\n    isActive = true,\n    evaluating,\n  } = options;\n\n  const result = computedAsync(\n    () => toPromiseValue(data),\n    undefined,\n    {\n      evaluating,\n    },\n  );\n\n  const viewer = useViewer();\n\n  watchEffect((onCleanup) => {\n    if (!viewer.value) {\n      return;\n    }\n    const _isActive = toValue(isActive);\n    if (_isActive) {\n      const list = Array.isArray(result.value) ? [...result.value] : [result.value];\n      const _collection = collection ?? viewer.value.scene.postProcessStages;\n\n      list.forEach(item => (item && _collection.add(item)));\n      onCleanup(() => {\n        list.forEach(item => item && _collection.remove(item));\n      });\n    }\n  });\n\n  return result;\n}\n","import type { PostProcessStage, PostProcessStageCollection } from 'cesium';\nimport type { MaybeRefOrGetter, ShallowReactive } from 'vue';\nimport type { EffcetRemovePredicate } from '../useCollectionScope';\nimport { computed, toValue } from 'vue';\nimport { useCollectionScope } from '../useCollectionScope';\nimport { useViewer } from '../useViewer';\n\nexport interface UsePostProcessStageScopeOptions {\n  /**\n   * The collection of PostProcessStage to be added\n   * @default useViewer().value.postProcessStages\n   */\n  collection?: MaybeRefOrGetter<PostProcessStageCollection>;\n}\n\nexport interface UsePostProcessStageScopeRetrun {\n  /**\n   * A `Set` for storing SideEffect instance,\n   * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality\n   */\n  scope: Readonly<ShallowReactive<Set<PostProcessStage>>>;\n\n  /**\n   * Add SideEffect instance\n   */\n  add: <T extends PostProcessStage>(postProcessStage: T) => T;\n\n  /**\n   * Remove specified SideEffect instance\n   */\n  remove: (postProcessStage: PostProcessStage, destroy?: boolean) => boolean;\n\n  /**\n   * Remove all SideEffect instance that meets the specified criteria\n   */\n  removeWhere: (predicate: EffcetRemovePredicate<PostProcessStage>, destroy?: boolean) => void;\n\n  /**\n   * Remove all SideEffect instance within current scope\n   */\n  removeScope: (destroy?: boolean) => void;\n}\n\n/**\n * Make `add` and `remove` operations of `PostProcessStageCollection` scoped,\n * automatically remove `PostProcessStage` instance when component is unmounted.\n */\nexport function usePostProcessStageScope(options: UsePostProcessStageScopeOptions = {}): UsePostProcessStageScopeRetrun {\n  const { collection: _collection } = options;\n  const viewer = useViewer();\n\n  const collection = computed(() => {\n    return toValue(_collection) ?? viewer.value?.postProcessStages;\n  });\n\n  const addFn = <T extends PostProcessStage>(postProcessStage: T): T => {\n    if (!collection.value) {\n      throw new Error('collection is not defined');\n    }\n    return collection.value.add(postProcessStage) as T;\n  };\n\n  const removeFn = (postProcessStage: PostProcessStage) => {\n    return !!collection.value?.remove(postProcessStage);\n  };\n\n  const { scope, add, remove, removeWhere, removeScope } = useCollectionScope<false>(addFn, removeFn, []);\n  return {\n    scope,\n    add,\n    remove,\n    removeWhere,\n    removeScope,\n  };\n}\n","import type { Arrayable } from '@vueuse/core';\nimport type { Primitive, PrimitiveCollection } from 'cesium';\nimport type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';\nimport type { MaybeRefOrAsyncGetter } from '../toPromiseValue';\nimport { computedAsync } from '@vueuse/core';\nimport { toValue, watchEffect } from 'vue';\nimport { toPromiseValue } from '../toPromiseValue';\nimport { useViewer } from '../useViewer';\n\nexport interface UsePrimitiveOptions {\n  /**\n   * The collection of Primitive to be added\n   * - `ground` : `useViewer().scene.groundPrimitives`\n   * @default useViewer().scene.primitives\n   */\n  collection?: PrimitiveCollection | 'ground';\n\n  /**\n   * default value of `isActive`\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean>;\n\n  /**\n   * Ref passed to receive the updated of async evaluation\n   */\n  evaluating?: Ref<boolean>;\n}\n\n/**\n * Add `Primitive` to the `PrimitiveCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `Primitive`.\n *\n * overLoaded1: Parameter supports passing in a single value.\n */\nexport function usePrimitive<T = any>(\n  primitive?: MaybeRefOrAsyncGetter<T | undefined>,\n  options?: UsePrimitiveOptions\n): ComputedRef<T | undefined>;\n\n/**\n * Add `Primitive` to the `PrimitiveCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `Primitive`.\n *\n * overLoaded2: Parameter supports passing in an array.\n */\nexport function usePrimitive<T = any>(\n  primitives?: MaybeRefOrAsyncGetter<Array<T | undefined>>,\n  options?: UsePrimitiveOptions\n): ComputedRef<T[] | undefined>;\n\nexport function usePrimitive<T extends Primitive>(\n  data?: MaybeRefOrAsyncGetter<Arrayable<T | undefined>>,\n  options: UsePrimitiveOptions = {},\n) {\n  const {\n    collection,\n    isActive = true,\n    evaluating,\n  } = options;\n\n  const result = computedAsync(\n    () => toPromiseValue(data),\n    undefined,\n    {\n      evaluating,\n    },\n  );\n\n  const viewer = useViewer();\n\n  watchEffect((onCleanup) => {\n    const _isActive = toValue(isActive);\n    if (_isActive) {\n      const list = Array.isArray(result.value) ? [...result.value] : [result.value];\n      const _collection = collection === 'ground' ? viewer.value?.scene.groundPrimitives : (collection ?? viewer.value?.scene.primitives);\n\n      list.forEach(item => (item && _collection?.add(item)));\n      onCleanup(() => {\n        !_collection?.isDestroyed() && list.forEach(item => item && _collection?.remove(item));\n      });\n    }\n  });\n\n  return result;\n}\n","import type { PrimitiveCollection } from 'cesium';\nimport type { MaybeRefOrGetter, ShallowReactive } from 'vue';\nimport type { EffcetRemovePredicate } from '../useCollectionScope';\nimport { computed, toValue } from 'vue';\nimport { useCollectionScope } from '../useCollectionScope';\nimport { useViewer } from '../useViewer';\n\nexport interface UsePrimitiveScopeOptions {\n  /**\n   * The collection of Primitive to be added\n   * @default useViewer().value.scene.primitives\n   */\n  collection?: MaybeRefOrGetter<PrimitiveCollection>;\n}\n\nexport interface UsePrimitiveScopeRetrun {\n  /**\n   * A `Set` for storing SideEffect instance,\n   * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality\n   */\n  scope: Readonly<ShallowReactive<Set<any>>>;\n\n  /**\n   * Add SideEffect instance\n   */\n  add: <T>(primitive: T) => T;\n\n  /**\n   * Remove specified SideEffect instance\n   */\n  remove: (primitive: any, destroy?: boolean) => boolean;\n\n  /**\n   * Remove all SideEffect instance that meets the specified criteria\n   */\n  removeWhere: (predicate: EffcetRemovePredicate<any>, destroy?: boolean) => void;\n\n  /**\n   * Remove all SideEffect instance within current scope\n   */\n  removeScope: (destroy?: boolean) => void;\n}\n\n/**\n * Make `add` and `remove` operations of `PrimitiveCollection` scoped,\n * automatically remove `Primitive` instance when component is unmounted.\n */\nexport function usePrimitiveScope(options: UsePrimitiveScopeOptions = {}): UsePrimitiveScopeRetrun {\n  const { collection: _collection } = options;\n  const viewer = useViewer();\n\n  const collection = computed(() => {\n    return toValue(_collection) ?? viewer.value?.scene.primitives;\n  });\n\n  const addFn = <T>(primitive: T): T => {\n    if (!collection.value) {\n      throw new Error('collection is not defined');\n    }\n    return collection.value.add(primitive) as T;\n  };\n\n  const removeFn = (primitive: any) => {\n    return !!collection.value?.remove(primitive);\n  };\n\n  const { scope, add, remove, removeWhere, removeScope } = useCollectionScope<false>(addFn, removeFn, []);\n  return {\n    scope,\n    add,\n    remove,\n    removeWhere,\n    removeScope,\n  };\n}\n","import type { MaybeRefOrGetter, Ref } from 'vue';\nimport { useElementSize, watchImmediate } from '@vueuse/core';\nimport { Cartesian2, EllipsoidGeodesic } from 'cesium';\nimport { computed, nextTick, readonly, ref, toValue } from 'vue';\nimport { useCesiumEventListener } from '../useCesiumEventListener';\nimport { useViewer } from '../useViewer';\nimport { throttle } from '../utils';\n\nexport interface UseScaleBarOptions {\n  /**\n   * The maximum width of the scale (px)\n   * @default 80\n   */\n  maxPixel?: MaybeRefOrGetter<number>;\n\n  /**\n   * Throttled delay duration (ms)\n   * @default 8\n   */\n  delay?: number;\n}\n\nexport interface UseScaleBarRetrun {\n  /**\n   * The actual distance of a single pixel in the current canvas\n   */\n  pixelDistance: Readonly<Ref<number | undefined>>;\n\n  /**\n   * The width of the scale.(px)\n   */\n  width: Readonly<Ref<number>>;\n\n  /**\n   * The actual distance corresponding to the width of the scale (m)\n   */\n  distance: Readonly<Ref<number | undefined>>;\n\n  /**\n   * Formatted content of distance.\n   * eg. 100m,100km\n   */\n  distanceText: Readonly<Ref<string | undefined>>;\n}\n\nconst distances = [\n  0.01,\n  0.05,\n  0.1,\n  0.5,\n  1,\n  2,\n  3,\n  5,\n  10,\n  20,\n  30,\n  50,\n  100,\n  200,\n  300,\n  500,\n  1000,\n  2000,\n  3000,\n  5000,\n  10000,\n  20000,\n  30000,\n  50000,\n  100000,\n  200000,\n  300000,\n  500000,\n  1000000,\n  2000000,\n  3000000,\n  5000000,\n  10000000,\n  20000000,\n  30000000,\n  50000000,\n].reverse();\n\n/**\n * Reactive generation of scale bars\n */\nexport function useScaleBar(options: UseScaleBarOptions = {}): UseScaleBarRetrun {\n  const { maxPixel = 80, delay = 8 } = options;\n  const maxPixelRef = computed(() => toValue(maxPixel));\n\n  const viewer = useViewer();\n  const canvasSize = useElementSize(() => viewer.value?.canvas);\n\n  const pixelDistance = ref<number>();\n\n  const setPixelDistance = async () => {\n    await nextTick();\n    const scene = viewer.value?.scene;\n    if (!scene) {\n      return;\n    }\n\n    const left = scene.camera.getPickRay(new Cartesian2(Math.floor(canvasSize.width.value / 2), canvasSize.height.value - 1));\n    const right = scene.camera.getPickRay(new Cartesian2(Math.floor(1 + canvasSize.width.value / 2), canvasSize.height.value - 1));\n    if (!left || !right) {\n      return;\n    }\n\n    const leftPosition = scene.globe.pick(left, scene);\n    const rightPosition = scene.globe.pick(right, scene);\n\n    if (!leftPosition || !rightPosition) {\n      return;\n    }\n\n    const leftCartographic = scene.globe.ellipsoid.cartesianToCartographic(leftPosition);\n    const rightCartographic = scene.globe.ellipsoid.cartesianToCartographic(rightPosition);\n    const geodesic = new EllipsoidGeodesic(leftCartographic, rightCartographic);\n    pixelDistance.value = geodesic.surfaceDistance;\n  };\n\n  watchImmediate(viewer, () => setPixelDistance());\n\n  useCesiumEventListener(\n    () => viewer.value?.camera.changed,\n    throttle(setPixelDistance, delay),\n  );\n\n  const distance = computed(() => {\n    if (pixelDistance.value) {\n      return distances.find(item => pixelDistance.value! * maxPixelRef.value > item);\n    }\n  });\n\n  const width = computed(() => {\n    if (distance.value && pixelDistance.value) {\n      const value = distance.value / pixelDistance.value;\n      return value;\n    }\n    return 0;\n  });\n  const distanceText = computed(() => {\n    if (distance.value) {\n      return distance.value > 1000 ? `${(distance.value / 1000) || 0}km` : `${(distance.value || 0)}m`;\n    }\n  });\n\n  return {\n    pixelDistance: readonly(pixelDistance),\n    width,\n    distance,\n    distanceText,\n  };\n}\n","import type { Cartesian2 } from 'cesium';\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport { refThrottled } from '@vueuse/core';\nimport { computed, toValue } from 'vue';\nimport { useViewer } from '../useViewer';\n\nexport interface UseSceneDrillPickOptions {\n\n  /**\n   * Whether to activate the pick function.\n   * @default true\n   */\n  isActive?: MaybeRefOrGetter<boolean | undefined>;\n\n  /**\n   * Throttled sampling (ms)\n   * @default 8\n   */\n  throttled?: number;\n\n  /**\n   * If supplied, stop drilling after collecting this many picks.\n   */\n  limit?: MaybeRefOrGetter<number | undefined>;\n\n  /**\n   * The width of the pick rectangle.\n   * @default 3\n   */\n  width?: MaybeRefOrGetter<number | undefined>;\n\n  /**\n   * The height of the pick rectangle.\n   * @default 3\n   */\n  height?: MaybeRefOrGetter<number | undefined>;\n\n}\n\n/**\n * Uses the `scene.drillPick` function to perform screen point picking,\n * return a computed property containing the pick result, or undefined if no object is picked.\n *\n * @param windowPosition The screen coordinates of the pick point.\n */\nexport function useSceneDrillPick(\n  windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>,\n  options: UseSceneDrillPickOptions = {},\n): ComputedRef<any [] | undefined> {\n  const { width = 3, height = 3, limit, throttled = 8, isActive = true } = options;\n\n  const viewer = useViewer();\n\n  const position = refThrottled(computed(() => toValue(windowPosition)), throttled, false, true);\n\n  const pick = computed(() => {\n    if (position.value && toValue(isActive)) {\n      return viewer.value?.scene.drillPick(\n        position.value,\n        toValue(limit),\n        toValue(width),\n        toValue(height),\n      );\n    }\n  });\n\n  return pick;\n}\n"],"mappings":"8dAcA,8EALaA,EAAsF,OAAO,8BAA8B,CAK3H,EAA2B,IAAI,QA0B5C,SAAgB,EAAa,GAAG,EAAW,CAEzC,IADM,EAAS,CAAA,EAAA,EAAA,aAAoB,CAC7B,EAAiB,CAAA,EAA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