@arcgis/core 5.1.0-next.66 → 5.1.0-next.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{97e15e66e55d9149fd48.js → 2e1aecdf59ad3421bbad.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{224461c1d9755966d0b6.js → 2f8ed1e7c1b10cb30972.js} +1 -1
  4. package/assets/esri/core/workers/chunks/3d9032217347dadcbe41.js +1 -0
  5. package/assets/esri/core/workers/chunks/{0d650b0d090a425c9c18.js → 4fd1bf82939e3bb9bc03.js} +1 -1
  6. package/assets/esri/core/workers/chunks/684ea7f75a7a5fb52cde.js +1 -0
  7. package/assets/esri/core/workers/chunks/{e0df7554b1679168663d.js → 6c40b3c2b9071edb758d.js} +1 -1
  8. package/assets/esri/core/workers/chunks/6ef3b8d67b498d655a99.js +1 -0
  9. package/assets/esri/core/workers/chunks/{3464a38e758c687a28d4.js → 7d73472696ec76458758.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{4141a3a93732996601e8.js → a8ef9ed9b59de95f2b23.js} +2 -2
  11. package/assets/esri/core/workers/chunks/{deddf6ae4498a3d0d0e5.js → abd5c1d4b7b91d9ea1eb.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{eab1b45ab5a802e29f8c.js → af007ec833ab49e4c958.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{468c70e5fdb61dfaad80.js → afea4a4b072c329d3749.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{bcb8a25438c66815e37a.js → b5648a0b92cf1a2c81ad.js} +1 -1
  15. package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +1 -0
  16. package/assets/esri/core/workers/chunks/{62a2da0ffc67f98445c1.js → e268e5be096392c2e69b.js} +1 -1
  17. package/chunks/GaussianSplat.glsl.js +8 -10
  18. package/config.js +1 -1
  19. package/interfaces.d.ts +0 -7
  20. package/kernel.js +1 -1
  21. package/layers/OrientedImageryLayer.js +1 -1
  22. package/layers/mixins/ArcGISImageService.js +1 -1
  23. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  24. package/layers/orientedImagery/core/utils.js +1 -1
  25. package/layers/raster/datasets/MRFRaster.js +1 -1
  26. package/layers/raster/functions/changeDetectionUtils.js +1 -1
  27. package/layers/support/ExportImageServiceParameters.js +1 -1
  28. package/networks/UnitIdentifierManager.d.ts +61 -0
  29. package/networks/UnitIdentifierManager.js +1 -1
  30. package/networks/UtilityNetwork.d.ts +0 -60
  31. package/networks/UtilityNetwork.js +1 -1
  32. package/package.json +2 -2
  33. package/popup/Features.d.ts +8 -28
  34. package/popup/Features.js +1 -1
  35. package/popup/actionUtils.js +2 -0
  36. package/popup/actions.js +2 -0
  37. package/popup/types.d.ts +11 -0
  38. package/rest/featureService/types.d.ts +1 -1
  39. package/support/revision.js +1 -1
  40. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  41. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  42. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  43. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  44. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  45. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  46. package/views/3d/layers/graphics/QueryEngineContext.js +1 -1
  47. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  48. package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
  49. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  50. package/views/analysis/ExclusiveOperationManager.js +1 -1
  51. package/views/interactive/sketch/SketchOptions.d.ts +34 -0
  52. package/widgets/Editor.js +1 -1
  53. package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.d.ts +8 -1
  54. package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.js +1 -1
  55. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  56. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  57. package/widgets/FeatureTable.d.ts +13 -0
  58. package/widgets/FeatureTable.js +1 -1
  59. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  60. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  61. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  62. package/widgets/OrientedImageryViewer.js +1 -1
  63. package/widgets/Popup/actionUtils.js +1 -1
  64. package/widgets/Sketch/VisibleElements.js +1 -1
  65. package/widgets/Sketch.js +1 -1
  66. package/assets/esri/core/workers/chunks/62d96b012c2d6f601863.js +0 -1
  67. package/assets/esri/core/workers/chunks/66692d6edc1bd96645e2.js +0 -1
  68. package/assets/esri/core/workers/chunks/a971e61336f455b953d5.js +0 -1
  69. package/assets/esri/core/workers/chunks/ed60b5eaa5765bfcb99c.js +0 -1
  70. /package/assets/esri/core/workers/chunks/{4141a3a93732996601e8.js.LICENSE.txt → a8ef9ed9b59de95f2b23.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as i}from"../core/arrayUtils.js";import{deprecateWidget as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{watch as l,sync as o,syncAndInitial as a,initial as r,on as c}from"../core/reactiveUtils.js";import{renderingSanitizer as d}from"../core/sanitizerUtils.js";import{formatFileSize as h}from"../core/unitFormatUtils.js";import{property as m,subclass as p}from"../core/accessorSupport/decorators.js";import{geometryTypes as u}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as g}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as w,isMapImageLayer as b,isSubtypeGroupLayer as v}from"../layers/support/layerUtils.js";import y from"../tables/AttributeTableTemplate.js";import f from"../time/TimeExtent.js";import _ from"./Widget.js";import{isSupportedImage as M,getCalciteIconForAttachment as V}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as C,Prompt as E}from"./Editor/components/Prompt.js";import A from"./FeatureTable/ColumnMenuVisibleElements.js";import S from"./FeatureTable/FeatureTableViewModel.js";import T from"./FeatureTable/VisibleElements.js";import{isGroupColumn as I}from"./FeatureTable/support/columnUtils.js";import D from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as P,isIFeatureTableSupportedLayer as R,isIFeatureTableSupportedLayerWithAttachments as k,getRelationshipIdsToShow as x}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as L}from"./support/componentsUtils.js";import{globalCss as O}from"./support/globalCss.js";import{getIconForLayer as F}from"./support/iconUtils.js";import{messageBundle as j,vmEvent as z,tsx as $,tsxFragment as U}from"./support/widget.js";import{storeNode as N,discardNode as H}from"./support/widgetUtils.js";var B;const Z="esri-feature-table",G=`${Z}__dialog`,W=`${Z}__attachments-view`,Q={base:Z,content:`${Z}__content`,menuPopover:`${Z}__menu-popover`,layerDropdownMenu:`${Z}__layer-switcher-menu`,tableContainer:`${Z}__table-container`,tableContainerWithAttachments:`${Z}__table-container--attachments`,tableNavigation:`${Z}__table-navigation`,attachmentsView:W,attachmentsViewContent:`${W}__content`,attachmentsViewDetails:`${W}__details`,attachmentsViewDropArea:`${W}__drop-area`,attachmentsViewDropAreaLabel:`${W}__drop-area__label`,attachmentsViewDropAreaMessage:`${W}__drop-area__message`,attachmentsViewIcon:`${W}__icon`,attachmentsViewInformation:`${W}__information`,attachmentsViewInformationData:`${W}__information__data`,attachmentsViewInformationLabel:`${W}__information__label`,attachmentsViewList:`${W}__list`,attachmentsViewListFileSize:`${W}__list__filesize`,attachmentsViewListThumbnail:`${W}__list__thumbnail`,expanded:`${Z}__expanded`,collapsed:`${Z}__collapsed`,dialog:`${G}`,dialogContent:`${G}__content`,dialogHeader:`${G}__header`,footerMessage:`${Z}__footer__message`,footerIconDanger:`${Z}__footer__icon--danger`,footerIconSuccess:`${Z}__footer__icon--success`},K={checkCircle:"check-circle",chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",expand:"expand",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",reset:"reset",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",table:"table",upload:"upload",zoomToSelection:"zoom-to-object"};let q=B=class extends _{constructor(e,t){super(e,t),this._attachmentsDialogPreviewLoading=!1,this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.messagesEditor=null,this.navigationScale="m",this.title=null,this.viewModel=new S,this.visibleElements=new T,this.announceDeprecation=()=>{s(n.getLogger(this),"Feature Table","arcgis-feature-table",{version:"5.0"})},this._showDeleteSelectionPrompt=this._showDeleteSelectionPrompt.bind(this),this._showDiscardEditsPrompt=this._showDiscardEditsPrompt.bind(this),this._resetNestedViews=this._resetNestedViews.bind(this)}initialize(){this.addHandles([l(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),l(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},o),l(()=>[this.topLayerDisabled,this.columns],()=>this.columns.forEach(e=>e.topLayerDisabled=this.topLayerDisabled),a),l(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},r),c(()=>this.viewModel,"show-related-table",e=>this._onShowRelatedTable(e)),l(()=>this.editingEnabled,()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)})])}loadDependencies(){return Promise.all([L({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),C(),P()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _attachmentsViewIsVisible(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some(e=>null!=e.attachmentsViewOptions.objectId))}get _columnVisibilityActionDisabled(){const e=this.effectiveTable;return e.menuConfig?.disabled??0===e.columns.length}get _dialogIsOpen(){return!!this.attachmentsViewOptions.dialogInfo}get _effectiveDescription(){const{description:e}=this;return null!=e?d.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(R):[],s=i.length?i:[...this._viewLayers];return e&&!s.includes(e)&&s.push(e),s}get _effectiveTitle(){const{layer:e,messages:i,state:s,highlightIds:n,title:l,size:o}=this;if(l)return d.sanitize("function"==typeof l?l():l);if(!i)return"";if(!e)return i.noLayer;switch(s){case"disabled":return i.errorLayer;case"ready":case"loading":return i.loading;case"error":return i.errorData}return t(i.header,{title:d.sanitize(e.title),count:o,selected:n.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._attachmentsViewIsVisible?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._attachmentsViewIsVisible}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showColumnVisibilityAction(){const{columnVisibilityMenu:e,header:t,menu:i,menuItems:s}=this._effectiveVisibleElements;return!(!(t&&i&&e&&!1!==s?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._attachmentsViewIsVisible)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._attachmentsViewIsVisible;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!R(e)||v(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},s=e=>{g(e)||"catalog-footprint"===e.type||(w(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):b(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):v(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(s),e.allTables.forEach(s),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get canAddRelatedFeature(){return this.viewModel.canAddRelatedFeature}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get filterByViewExtent(){return this.viewModel.filterByViewExtent}set filterByViewExtent(e){this.viewModel.filterByViewExtent=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return K.table}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multipleSelectionEnabledOverride(){return this.viewModel.multipleSelectionEnabledOverride}set multipleSelectionEnabledOverride(e){this.viewModel.multipleSelectionEnabledOverride=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get pendingEditsCount(){return this.viewModel.pendingEditsCount}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTableHasContingentValues(){return this.viewModel.relatedTableHasContingentValues}get relatedTableHasInvalidPendingEdits(){return this.viewModel.relatedTableHasInvalidPendingEdits}get relatedTableHasPendingEdits(){return this.viewModel.relatedTableHasPendingEdits}get relatedTables(){return this.viewModel.relatedTables}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get syncViewSelection(){return this.viewModel.syncViewSelection}set syncViewSelection(e){this.viewModel.syncViewSelection=e}get syncWithViewSelectionManager(){return this.syncViewSelection}set syncWithViewSelectionManager(e){this.syncViewSelection=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:s}=this,{columnDescriptions:n,columnMenus:l,tooltips:o}=s,a=null!=e.objectId;if(t)return new T({columnDescriptions:n,columnMenus:l,tooltips:o,close:s.close,header:s.header,layerDropdown:s.layerDropdown,layerDropdownIcons:s.layerDropdownIcons,menu:s.menu,menuItems:s.menuItems,progress:s.progress,selectionColumn:!1,columnMenuItems:new A({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&s.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new T({columnDescriptions:n,columnMenus:l,tooltips:o,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,pendingEditsFooter:!1,progress:!1,columnMenuItems:new A({sortAscending:c,sortDescending:c})})}return a?new T({columnDescriptions:n,columnMenus:l,tooltips:o,close:s.close,header:s.header,layerDropdown:s.layerDropdown,layerDropdownIcons:s.layerDropdownIcons,menu:s.menu,menuItems:s.menuItems,progress:s.progress,selectionColumn:!1,columnMenuItems:new A({sortAscending:!1,sortDescending:!1})}):null}addPendingEdits(e){this.viewModel.addPendingEdits(e)}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}async deleteSelection(e){this.highlightIds.length&&(e?this._showDeleteSelectionPrompt():await this.viewModel.deleteSelection())}async discardPendingEdits(e,t){return t?this._showDiscardEditsPrompt(e):this.viewModel.discardPendingEdits(e)}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}async exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}findColumn(e){return this.viewModel.findColumn(e)}getFeatureStoreItemByObjectId(e){return this.viewModel.getFeatureStoreItemByObjectId(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}async zoomToSelection(){return this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:s}=this;return $("div",{bind:this,class:this.classes(Q.base,O.widget)},$("calcite-panel",{bind:this,class:Q.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===s&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:"table-content",loading:"loading"===s,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?$("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt(),this._renderDialog())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(Q.tableContainer);if(t.length){const s=this.classes(Q.base,this.allRelatedTablesVisible?Q.expanded:Q.collapsed,this._attachmentsViewIsVisible?Q.tableContainerWithAttachments:void 0);return $("div",{class:i},$("calcite-panel",{overlayPositioning:"fixed"},$("div",null,[this._shouldShowGrid?$("div",{class:s},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return $("div",{class:s,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?$("div",{class:i},$("calcite-panel",{overlayPositioning:"fixed"},$("div",null,[$("div",{class:this.classes(Q.base,Q.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[$("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return $("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>{this._attachmentsDialogPreviewLoading=!1,this.goToPage(e.currentTarget.startItem-1)}})}_renderError(){const{messages:e}=this;return $("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:K.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",topLayerDisabled:this.topLayerDisabled,onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},$("span",{slot:"message"},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this._effectiveVisibleElements.pendingEditsFooter)return;const{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:i,messagesCommon:s}=this,n=e||t,l=this.hasContingentValues,o=[$("calcite-button",{appearance:"outline",disabled:t,iconStart:K.reset,key:"footer-reset-button",onclick:()=>{this.discardPendingEdits()},slot:"footer-end",width:"auto"},s.reset),$("calcite-button",{disabled:n,iconStart:K.save,key:"footer-save-button",loading:this.isSyncing,onclick:()=>{this.savePendingEdits()},slot:"footer-end",width:"auto"},s.save)];if(l){const t=e?i.contingentValues.hasInvalidValues:i.contingentValues.hasValidValues,s=e?K.exclamationMarkTriangle:K.checkCircle,n=e?Q.footerIconDanger:Q.footerIconSuccess;o.push($("div",{class:Q.footerMessage,key:"footer-message",slot:"footer-start"},$("calcite-icon",{class:n,icon:s,scale:"s",slot:"footer-start"}),t))}return o}_renderPrompt(){return this.prompt?$(E,{...this.prompt,headingLevel:2}):void 0}_showDeleteSelectionPrompt(){const{messages:e,messagesCommon:i}=this,s=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:s,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:i.delete,action:async()=>{try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,i){const{messages:s,messagesCommon:n}=this,l=t(s.deleteAttachmentCount,{count:i.length});this.showPrompt({title:l,message:s.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:n.delete,action:async()=>{try{await this.deleteAttachments(e,i,!1)}finally{this.clearPrompt()}}},secondary:{label:n.cancel,action:()=>this.clearPrompt()}}})}async _showDiscardEditsPrompt(e){const t=Promise.withResolvers(),{messagesEditor:i}=this;return this.showPrompt({title:i.cancelEditTitle,message:i.cancelEditWarningMessage,context:"danger",actions:{primary:{label:i.discardEdits,action:async()=>{try{await this.discardPendingEdits(e)}finally{t.resolve(!0)}}},secondary:{label:i.continueEditing,action:()=>t.resolve(!1)}}}),t.promise.finally(()=>this.clearPrompt())}_onTableViewChange(e){this.hasPendingEdits?this._showDiscardEditsPrompt().then(t=>t&&e()):e()}_resetNestedViews(){this.relatedTable&&this.drainRelatedTables(),this.effectiveTable.attachmentsViewOptions.objectId=null}_renderDialog(){const{attachmentsViewOptions:e,messages:t}=this,{objectId:i}=e;return $("calcite-dialog",{class:Q.dialog,description:this.viewModel.getFeatureTitleSync(i),heading:t.attachments,modal:!0,open:this._dialogIsOpen,placement:"cover",width:"l",onCalciteDialogClose:()=>this._onDialogClose()},this._renderDialogContent())}_renderDialogContent(){const e=this.attachmentsViewOptions.dialogInfo;if(e)return this._renderAttachmentsDialogContent(e)}_renderAttachmentsDialogContent(e){const{attachmentsViewOptions:t,messages:i}=this,{attachmentInfos:s}=t,n=s.indexOf(e);return $(U,null,$("div",{class:Q.dialogHeader,key:"header",slot:"content-top"},$("span",null,e.name),$("calcite-button",{appearance:"outline",onclick:()=>{t.attachmentId=e.id,t.dialogId=null}},i.viewDetails)),$("calcite-progress",{type:this._attachmentsDialogPreviewLoading?"indeterminate":"determinate"}),$("div",{class:Q.dialogContent,key:"content"},this._renderAttachmentsViewDetailsImage(e)),$("calcite-pagination",{pageSize:1,slot:"footer",startItem:n+1,totalItems:s.length,onCalcitePaginationChange:e=>{const i=e.currentTarget.startItem-1,n=s[i]?.id;t.dialogId=n}}))}_onDialogClose(){const e=this.attachmentsViewOptions;null!=e.dialogId&&(e.dialogId=null),this._attachmentsDialogPreviewLoading=!1}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:s,text:n,clickFunction:l}=e;if(!i)return $("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:s??void 0,key:n,onclick:()=>l(),slot:"header-menu-actions",text:n,textEnabled:!0,title:n})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:K.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:K.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:K.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:K.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:K.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:K.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:K.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(i).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,label:s,clickFunction:n})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:s,disabled:e,clickFunction:e=>n(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnVisibilityAction)return[];const{_columnVisibilityActions:e,id:t}=this,i=this.messages.menuText.columnVisibility;return $("calcite-action",{afterCreate:i=>e.set(t,i),afterRemoved:()=>e.delete(t),bind:this,disabled:this._columnVisibilityActionDisabled,icon:K.showColumn,id:`${t}__toggle-columns-action`,slot:"header-actions-end",text:i},this._effectiveVisibleElements.tooltips?$("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",referenceElement:e.get(t),topLayerDisabled:this.topLayerDisabled},i):null)}_renderColumnVisibilityPopover(){if(!this._showColumnVisibilityAction||this._columnVisibilityActionDisabled)return;const e=this.visibleElements.columnVisibilityMenuItems.header,t=this.messages.menuText.columnVisibility;return $("calcite-popover",{autoClose:!0,class:Q.menuPopover,closable:e,heading:e?t:void 0,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id),topLayerDisabled:this.topLayerDisabled},this._renderColumnVisibilityList())}_renderColumnVisibilityList(){const{effectiveTable:e,messages:{menuText:t}}=this;if(0!==e.columns.length)return $("calcite-list",{displayMode:"nested",filterEnabled:this.visibleElements.columnVisibilityMenuItems.filter,filterPlaceholder:t.searchFields,label:t.fieldVisibility,selectionMode:"multiple"},e.columns.toArray().map(t=>{const i=I(t)?t.columns?.map(t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0})):void 0;return this._renderColumnListItem({column:t,table:e,items:i})}))}_renderColumnListItem(e){const{column:t,table:i,items:s,ignoreSelect:n}=e,{effectiveLabel:l,fieldName:o,hidden:a}=t;return $("calcite-list-item",{expanded:!(!s?.length||a)||void 0,key:`toggle-columns__item-${o}`,label:l,selected:!a,value:o,onCalciteListItemSelect:e=>{n&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},s)}_renderLayerDropdown(){const e=this.messages.selectALayer;return $("div",{class:Q.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},$("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start",topLayerDisabled:this.topLayerDisabled},$("calcite-action",{icon:K.layers,slot:"trigger",text:e,title:e}),$("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return $("calcite-dropdown-item",{iconStart:i?F(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>this._onTableViewChange(()=>this.layer=e)},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||this.hasPendingEdits||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{autoRefreshEnabled:t,autoSaveEnabled:i,editingEnabled:s,effectiveTable:n,multipleSelectionEnabled:l,paginationEnabled:o,pageSize:a,view:r,viewModel:c}=this,{layer:d,objectId:h,relatedLayer:m,relationshipId:p}=e;await d.load();const u=this.attachmentsEnabled&&k(d),g=new B({layer:d,autoRefreshEnabled:t,autoSaveEnabled:i,attachmentsEnabled:u,editingEnabled:s,multipleSelectionEnabled:l,paginationEnabled:o,pageSize:a,relatedRecordsEnabled:!0,relationshipConfig:{objectId:h,relatedLayer:m,relationshipId:p},relationshipColumnConfigs:x(d,p),tableController:this,tableParent:n,view:r,showRelatedTableCallback:e=>c.emit("show-related-table",e)});this.relatedTables.add(g),this.scheduleRender()}_renderAttachmentsView(){switch(this.attachmentsViewOptions.effectiveMode){case"list":return this._renderAttachmentsViewList();case"details":return this._renderAttachmentsViewDetails();case"file":return this._renderAttachmentsViewFile()}}_renderAttachmentsViewFile(){const e=this.attachmentsViewOptions,{objectId:t}=e;if(null!=t)return[$("div",{class:Q.attachmentsView,key:"attachments-view"},this._renderAttachmentsViewInformation(),$("div",{class:Q.attachmentsViewContent,key:"attachments-view-content"},$("div",{bind:this,class:Q.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},$("calcite-icon",{class:Q.attachmentsViewIcon,icon:K.upload,scale:"l"}),this._renderAttachmentsViewFileLabelNode(),this._renderAttachmentsViewFileMessageNode(),$("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},$("fieldset",null,this._renderAttachmentsViewFileNameNode(),$("input",{afterCreate:N,afterRemoved:H,afterUpdate:N,bind:this,"data-node-ref":"_attachmentsInput",files:e.candidates,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),this._renderAttachmentsViewFileSelectNode(),this._renderAttachmentsViewFileSaveNode(),this._renderAttachmentsViewFileCancelNode())))))]}_renderAttachmentsViewFileLabelNode(){if("replace"===this.attachmentsViewOptions.fileMode)return $("span",{class:Q.attachmentsViewDropAreaLabel,key:"replace-file-node"},this.messages.replaceFile)}_renderAttachmentsViewFileMessageNode(){const e=this.attachmentsViewOptions;if(e.hasCandidates)return;const{messages:t}=this,i=this.supportsAddAttachments?null==e.objectId?t.noFeature:t.dragAndDropToUpload:t.editingRestricted;return $("span",{class:Q.attachmentsViewDropAreaMessage,key:"message-node"},i)}_renderAttachmentsViewFileNameNode(){const e=this.attachmentsViewOptions.candidates,t=Array.from(e??[]).at(-1);if(t)return $("span",{class:Q.attachmentsViewDropAreaMessage,key:"filename-node"},t.name)}_renderAttachmentsViewFileSelectNode(){if(this.supportsAddAttachments)return $("calcite-button",{appearance:"outline-fill",disabled:this.isSyncingAttachments,iconStart:K.folderOpen,key:"select-node",onclick:()=>{this._resetAttachmentsInput(),this._attachmentsInput?.click()}},this.messages.selectFile)}_renderAttachmentsViewFileSaveNode(){const{isSyncingAttachments:e,messages:t}=this,{attachmentInfo:i,hasCandidates:s}=this.attachmentsViewOptions;if(this.supportsAddAttachments&&s)return $("calcite-button",{appearance:"solid",disabled:e,iconStart:K.save,key:"save-node",loading:e,onclick:()=>{this.saveAttachmentsViewForm()}},i?t.updateAttachment:t.addAttachment)}_renderAttachmentsViewFileCancelNode(){const{hasAttachments:e,hasCandidates:t}=this.attachmentsViewOptions;if(e||t)return $("calcite-button",{appearance:"transparent",bind:this,disabled:this.isSyncingAttachments,key:"cancel-node",onclick:()=>{this._resetAttachmentsInput(),this.attachmentsViewOptions.cancel()}},this.messagesCommon.cancel)}_renderAttachmentsViewDetails(){const{attachmentInfo:e}=this.attachmentsViewOptions;if(e)return[$("div",{class:Q.attachmentsView,key:"attachments-view"},this._renderAttachmentsViewInformation(),$("div",{class:Q.attachmentsViewContent,key:"attachments-view-content"},$("div",{class:Q.attachmentsViewDetails},this._renderAttachmentsViewDetailsPreview(e))))]}_renderAttachmentsViewDetailsPreview(e){const t=[this._renderAttachmentsViewDetailsImage(e)];if(M(e.contentType)){const i=this.messages.maximize;t.push($("calcite-action",{icon:K.expand,label:i,onclick:t=>{t.preventDefault(),this.attachmentsViewOptions.dialogId=e.id},text:i,textEnabled:!0,title:i}))}return t}_renderAttachmentsViewDetailsImage(e){const{contentType:t,name:i,size:s,url:n}=e,{messages:l}=this;return M(t)?$("img",{afterCreate:()=>this._attachmentsDialogPreviewLoading=!0,alt:i,key:`thumbnail-image-${i}`,onerror:()=>this._attachmentsDialogPreviewLoading=!1,onload:()=>this._attachmentsDialogPreviewLoading=!1,src:`${n}${n?.includes("?")?"&":"?"}s=${s}`,title:i}):[$("calcite-icon",{icon:V(t),key:`thumbnail-icon-${i}`,scale:"l",textLabel:i,title:i}),l.noPreviewAvailable]}_renderAttachmentsViewInformation(){const{attachmentsViewOptions:e,messages:t,messagesUnits:i}=this,{attachmentInfo:s,objectId:n}=e;if(s&&null!=n)return $("div",{class:Q.attachmentsViewInformation,key:"information"},this._renderAttachmentViewInformationButtons(s,n),$("span",{class:Q.attachmentsViewInformationLabel,key:"file-label"},t.fileName),$("span",{class:Q.attachmentsViewInformationData,key:"file-value"},s.name),$("span",{class:Q.attachmentsViewInformationLabel,key:"type-label"},t.attachmentType),$("span",{class:Q.attachmentsViewInformationData,key:"type-value"},this._getLabelForAttachmentType(s)),this._renderAttachmentKeywordDetails(s),$("span",{class:Q.attachmentsViewInformationLabel,key:"size-label"},t.size),$("span",{class:Q.attachmentsViewInformationData,key:"size-span"},h(i,s.size??0)))}_renderAttachmentViewInformationButtons(e,t){const{attachmentsViewOptions:i,messages:s,messagesCommon:n}=this,l="details"!==i.effectiveMode,o=e.id,a=[$("calcite-button",{appearance:"outline",disabled:l,key:"download-button",onclick:e=>{e.preventDefault(),this.downloadAttachmentById(t,o)},width:"full"},s.download)];return this.supportsUpdateAttachments&&a.push($("calcite-button",{appearance:"outline",disabled:l,key:"replace-button",onclick:()=>{i.mode="file",i.attachmentId=o},width:"full"},s.replace)),this.supportsDeleteAttachments&&a.push($("calcite-button",{appearance:"outline",disabled:l,key:"delete-button",onclick:()=>{this.deleteAttachments(t,[o],!0)},width:"full"},n.delete)),a}_renderAttachmentKeywordDetails({keywords:e}){if(e&&""!==e)return[$("span",{class:Q.attachmentsViewInformationLabel,key:"keyword-label"},this.messages.keyword),$("span",{class:Q.attachmentsViewInformationData,key:"keyword-value"},e)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:s}=this,{attachmentInfos:n,objectId:l}=e;return $("calcite-list",{afterCreate:N,afterRemoved:H,afterUpdate:N,bind:this,class:Q.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${l}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:this.supportsDeleteAttachments?"multiple":"none",onCalciteListChange:()=>this.scheduleRender()},...n?.map(t=>{const{id:n,name:o,size:a}=t,r=h(s,a??0);return $("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${n}`,label:o,value:n},this._renderAttachmentsViewListPreview(t),$("span",{class:Q.attachmentsViewListFileSize,slot:"actions-end",title:r},r),$("calcite-action",{icon:K.downloadTo,key:"download",label:o,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(l??-1,n)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),$("calcite-action",{icon:K.chevronRight,iconFlipRtl:!0,key:"details",label:o,onclick:()=>{e.mode="details",e.attachmentId=n},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}))}))}_renderAttachmentsViewListPreview(e){return $("div",{class:Q.attachmentsViewListThumbnail,slot:"content-start"},$("span",null,this._renderAttachmentsViewListImage(e)))}_renderAttachmentsViewListImage(e,t=64){const{contentType:i,name:s,size:n,url:l}=e,o=`${l}${l?.includes("?")?"&":"?"}w=${t}&s=${n}`;return this.supportsResizeAttachments&&M(i)?$("img",{alt:s,key:`thumbnail-image-${s}`,src:o,title:s}):$("calcite-icon",{icon:V(i),key:`thumbnail-icon-${s}`,scale:"l",textLabel:s,title:s})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&(this.attachmentsViewOptions.mode="file",this.attachmentsViewOptions.candidates=e.dataTransfer?.files)}_resetAttachmentsInput(){this._attachmentsInput&&(this._attachmentsInput.value="")}_getLabelForAttachmentType({contentType:e}){const t=this.messages;return e.startsWith("image/")?t.attachmentTypes.image:e.startsWith("audio/")?t.attachmentTypes.audio:e.startsWith("video/")?t.attachmentTypes.video:e.startsWith("text/")||e.startsWith("application/")||e.startsWith("model/")?t.attachmentTypes.document:t.attachmentTypes.unknown}_renderNavigationBar(){const{effectiveTable:e,messages:i,messagesCommon:s,navigationScale:n,relatedTable:l,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:a,attachmentsViewOptions:r,layer:c,supportsAddAttachments:d,supportsDeleteAttachments:h}=e;if(!c)return;const{attachmentInfos:m,objectId:p}=r,u=null!=p,g=m.length,w=a?.selectedItems?.length??0,b=`${c.objectIdField}: ${p}`,v=t(i.selectedCount,{count:w}),y=t(i.attachmentsCount,{count:g}),f=u?$("calcite-action",{bind:this,icon:K.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(p),scale:n,text:b,textEnabled:!0,title:b}):void 0,_=u?$("calcite-action",{icon:K.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:y,onclick:()=>{g>0&&(r.mode="list")},scale:n,text:y,textEnabled:!0,title:y}):void 0,M=u?$("calcite-chip",{closable:!0,closed:0===w,key:"navigation-chip",kind:"inverse",label:v,scale:"s",selected:!0,title:v,value:"selected",onCalciteChipClose:()=>a?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,V=l?$("calcite-label",{layout:"inline",scale:n},i.showAllTables,$("calcite-switch",{checked:this.allRelatedTablesVisible,scale:n,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,C=u&&"list"===r.effectiveMode&&null!=p&&w&&h?$("calcite-action",{icon:K.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(p,a?.selectedItems?.map(e=>e.value)??[],!0)},scale:n,text:s.delete,textEnabled:!0,title:t(i.deleteAttachmentCount,{count:w})}):void 0,E=u&&"list"===r.effectiveMode&&d?$("calcite-action",{bind:this,icon:K.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{r.objectId=p,r.attachmentId=null,r.mode="file"},scale:n,text:i.addAttachment,textEnabled:!0,title:i.addAttachment}):void 0;return $("div",{class:Q.tableNavigation,key:"table-nav"},$("calcite-action",{icon:K.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>this._onTableViewChange(this._resetNestedViews),scale:n,text:this.layer?.title??"",textEnabled:!1,title:l?i.exitRelatedRecords:i.exitAttachments}),o.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),f,_,$("div",null,M,V,C,E))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return $("calcite-action",{icon:K.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>{(t!==this.relatedTables.length-1||this._attachmentsViewIsVisible)&&this._onTableViewChange(()=>this._onRelatedNavigationItemClick(t))},scale:this.navigationScale,text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([m()],q.prototype,"_attachmentsDialogPreviewLoading",void 0),e([m()],q.prototype,"_attachmentsInput",void 0),e([m()],q.prototype,"_attachmentsViewIsVisible",null),e([m()],q.prototype,"_columnVisibilityActions",void 0),e([m()],q.prototype,"_columnVisibilityActionDisabled",null),e([m()],q.prototype,"_dialogIsOpen",null),e([m()],q.prototype,"_effectiveDescription",null),e([m()],q.prototype,"_effectiveLayers",null),e([m()],q.prototype,"_effectiveTitle",null),e([m()],q.prototype,"_effectiveVisibleElements",null),e([m()],q.prototype,"_filteredTables",null),e([m()],q.prototype,"_hasAttachmentsViewError",null),e([m()],q.prototype,"_hasCustomMenuItems",null),e([m()],q.prototype,"_hasDefaultMenuItems",null),e([m()],q.prototype,"_shouldShowGrid",null),e([m()],q.prototype,"_shouldShowMenu",null),e([m()],q.prototype,"_showClearSelectionAction",null),e([m()],q.prototype,"_showColumnVisibilityAction",null),e([m()],q.prototype,"_showDeleteSelectionAction",null),e([m()],q.prototype,"_showExportSelectionToCSVAction",null),e([m()],q.prototype,"_showLayerDropdown",null),e([m()],q.prototype,"_shouldShowNavigationBar",null),e([m()],q.prototype,"_showRefreshDataAction",null),e([m()],q.prototype,"_showSelectedRecordsShowSelectedAction",null),e([m()],q.prototype,"_showSelectedRecordsShowAllAction",null),e([m()],q.prototype,"_showZoomToSelectionAction",null),e([m()],q.prototype,"_viewLayers",null),e([m()],q.prototype,"attachmentsList",void 0),e([m({readOnly:!0})],q.prototype,"grid",null),e([m()],q.prototype,"actionColumn",null),e([m()],q.prototype,"actionColumnConfig",null),e([m({readOnly:!0})],q.prototype,"activeFilters",null),e([m({readOnly:!0})],q.prototype,"activeSortOrders",null),e([m()],q.prototype,"allColumns",null),e([m({readOnly:!0})],q.prototype,"allRelatedTablesVisible",null),e([m()],q.prototype,"allVisibleColumns",null),e([m()],q.prototype,"attachmentsColumns",null),e([m()],q.prototype,"attachmentsEnabled",null),e([m()],q.prototype,"attachmentsViewOptions",null),e([m({type:y})],q.prototype,"attributeTableTemplate",null),e([m()],q.prototype,"autoRefreshEnabled",null),e([m()],q.prototype,"autoSaveEnabled",null),e([m()],q.prototype,"canAddRelatedFeature",null),e([m()],q.prototype,"clearPrompt",null),e([m()],q.prototype,"columnPerformanceModeEnabled",null),e([m()],q.prototype,"columnReorderingEnabled",null),e([m({readOnly:!0})],q.prototype,"columns",null),e([m()],q.prototype,"definitionExpression",null),e([m()],q.prototype,"description",void 0),e([m()],q.prototype,"disabled",void 0),e([m()],q.prototype,"editingEnabled",null),e([m()],q.prototype,"effectiveSelectionManager",null),e([m()],q.prototype,"effectiveSize",null),e([m()],q.prototype,"effectiveTable",null),e([m()],q.prototype,"fieldColumns",null),e([m({types:u})],q.prototype,"filterGeometry",null),e([m()],q.prototype,"filterBySelectionEnabled",null),e([m()],q.prototype,"filterByViewExtent",null),e([m()],q.prototype,"groupColumns",null),e([m()],q.prototype,"hasContingentValues",null),e([m()],q.prototype,"hasInvalidPendingEdits",null),e([m()],q.prototype,"hasPendingEdits",null),e([m()],q.prototype,"hiddenFields",null),e([m()],q.prototype,"highlightEnabled",null),e([m()],q.prototype,"highlightIds",null),e([m()],q.prototype,"icon",null),e([m()],q.prototype,"initialSize",null),e([m()],q.prototype,"isQueryingOrSyncing",null),e([m()],q.prototype,"isSyncing",null),e([m()],q.prototype,"isSyncingAttachments",null),e([m()],q.prototype,"label",null),e([m()],q.prototype,"layer",null),e([m()],q.prototype,"layers",null),e([m()],q.prototype,"layerView",null),e([m()],q.prototype,"maxSize",null),e([m(),j("esri/widgets/FeatureTable/t9n/FeatureTable")],q.prototype,"messages",null),e([m(),j("esri/t9n/common")],q.prototype,"messagesCommon",null),e([m(),j("esri/widgets/Editor/t9n/Editor")],q.prototype,"messagesEditor",void 0),e([m(),j("esri/core/t9n/Units")],q.prototype,"messagesUnits",null),e([m(),j("esri/widgets/support/t9n/uriUtils")],q.prototype,"messagesURIUtils",null),e([m()],q.prototype,"menuConfig",null),e([m()],q.prototype,"multipleSelectionEnabled",null),e([m()],q.prototype,"multipleSelectionEnabledOverride",null),e([m()],q.prototype,"multiSortEnabled",null),e([m()],q.prototype,"multipleSortPriority",null),e([m()],q.prototype,"navigationScale",void 0),e([m()],q.prototype,"noDataMessage",null),e([m()],q.prototype,"objectIds",null),e([m()],q.prototype,"outFields",null),e([m()],q.prototype,"pageCount",null),e([m()],q.prototype,"pageIndex",null),e([m()],q.prototype,"pageSize",null),e([m()],q.prototype,"paginationEnabled",null),e([m()],q.prototype,"pendingEditsCount",null),e([m()],q.prototype,"prompt",null),e([m()],q.prototype,"relatedRecordsEnabled",null),e([m()],q.prototype,"relatedTable",null),e([m()],q.prototype,"relatedTableHasContingentValues",null),e([m()],q.prototype,"relatedTableHasInvalidPendingEdits",null),e([m()],q.prototype,"relatedTableHasPendingEdits",null),e([m()],q.prototype,"relatedTables",null),e([m()],q.prototype,"relationship",null),e([m()],q.prototype,"relationshipColumnConfigs",null),e([m()],q.prototype,"relationshipColumns",null),e([m()],q.prototype,"relationshipConfig",null),e([m()],q.prototype,"relationshipInfos",null),e([m()],q.prototype,"returnGeometryEnabled",null),e([m()],q.prototype,"returnMEnabled",null),e([m()],q.prototype,"returnZEnabled",null),e([m()],q.prototype,"rowHighlightIds",null),e([m()],q.prototype,"selectionManager",null),e([m()],q.prototype,"selectionSource",null),e([m()],q.prototype,"showAllRelatedTables",null),e([m()],q.prototype,"showPrompt",null),e([m()],q.prototype,"showRelatedTableCallback",null),e([m()],q.prototype,"size",null),e([m({readOnly:!0})],q.prototype,"state",null),e([m()],q.prototype,"supportsAddAttachments",null),e([m()],q.prototype,"supportsAttachments",null),e([m()],q.prototype,"supportsDeleteAttachments",null),e([m()],q.prototype,"supportsResizeAttachments",null),e([m()],q.prototype,"supportsUpdateAttachments",null),e([m()],q.prototype,"syncTemplateOnChangesEnabled",null),e([m()],q.prototype,"syncViewSelection",null),e([m()],q.prototype,"syncWithViewSelectionManager",null),e([m({constructOnly:!0})],q.prototype,"tableController",null),e([m({constructOnly:!0})],q.prototype,"tableParent",null),e([m({type:D})],q.prototype,"tableTemplate",null),e([m()],q.prototype,"tableTemplateOverride",null),e([m()],q.prototype,"title",void 0),e([m({type:f})],q.prototype,"timeExtent",null),e([m()],q.prototype,"timeZone",null),e([m()],q.prototype,"view",null),e([m({type:S}),z(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],q.prototype,"viewModel",void 0),e([m()],q.prototype,"visibleColumns",null),e([m({type:T,nonNullable:!0})],q.prototype,"visibleElements",void 0),e([m({type:T})],q.prototype,"visibleElementsOverride",null),q=B=e([p("esri.widgets.FeatureTable")],q);const J=q;export{J as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as i}from"../core/arrayUtils.js";import{deprecateWidget as s}from"../core/deprecate.js";import n from"../core/Logger.js";import{watch as l,sync as o,syncAndInitial as a,initial as r,on as c}from"../core/reactiveUtils.js";import{renderingSanitizer as d}from"../core/sanitizerUtils.js";import{formatFileSize as h}from"../core/unitFormatUtils.js";import{property as m,subclass as p}from"../core/accessorSupport/decorators.js";import{geometryTypes as u}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as g}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as w,isMapImageLayer as b,isSubtypeGroupLayer as v}from"../layers/support/layerUtils.js";import y from"../tables/AttributeTableTemplate.js";import f from"../time/TimeExtent.js";import _ from"./Widget.js";import{isSupportedImage as M,getCalciteIconForAttachment as V}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as C,Prompt as A}from"./Editor/components/Prompt.js";import E from"./FeatureTable/ColumnMenuVisibleElements.js";import S from"./FeatureTable/FeatureTableViewModel.js";import T from"./FeatureTable/VisibleElements.js";import{isGroupColumn as I,isFieldColumn as D}from"./FeatureTable/support/columnUtils.js";import P from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as R,isIFeatureTableSupportedLayer as k,isIFeatureTableSupportedLayerWithAttachments as x,getRelationshipIdsToShow as L}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as O}from"./support/componentsUtils.js";import{globalCss as F}from"./support/globalCss.js";import{getIconForLayer as j}from"./support/iconUtils.js";import{messageBundle as z,vmEvent as $,tsx as U,tsxFragment as N}from"./support/widget.js";import{storeNode as H,discardNode as B}from"./support/widgetUtils.js";var Z;const G="esri-feature-table",W=`${G}__dialog`,Q=`${G}__attachments-view`,K={base:G,content:`${G}__content`,menuPopover:`${G}__menu-popover`,layerDropdownMenu:`${G}__layer-switcher-menu`,tableContainer:`${G}__table-container`,tableContainerWithAttachments:`${G}__table-container--attachments`,tableNavigation:`${G}__table-navigation`,attachmentsView:Q,attachmentsViewContent:`${Q}__content`,attachmentsViewDetails:`${Q}__details`,attachmentsViewDropArea:`${Q}__drop-area`,attachmentsViewDropAreaLabel:`${Q}__drop-area__label`,attachmentsViewDropAreaMessage:`${Q}__drop-area__message`,attachmentsViewIcon:`${Q}__icon`,attachmentsViewInformation:`${Q}__information`,attachmentsViewInformationData:`${Q}__information__data`,attachmentsViewInformationLabel:`${Q}__information__label`,attachmentsViewList:`${Q}__list`,attachmentsViewListFileSize:`${Q}__list__filesize`,attachmentsViewListThumbnail:`${Q}__list__thumbnail`,expanded:`${G}__expanded`,collapsed:`${G}__collapsed`,dialog:`${W}`,dialogContent:`${W}__content`,dialogHeader:`${W}__header`,footerMessage:`${G}__footer__message`,footerIconDanger:`${G}__footer__icon--danger`,footerIconSuccess:`${G}__footer__icon--success`},q={checkCircle:"check-circle",chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",expand:"expand",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",reset:"reset",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",table:"table",upload:"upload",zoomToSelection:"zoom-to-object"};let J=Z=class extends _{constructor(e,t){super(e,t),this._attachmentsDialogPreviewLoading=!1,this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.messagesEditor=null,this.navigationScale="m",this.title=null,this.viewModel=new S,this.visibleElements=new T,this.announceDeprecation=()=>{s(n.getLogger(this),"Feature Table","arcgis-feature-table",{version:"5.0"})},this._showDeleteSelectionPrompt=this._showDeleteSelectionPrompt.bind(this),this._showDiscardEditsPrompt=this._showDiscardEditsPrompt.bind(this),this._resetNestedViews=this._resetNestedViews.bind(this)}initialize(){this.addHandles([l(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),l(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},o),l(()=>[this.topLayerDisabled,this.columns],()=>this.columns.forEach(e=>e.topLayerDisabled=this.topLayerDisabled),a),l(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},r),c(()=>this.viewModel,"show-related-table",e=>this._onShowRelatedTable(e)),l(()=>this.editingEnabled,()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)})])}loadDependencies(){return Promise.all([O({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),C(),R()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _attachmentsViewIsVisible(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some(e=>null!=e.attachmentsViewOptions.objectId))}get _columnVisibilityActionDisabled(){const e=this.effectiveTable;return e.menuConfig?.disabled??0===e.columns.length}get _dialogIsOpen(){return!!this.attachmentsViewOptions.dialogInfo}get _effectiveDescription(){const{description:e}=this;return null!=e?d.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(k):[],s=i.length?i:[...this._viewLayers];return e&&!s.includes(e)&&s.push(e),s}get _effectiveTitle(){const{layer:e,messages:i,state:s,highlightIds:n,title:l,size:o}=this;if(l)return d.sanitize("function"==typeof l?l():l);if(!i)return"";if(!e)return i.noLayer;switch(s){case"disabled":return i.errorLayer;case"ready":case"loading":return i.loading;case"error":return i.errorData}return t(i.header,{title:d.sanitize(e.title),count:o,selected:n.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._attachmentsViewIsVisible?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._attachmentsViewIsVisible}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showColumnVisibilityAction(){const{columnVisibilityMenu:e,header:t,menu:i,menuItems:s}=this._effectiveVisibleElements;return!(!(t&&i&&e&&!1!==s?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._attachmentsViewIsVisible)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._attachmentsViewIsVisible;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._attachmentsViewIsVisible)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!k(e)||v(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},s=e=>{g(e)||"catalog-footprint"===e.type||(w(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):b(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):v(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(s),e.allTables.forEach(s),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allColumnsVisible(){return this.viewModel.allColumnsVisible}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get canAddRelatedFeature(){return this.viewModel.canAddRelatedFeature}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get filterByViewExtent(){return this.viewModel.filterByViewExtent}set filterByViewExtent(e){this.viewModel.filterByViewExtent=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return q.table}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multipleSelectionEnabledOverride(){return this.viewModel.multipleSelectionEnabledOverride}set multipleSelectionEnabledOverride(e){this.viewModel.multipleSelectionEnabledOverride=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get pendingEditsCount(){return this.viewModel.pendingEditsCount}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTableHasContingentValues(){return this.viewModel.relatedTableHasContingentValues}get relatedTableHasInvalidPendingEdits(){return this.viewModel.relatedTableHasInvalidPendingEdits}get relatedTableHasPendingEdits(){return this.viewModel.relatedTableHasPendingEdits}get relatedTables(){return this.viewModel.relatedTables}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get syncViewSelection(){return this.viewModel.syncViewSelection}set syncViewSelection(e){this.viewModel.syncViewSelection=e}get syncWithViewSelectionManager(){return this.syncViewSelection}set syncWithViewSelectionManager(e){this.syncViewSelection=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:s}=this,{columnDescriptions:n,columnMenus:l,tooltips:o}=s,a=null!=e.objectId;if(t)return new T({columnDescriptions:n,columnMenus:l,tooltips:o,close:s.close,header:s.header,layerDropdown:s.layerDropdown,layerDropdownIcons:s.layerDropdownIcons,menu:s.menu,menuItems:s.menuItems,progress:s.progress,selectionColumn:!1,columnMenuItems:new E({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&s.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new T({columnDescriptions:n,columnMenus:l,tooltips:o,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,pendingEditsFooter:!1,progress:!1,columnMenuItems:new E({sortAscending:c,sortDescending:c})})}return a?new T({columnDescriptions:n,columnMenus:l,tooltips:o,close:s.close,header:s.header,layerDropdown:s.layerDropdown,layerDropdownIcons:s.layerDropdownIcons,menu:s.menu,menuItems:s.menuItems,progress:s.progress,selectionColumn:!1,columnMenuItems:new E({sortAscending:!1,sortDescending:!1})}):null}addPendingEdits(e){this.viewModel.addPendingEdits(e)}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}async deleteSelection(e){this.highlightIds.length&&(e?this._showDeleteSelectionPrompt():await this.viewModel.deleteSelection())}async discardPendingEdits(e,t){return t?this._showDiscardEditsPrompt(e):this.viewModel.discardPendingEdits(e)}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}async exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}findColumn(e){return this.viewModel.findColumn(e)}getFeatureStoreItemByObjectId(e){return this.viewModel.getFeatureStoreItemByObjectId(e)}goToPage(e){this.viewModel.goToPage(e)}hideAllColumns(){this.viewModel.hideAllColumns()}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}async zoomToSelection(){return this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:s}=this;return U("div",{bind:this,class:this.classes(K.base,F.widget)},U("calcite-panel",{bind:this,class:K.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===s&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:"table-content",loading:"loading"===s,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?U("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt(),this._renderDialog())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(K.tableContainer);if(t.length){const s=this.classes(K.base,this.allRelatedTablesVisible?K.expanded:K.collapsed,this._attachmentsViewIsVisible?K.tableContainerWithAttachments:void 0);return U("div",{class:i},U("calcite-panel",{overlayPositioning:"fixed"},U("div",null,[this._shouldShowGrid?U("div",{class:s},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return U("div",{class:s,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?U("div",{class:i},U("calcite-panel",{overlayPositioning:"fixed"},U("div",null,[U("div",{class:this.classes(K.base,K.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[U("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return U("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>{this._attachmentsDialogPreviewLoading=!1,this.goToPage(e.currentTarget.startItem-1)}})}_renderError(){const{messages:e}=this;return U("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:q.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",topLayerDisabled:this.topLayerDisabled,onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},U("span",{slot:"message"},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this._effectiveVisibleElements.pendingEditsFooter)return;const{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:i,messagesCommon:s}=this,n=e||t,l=this.hasContingentValues,o=[U("calcite-button",{appearance:"outline",disabled:t,iconStart:q.reset,key:"footer-reset-button",onclick:()=>{this.discardPendingEdits()},slot:"footer-end",width:"auto"},s.reset),U("calcite-button",{disabled:n,iconStart:q.save,key:"footer-save-button",loading:this.isSyncing,onclick:()=>{this.savePendingEdits()},slot:"footer-end",width:"auto"},s.save)];if(l){const t=e?i.contingentValues.hasInvalidValues:i.contingentValues.hasValidValues,s=e?q.exclamationMarkTriangle:q.checkCircle,n=e?K.footerIconDanger:K.footerIconSuccess;o.push(U("div",{class:K.footerMessage,key:"footer-message",slot:"footer-start"},U("calcite-icon",{class:n,icon:s,scale:"s",slot:"footer-start"}),t))}return o}_renderPrompt(){return this.prompt?U(A,{...this.prompt,headingLevel:2}):void 0}_showDeleteSelectionPrompt(){const{messages:e,messagesCommon:i}=this,s=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:s,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:i.delete,action:async()=>{try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,i){const{messages:s,messagesCommon:n}=this,l=t(s.deleteAttachmentCount,{count:i.length});this.showPrompt({title:l,message:s.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:n.delete,action:async()=>{try{await this.deleteAttachments(e,i,!1)}finally{this.clearPrompt()}}},secondary:{label:n.cancel,action:()=>this.clearPrompt()}}})}async _showDiscardEditsPrompt(e){const t=Promise.withResolvers(),{messagesEditor:i}=this;return this.showPrompt({title:i.cancelEditTitle,message:i.cancelEditWarningMessage,context:"danger",actions:{primary:{label:i.discardEdits,action:async()=>{try{await this.discardPendingEdits(e)}finally{t.resolve(!0)}}},secondary:{label:i.continueEditing,action:()=>t.resolve(!1)}}}),t.promise.finally(()=>this.clearPrompt())}_onTableViewChange(e){this.hasPendingEdits?this._showDiscardEditsPrompt().then(t=>t&&e()):e()}_resetNestedViews(){this.relatedTable&&this.drainRelatedTables(),this.effectiveTable.attachmentsViewOptions.objectId=null}_renderDialog(){const{attachmentsViewOptions:e,messages:t}=this,{objectId:i}=e;return U("calcite-dialog",{class:K.dialog,description:this.viewModel.getFeatureTitleSync(i),heading:t.attachments,modal:!0,open:this._dialogIsOpen,placement:"cover",width:"l",onCalciteDialogClose:()=>this._onDialogClose()},this._renderDialogContent())}_renderDialogContent(){const e=this.attachmentsViewOptions.dialogInfo;if(e)return this._renderAttachmentsDialogContent(e)}_renderAttachmentsDialogContent(e){const{attachmentsViewOptions:t,messages:i}=this,{attachmentInfos:s}=t,n=s.indexOf(e);return U(N,null,U("div",{class:K.dialogHeader,key:"header",slot:"content-top"},U("span",null,e.name),U("calcite-button",{appearance:"outline",onclick:()=>{t.attachmentId=e.id,t.dialogId=null}},i.viewDetails)),U("calcite-progress",{type:this._attachmentsDialogPreviewLoading?"indeterminate":"determinate"}),U("div",{class:K.dialogContent,key:"content"},this._renderAttachmentsViewDetailsImage(e)),U("calcite-pagination",{pageSize:1,slot:"footer",startItem:n+1,totalItems:s.length,onCalcitePaginationChange:e=>{const i=e.currentTarget.startItem-1,n=s[i]?.id;t.dialogId=n}}))}_onDialogClose(){const e=this.attachmentsViewOptions;null!=e.dialogId&&(e.dialogId=null),this._attachmentsDialogPreviewLoading=!1}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:s,text:n,clickFunction:l}=e;if(!i)return U("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:s??void 0,key:n,onclick:()=>l(),slot:"header-menu-actions",text:n,textEnabled:!0,title:n})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:q.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:q.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:q.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:q.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:q.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:q.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:q.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(i).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,label:s,clickFunction:n})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:s,disabled:e,clickFunction:e=>n(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnVisibilityAction)return[];const{_columnVisibilityActions:e,id:t}=this,i=this.messages.menuText.columnVisibility;return U("calcite-action",{afterCreate:i=>e.set(t,i),afterRemoved:()=>e.delete(t),bind:this,disabled:this._columnVisibilityActionDisabled,icon:q.showColumn,id:`${t}__toggle-columns-action`,slot:"header-actions-end",text:i},this._effectiveVisibleElements.tooltips?U("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",referenceElement:e.get(t),topLayerDisabled:this.topLayerDisabled},i):null)}_renderColumnVisibilityPopover(){if(!this._showColumnVisibilityAction||this._columnVisibilityActionDisabled)return;const e=this.visibleElements.columnVisibilityMenuItems.header,t=this.messages.menuText.columnVisibility;return U("calcite-popover",{autoClose:!0,class:K.menuPopover,closable:e,heading:e?t:void 0,label:t,overlayPositioning:"fixed",referenceElement:this._columnVisibilityActions.get(this.id),topLayerDisabled:this.topLayerDisabled},this._renderColumnVisibilityList())}_renderColumnVisibilityList(){const{effectiveTable:e,messages:{menuText:t}}=this;if(0!==e.columns.length)return U("calcite-list",{displayMode:"nested",filterEnabled:this.visibleElements.columnVisibilityMenuItems.filter,filterPlaceholder:t.searchFields,label:t.fieldVisibility,selectionMode:"multiple"},this._renderColumnToggleAll(),e.columns.toArray().map(t=>{const i=I(t)?t.columns?.map(t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0})):void 0;return this._renderColumnListItem({column:t,table:e,items:i})}))}_renderColumnToggleAll(){if(!this.visibleElements.columnVisibilityMenuItems.toggleAll)return;const{effectiveTable:e,messages:{menuText:t}}=this;return U("calcite-button",{appearance:"transparent",onclick:()=>this._toggleAllColumns(),width:"full"},e.allColumnsVisible?t.deselectAll:t.selectAll)}_renderColumnListItem(e){const{column:t,table:i,items:s,ignoreSelect:n}=e,{effectiveLabel:l,fieldName:o,hidden:a}=t;return U("calcite-list-item",{expanded:!(!s?.length||a)||void 0,key:`toggle-columns__item-${o}`,label:l,metadata:{description:t.effectiveDescription,type:D(t)?t.field.type:void 0},selected:!a,value:o,onCalciteListItemSelect:e=>{n&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},s)}_renderLayerDropdown(){const e=this.messages.selectALayer;return U("div",{class:K.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},U("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start",topLayerDisabled:this.topLayerDisabled},U("calcite-action",{icon:q.layers,slot:"trigger",text:e,title:e}),U("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return U("calcite-dropdown-item",{iconStart:i?j(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>this._onTableViewChange(()=>this.layer=e)},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||this.hasPendingEdits||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{autoRefreshEnabled:t,autoSaveEnabled:i,editingEnabled:s,effectiveTable:n,multipleSelectionEnabled:l,paginationEnabled:o,pageSize:a,view:r,viewModel:c}=this,{layer:d,objectId:h,relatedLayer:m,relationshipId:p}=e;await d.load();const u=this.attachmentsEnabled&&x(d),g=new Z({layer:d,autoRefreshEnabled:t,autoSaveEnabled:i,attachmentsEnabled:u,editingEnabled:s,multipleSelectionEnabled:l,paginationEnabled:o,pageSize:a,relatedRecordsEnabled:!0,relationshipConfig:{objectId:h,relatedLayer:m,relationshipId:p},relationshipColumnConfigs:L(d,p),tableController:this,tableParent:n,view:r,showRelatedTableCallback:e=>c.emit("show-related-table",e)});this.relatedTables.add(g),this.scheduleRender()}_renderAttachmentsView(){switch(this.attachmentsViewOptions.effectiveMode){case"list":return this._renderAttachmentsViewList();case"details":return this._renderAttachmentsViewDetails();case"file":return this._renderAttachmentsViewFile()}}_renderAttachmentsViewFile(){const e=this.attachmentsViewOptions,{objectId:t}=e;if(null!=t)return[U("div",{class:K.attachmentsView,key:"attachments-view"},this._renderAttachmentsViewInformation(),U("div",{class:K.attachmentsViewContent,key:"attachments-view-content"},U("div",{bind:this,class:K.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},U("calcite-icon",{class:K.attachmentsViewIcon,icon:q.upload,scale:"l"}),this._renderAttachmentsViewFileLabelNode(),this._renderAttachmentsViewFileMessageNode(),U("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},U("fieldset",null,this._renderAttachmentsViewFileNameNode(),U("input",{afterCreate:H,afterRemoved:B,afterUpdate:H,bind:this,"data-node-ref":"_attachmentsInput",files:e.candidates,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),this._renderAttachmentsViewFileSelectNode(),this._renderAttachmentsViewFileSaveNode(),this._renderAttachmentsViewFileCancelNode())))))]}_renderAttachmentsViewFileLabelNode(){if("replace"===this.attachmentsViewOptions.fileMode)return U("span",{class:K.attachmentsViewDropAreaLabel,key:"replace-file-node"},this.messages.replaceFile)}_renderAttachmentsViewFileMessageNode(){const e=this.attachmentsViewOptions;if(e.hasCandidates)return;const{messages:t}=this,i=this.supportsAddAttachments?null==e.objectId?t.noFeature:t.dragAndDropToUpload:t.editingRestricted;return U("span",{class:K.attachmentsViewDropAreaMessage,key:"message-node"},i)}_renderAttachmentsViewFileNameNode(){const e=this.attachmentsViewOptions.candidates,t=Array.from(e??[]).at(-1);if(t)return U("span",{class:K.attachmentsViewDropAreaMessage,key:"filename-node"},t.name)}_renderAttachmentsViewFileSelectNode(){if(this.supportsAddAttachments)return U("calcite-button",{appearance:"outline-fill",disabled:this.isSyncingAttachments,iconStart:q.folderOpen,key:"select-node",onclick:()=>{this._resetAttachmentsInput(),this._attachmentsInput?.click()}},this.messages.selectFile)}_renderAttachmentsViewFileSaveNode(){const{isSyncingAttachments:e,messages:t}=this,{attachmentInfo:i,hasCandidates:s}=this.attachmentsViewOptions;if(this.supportsAddAttachments&&s)return U("calcite-button",{appearance:"solid",disabled:e,iconStart:q.save,key:"save-node",loading:e,onclick:()=>{this.saveAttachmentsViewForm()}},i?t.updateAttachment:t.addAttachment)}_renderAttachmentsViewFileCancelNode(){const{hasAttachments:e,hasCandidates:t}=this.attachmentsViewOptions;if(e||t)return U("calcite-button",{appearance:"transparent",bind:this,disabled:this.isSyncingAttachments,key:"cancel-node",onclick:()=>{this._resetAttachmentsInput(),this.attachmentsViewOptions.cancel()}},this.messagesCommon.cancel)}_renderAttachmentsViewDetails(){const{attachmentInfo:e}=this.attachmentsViewOptions;if(e)return[U("div",{class:K.attachmentsView,key:"attachments-view"},this._renderAttachmentsViewInformation(),U("div",{class:K.attachmentsViewContent,key:"attachments-view-content"},U("div",{class:K.attachmentsViewDetails},this._renderAttachmentsViewDetailsPreview(e))))]}_renderAttachmentsViewDetailsPreview(e){const t=[this._renderAttachmentsViewDetailsImage(e)];if(M(e.contentType)){const i=this.messages.maximize;t.push(U("calcite-action",{icon:q.expand,label:i,onclick:t=>{t.preventDefault(),this.attachmentsViewOptions.dialogId=e.id},text:i,textEnabled:!0,title:i}))}return t}_renderAttachmentsViewDetailsImage(e){const{contentType:t,name:i,size:s,url:n}=e,{messages:l}=this;return M(t)?U("img",{afterCreate:()=>this._attachmentsDialogPreviewLoading=!0,alt:i,key:`thumbnail-image-${i}`,onerror:()=>this._attachmentsDialogPreviewLoading=!1,onload:()=>this._attachmentsDialogPreviewLoading=!1,src:`${n}${n?.includes("?")?"&":"?"}s=${s}`,title:i}):[U("calcite-icon",{icon:V(t),key:`thumbnail-icon-${i}`,scale:"l",textLabel:i,title:i}),l.noPreviewAvailable]}_renderAttachmentsViewInformation(){const{attachmentsViewOptions:e,messages:t,messagesUnits:i}=this,{attachmentInfo:s,objectId:n}=e;if(s&&null!=n)return U("div",{class:K.attachmentsViewInformation,key:"information"},this._renderAttachmentViewInformationButtons(s,n),U("span",{class:K.attachmentsViewInformationLabel,key:"file-label"},t.fileName),U("span",{class:K.attachmentsViewInformationData,key:"file-value"},s.name),U("span",{class:K.attachmentsViewInformationLabel,key:"type-label"},t.attachmentType),U("span",{class:K.attachmentsViewInformationData,key:"type-value"},this._getLabelForAttachmentType(s)),this._renderAttachmentKeywordDetails(s),U("span",{class:K.attachmentsViewInformationLabel,key:"size-label"},t.size),U("span",{class:K.attachmentsViewInformationData,key:"size-span"},h(i,s.size??0)))}_renderAttachmentViewInformationButtons(e,t){const{attachmentsViewOptions:i,messages:s,messagesCommon:n}=this,l="details"!==i.effectiveMode,o=e.id,a=[U("calcite-button",{appearance:"outline",disabled:l,key:"download-button",onclick:e=>{e.preventDefault(),this.downloadAttachmentById(t,o)},width:"full"},s.download)];return this.supportsUpdateAttachments&&a.push(U("calcite-button",{appearance:"outline",disabled:l,key:"replace-button",onclick:()=>{i.mode="file",i.attachmentId=o},width:"full"},s.replace)),this.supportsDeleteAttachments&&a.push(U("calcite-button",{appearance:"outline",disabled:l,key:"delete-button",onclick:()=>{this.deleteAttachments(t,[o],!0)},width:"full"},n.delete)),a}_renderAttachmentKeywordDetails({keywords:e}){if(e&&""!==e)return[U("span",{class:K.attachmentsViewInformationLabel,key:"keyword-label"},this.messages.keyword),U("span",{class:K.attachmentsViewInformationData,key:"keyword-value"},e)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:s}=this,{attachmentInfos:n,objectId:l}=e;return U("calcite-list",{afterCreate:H,afterRemoved:B,afterUpdate:H,bind:this,class:K.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${l}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:this.supportsDeleteAttachments?"multiple":"none",onCalciteListChange:()=>this.scheduleRender()},...n?.map(t=>{const{id:n,name:o,size:a}=t,r=h(s,a??0);return U("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${n}`,label:o,value:n},this._renderAttachmentsViewListPreview(t),U("span",{class:K.attachmentsViewListFileSize,slot:"actions-end",title:r},r),U("calcite-action",{icon:q.downloadTo,key:"download",label:o,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(l??-1,n)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),U("calcite-action",{icon:q.chevronRight,iconFlipRtl:!0,key:"details",label:o,onclick:()=>{e.mode="details",e.attachmentId=n},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}))}))}_renderAttachmentsViewListPreview(e){return U("div",{class:K.attachmentsViewListThumbnail,slot:"content-start"},U("span",null,this._renderAttachmentsViewListImage(e)))}_renderAttachmentsViewListImage(e,t=64){const{contentType:i,name:s,size:n,url:l}=e,o=`${l}${l?.includes("?")?"&":"?"}w=${t}&s=${n}`;return this.supportsResizeAttachments&&M(i)?U("img",{alt:s,key:`thumbnail-image-${s}`,src:o,title:s}):U("calcite-icon",{icon:V(i),key:`thumbnail-icon-${s}`,scale:"l",textLabel:s,title:s})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&(this.attachmentsViewOptions.mode="file",this.attachmentsViewOptions.candidates=e.dataTransfer?.files)}_resetAttachmentsInput(){this._attachmentsInput&&(this._attachmentsInput.value="")}_getLabelForAttachmentType({contentType:e}){const t=this.messages;return e.startsWith("image/")?t.attachmentTypes.image:e.startsWith("audio/")?t.attachmentTypes.audio:e.startsWith("video/")?t.attachmentTypes.video:e.startsWith("text/")||e.startsWith("application/")||e.startsWith("model/")?t.attachmentTypes.document:t.attachmentTypes.unknown}_renderNavigationBar(){const{effectiveTable:e,messages:i,messagesCommon:s,navigationScale:n,relatedTable:l,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:a,attachmentsViewOptions:r,layer:c,supportsAddAttachments:d,supportsDeleteAttachments:h}=e;if(!c)return;const{attachmentInfos:m,objectId:p}=r,u=null!=p,g=m.length,w=a?.selectedItems?.length??0,b=`${c.objectIdField}: ${p}`,v=t(i.selectedCount,{count:w}),y=t(i.attachmentsCount,{count:g}),f=u?U("calcite-action",{bind:this,icon:q.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(p),scale:n,text:b,textEnabled:!0,title:b}):void 0,_=u?U("calcite-action",{icon:q.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:y,onclick:()=>{g>0&&(r.mode="list")},scale:n,text:y,textEnabled:!0,title:y}):void 0,M=u?U("calcite-chip",{closable:!0,closed:0===w,key:"navigation-chip",kind:"inverse",label:v,scale:"s",selected:!0,title:v,value:"selected",onCalciteChipClose:()=>a?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,V=l?U("calcite-label",{layout:"inline",scale:n},i.showAllTables,U("calcite-switch",{checked:this.allRelatedTablesVisible,scale:n,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,C=u&&"list"===r.effectiveMode&&null!=p&&w&&h?U("calcite-action",{icon:q.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(p,a?.selectedItems?.map(e=>e.value)??[],!0)},scale:n,text:s.delete,textEnabled:!0,title:t(i.deleteAttachmentCount,{count:w})}):void 0,A=u&&"list"===r.effectiveMode&&d?U("calcite-action",{bind:this,icon:q.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{r.objectId=p,r.attachmentId=null,r.mode="file"},scale:n,text:i.addAttachment,textEnabled:!0,title:i.addAttachment}):void 0;return U("div",{class:K.tableNavigation,key:"table-nav"},U("calcite-action",{icon:q.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>this._onTableViewChange(this._resetNestedViews),scale:n,text:this.layer?.title??"",textEnabled:!1,title:l?i.exitRelatedRecords:i.exitAttachments}),o.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),f,_,U("div",null,M,V,C,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return U("calcite-action",{icon:q.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>{(t!==this.relatedTables.length-1||this._attachmentsViewIsVisible)&&this._onTableViewChange(()=>this._onRelatedNavigationItemClick(t))},scale:this.navigationScale,text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}_toggleAllColumns(){const e=this.effectiveTable;e.allColumnsVisible?e.hideAllColumns():e.showAllColumns()}};e([m()],J.prototype,"_attachmentsDialogPreviewLoading",void 0),e([m()],J.prototype,"_attachmentsInput",void 0),e([m()],J.prototype,"_attachmentsViewIsVisible",null),e([m()],J.prototype,"_columnVisibilityActions",void 0),e([m()],J.prototype,"_columnVisibilityActionDisabled",null),e([m()],J.prototype,"_dialogIsOpen",null),e([m()],J.prototype,"_effectiveDescription",null),e([m()],J.prototype,"_effectiveLayers",null),e([m()],J.prototype,"_effectiveTitle",null),e([m()],J.prototype,"_effectiveVisibleElements",null),e([m()],J.prototype,"_filteredTables",null),e([m()],J.prototype,"_hasAttachmentsViewError",null),e([m()],J.prototype,"_hasCustomMenuItems",null),e([m()],J.prototype,"_hasDefaultMenuItems",null),e([m()],J.prototype,"_shouldShowGrid",null),e([m()],J.prototype,"_shouldShowMenu",null),e([m()],J.prototype,"_showClearSelectionAction",null),e([m()],J.prototype,"_showColumnVisibilityAction",null),e([m()],J.prototype,"_showDeleteSelectionAction",null),e([m()],J.prototype,"_showExportSelectionToCSVAction",null),e([m()],J.prototype,"_showLayerDropdown",null),e([m()],J.prototype,"_shouldShowNavigationBar",null),e([m()],J.prototype,"_showRefreshDataAction",null),e([m()],J.prototype,"_showSelectedRecordsShowSelectedAction",null),e([m()],J.prototype,"_showSelectedRecordsShowAllAction",null),e([m()],J.prototype,"_showZoomToSelectionAction",null),e([m()],J.prototype,"_viewLayers",null),e([m()],J.prototype,"attachmentsList",void 0),e([m({readOnly:!0})],J.prototype,"grid",null),e([m()],J.prototype,"actionColumn",null),e([m()],J.prototype,"actionColumnConfig",null),e([m({readOnly:!0})],J.prototype,"activeFilters",null),e([m({readOnly:!0})],J.prototype,"activeSortOrders",null),e([m()],J.prototype,"allColumns",null),e([m()],J.prototype,"allColumnsVisible",null),e([m({readOnly:!0})],J.prototype,"allRelatedTablesVisible",null),e([m()],J.prototype,"allVisibleColumns",null),e([m()],J.prototype,"attachmentsColumns",null),e([m()],J.prototype,"attachmentsEnabled",null),e([m()],J.prototype,"attachmentsViewOptions",null),e([m({type:y})],J.prototype,"attributeTableTemplate",null),e([m()],J.prototype,"autoRefreshEnabled",null),e([m()],J.prototype,"autoSaveEnabled",null),e([m()],J.prototype,"canAddRelatedFeature",null),e([m()],J.prototype,"clearPrompt",null),e([m()],J.prototype,"columnPerformanceModeEnabled",null),e([m()],J.prototype,"columnReorderingEnabled",null),e([m({readOnly:!0})],J.prototype,"columns",null),e([m()],J.prototype,"definitionExpression",null),e([m()],J.prototype,"description",void 0),e([m()],J.prototype,"disabled",void 0),e([m()],J.prototype,"editingEnabled",null),e([m()],J.prototype,"effectiveSelectionManager",null),e([m()],J.prototype,"effectiveSize",null),e([m()],J.prototype,"effectiveTable",null),e([m()],J.prototype,"fieldColumns",null),e([m({types:u})],J.prototype,"filterGeometry",null),e([m()],J.prototype,"filterBySelectionEnabled",null),e([m()],J.prototype,"filterByViewExtent",null),e([m()],J.prototype,"groupColumns",null),e([m()],J.prototype,"hasContingentValues",null),e([m()],J.prototype,"hasInvalidPendingEdits",null),e([m()],J.prototype,"hasPendingEdits",null),e([m()],J.prototype,"hiddenFields",null),e([m()],J.prototype,"highlightEnabled",null),e([m()],J.prototype,"highlightIds",null),e([m()],J.prototype,"icon",null),e([m()],J.prototype,"initialSize",null),e([m()],J.prototype,"isQueryingOrSyncing",null),e([m()],J.prototype,"isSyncing",null),e([m()],J.prototype,"isSyncingAttachments",null),e([m()],J.prototype,"label",null),e([m()],J.prototype,"layer",null),e([m()],J.prototype,"layers",null),e([m()],J.prototype,"layerView",null),e([m()],J.prototype,"maxSize",null),e([m(),z("esri/widgets/FeatureTable/t9n/FeatureTable")],J.prototype,"messages",null),e([m(),z("esri/t9n/common")],J.prototype,"messagesCommon",null),e([m(),z("esri/widgets/Editor/t9n/Editor")],J.prototype,"messagesEditor",void 0),e([m(),z("esri/core/t9n/Units")],J.prototype,"messagesUnits",null),e([m(),z("esri/widgets/support/t9n/uriUtils")],J.prototype,"messagesURIUtils",null),e([m()],J.prototype,"menuConfig",null),e([m()],J.prototype,"multipleSelectionEnabled",null),e([m()],J.prototype,"multipleSelectionEnabledOverride",null),e([m()],J.prototype,"multiSortEnabled",null),e([m()],J.prototype,"multipleSortPriority",null),e([m()],J.prototype,"navigationScale",void 0),e([m()],J.prototype,"noDataMessage",null),e([m()],J.prototype,"objectIds",null),e([m()],J.prototype,"outFields",null),e([m()],J.prototype,"pageCount",null),e([m()],J.prototype,"pageIndex",null),e([m()],J.prototype,"pageSize",null),e([m()],J.prototype,"paginationEnabled",null),e([m()],J.prototype,"pendingEditsCount",null),e([m()],J.prototype,"prompt",null),e([m()],J.prototype,"relatedRecordsEnabled",null),e([m()],J.prototype,"relatedTable",null),e([m()],J.prototype,"relatedTableHasContingentValues",null),e([m()],J.prototype,"relatedTableHasInvalidPendingEdits",null),e([m()],J.prototype,"relatedTableHasPendingEdits",null),e([m()],J.prototype,"relatedTables",null),e([m()],J.prototype,"relationship",null),e([m()],J.prototype,"relationshipColumnConfigs",null),e([m()],J.prototype,"relationshipColumns",null),e([m()],J.prototype,"relationshipConfig",null),e([m()],J.prototype,"relationshipInfos",null),e([m()],J.prototype,"returnGeometryEnabled",null),e([m()],J.prototype,"returnMEnabled",null),e([m()],J.prototype,"returnZEnabled",null),e([m()],J.prototype,"rowHighlightIds",null),e([m()],J.prototype,"selectionManager",null),e([m()],J.prototype,"selectionSource",null),e([m()],J.prototype,"showAllRelatedTables",null),e([m()],J.prototype,"showPrompt",null),e([m()],J.prototype,"showRelatedTableCallback",null),e([m()],J.prototype,"size",null),e([m({readOnly:!0})],J.prototype,"state",null),e([m()],J.prototype,"supportsAddAttachments",null),e([m()],J.prototype,"supportsAttachments",null),e([m()],J.prototype,"supportsDeleteAttachments",null),e([m()],J.prototype,"supportsResizeAttachments",null),e([m()],J.prototype,"supportsUpdateAttachments",null),e([m()],J.prototype,"syncTemplateOnChangesEnabled",null),e([m()],J.prototype,"syncViewSelection",null),e([m()],J.prototype,"syncWithViewSelectionManager",null),e([m({constructOnly:!0})],J.prototype,"tableController",null),e([m({constructOnly:!0})],J.prototype,"tableParent",null),e([m({type:P})],J.prototype,"tableTemplate",null),e([m()],J.prototype,"tableTemplateOverride",null),e([m()],J.prototype,"title",void 0),e([m({type:f})],J.prototype,"timeExtent",null),e([m()],J.prototype,"timeZone",null),e([m()],J.prototype,"view",null),e([m({type:S}),$(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],J.prototype,"viewModel",void 0),e([m()],J.prototype,"visibleColumns",null),e([m({type:T,nonNullable:!0})],J.prototype,"visibleElements",void 0),e([m({type:T})],J.prototype,"visibleElementsOverride",null),J=Z=e([p("esri.widgets.FeatureTable")],J);const X=J;export{X as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{property as o,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../../geometry/Point.js";import{polygonCentroidPoint as n}from"../../../geometry/support/centroid.js";import{createCoveragePolygon as a}from"../../../layers/orientedImagery/core/coverageUtils.js";import l from"../../../layers/orientedImagery/core/ExposurePoint.js";import{NoSequenceFoundError as d,NoImageInSequenceError as u,InvalidDirectionError as c}from"./errors.js";import{queryNextLocationFeatures as g,querySequenceCount as w,queryAfterSequenceField as p,querySequenceFeaturesAroundPoint as f,queryOffsetSequenceFeatures as v}from"./queries.js";import{shouldQueryAndNavigateSequentially as y,sortStringOrNumber as h,shouldQueryAndNavigate as m}from"./utils.js";let M=class extends t{constructor(e){super(e),this.viewModel=null}get currentNode(){return this.viewModel.currentNode}get layer(){return this.viewModel.layer}get navigationNodes(){return this.viewModel.navigationNodes}async _queryAndHandleFeatureResponse(e,t,o,i,s){const{error:n,nextLocation:a,response:l}=await g(e,t,o,i,s);if(r(s),n)throw n;this.viewModel.selectedPoint=a,await this.viewModel.processFeatureResponse(l,a,{signal:s?.signal,loadBestImage:!1})}async afterNavigate(e,t,r){return await this.viewModel.selectBestFeature(t.id,r),t}async navigate(e,t){let r;if("direction"in t?r=await this.navigateInDirection(e,t):("step"in t||"goTo"in t)&&(r=await this.navigateInSequence(e,t)),!r)throw new Error("No next node found");return await this.afterNavigate(e,r,t)}async navigateBySkippingSteps(e,t){const{step:r}=t,{layer:o}=this,{layerFloorFilterClause:i,layerTimeExtent:c,preloadMediaSize:g}=this.viewModel;if(!o)throw new Error("Layer is not defined");const v=e.attributes.sequenceOrder;if(0===await w(o,i??void 0,c,{signal:t.signal})||!v)throw new d;const m=r>0?e.next:e.previous;if(!y(m))return m;const{response:M,error:N}=await p(o,v,r,g,i??void 0,c,{signal:t.signal});if(N)throw new Error("Error querying sequence features");const S=M?.features[0];if(!S)throw new u(r>0?"end":"start");const b=l.fromJSON({...S.toJSON(),layer:o}),{polygon:q}=a(b),E=s.fromJSON(n(q)),{response:j,error:I,nextLocation:x}=await f(o,E,i??void 0,c,{signal:t.signal});if(I)throw new Error("Error querying sequence features");const O=new Set(j.features.map(e=>e.attributes.objectId)),F=[...M.features.filter(e=>!O.has(e.attributes.objectId)),...j.features],P=new Set(F.map(e=>e.attributes.objectId));j.features=F,this.viewModel.selectedPoint=x;const T=S.attributes.objectId;await this.viewModel.processFeatureResponse(j,x,{signal:t.signal,loadBestImage:!1});const B=this.viewModel.navigationNodes.filter((e,t)=>null!=e.attributes.sequenceOrder&&P.has(e.attributes.objectId)&&t===this.viewModel.navigationNodes.indexOf(e)).items.toSorted((e,t)=>h(e.attributes.sequenceOrder,t.attributes.sequenceOrder)),J=B.length;for(let s=0;s<J;s++){const e=B[s];e.previous=s>0?B[s-1]:null,e.next=s<J-1?B[s+1]:null}return this.viewModel.selectedPoint=x,this.viewModel.navigationNodes.find(e=>e.id===T)}async navigateInDirection(e,t){const{viewModel:r}=this,{layer:o,layerFloorFilterClause:i,layerTimeExtent:s}=r,{direction:n,signal:a}=t,l=e?.[n];if(!l)throw new c(n);return m(l,n)&&await this._queryAndHandleFeatureResponse(o,l,i??void 0,s,{signal:a}),l}async navigateInSequence(e,t){return"step"in t?this.navigateBySkippingSteps(e,t):this.navigateTo(t)}async navigateTo(e){const{goTo:t}=e,{layer:r}=this,{layerFloorFilterClause:o,layerTimeExtent:i}=this.viewModel;if(!r)throw new Error("Layer is not defined");const d="number"==typeof t?t:1,u=this.viewModel.navigationNodes.find(e=>e.id===d);if(u)return u;const{response:c,error:g}=await v(r,d,1,"end"===t?"DESC":"ASC",o??void 0,i,{signal:e.signal});if(g)throw new Error("Error querying sequence features");const w=c?.features[0];if(!w)throw new Error("No next node found");const p=l.fromJSON({...w.toJSON(),layer:r}),{polygon:y}=a(p),h=s.fromJSON(n(y)),{response:m,error:M,nextLocation:N}=await f(r,h,o??void 0,i,{signal:e.signal});if(M)throw new Error("Error querying sequence features");const S=[...m.features];S.push(w),m.features=S,this.viewModel.selectedPoint=N;const b=w.attributes.objectId;return await this.viewModel.processFeatureResponse(m,N,{signal:e.signal,loadBestImage:!1}),this.viewModel.selectedPoint=N,this.viewModel.navigationNodes.find(e=>e.id===b)}};e([o()],M.prototype,"currentNode",null),e([o()],M.prototype,"layer",null),e([o()],M.prototype,"navigationNodes",null),e([o({constructOnly:!0})],M.prototype,"viewModel",void 0),M=e([i("esri.widgets.OrientedImageryViewer.navigation.NavigationManager")],M);export{M as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{property as o,subclass as i}from"../../../core/accessorSupport/decorators.js";import n from"../../../geometry/Point.js";import{polygonCentroidPoint as s}from"../../../geometry/support/centroid.js";import{createCoveragePolygon as a}from"../../../layers/orientedImagery/core/coverageUtils.js";import l from"../../../layers/orientedImagery/core/ExposurePoint.js";import{NoSequenceFoundError as d,NoImageInSequenceError as u,InvalidDirectionError as c}from"./errors.js";import{queryNextLocationFeatures as g,queryAfterSequenceField as f,querySequenceFeaturesAroundPoint as w,queryOffsetSequenceFeatures as p}from"./queries.js";import{shouldQueryAndNavigateSequentially as v,shouldQueryAndNavigate as y}from"./utils.js";let h=class extends t{constructor(e){super(e),this.viewModel=null}get currentNode(){return this.viewModel.currentNode}get layer(){return this.viewModel.layer}get navigationNodes(){return this.viewModel.navigationNodes}async _queryAndHandleFeatureResponse(e,t,o,i,n){const{error:s,nextLocation:a,response:l}=await g(e,t,o,i,n);if(r(n),s)throw s;this.viewModel.selectedPoint=a,await this.viewModel.processFeatureResponse(l,a,{signal:n?.signal,loadBestImage:!1})}async afterNavigate(e,t,r){return await this.viewModel.selectBestFeature(t.id,r),t}async navigate(e,t){let r;if("direction"in t?r=await this.navigateInDirection(e,t):("step"in t||"goTo"in t)&&(r=await this.navigateInSequence(e,t)),!r)throw new Error("No next node found");return await this.afterNavigate(e,r,t)}async navigateBySkippingSteps(e,t){const{step:r}=t,{layer:o}=this,{layerFloorFilterClause:i,layerTimeExtent:c,preloadMediaSize:g}=this.viewModel;if(!o)throw new Error("Layer is not defined");const p=e.attributes.sequenceOrder;if(!p)throw new d;const y=r>0?e.next:e.previous;if(!v(y))return y;const{response:h,error:m}=await f(o,p,r>0?"next":"previous",g,i??void 0,c,{signal:t.signal});if(m)throw new Error("Error querying sequence features");const M=h?.features[0];if(!M)throw new u(r>0?"end":"start");const N=l.fromJSON({...M.toJSON(),layer:o}),{polygon:E}=a(N),S=n.fromJSON(s(E)),{response:q,error:j,nextLocation:x}=await w(o,S,i??void 0,c,{signal:t.signal});if(j)throw new Error("Error querying sequence features");const I=new Set(q.features.map(e=>e.attributes.objectId)),b=[...h.features.filter(e=>!I.has(e.attributes.objectId)),...q.features];q.features=b,this.viewModel.selectedPoint=x;const F=M.attributes.objectId;await this.viewModel.processFeatureResponse(q,x,{signal:t.signal,loadBestImage:!1});const O=this.viewModel.navigationNodes.toArray();O.sort((e,t)=>{const r=e.attributes.sequenceOrder,o=t.attributes.sequenceOrder;if(!r||!o)return 0;const i=r.length;for(let n=0;n<i;n++){const{value:e,sortOrder:t}=r[n],{value:i}=o[n];if("desc"===t){if(e<i)return 1;if(e>i)return-1}else{if(e<i)return-1;if(e>i)return 1}}return 0});const P=O.length;for(let n=0;n<P;n++){const e=O[n];e.previous=n>0?O[n-1]:null,e.next=n<P-1?O[n+1]:null}return this.viewModel.selectedPoint=x,this.viewModel.navigationNodes.find(e=>e.id===F)}async navigateInDirection(e,t){const{viewModel:r}=this,{layer:o,layerFloorFilterClause:i,layerTimeExtent:n}=r,{direction:s,signal:a}=t,l=e?.[s];if(!l)throw new c(s);return y(l,s)&&await this._queryAndHandleFeatureResponse(o,l,i??void 0,n,{signal:a}),l}async navigateInSequence(e,t){return"step"in t?this.navigateBySkippingSteps(e,t):this.navigateTo(t)}async navigateTo(e){const{goTo:t}=e,{layer:r}=this,{layerFloorFilterClause:o,layerTimeExtent:i}=this.viewModel;if(!r)throw new Error("Layer is not defined");const d="number"==typeof t?t:1,u=this.viewModel.navigationNodes.find(e=>e.id===d);if(u)return u;const{response:c,error:g}=await p(r,d,1,"end"===t?"DESC":"ASC",o??void 0,i,{signal:e.signal});if(g)throw new Error("Error querying sequence features");const f=c?.features[0];if(!f)throw new Error("No next node found");const v=l.fromJSON({...f.toJSON(),layer:r}),{polygon:y}=a(v),h=n.fromJSON(s(y)),{response:m,error:M,nextLocation:N}=await w(r,h,o??void 0,i,{signal:e.signal});if(M)throw new Error("Error querying sequence features");const E=[...m.features];E.push(f),m.features=E,this.viewModel.selectedPoint=N;const S=f.attributes.objectId;return await this.viewModel.processFeatureResponse(m,N,{signal:e.signal,loadBestImage:!1}),this.viewModel.selectedPoint=N,this.viewModel.navigationNodes.find(e=>e.id===S)}};e([o()],h.prototype,"currentNode",null),e([o()],h.prototype,"layer",null),e([o()],h.prototype,"navigationNodes",null),e([o({constructOnly:!0})],h.prototype,"viewModel",void 0),h=e([i("esri.widgets.OrientedImageryViewer.navigation.NavigationManager")],h);export{h as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{sqlAnd as e}from"../../../core/sql.js";import t from"../../../geometry/Point.js";import r from"../../../geometry/SpatialReference.js";import{polygonCentroidPoint as n}from"../../../geometry/support/centroid.js";import{searchImages as i}from"../../../layers/orientedImagery/queries.js";import{createCoveragePolygon as o}from"../../../layers/orientedImagery/core/coverageUtils.js";async function a(e,r,a,s,c){const{polygon:u}=o(r.attributes),f=t.fromJSON(n(u));f.z=void 0;const y=h(e.definitionExpression,a);let d,p;try{d=await i({layerInstanceOrURL:e,point:f,queryParams:{where:y,timeExtent:s}},c)}catch(l){p=l}return new m(f,d,p)}async function s(e,t,r,n,o){const a=e.effectiveSequenceOrderField,s=h(e.definitionExpression,r,`${a} IS NOT NULL`);let c,u;try{c=await i({layerInstanceOrURL:e,point:t,queryParams:{where:s,orderByFields:[`${a}`],returnGeometry:!0,outFields:["*"],timeExtent:n}},o)}catch(f){u=f}return new m(t,c,u)}function c(e,t,r,n){const i=e.effectiveSequenceOrderField,o=h(e.definitionExpression,t,`${i} IS NOT NULL`),a=e.createQuery();return a.where=o,a.timeExtent=r,e.queryFeatureCount(a,n)}async function u(t,n,i,o="ASC",a,s,c){const u=t.effectiveSequenceOrderField;let f=h(t.definitionExpression,a,`${u} IS NOT NULL`);const y="number"==typeof n?n-1:void 0;"string"===n&&(f=e(f,`${u} = ${n}`));const m=t.createQuery();m.where=f,m.start=y,m.num=i,m.timeExtent=s,m.orderByFields=[`${u} ${o}`],t.spatialReference.isGeographic&&(m.outSpatialReference=r.WebMercator);try{const e=await t.queryFeatures(m,c);return await w(e,t),new d(e)}catch(p){return new d(void 0,p)}}async function f(e,t,n=0,i=1,o,a,s){const c=e.effectiveSequenceOrderField,u=l(c,n),f=h(e.definitionExpression,o,p(n,t,c)),y=e.createQuery();y.where=f,y.num=i,y.orderByFields=u,y.timeExtent=a,e.spatialReference.isGeographic&&(y.outSpatialReference=r.WebMercator);try{const t=await e.queryFeatures(y,s);return await w(t,e),new d(t)}catch(m){return new d(void 0,m)}}async function y(e,t,n,i,o){const a=Array.isArray(t)?t:[t],s=h(e.definitionExpression,n,`${e.objectIdField} IN (${a.join(",")})`),c=e.createQuery();c.where=s,e.spatialReference.isGeographic&&(c.outSpatialReference=r.WebMercator),i&&(c.timeExtent=i);try{const t=await e.queryFeatures(c,o);return await w(t,e),new d(t)}catch(u){return new d(void 0,u)}}class d{constructor(e,t){this.response=e,this.error=t}}class m{constructor(e,t,r){this.nextLocation=e,this.response=t,this.error=r}}function p(e,t,r){return e>0?`${r} IS NOT NULL AND ${r} > ${t}`:`${r} IS NOT NULL AND ${r} < ${t}`}function l(e,t){return t>0?[`${e}`]:[`${e} DESC`]}async function w(e,t){const r=await import("../../../layers/orientedImagery/core/ExposurePoint.js").then(e=>e.default);e.features.forEach(e=>{const n=r.fromJSON({...e.toJSON(),layer:t});n&&(e.attributes=n)})}function h(...t){let r="1=1";return t.forEach(t=>{r=e(r,t)}),r}export{m as QueryNextLocationFeaturesResponse,d as QueryOrientedImageryFeaturesResponse,f as queryAfterSequenceField,y as queryFeatureByObjectIds,a as queryNextLocationFeatures,u as queryOffsetSequenceFeatures,c as querySequenceCount,s as querySequenceFeaturesAroundPoint};
2
+ import{sqlAnd as e}from"../../../core/sql.js";import r from"../../../geometry/Point.js";import t from"../../../geometry/SpatialReference.js";import{polygonCentroidPoint as n}from"../../../geometry/support/centroid.js";import{searchImages as i}from"../../../layers/orientedImagery/queries.js";import{createCoveragePolygon as o}from"../../../layers/orientedImagery/core/coverageUtils.js";import{constructWhereClauseForSequenceFields as s}from"./utils.js";async function a(e,t,s,a,c){const{polygon:u}=o(t.attributes),f=r.fromJSON(n(u));f.z=void 0;const y=w(e.definitionExpression,s);let d,m;try{d=await i({layerInstanceOrURL:e,point:f,queryParams:{where:y,timeExtent:a}},c)}catch(l){m=l}return new p(f,d,m)}async function c(e,r,t,n,o){const s=e.effectiveSequenceOrderField?.map(({fieldName:e,sortOrder:r})=>`${e} ${"desc"===r?"DESC":"ASC"}`),a=w(e.definitionExpression,t);let c,u;try{c=await i({layerInstanceOrURL:e,point:r,queryParams:{where:a,orderByFields:s,returnGeometry:!0,outFields:["*"],timeExtent:n}},o)}catch(f){u=f}return new p(r,c,u)}function u(e,r,t,n){const i=e.effectiveSequenceOrderField,o=w(e.definitionExpression,r,`${i} IS NOT NULL`),s=e.createQuery();return s.where=o,s.timeExtent=t,e.queryFeatureCount(s,n)}async function f(r,n,i,o="ASC",s,a,c){const u=r.effectiveSequenceOrderField;let f=w(r.definitionExpression,s,`${u} IS NOT NULL`);const y="number"==typeof n?n-1:void 0;"string"===n&&(f=e(f,`${u} = ${n}`));const d=r.createQuery();d.where=f,d.start=y,d.num=i,d.timeExtent=a,d.orderByFields=[`${u} ${o}`],r.spatialReference.isGeographic&&(d.outSpatialReference=t.WebMercator);try{const e=await r.queryFeatures(d,c);return await l(e,r),new m(e)}catch(p){return new m(void 0,p)}}async function y(e,r,n,i=1,o,a,c){const u=e.effectiveSequenceOrderField?.map(({fieldName:e,sortOrder:r})=>`${e} ${"desc"===r?"DESC":"ASC"}`),f=w(e.definitionExpression,o,s(r,n)),y=e.createQuery();y.where=f,y.num=i,y.orderByFields=u,y.timeExtent=a,e.spatialReference.isGeographic&&(y.outSpatialReference=t.WebMercator);try{const r=await e.queryFeatures(y,c);return await l(r,e),new m(r)}catch(d){return new m(void 0,d)}}async function d(e,r,n,i,o){const s=Array.isArray(r)?r:[r],a=w(e.definitionExpression,n,`${e.objectIdField} IN (${s.join(",")})`),c=e.createQuery();c.where=a,e.spatialReference.isGeographic&&(c.outSpatialReference=t.WebMercator),i&&(c.timeExtent=i);try{const r=await e.queryFeatures(c,o);return await l(r,e),new m(r)}catch(u){return new m(void 0,u)}}class m{constructor(e,r){this.response=e,this.error=r}}class p{constructor(e,r,t){this.nextLocation=e,this.response=r,this.error=t}}async function l(e,r){const t=await import("../../../layers/orientedImagery/core/ExposurePoint.js").then(e=>e.default);e.features.forEach(e=>{const n=t.fromJSON({...e.toJSON(),layer:r});n&&(e.attributes=n)})}function w(...r){let t="1=1";return r.forEach(r=>{t=e(t,r)}),t}export{p as QueryNextLocationFeaturesResponse,m as QueryOrientedImageryFeaturesResponse,w as mergeSQLstatements,y as queryAfterSequenceField,d as queryFeatureByObjectIds,a as queryNextLocationFeatures,f as queryOffsetSequenceFeatures,u as querySequenceCount,c as querySequenceFeaturesAroundPoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getMetersPerUnitForSR as n}from"../../../core/units.js";import t from"../../../geometry/Extent.js";import{getWebMercatorScalingFactor as e}from"../../../layers/orientedImagery/transformations/utils.js";import{clockwiseDirections as r}from"../constants.js";function o(r,o){const{x:i,y:s,spatialReference:f}=r,u=o*e(s,f)/n(f);return new t({xmin:i-u,xmax:i+u,ymin:s-u,ymax:s+u,spatialReference:r.spatialReference})}function i(n){return!n||null===n.previous||null===n.next}function s(n,t,e=1){if(null==n[t])return!0;const o=n=>n?r.reduce((t,e)=>n[e]?t+1:t,0):0,i=new Set,s=[{node:n,depth:0}];for(;s.length;){const{node:n,depth:t}=s.shift();if(n&&!i.has(n)){if(i.add(n),o(n)<2)return!0;if(t<e)for(const e of r){const r=n[e];r&&!i.has(r)&&s.push({node:r,depth:t+1})}}}return!1}function f(n,t){if(!n&&!t)return 0;const e=Number(n),r=Number(t);if(!isNaN(e)&&!isNaN(r))return e-r;const o=String(n),i=String(t);return o<i?-1:o>i?1:0}export{o as createExtentAroundPoint,s as shouldQueryAndNavigate,i as shouldQueryAndNavigateSequentially,f as sortStringOrNumber};
2
+ import{getMetersPerUnitForSR as e}from"../../../core/units.js";import n from"../../../geometry/Extent.js";import{getWebMercatorScalingFactor as t}from"../../../layers/orientedImagery/transformations/utils.js";import{clockwiseDirections as r}from"../constants.js";function o(r,o){const{x:i,y:u,spatialReference:s}=r,a=o*t(u,s)/e(s);return new n({xmin:i-a,xmax:i+a,ymin:u-a,ymax:u+a,spatialReference:r.spatialReference})}function i(e){return!e||null===e.previous||null===e.next}function u(e,n,t=1){if(null==e[n])return!0;const o=e=>e?r.reduce((n,t)=>e[t]?n+1:n,0):0,i=new Set,u=[{node:e,depth:0}];for(;u.length;){const{node:e,depth:n}=u.shift();if(e&&!i.has(e)){if(i.add(e),o(e)<2)return!0;if(n<t)for(const t of r){const r=e[t];r&&!i.has(r)&&u.push({node:r,depth:n+1})}}}return!1}function s(e,n){if(!e&&!n)return 0;const t=Number(e),r=Number(n);if(!isNaN(t)&&!isNaN(r))return t-r;const o=String(e),i=String(n);return o<i?-1:o>i?1:0}function a(e,n){if(!e)return"1=1";switch(n){case"next":return f(e,"next");case"previous":return f(e,"previous");default:return"1=1"}}function f(e,n){return e.map((t,r)=>{const o=e.slice(0,r).map(e=>e?.value?`(${e.fieldName} = ${e.value})`:null).filter(Boolean).join(" AND "),i="asc"===t.sortOrder?"next"===n?">":"<":"next"===n?"<":">",u=[o,t?.value?`(${t.fieldName} ${i} ${t.value})`:null].filter(Boolean);return u.length>1?`(${u.join(" AND ")})`:u.join(" AND ")}).filter(Boolean).join(" OR ")}export{a as constructWhereClauseForSequenceFields,o as createExtentAroundPoint,u as shouldQueryAndNavigate,i as shouldQueryAndNavigateSequentially,s as sortStringOrNumber};