{"version":3,"sources":["jsdelivr-header.js","/npm/es6-cesium-navigation@1.0.4/viewerCesiumNavigationMixin.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNO,qBAAsB,2BACtB,kCAOP,MAAM,4BAkBJ,WAAA,CAAY,EAAQ,GAClB,IAAK,OAAO,QAAQ,GAClB,MAAM,IAAI,OAAO,eAAe,uBAElC,KAAK,OAAS,EACd,KAAK,QAAU,EACf,KAAK,MACP,CAOA,WAAA,CAAY,EAAc,GACxB,OAAO,KAAK,KAAK,WAAM,EAAW,UACpC,CAEA,IAAA,GACE,MAAM,OAAE,EAAM,QAAE,GAAY,KAC5B,IAAI,EAAmB,IAAI,iBAAiB,EAAQ,GAEhD,EAAe,OAAO,QAAQ,EAAO,cAAgB,EAAO,aAAe,EA0B/E,OAxBA,OAAO,iBAAiB,EAAc,CACpC,iBAAkB,CAChB,cAAc,EACd,IAAK,WACH,OAAO,CACT,KAIJ,EAAiB,qBACf,SAAU,GACR,OAAO,kBACE,EAAa,gBACtB,CACD,CAJD,CAIG,IAGL,EAAiB,qBACf,SAAU,GACR,OAAO,kBACE,EAAO,gBAChB,CACD,CAJD,CAIG,IAEE,CACT,iBAGa","file":"/npm/es6-cesium-navigation@1.0.4/viewerCesiumNavigationMixin.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/es6-cesium-navigation@1.0.4/viewerCesiumNavigationMixin.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import CesiumNavigation from './CesiumNavigation'\nimport './styles/cesium-navigation.less'\n\n/**\n * @param {Viewer|CesiumWidget} viewerCesiumWidget The Viewer or CesiumWidget instance\n * @param {{}} options the options\n */\n\nclass viewerCesiumNavigationMixin {\n  /**\n   * A mixin which adds the Compass/Navigation widget to the Viewer widget.\n   * Rather than being called directly, this function is normally passed as\n   * a parameter to {@link Viewer#extend}, as shown in the example below.\n   * @exports viewerCesiumNavigationMixin\n   *\n   * @param {Viewer} viewer The viewer instance.\n   * @param {{}} options The options.\n   *\n   * @exception {DeveloperError} viewer is required.\n   *\n   * @demo {@link http://localhost:8080/index.html|run local server with examples}\n   *\n   * @example\n   * var viewer = new Cesium.Viewer('cesiumContainer');\n   * viewer.extend(viewerCesiumNavigationMixin);\n   */\n  constructor(viewer, options) {\n    if (!Cesium.defined(viewer)) {\n      throw new Cesium.DeveloperError('viewer is required.')\n    }\n    this.viewer = viewer\n    this.options = options\n    this.init()\n  }\n\n  /**\n   *\n   * @param {CesiumWidget} cesiumWidget The cesium widget instance.\n   * @param {{}} options The options.\n   */\n  mixinWidget(cesiumWidget, options) {\n    return this.init.apply(undefined, arguments)\n  }\n\n  init() {\n    const { viewer, options } = this\n    var cesiumNavigation = new CesiumNavigation(viewer, options)\n\n    var cesiumWidget = Cesium.defined(viewer.cesiumWidget) ? viewer.cesiumWidget : viewer\n\n    Cesium.defineProperties(cesiumWidget, {\n      cesiumNavigation: {\n        configurable: true,\n        get: function() {\n          return cesiumNavigation\n        }\n      }\n    })\n\n    cesiumNavigation.addOnDestroyListener(\n      (function(cesiumWidget) {\n        return function() {\n          delete cesiumWidget.cesiumNavigation\n        }\n      })(cesiumWidget)\n    )\n\n    cesiumNavigation.addOnDestroyListener(\n      (function(viewer) {\n        return function() {\n          delete viewer.cesiumNavigation\n        }\n      })(viewer)\n    )\n    return cesiumNavigation\n  }\n}\n\nexport default viewerCesiumNavigationMixin\n"]}