/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
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 l}from"../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as m}from"../../views/support/spatialReferenceSupport.js";import{registerLoader as g}from"../../webscene/support/schemaValidatorLoader.js";import{widgetMap as d}from"../../widgets/support/jsxWidgetSupport.js";import{widgetTestDataSymbol as h}from"../../widgets/support/symbols.js";function y(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 S(r){return r.back()}function j(r){return r.hasPendingEdits}function w(r,e){return o.getLogger("sceneViewer.appState.saveState").warn(r,e)}function L(r){return i(r)}function F(r,e,o,t){return u(r,e,o,t)}function b(r){return!r.canNotSaveAs()}function v(r,e){return m(r,a(e))}function C(r,e){return r.getCompatibleForVTL(e)}function G(r){return new l(r)}function P(r){return null==l.checkUnsupported(r)}function V(){s(()=>import("../../layers/support/schemaValidator.js")),g(()=>import("../../webscene/support/schemaValidator.js"))}function R(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&&"fetchPopupFeaturesFromGraphics"in r&&"function"==typeof r.fetchPopupFeaturesFromGraphics?r.fetchPopupFeaturesFromGraphics(o):Promise.reject(new e("layerview:fetchPopupFeaturesFromGraphics","The input layerview does not support fetchPopupFeaturesFromGraphics"))}function M(r,e,o){return t(r,e,o)}function k(r){r.removeContainer()}function q(){return d}function x(){return h}function E(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 O(r,e){r&&(r.origin=e.graphicOrigin,r.sourceLayer=e)}export{b as canSaveAs,T as closeCatalogLayer,M as convertToUnit,G as createTilingScheme,j as editorHasPendingEdits,S as editorNavigateBack,U as fetchPopupFeaturesFromGraphics,C as getCompatibleTileInfoForVTL,q as getJsxWidgetMap,E as getSourceLayerFromBuildingComponentSublayerGraphic,x as getWidgetTestDataSymbol,V as initializeSchemaValidators,L as isHostedAgolServiceUrl,R as isSchemaValidationError,v as isSpatialReferenceSupported,P as isSupportedTileInfo,k as removeWidgetContainer,F as renderSVG,w as saveStateWarning,y as setDefaultsFromMapSettings,O as setSourceLayerOfBuildingComponentSublayerGraphic,B as zoomDragBeginPoint};
