/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import r from"../../core/Collection.js";import e from"../../core/Error.js";import o from"../../core/Logger.js";import{convertUnit as t}from"../../core/units.js";import{isBuildingGraphicOrigin as n}from"../../graphic/isBuildingGraphicOrigin.js";import{isHostedAgolService as i}from"../../layers/support/arcgisLayerUrl.js";import{registerLoader as s}from"../../layers/support/schemaValidatorLoader.js";import{schemaValidationErrorName as p}from"../../support/webSceneUtils.js";import{renderSVG as u}from"../../symbols/support/svgUtils.js";import{viewingModeFromString as a}from"../../views/ViewingMode.js";import{ZoomControllerGlobal as c}from"../../views/3d/state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as f}from"../../views/3d/state/controllers/ZoomControllerLocal.js";import{TilingScheme as m}from"../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as l}from"../../views/support/spatialReferenceSupport.js";import{checkWebGLRequirements as g}from"../../views/support/WebGLRequirements.js";import{registerLoader as d}from"../../webscene/support/schemaValidatorLoader.js";import{widgetMap as y}from"../../widgets/support/jsxWidgetSupport.js";import{widgetTestDataSymbol as h}from"../../widgets/support/symbols.js";function S(e,{defaultSpatialReference:o,isSpatialReferenceSupported:t,priorityLayers:n,required:i}){const s={...e.defaultsFromMapSettings};o&&(s.defaultSpatialReference=o),t&&(s.getSpatialReferenceSupport=(r,o)=>t(r,o)?e.getSpatialReferenceSupport(r,o):null),n&&(s.priorityCollection={layers:new r(n)}),i&&(s.required=i),e.defaultsFromMapSettings=s}function j(r){return r.back()}function w(r){return r.hasPendingEdits}function L(r,e){return o.getLogger("sceneViewer.appState.saveState").warn(r,e)}function b(r){return i(r)}function F(r,e,o,t){return u(r,e,o,t)}function v(r){return!r.canNotSaveAs()}function C(r,e){return l(r,a(e))}function R(r,e){return r.getCompatibleForVTL(e)}function G(r){return new m(r)}function P(r){return null==m.checkUnsupported(r)}function V(){s(()=>import("../../layers/support/schemaValidator.js")),d(()=>import("../../webscene/support/schemaValidator.js"))}function q(r){return r&&r.name===p}function B(r){const e=r.state.cameraController;return e instanceof c||e instanceof f?e.dragBeginPoint:null}function T(r){r.openedLayers.pop()}function U(r,o){return r&&"patchFeaturesForPopup"in r&&"function"==typeof r.patchFeaturesForPopup?r.patchFeaturesForPopup(o):Promise.reject(new e("layerview:fetchPopupFeaturesFromGraphics","The input layerview does not support fetchPopupFeaturesFromGraphics"))}function k(r,e,o){return t(r,e,o)}function M(r){r.removeContainer()}function W(){return y}function x(){return h}function E(r){return g(r)}function O(r){if(n(r?.origin))return r.origin.sublayer;if(!r?.sourceLayer)return null;if("building-component"===r.sourceLayer.type)return r.sourceLayer;throw new e("getSourceLayerFromBuildingComponentSublayerGraphic","The input graphic source layer is not of type BuildingComponentSublayer")}function Z(r,e){r&&(r.origin=e.graphicOrigin,r.sourceLayer=e)}export{v as canSaveAs,E as checkWebGLRequirements,T as closeCatalogLayer,k as convertToUnit,G as createTilingScheme,w as editorHasPendingEdits,j as editorNavigateBack,U as fetchPopupFeaturesFromGraphics,R as getCompatibleTileInfoForVTL,W as getJsxWidgetMap,O as getSourceLayerFromBuildingComponentSublayerGraphic,x as getWidgetTestDataSymbol,V as initializeSchemaValidators,b as isHostedAgolServiceUrl,q as isSchemaValidationError,C as isSpatialReferenceSupported,P as isSupportedTileInfo,M as removeWidgetContainer,F as renderSVG,L as saveStateWarning,S as setDefaultsFromMapSettings,Z as setSourceLayerOfBuildingComponentSublayerGraphic,B as zoomDragBeginPoint};
