@arcgis/core 4.30.0-next.20240520 → 4.30.0-next.20240521
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.
- package/applications/Components/drawUtils.d.ts +4 -0
- package/applications/Components/getContrastingBackgroundTheme.d.ts +4 -0
- package/applications/Components/gfxUtils.d.ts +4 -0
- package/applications/Components/gfxUtils.js +1 -1
- package/applications/Components/layerOriginUtils.d.ts +4 -0
- package/applications/Components/styleUtils.d.ts +4 -0
- package/applications/Components/svgUtils.d.ts +4 -0
- package/applications/Components/webStyleSymbolUtils.d.ts +4 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{9bf758be13aaa5ebba64.js → 1b4c91833fb7b99c6cfe.js} +1 -1
- package/assets/esri/core/workers/chunks/{1476f4b9ed8a7d3330ce.js → 2f8a51d6b8229a90c240.js} +1 -1
- package/assets/esri/core/workers/chunks/3ad5de35a52b16be8dd5.js +1 -0
- package/assets/esri/core/workers/chunks/{c8628b5e9472e72a9cb3.js → 6d409cb694daa5002747.js} +1 -1
- package/assets/esri/core/workers/chunks/ba988cd3a49987a0fb83.js +1 -0
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +1 -0
- package/assets/esri/themes/base/widgets/_Grid.scss +4 -0
- package/assets/esri/themes/base/widgets/_Widget.scss +1 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/core/Accessor.js +1 -1
- package/core/Collection.js +1 -1
- package/core/Handles.js +1 -1
- package/interfaces.d.ts +203 -29
- package/layers/CatalogLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/catalog/CatalogDynamicGroupLayer.js +1 -1
- package/package.json +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/AnimationManager.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/ui/UI.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/assets/esri/core/workers/chunks/92979bf325405d87c090.js +0 -1
- package/assets/esri/core/workers/chunks/ed24ad7c7fbb02c307aa.js +0 -1
package/widgets/FeatureTable.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{watch as i,sync as l,initial as o,on as s}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import d from"./FeatureTable/ColumnMenuVisibleElements.js";import c from"./FeatureTable/FeatureTableViewModel.js";import h from"./FeatureTable/VisibleElements.js";import p from"./FeatureTable/support/FieldColumnTemplate.js";import m from"./FeatureTable/support/TableTemplate.js";import{uniqueColumnNames as u,isIFeatureTableSupportedLayerWithAttachments as g}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import{Heading as v}from"./support/Heading.js";import{renderingSanitizer as y}from"./support/widgetUtils.js";import{messageBundle as f}from"./support/decorators/messageBundle.js";import{vmEvent as _}from"./support/decorators/vmEvent.js";import{tsx as M}from"./support/jsxFactory.js";import{substitute as C}from"../intl/substitute.js";var S;const E="esri-feature-table",T=`${E}__prompt`,A={base:E,content:`${E}__content`,menuPopover:`${E}__menu-popover`,tableContainer:`${E}__table-container`,tableNavigation:`${E}__table-navigation`,expanded:`${E}__expanded`,collapsed:`${E}__collapsed`,promptContainer:T,promptHeader:`${T}__header`,promptHeading:`${T}__header__heading`,promptMessage:`${T}__message`,promptDivider:`${T}__divider`,promptActions:`${T}__actions`},I={clearSelection:"clear-selection",delete:"trash",refresh:"refresh",showAll:"selection-x",showSelected:"selection-filter",zoomToSelection:"zoom-to-object"};let R=S=class extends a{constructor(e,i){super(e,i),this._columnVisibilityActions=new Map,this._prompt=null,this._showAllTablesEnabled=!1,this.disabled=!1,this.menuConfig=null,this.relatedTables=new t,this.tableParent=null,this.title=null,this.viewModel=new c,this.visibleElements=new h,this.visibleElementsOverride=null,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([i((()=>[this.viewModel.store.querying,this.viewModel.store.syncing,this.editingEnabled]),(()=>this.scheduleRender())),i((()=>({visibleElements:this._effectiveVisibleElements,items:this.columns.length})),(({visibleElements:e})=>{this.columns.forEach((t=>t.visibleElements=e)),this.refreshCellContent()}),l),i((()=>this._effectiveVisibleElements.selectionColumn),(e=>{this.grid&&(this.grid.selectionColumnEnabled=e)}),o),s((()=>this.viewModel),"show-related-table",(e=>this._onShowRelatedTable(e))),i((()=>this.viewModel.state),(e=>{"disabled"===e&&this.relatedTables.length&&this._drainRelatedTables()}))])}loadDependencies(){return b({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel.js"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover.js"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress.js"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar.js"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown.js"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group.js"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item.js"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker.js"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker.js"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone.js")})}destroy(){this._clearPrompt()}get _effectiveTitle(){const{layer:e,messages:t,state:i,highlightIds:l,title:o,viewModel:s}=this;if(o)return y.sanitize("function"==typeof o?o():o);if(!e)return t.noLayer;switch(i){case"disabled":return t.errorLayer;case"ready":return y.sanitize(e.title);case"loading":return t.loading;case"error":return t.errorData}return C(t.header,{title:y.sanitize(e.title),count:s.size,selected:l.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}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)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this._showAllTablesEnabled)}get _showDeleteSelectionAction(){return!!(this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.editingEnabled&&this.layer?.capabilities?.operations?.supportsDelete)}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)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!!(this.view&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.zoomToSelection)}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 attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=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 editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}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 grid(){return this.viewModel.grid}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"table"}set icon(e){this._overrideIfSome("icon",e)}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing||this.relatedTables.some((e=>!!e.isQueryingOrSyncing))}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 layerView(){return this.viewModel.layerView}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 messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=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 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}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}hideColumn(e){this.grid?.hideColumn(e)}async refresh(){this.relatedTables.forEach((async e=>await e.refresh())),await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollToIndex(e){this.viewModel.scrollToIndex(e)}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.viewModel.zoomToSelection()}render(){const{_prompt:e,_effectiveVisibleElements:t,isQueryingOrSyncing:i,menuConfig:l,state:o}=this;return M("div",{bind:this,class:this.classes(A.base,w.widget)},M("calcite-panel",{bind:this,class:A.content,closable:t.close,disabled:this.disabled||"disabled"===o,heading:t.header?this._effectiveTitle:void 0,loading:"loading"===o,menuOpen:!!l?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.target.closed=!1,this.emit("close")}},t.progress?M("calcite-progress",{type:i?"indeterminate":"determinate"}):null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderRelatedTableNavigationBar(),M("div",{class:A.tableContainer},this._renderTables())),e?M("calcite-scrim",null,this._renderPrompt(e)):null)}_renderTables(){const{_showAllTablesEnabled:e,grid:t,relatedTables:i}=this;return i.length?M("calcite-panel",null,M("div",null,M("div",{class:this.classes(A.base,{[A.expanded]:e,[A.collapsed]:!e})},t?.render()),...i.toArray().map(((t,i)=>M("div",{class:this.classes(A.base,e?A.expanded:A.collapsed),key:`related-${i}`},t.render()))))):t?.render()}_clearPrompt(){this._prompt=null}_renderPrompt({title:e,message:t,context:i,actions:l}){const o=M("calcite-button",{appearance:"solid",key:"prompt-primary-button",kind:"danger"===i?"danger":"brand",onclick:l.primary.action,width:l.secondary?"half":"full"},l.primary.label),s=l.secondary?M("calcite-button",{appearance:"outline",key:"prompt-secondary-button",kind:"danger"===i?"danger":"brand",onclick:l.secondary.action,width:"half"},l.secondary.label):null;return M("div",{class:`${A.promptContainer}--${i}`},M("div",{class:A.promptHeader},M("calcite-icon",{icon:"exclamation-mark-triangle"}),M(v,{class:A.promptHeading,level:2},e)),M("div",{class:A.promptMessage},t),M("div",{class:A.promptDivider}),M("div",{class:A.promptActions},s,o))}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=C(e.deleteSelectionCount,{count:this.highlightIds.length});this._prompt={title:i,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this._clearPrompt()}}}}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this._clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:s}=e;if(!i)return M("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>s(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this,t=[];return this._showRefreshDataAction&&t.push(this._renderHeaderMenuAction({icon:I.refresh,text:e.refreshData,clickFunction:()=>this.refresh()})),this._showDeleteSelectionAction&&t.push(this._renderHeaderMenuAction({icon:I.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)})),this._showClearSelectionAction&&t.push(this._renderHeaderMenuAction({icon:I.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()})),this._showZoomToSelectionAction&&t.push(this._renderHeaderMenuAction({icon:I.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()})),this._showSelectedRecordsShowSelectedAction&&t.push(this._renderHeaderMenuAction({icon:I.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}})),this._showSelectedRecordsShowAllAction&&t.push(this._renderHeaderMenuAction({icon:I.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()})),t}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map((({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)})))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,_effectiveVisibleElements:t,id:i,messages:l}=this,o=this.relatedTables.at(-1)||this,s=o.columns.toArray(),n=l?.toggleColumns,r=`${i}__toggle-columns-action`,a=[M("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:o.menuConfig?.disabled,icon:"show-column",id:r,slot:"header-actions-end",text:n},t.tooltips?M("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},n):null)];return o.menuConfig?.disabled||a.push(M("calcite-popover",{autoClose:!0,class:A.menuPopover,label:n,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:e.get(i)},M("calcite-list",{filterEnabled:!0,selectionMode:"multiple"},...s.map((({effectiveLabel:e,fieldName:t,hidden:i})=>M("calcite-list-item",{key:`toggle-columns__item-${t}`,label:e,selected:!i,value:t,onCalciteListItemSelect:({target:e})=>o.toggleColumnVisibility(e.value)})))))),a}_onShowRelatedTable(e){if(this.showRelatedTableCallback)return;const{relatedTables:t}=this,{length:i}=t,l=i?t.getItemAt(i-1):this;this._collapseRelatedTable(l,e),this._createRelatedTable(e)}_renderRelatedTableNavigationBar(){const e=this.messages.exitRelatedRecords;if(this.relatedTables.length&&!this.showRelatedTableCallback)return M("div",{class:A.tableNavigation,key:"table-nav"},M("calcite-action",{icon:"move-up",key:e,onclick:()=>this._drainRelatedTables(),text:e,title:e}),this.relatedTables.toArray().map(((e,t)=>this._renderRelatedTableNavigationAction(e,t))),M("div",null,M("calcite-label",{layout:"inline"},"Show all tables",M("calcite-switch",{checked:this._showAllTablesEnabled,onCalciteSwitchChange:e=>{const{relatedTables:t}=this,i=!!e.target.checked,l=t.at(-1);this._showAllTablesEnabled=i,l&&(i?this._enterShowAllView(l):this._exitShowAllView(l))}}))))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return M("calcite-action",{icon:"chevron-right",key:t,onclick:()=>this._drainRelatedTablesAboveIndex(t),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}_drainRelatedTables(){this.relatedTables.drain((e=>!e.destroyed&&e.destroy())),this.set({multipleSelectionEnabled:!0,tableTemplateOverride:null,relationshipColumnConfigs:null,visibleElementsOverride:null}),this.hiddenFields.removeMany([u.action,u.attachments])}_drainRelatedTablesAboveIndex(e){const t=this.relatedTables,i=t.filter(((t,i)=>i>e));i.forEach((e=>!e.destroyed&&e.destroy())),t.removeMany(i);const l=t.at(-1);if(!l?.layer||!l?.relationship)return;const{layer:o,relationship:s}=l;this._showAllTablesEnabled?this._enterShowAllView(l):l.set({multipleSelectionEnabled:!0,tableTemplateOverride:null,relationshipColumnConfigs:this._getRelationshipIdsToShow(o,s.id),visibleElementsOverride:null}),l.hiddenFields.removeMany([u.action,u.attachments])}_getRelatedTableMenuItemConfig(e,t,i){return t.fields.map((({alias:l,name:o})=>({selected:o===i,label:l||o,clickFunction:i=>{i.stopPropagation(),e.tableTemplateOverride=new m({columnTemplates:[this._createRelatedFieldColumnTemplate(e,t,o)]})}})))}_createRelatedFieldColumnTemplate(e,t,i){return new p({fieldName:i,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._getRelatedTableMenuItemConfig(e,t,i)},resizable:!1})}_enterShowAllView(e){const t=e.layer;if(!t)return;const i=e===this,{visibleElements:l}=e,o=t.displayField||t.objectIdField;e.set({relationshipColumnConfigs:[],tableTemplateOverride:new m({columnTemplates:[this._createRelatedFieldColumnTemplate(e,t,o)]}),visibleElementsOverride:new h({header:i&&l.header,progress:i&&l.progress,columnMenus:l.columnMenus,close:l.close,tooltips:l.tooltips,selectionColumn:!1,columnMenuItems:new d({sortAscending:!1,sortDescending:!1})})}),e.hiddenFields.addMany([u.action,u.attachments])}_exitShowAllView(e){const{layer:t,relationship:i}=e;t&&null!=i?.id&&(e.set({relationshipColumnConfigs:this._getRelationshipIdsToShow(t,i.id),tableTemplateOverride:null,visibleElementsOverride:null}),e.hiddenFields.removeMany([u.action,u.attachments]))}_collapseRelatedTable(e,i){const{relatedLayer:l,feature:o,relationshipId:s}=i,n=l.relationships?.find((({id:e})=>e===s)),{objectIdField:r}=l,a=l.displayField||n?.keyField||r,c=o.getObjectId()??o.attributes[r],p=e===this,{visibleElements:g}=e;e.set({highlightIds:new t([c]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[{relationshipId:s,collapsed:!0}],tableTemplateOverride:new m({columnTemplates:[this._createRelatedFieldColumnTemplate(e,l,a)]}),visibleElementsOverride:new h({header:p&&g.header,progress:p&&g.progress,columnMenus:g.columnMenus,close:g.close,tooltips:g.tooltips,selectionColumn:!1,columnMenuItems:new d({sortAscending:!1,sortDescending:!1})})}),e.hiddenFields.addMany([u.action,u.attachments])}_getRelationshipIdsToShow(e,t){return(e.relationships??[]).filter((e=>!(e.id===t&&"one-to-one"===e.cardinality))).map((({id:e})=>({relationshipId:e})))}async _createRelatedTable(e){const{editingEnabled:t,relatedTables:i,view:l,viewModel:o}=this,{layer:n,feature:r,relatedLayer:a,relationshipId:d}=e,c=r.getObjectId()??r.attributes[a.objectIdField],p=i.length,m=p?i.getItemAt(p-1):this;await n.load();const u=this.attachmentsEnabled&&g(n),b=new S({layer:n,attachmentsEnabled:u,editingEnabled:t,relatedRecordsEnabled:!0,relationshipConfig:{objectId:c,relatedLayer:a,relationshipId:d},relationshipColumnConfigs:this._getRelationshipIdsToShow(n,d),tableParent:m,view:l,visibleElements:new h({header:!1,progress:!1}),showRelatedTableCallback:({feature:e,layer:t,relatedLayer:i,relationshipId:l})=>{null!=(e.getObjectId()??e.attributes[i.objectIdField])&&o.emit("show-related-table",{feature:e,layer:t,relatedLayer:i,relationshipId:l})}});b.addHandles([s((()=>m.highlightIds),"change",(({added:e})=>{const t=e[0];null!=t&&(b.highlightIds.removeAll(),b.relationshipConfig={objectId:t,relatedLayer:a,relationshipId:d})})),s((()=>m),"cell-click",(e=>{const{feature:t}=e;if(t){const e=t.getObjectId()??t.attributes[a.objectIdField];null!=e&&m.highlightIds.add(e)}}))]),this.relatedTables.add(b),this.scheduleRender()}};e([n()],R.prototype,"_columnVisibilityActions",void 0),e([n()],R.prototype,"_effectiveTitle",null),e([n()],R.prototype,"_effectiveVisibleElements",null),e([n()],R.prototype,"_hasCustomMenuItems",null),e([n()],R.prototype,"_hasDefaultMenuItems",null),e([n()],R.prototype,"_prompt",void 0),e([n()],R.prototype,"_shouldShowMenu",null),e([n()],R.prototype,"_showAllTablesEnabled",void 0),e([n()],R.prototype,"_showClearSelectionAction",null),e([n()],R.prototype,"_showColumnsVisibilityAction",null),e([n()],R.prototype,"_showDeleteSelectionAction",null),e([n()],R.prototype,"_showRefreshDataAction",null),e([n()],R.prototype,"_showSelectedRecordsShowSelectedAction",null),e([n()],R.prototype,"_showSelectedRecordsShowAllAction",null),e([n()],R.prototype,"_showZoomToSelectionAction",null),e([n()],R.prototype,"actionColumnConfig",null),e([n({readOnly:!0})],R.prototype,"activeFilters",null),e([n({readOnly:!0})],R.prototype,"activeSortOrders",null),e([n()],R.prototype,"attachmentsEnabled",null),e([n()],R.prototype,"autoRefreshEnabled",null),e([n()],R.prototype,"columnPerformanceModeEnabled",null),e([n()],R.prototype,"columnReorderingEnabled",null),e([n({readOnly:!0})],R.prototype,"columns",null),e([n()],R.prototype,"disabled",void 0),e([n()],R.prototype,"editingEnabled",null),e([n()],R.prototype,"filterGeometry",null),e([n()],R.prototype,"filterBySelectionEnabled",null),e([n({readOnly:!0})],R.prototype,"grid",null),e([n()],R.prototype,"hiddenFields",null),e([n()],R.prototype,"highlightEnabled",null),e([n()],R.prototype,"highlightIds",null),e([n()],R.prototype,"icon",null),e([n()],R.prototype,"isQueryingOrSyncing",null),e([n()],R.prototype,"label",null),e([n()],R.prototype,"layer",null),e([n()],R.prototype,"layerView",null),e([n(),f("esri/widgets/FeatureTable/t9n/FeatureTable")],R.prototype,"messages",null),e([n(),f("esri/t9n/common")],R.prototype,"messagesCommon",null),e([n(),f("esri/widgets/support/t9n/uriUtils")],R.prototype,"messagesURIUtils",null),e([n()],R.prototype,"menuConfig",void 0),e([n()],R.prototype,"multipleSelectionEnabled",null),e([n()],R.prototype,"multiSortEnabled",null),e([n()],R.prototype,"objectIds",null),e([n()],R.prototype,"pageSize",null),e([n()],R.prototype,"relatedRecordsEnabled",null),e([n()],R.prototype,"relatedTable",null),e([n()],R.prototype,"relatedTables",void 0),e([n()],R.prototype,"relationship",null),e([n()],R.prototype,"relationshipColumnConfigs",null),e([n()],R.prototype,"relationshipConfig",null),e([n()],R.prototype,"returnGeometryEnabled",null),e([n()],R.prototype,"rowHighlightIds",null),e([n()],R.prototype,"selectionSource",null),e([n()],R.prototype,"showRelatedTableCallback",null),e([n()],R.prototype,"size",null),e([n({readOnly:!0})],R.prototype,"state",null),e([n({constructOnly:!0})],R.prototype,"tableParent",void 0),e([n()],R.prototype,"tableTemplate",null),e([n()],R.prototype,"tableTemplateOverride",null),e([n()],R.prototype,"title",void 0),e([n()],R.prototype,"timeExtent",null),e([n()],R.prototype,"timeZone",null),e([n()],R.prototype,"view",null),e([n({type:c}),_(["cell-click","cell-pointerover","cell-pointerout","cell-keydown","show-related-table"])],R.prototype,"viewModel",void 0),e([n({type:h,nonNullable:!0})],R.prototype,"visibleElements",void 0),e([n({type:h})],R.prototype,"visibleElementsOverride",void 0),R=S=e([r("esri.widgets.FeatureTable")],R);const j=R;export{j as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{watch as i,sync as l,initial as o,on as s}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import d from"./FeatureTable/ColumnMenuVisibleElements.js";import c from"./FeatureTable/FeatureTableViewModel.js";import h from"./FeatureTable/VisibleElements.js";import p from"./FeatureTable/support/FieldColumnTemplate.js";import m from"./FeatureTable/support/TableTemplate.js";import{uniqueColumnNames as u,isIFeatureTableSupportedLayerWithAttachments as g}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import{Heading as v}from"./support/Heading.js";import{renderingSanitizer as y}from"./support/widgetUtils.js";import{messageBundle as f}from"./support/decorators/messageBundle.js";import{vmEvent as _}from"./support/decorators/vmEvent.js";import{tsx as M}from"./support/jsxFactory.js";import{substitute as C}from"../intl/substitute.js";var S;const E="esri-feature-table",T=`${E}__prompt`,A={base:E,content:`${E}__content`,menuPopover:`${E}__menu-popover`,tableContainer:`${E}__table-container`,tableNavigation:`${E}__table-navigation`,expanded:`${E}__expanded`,collapsed:`${E}__collapsed`,promptContainer:T,promptHeader:`${T}__header`,promptHeading:`${T}__header__heading`,promptMessage:`${T}__message`,promptDivider:`${T}__divider`,promptActions:`${T}__actions`},I={clearSelection:"clear-selection",delete:"trash",refresh:"refresh",showAll:"selection-x",showSelected:"selection-filter",zoomToSelection:"zoom-to-object"};let R=S=class extends a{constructor(e,i){super(e,i),this._columnVisibilityActions=new Map,this._prompt=null,this._showAllTablesEnabled=!1,this.disabled=!1,this.menuConfig=null,this.relatedTables=new t,this.tableParent=null,this.title=null,this.viewModel=new c,this.visibleElements=new h,this.visibleElementsOverride=null,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([i((()=>[this.viewModel.store.querying,this.viewModel.store.syncing,this.editingEnabled]),(()=>this.scheduleRender())),i((()=>({visibleElements:this._effectiveVisibleElements,items:this.columns.length})),(({visibleElements:e})=>{this.columns.forEach((t=>t.visibleElements=e)),this.refreshCellContent()}),l),i((()=>this._effectiveVisibleElements.selectionColumn),(e=>{this.grid&&(this.grid.selectionColumnEnabled=e)}),o),s((()=>this.viewModel),"show-related-table",(e=>this._onShowRelatedTable(e))),i((()=>this.viewModel.state),(e=>{"disabled"===e&&this.relatedTables.length&&this._drainRelatedTables()}))])}loadDependencies(){return b({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel.js"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover.js"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress.js"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar.js"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown.js"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group.js"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item.js"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker.js"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker.js"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone.js")})}destroy(){this._clearPrompt()}get _effectiveTitle(){const{layer:e,messages:t,state:i,highlightIds:l,title:o,viewModel:s}=this;if(o)return y.sanitize("function"==typeof o?o():o);if(!e)return t.noLayer;switch(i){case"disabled":return t.errorLayer;case"ready":return y.sanitize(e.title);case"loading":return t.loading;case"error":return t.errorData}return C(t.header,{title:y.sanitize(e.title),count:s.size,selected:l.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}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)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this._showAllTablesEnabled)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length)}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)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!!(this.view&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.zoomToSelection)}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 attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=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 editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}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 grid(){return this.viewModel.grid}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"table"}set icon(e){this._overrideIfSome("icon",e)}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing||this.relatedTables.some((e=>!!e.isQueryingOrSyncing))}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 layerView(){return this.viewModel.layerView}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 messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=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 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}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}hideColumn(e){this.grid?.hideColumn(e)}async refresh(){this.relatedTables.forEach((async e=>await e.refresh())),await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollToIndex(e){this.viewModel.scrollToIndex(e)}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.viewModel.zoomToSelection()}render(){const{_prompt:e,_effectiveVisibleElements:t,isQueryingOrSyncing:i,menuConfig:l,state:o}=this;return M("div",{bind:this,class:this.classes(A.base,w.widget)},M("calcite-panel",{bind:this,class:A.content,closable:t.close,disabled:this.disabled||"disabled"===o,heading:t.header?this._effectiveTitle:void 0,loading:"loading"===o,menuOpen:!!l?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.target.closed=!1,this.emit("close")}},t.progress?M("calcite-progress",{type:i?"indeterminate":"determinate"}):null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderRelatedTableNavigationBar(),M("div",{class:A.tableContainer},this._renderTables())),e?M("calcite-scrim",null,this._renderPrompt(e)):null)}_renderTables(){const{_showAllTablesEnabled:e,grid:t,relatedTables:i}=this;if(i.length){const l=i.toArray(),o=1===l.length,s=this.classes(A.base,e?A.expanded:A.collapsed),n=e||o,r=e?l:o?[l[0]]:l.slice(-2);return M("calcite-panel",null,M("div",null,[n?M("div",{class:s},t?.render()):void 0,...r.map((e=>{const t=i.indexOf(e);return M("div",{class:s,key:`related-${t}`},e.render())})),,]))}return t?.render()}_clearPrompt(){this._prompt=null}_renderPrompt({title:e,message:t,context:i,actions:l}){const o=M("calcite-button",{appearance:"solid",key:"prompt-primary-button",kind:"danger"===i?"danger":"brand",onclick:l.primary.action,width:l.secondary?"half":"full"},l.primary.label),s=l.secondary?M("calcite-button",{appearance:"outline",key:"prompt-secondary-button",kind:"danger"===i?"danger":"brand",onclick:l.secondary.action,width:"half"},l.secondary.label):null;return M("div",{class:`${A.promptContainer}--${i}`},M("div",{class:A.promptHeader},M("calcite-icon",{icon:"exclamation-mark-triangle"}),M(v,{class:A.promptHeading,level:2},e)),M("div",{class:A.promptMessage},t),M("div",{class:A.promptDivider}),M("div",{class:A.promptActions},s,o))}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=C(e.deleteSelectionCount,{count:this.highlightIds.length});this._prompt={title:i,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this._clearPrompt()}}}}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this._clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:s}=e;if(!i)return M("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>s(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this,t=[];return this._showRefreshDataAction&&t.push(this._renderHeaderMenuAction({icon:I.refresh,text:e.refreshData,clickFunction:()=>this.refresh()})),this._showDeleteSelectionAction&&t.push(this._renderHeaderMenuAction({icon:I.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)})),this._showClearSelectionAction&&t.push(this._renderHeaderMenuAction({icon:I.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()})),this._showZoomToSelectionAction&&t.push(this._renderHeaderMenuAction({icon:I.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()})),this._showSelectedRecordsShowSelectedAction&&t.push(this._renderHeaderMenuAction({icon:I.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}})),this._showSelectedRecordsShowAllAction&&t.push(this._renderHeaderMenuAction({icon:I.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()})),t}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map((({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)})))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,_effectiveVisibleElements:t,id:i,messages:l}=this,o=this.relatedTables.at(-1)||this,s=o.columns.toArray(),n=l?.toggleColumns,r=`${i}__toggle-columns-action`,a=[M("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:o.menuConfig?.disabled,icon:"show-column",id:r,slot:"header-actions-end",text:n},t.tooltips?M("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},n):null)];return o.menuConfig?.disabled||a.push(M("calcite-popover",{autoClose:!0,class:A.menuPopover,label:n,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:e.get(i)},M("calcite-list",{filterEnabled:!0,selectionMode:"multiple"},...s.map((({effectiveLabel:e,fieldName:t,hidden:i})=>M("calcite-list-item",{key:`toggle-columns__item-${t}`,label:e,selected:!i,value:t,onCalciteListItemSelect:({target:e})=>o.toggleColumnVisibility(e.value)})))))),a}_onShowRelatedTable(e){if(this.showRelatedTableCallback)return;const{relatedTables:t}=this,{length:i}=t,l=i?t.getItemAt(i-1):this;this._collapseRelatedTable(l,e),this._createRelatedTable(e)}_renderRelatedTableNavigationBar(){const e=this.messages.exitRelatedRecords;if(this.relatedTables.length&&!this.showRelatedTableCallback)return M("div",{class:A.tableNavigation,key:"table-nav"},M("calcite-action",{icon:"move-up",key:e,onclick:()=>this._drainRelatedTables(),text:e,title:e}),this.relatedTables.toArray().map(((e,t)=>this._renderRelatedTableNavigationAction(e,t))),M("div",null,M("calcite-label",{layout:"inline"},"Show all tables",M("calcite-switch",{checked:this._showAllTablesEnabled,onCalciteSwitchChange:e=>{const{relatedTables:t}=this,i=!!e.target.checked,l=t.at(-1);this._showAllTablesEnabled=i,l&&(i?this._enterShowAllView(l):this._exitShowAllView(l))}}))))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return M("calcite-action",{icon:"chevron-right",key:t,onclick:()=>this._drainRelatedTablesAboveIndex(t),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}_drainRelatedTables(){this.relatedTables.drain((e=>!e.destroyed&&e.destroy())),this.set({_showAllTablesEnabled:!1,multipleSelectionEnabled:!0,tableTemplateOverride:null,relationshipColumnConfigs:null,visibleElementsOverride:null}),this.hiddenFields.removeMany([u.action,u.attachments])}_drainRelatedTablesAboveIndex(e){const t=this.relatedTables,i=t.filter(((t,i)=>i>e));i.forEach((e=>!e.destroyed&&e.destroy())),t.removeMany(i);const l=t.at(-1);if(!l?.layer||!l?.relationship)return;const{layer:o,relationship:s}=l;this._showAllTablesEnabled?this._enterShowAllView(l):l.set({multipleSelectionEnabled:!0,tableTemplateOverride:null,relationshipColumnConfigs:this._getRelationshipIdsToShow(o,s.id),visibleElementsOverride:null}),l.hiddenFields.removeMany([u.action,u.attachments])}_getRelatedTableMenuItemConfig(e,t,i){return t.fields.map((({alias:l,name:o})=>({selected:o===i,label:l||o,clickFunction:i=>{i.stopPropagation(),e.tableTemplateOverride=new m({columnTemplates:[this._createRelatedFieldColumnTemplate(e,t,o)]})}})))}_createRelatedFieldColumnTemplate(e,t,i){return new p({fieldName:i,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._getRelatedTableMenuItemConfig(e,t,i)},resizable:!1})}_enterShowAllView(e){const t=e.layer;if(!t)return;const i=e===this,{visibleElements:l}=e,o=t.displayField||t.objectIdField;e.set({relationshipColumnConfigs:[],tableTemplateOverride:new m({columnTemplates:[this._createRelatedFieldColumnTemplate(e,t,o)]}),visibleElementsOverride:new h({header:i&&l.header,progress:i&&l.progress,columnMenus:l.columnMenus,close:l.close,tooltips:l.tooltips,selectionColumn:!1,columnMenuItems:new d({sortAscending:!1,sortDescending:!1})})}),e.hiddenFields.addMany([u.action,u.attachments])}_exitShowAllView(e){const{layer:t,relationship:i}=e;t&&null!=i?.id&&(e.set({relationshipColumnConfigs:this._getRelationshipIdsToShow(t,i.id),tableTemplateOverride:null,visibleElementsOverride:null}),e.hiddenFields.removeMany([u.action,u.attachments]))}_collapseRelatedTable(e,i){const{relatedLayer:l,feature:o,relationshipId:s}=i,n=l.relationships?.find((({id:e})=>e===s)),{objectIdField:r}=l,a=l.displayField||n?.keyField||r,c=o.getObjectId()??o.attributes[r],p=e===this,{visibleElements:g}=e;e.set({highlightIds:new t([c]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[{relationshipId:s,collapsed:!0}],tableTemplateOverride:new m({columnTemplates:[this._createRelatedFieldColumnTemplate(e,l,a)]}),visibleElementsOverride:new h({header:p&&g.header,progress:p&&g.progress,columnMenus:g.columnMenus,close:g.close,tooltips:g.tooltips,selectionColumn:!1,columnMenuItems:new d({sortAscending:!1,sortDescending:!1})})}),e.hiddenFields.addMany([u.action,u.attachments])}_getRelationshipIdsToShow(e,t){return(e.relationships??[]).filter((e=>!(e.id===t&&"one-to-one"===e.cardinality))).map((({id:e})=>({relationshipId:e})))}async _createRelatedTable(e){const{editingEnabled:t,relatedTables:i,view:l,viewModel:o}=this,{layer:n,feature:r,relatedLayer:a,relationshipId:d}=e,c=r.getObjectId()??r.attributes[a.objectIdField],p=i.length,m=p?i.getItemAt(p-1):this;await n.load();const u=this.attachmentsEnabled&&g(n),b=new S({layer:n,attachmentsEnabled:u,editingEnabled:t,relatedRecordsEnabled:!0,relationshipConfig:{objectId:c,relatedLayer:a,relationshipId:d},relationshipColumnConfigs:this._getRelationshipIdsToShow(n,d),tableParent:m,view:l,visibleElements:new h({header:!1,progress:!1}),showRelatedTableCallback:({feature:e,layer:t,relatedLayer:i,relationshipId:l})=>{null!=(e.getObjectId()??e.attributes[i.objectIdField])&&o.emit("show-related-table",{feature:e,layer:t,relatedLayer:i,relationshipId:l})}});b.addHandles([s((()=>m.highlightIds),"change",(({added:e})=>{const t=e[0];null!=t&&(b.highlightIds.removeAll(),b.relationshipConfig={objectId:t,relatedLayer:a,relationshipId:d})})),s((()=>m),"cell-click",(e=>{const{feature:t}=e;if(t){const e=t.getObjectId()??t.attributes[a.objectIdField];null!=e&&m.highlightIds.add(e)}}))]),this.relatedTables.add(b),this.scheduleRender()}};e([n()],R.prototype,"_columnVisibilityActions",void 0),e([n()],R.prototype,"_effectiveTitle",null),e([n()],R.prototype,"_effectiveVisibleElements",null),e([n()],R.prototype,"_hasCustomMenuItems",null),e([n()],R.prototype,"_hasDefaultMenuItems",null),e([n()],R.prototype,"_prompt",void 0),e([n()],R.prototype,"_shouldShowMenu",null),e([n()],R.prototype,"_showAllTablesEnabled",void 0),e([n()],R.prototype,"_showClearSelectionAction",null),e([n()],R.prototype,"_showColumnsVisibilityAction",null),e([n()],R.prototype,"_showDeleteSelectionAction",null),e([n()],R.prototype,"_showRefreshDataAction",null),e([n()],R.prototype,"_showSelectedRecordsShowSelectedAction",null),e([n()],R.prototype,"_showSelectedRecordsShowAllAction",null),e([n()],R.prototype,"_showZoomToSelectionAction",null),e([n()],R.prototype,"actionColumnConfig",null),e([n({readOnly:!0})],R.prototype,"activeFilters",null),e([n({readOnly:!0})],R.prototype,"activeSortOrders",null),e([n()],R.prototype,"attachmentsEnabled",null),e([n()],R.prototype,"autoRefreshEnabled",null),e([n()],R.prototype,"columnPerformanceModeEnabled",null),e([n()],R.prototype,"columnReorderingEnabled",null),e([n({readOnly:!0})],R.prototype,"columns",null),e([n()],R.prototype,"disabled",void 0),e([n()],R.prototype,"editingEnabled",null),e([n()],R.prototype,"filterGeometry",null),e([n()],R.prototype,"filterBySelectionEnabled",null),e([n({readOnly:!0})],R.prototype,"grid",null),e([n()],R.prototype,"hiddenFields",null),e([n()],R.prototype,"highlightEnabled",null),e([n()],R.prototype,"highlightIds",null),e([n()],R.prototype,"icon",null),e([n()],R.prototype,"isQueryingOrSyncing",null),e([n()],R.prototype,"label",null),e([n()],R.prototype,"layer",null),e([n()],R.prototype,"layerView",null),e([n(),f("esri/widgets/FeatureTable/t9n/FeatureTable")],R.prototype,"messages",null),e([n(),f("esri/t9n/common")],R.prototype,"messagesCommon",null),e([n(),f("esri/widgets/support/t9n/uriUtils")],R.prototype,"messagesURIUtils",null),e([n()],R.prototype,"menuConfig",void 0),e([n()],R.prototype,"multipleSelectionEnabled",null),e([n()],R.prototype,"multiSortEnabled",null),e([n()],R.prototype,"objectIds",null),e([n()],R.prototype,"pageSize",null),e([n()],R.prototype,"relatedRecordsEnabled",null),e([n()],R.prototype,"relatedTable",null),e([n()],R.prototype,"relatedTables",void 0),e([n()],R.prototype,"relationship",null),e([n()],R.prototype,"relationshipColumnConfigs",null),e([n()],R.prototype,"relationshipConfig",null),e([n()],R.prototype,"returnGeometryEnabled",null),e([n()],R.prototype,"rowHighlightIds",null),e([n()],R.prototype,"selectionSource",null),e([n()],R.prototype,"showRelatedTableCallback",null),e([n()],R.prototype,"size",null),e([n({readOnly:!0})],R.prototype,"state",null),e([n({constructOnly:!0})],R.prototype,"tableParent",void 0),e([n()],R.prototype,"tableTemplate",null),e([n()],R.prototype,"tableTemplateOverride",null),e([n()],R.prototype,"title",void 0),e([n()],R.prototype,"timeExtent",null),e([n()],R.prototype,"timeZone",null),e([n()],R.prototype,"view",null),e([n({type:c}),_(["cell-click","cell-pointerover","cell-pointerout","cell-keydown","show-related-table"])],R.prototype,"viewModel",void 0),e([n({type:h,nonNullable:!0})],R.prototype,"visibleElements",void 0),e([n({type:h})],R.prototype,"visibleElementsOverride",void 0),R=S=e([r("esri.widgets.FeatureTable")],R);const j=R;export{j as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{id as e}from"../../kernel.js";import i from"../../request.js";import{isSome as r}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import s from"../../core/Error.js";import{JSONMap as a}from"../../core/jsonMap.js";import{clone as l}from"../../core/lang.js";import n from"../../core/Loadable.js";import{isAbortError as p}from"../../core/promiseUtils.js";import{watch as m,initial as u}from"../../core/reactiveUtils.js";import{createScreenPoint as h}from"../../core/screenUtils.js";import{convertUnit as c,getMetersPerUnitForSR as d,inchesPerMeter as y}from"../../core/unitUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import{formatDate as w,convertDateFormatToIntlOptions as _}from"../../intl/date.js";import{getLanguage as g}from"../../intl/locale.js";import T from"../../portal/Portal.js";import I from"../../portal/PortalQueryParams.js";import{execute as O}from"../../rest/geoprocessor/execute.js";import{submitJob as b}from"../../rest/geoprocessor/submitJob.js";import{execute as x,getTasks as P,getMode as L}from"../../rest/print.js";import{fromJSON as S}from"../../rest/support/fileFormat.js";import{fromJSON as j}from"../../rest/support/layoutTemplate.js";import E from"../../rest/support/PrintParameters.js";import U from"../../rest/support/PrintTemplate.js";import{getExtent as C}from"../../views/2d/viewpointUtils.js";import{ViewEventPriorities as H}from"../../views/input/InputManager.js";import D from"../../views/overlay/BoxOverlayItem.js";import F from"./CustomTemplate.js";import k from"./TemplateOptions.js";import M from"../../geometry/Extent.js";const N=new a({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),W=o.ofType(F);function A(t){t.layoutOptions??={},t.layoutOptions.customTextElements??=[];const e="date";if(!t.layoutOptions.customTextElements.find((t=>e in t))){const{customTextElements:e}=t.layoutOptions;let i=w(Date.now(),_("short-date"));"ar"===g()&&(i=""+i),e.push({date:i})}}let z=class extends n{constructor(t){super(t),this._serviceTemplateCustomTextElements=null,this._templateToLayoutInfo=new Map,this._isFreeHand=!1,this._freeHandWidth=0,this._freehandHeight=0,this.allowedFormats="all",this.allowedLayouts="all",this.browseTemplates=new W,this.defaultTemplates=new W,this.error=null,this.extraParameters=null,this.includeDefaultTemplates=!0,this.portal=T.getDefault(),this.printPreviewEnabled=!1,this.printServiceUrl=null,this.printTimeout=12e4,this.templatesInfo=null,this.updateDelay=1e3,this.view=null,this.templateCustomTextElements=null,this.templateOptions=new k}initialize(){this.addHandles(m((()=>this.printPreviewEnabled),(t=>{t?this._enablePrintPreview():(this.removeHandles("overlay-handler"),this.view?.overlay?.removeItem(this._getOverlayItem()))})))}destroy(){this.removeHandles("overlay-handler"),this.view&&(this._overlayItem&&(this.view.overlay?.removeItem(this._overlayItem),this._overlayItem.destroy(),this._overlayItem=null),this.view=null)}get effectivePrintServiceUrl(){return this.printServiceUrl??null}get effectiveTemplateCustomTextElements(){if(!this._serviceTemplateCustomTextElements)return{};const t=l(this._serviceTemplateCustomTextElements);return this.templateCustomTextElements&&Object.keys(this.templateCustomTextElements).forEach((e=>{const i=t[e];if(i){const t=this.templateCustomTextElements?.[e];i.forEach((e=>{const[i]=Object.entries(e)[0];t?.forEach((t=>{const[r,o]=Object.entries(t)[0];i===r&&(e[i]=o)}))}))}})),Object.freeze(t)}get layoutTemplateInfo(){return this._templateToLayoutInfo.get(this.templateOptions.layoutItem?.id??this.templateOptions.layout)}get state(){return"loading"===this.loadStatus?"initializing":"failed"===this.loadStatus||this.error?"error":"loaded"===this.loadStatus&&this.view?.ready?"ready":"disabled"}get layoutTemplateNorthArrowInfo(){return this.layoutTemplateInfo?.layoutOptions?.mapSurroundInfos?this.layoutTemplateInfo.layoutOptions.mapSurroundInfos.find((t=>"CIMMarkerNorthArrow"===t.type)):null}async load(t){return this.addResolvingPromise(this._loadResources(t).catch((t=>this.error=t))),this}async print(t){const{view:e,extraParameters:i,updateDelay:r}=this;if(!e)throw new s("print:view-required","view is not set");A(t);const o=this._getOverlayItem(),a=t.scalePreserved||!this.printPreviewEnabled?void 0:C(new M,e.viewpoint,"MAP_ONLY"===t.layout?[t.exportOptions.width,t.exportOptions.height]:[o.boxWidth,o.boxHeight]),l=new E({view:e,template:t,extent:a,extraParameters:i,updateDelay:r});try{return await x(this.effectivePrintServiceUrl,l,{timeout:this.printTimeout})}catch(n){throw new s("print:export-error","An error occurred while exporting the web map.",{error:n})}}toPrintTemplate({attributionEnabled:t,author:e,copyright:i,customTextElements:r,dpi:o,forceFeatureAttributes:s,format:a,height:l,includeTables:n,layout:p,layoutItem:m,legendEnabled:u,northArrowEnabled:h,scale:c,scaleEnabled:d,title:y,width:f}){const v=new U({attributionVisible:t,forceFeatureAttributes:s,format:a,includeTables:n,layout:p,layoutItem:m,layoutOptions:{authorText:e||"",copyrightText:i||"",customTextElements:r,titleText:y||""},outScale:c??0,scalePreserved:d});f&&(v.exportOptions.width=f),l&&(v.exportOptions.height=l),o&&(v.exportOptions.dpi=o),!u&&v.layoutOptions&&(v.layoutOptions.legendLayers=[]);const w=this.layoutTemplateNorthArrowInfo;if(w){!(w.visible===h)&&v.layoutOptions&&(v.layoutOptions.elementOverrides={[w.name]:{visible:h}})}return v}async fetchLayoutTemplateInfo(t,e){if(!t.layoutItem?.id)return;const i=await this._fetchPortalLayoutTemplateInfo(t.layoutItem,e);this._templateToLayoutInfo.set(t.layoutItem.id,i),t.layoutTemplateInfo=i;const{hasLegend:r,mapSurroundInfos:o}=i.layoutOptions,s=o.some((({type:t,visible:e})=>"CIMMarkerNorthArrow"===t&&e));t.layoutOptions={legend:r,northArrow:s}}getPageSizeLabel(t){if(!t)return;const e=this._templateToLayoutInfo.get(t);return e?`${e.pageSize.join(" x ")} ${N.fromJSON(e.pageUnits.toLowerCase())}`:void 0}async addPortalTemplate(t){const e=new F({label:t.title,layoutItem:t});this.browseTemplates.add(e)}removePortalTemplate(t){t.layoutItem?.id&&this.templateOptions.layoutItem?.id===t.layoutItem.id&&(this.templateOptions.layout=this.templatesInfo?.layout?.defaultValue??"letter-ansi-a-landscape",this.templateOptions.layoutItem=null),this._templateToLayoutInfo.delete(t.layoutItem.id),this.browseTemplates.remove(t)}async _loadResources(t){let e=[];if(!this.printServiceUrl){if(this.destroyed)return;try{await this.portal.load(t)}catch(l){throw new s("print:could-not-load-portal","Cannot load print resource information from portal",{error:l,url:this.effectivePrintServiceUrl})}const i=this.portal.helperServices?.printTask;i&&(this._set("effectivePrintServiceUrl",i.url),e=i.templates?.map((t=>F.fromJSON(t)))??[])}this.defaultTemplates.addMany(e);const i=this.effectivePrintServiceUrl?.toLowerCase().split("/");if(!i?.includes("gpserver"))throw new s("print:invalid-print-service-url","Can't fetch print templates information from provided URL",{url:this.effectivePrintServiceUrl});const[r,o,a]=await Promise.all([this._getPrintServiceLayouts(t),this._getPrintServiceTemplates(t),this._getPortalCustomTemplates(t)]);this._processPrintServiceLayouts(r),this._processPrintServiceTemplates(o),this._processPortalTemplates(a)}async _getPortalCustomTemplates(t){if(this.printServiceUrl)return[];const{layoutGroupQuery:e}=this.portal;if(!e)return[];const i=new I({query:e,disableExtraQuery:!0}),r=await this.portal.queryGroups(i,t);if(!r.total)return[];const o=r.results[0],s=new I({num:100,query:"type:Layout"}),a=(await o.queryItems(s,t)).results;return a.length?a.map((t=>new F({label:t.title,layoutItem:t}))):[]}async _fetchPortalLayoutTemplateInfo(t,i){const{id:r}=t;"public"!==t.access&&e&&await e.getCredential(this._printServiceLayoutsUrl);const o={Layout_Item_ID:JSON.stringify({id:r})},{results:s}=await O(this._printServiceLayoutsUrl,o,null,i);return s[0].value[0]}_processPortalTemplates(t){this.defaultTemplates.addMany(t)}_processPrintServiceTemplates(t){this._set("templatesInfo",t)}async _getPrintServiceLayouts(t){let e=[];const i=async e=>{const i=await L(this.effectivePrintServiceUrl);if(this._printServiceLayoutsUrl=this.effectivePrintServiceUrl.replace(/(\/GPServer\/).+/i,`$1${encodeURI(e)}`),"async"===i){const e=await b(this._printServiceLayoutsUrl,void 0,void 0,t||void 0);await e.waitForJobCompletion({interval:1e3});return(await e.fetchResultData("Output_JSON")).value}return(await O(this._printServiceLayoutsUrl,null,null,t)).results[0].value},r=(await P(this.effectivePrintServiceUrl,t)).find((t=>t.includes("Get Layout Templates Info")));if(r)try{e=await i(r)}catch{}return e}_processPrintServiceLayouts(t){const e={};for(const i of t){const{layoutTemplate:t,layoutOptions:r}=i,o=j(t);this._templateToLayoutInfo.set(o,i),e[o]=r.customTextElements}this._serviceTemplateCustomTextElements=Object.freeze(e)}async _getPrintServiceTemplates(t){let e;try{({data:e}=await i(this.effectivePrintServiceUrl,{...t,query:{f:"json"},timeout:this.printTimeout}))}catch(l){throw p(l)?l:new s("print:unavailable-service-info","Can't fetch templates info from service",{error:l})}const{parameters:r}=e,o=r.find((({name:t})=>"Format"===t)),a=r.find((({name:t})=>"Layout_Template"===t));return{format:this._getFormat(o),layout:this._getLayout(a)}}_getFormat(t){const e="all"===this.allowedFormats?t.choiceList:t.choiceList.filter((t=>this.allowedFormats.includes(S(t)))),i=(e.length?e:t.choiceList).map(S).filter(r),o=S(t.defaultValue),s=i.includes(o)?o:i[0];return{choiceList:i,defaultValue:s}}_getLayout(t){const e=t.choiceList.filter((t=>"map_only"!==t.toLowerCase())),i="all"===this.allowedLayouts?e:e.filter((t=>this.allowedLayouts.includes(j(t)))),o=(i.length?i:e).map(j).filter(r),s=j(t.defaultValue),a=o.includes(s)?s:o.find((t=>/(?=.*letter)(?=.*landscape)/i.test(t)))??o.find((t=>/(?=.*a4)(?=.*landscape)/i.test(t)))??o[0];return{choiceList:o,defaultValue:a}}_getOverlayItem(){return this._overlayItem||(this._overlayItem=new D({strokeDash:[5],strokeWidth:2,strokeColor:[30,144,255,255]})),this._overlayItem}_enablePrintPreview(){if(!this.view?.overlay)return;const t=this.templateOptions,e=this._getOverlayItem();this.addHandles([m((()=>[t.width,t.height,t.scaleEnabled,t.scale,t.layout,t.layoutItem,this.view?.scale,this.view?.size,this.view?.state.paddedViewState.size,this.view?.state.padding]),(()=>this._updateOverLayItem()),u),this.view?.on("drag",["Shift"],(t=>this._handleDrag(t)),H.WIDGET),this.view?.on("key-down",["Escape"],(()=>this._resetDrag()),H.WIDGET)],"overlay-handler"),this.view.overlay.addItem(e)}_updateOverLayItem(){if(!this.view)return;const t=this.templateOptions,e=this._getOverlayItem(),i=t.layoutItem?.id??t.layout,r=this.view,o=r.spatialReference,[s,a]=r.state.paddedViewState.size,l=r.state.padding;let n=0,p=0;if("MAP_ONLY"===i)null!=t.width&&null!=t.height&&(n=t.width,p=t.height);else{const{webMapFrameSize:e,pageUnits:r}=this._templateToLayoutInfo.get(i)??{};if(e&&r)if(this._isFreeHand){const t=e[0]/e[1];n=this._freeHandWidth,p=this._freehandHeight,n>p?p=n/t:n=p*t}else{const t=N.fromJSON(r.toLowerCase()),i=o.unit;n=c(e[0],t,i),p=c(e[1],t,i)}if(!this._isFreeHand)if(t.scaleEnabled&&t.scale){const e=d(o)*y*t.dpi;n*=e,p*=e}else if(0===n||0===p)n=s,p=a;else{const t=(s-.1*s)/n,e=(a-.1*a)/p,i=Math.min(t,e);n*=i,p*=i}}const{scaleEnabled:m,scale:u}=t,h=m&&u?u/this.view.scale:1;e.boxWidth=n*h,e.boxHeight=p*h,l&&(e.padding=l),e.backgroundWidth=s??0,e.backgroundHeight=a??0}_resetDrag(){this._isFreeHand=!1,this._updateOverLayItem()}_handleDrag(t){switch(t.action){case"start":this._start();break;case"update":this._update(t);break;case"end":this._end()}t.stopPropagation()}_start(){this._isFreeHand=!0}_update(t){const e=this._getOverlayItem(),{x:i,y:r}=t,{x:o,y:s}=t.origin;i>o?(e.x=o,e.boxWidth=i-o):(e.x=i,e.boxWidth=o-i),r>s?(e.y=s,e.boxHeight=r-s):(e.y=r,e.boxHeight=s-r)}_end(){const t=this._getOverlayItem();if(!this.view||null==t.x||null==t.y)return;const e=this.view,i=e.toMap(h(t.x+.5*t.boxWidth,t.y+.5*t.boxHeight));t.x=null,t.y=null,e.goTo({center:i}),this._freeHandWidth=t.boxWidth,this._freehandHeight=t.boxHeight,"MAP_ONLY"===this.templateOptions.layout&&(this.templateOptions.width=this._freeHandWidth,this.templateOptions.height=this._freehandHeight),this.templateOptions.scale=this.view.scale,this._updateOverLayItem()}};t([f()],z.prototype,"_serviceTemplateCustomTextElements",void 0),t([f()],z.prototype,"_templateToLayoutInfo",void 0),t([f()],z.prototype,"allowedFormats",void 0),t([f()],z.prototype,"allowedLayouts",void 0),t([f({type:W})],z.prototype,"browseTemplates",void 0),t([f({type:W})],z.prototype,"defaultTemplates",void 0),t([f()],z.prototype,"error",void 0),t([f()],z.prototype,"extraParameters",void 0),t([f()],z.prototype,"includeDefaultTemplates",void 0),t([f({readOnly:!0})],z.prototype,"effectivePrintServiceUrl",null),t([f()],z.prototype,"effectiveTemplateCustomTextElements",null),t([f()],z.prototype,"layoutTemplateInfo",null),t([f({type:T})],z.prototype,"portal",void 0),t([f()],z.prototype,"printPreviewEnabled",void 0),t([f()],z.prototype,"printServiceUrl",void 0),t([f()],z.prototype,"printTimeout",void 0),t([f({readOnly:!0})],z.prototype,"state",null),t([f({readOnly:!0})],z.prototype,"templatesInfo",void 0),t([f()],z.prototype,"updateDelay",void 0),t([f()],z.prototype,"view",void 0),t([f()],z.prototype,"templateCustomTextElements",void 0),t([f({type:k})],z.prototype,"templateOptions",void 0),t([f()],z.prototype,"layoutTemplateNorthArrowInfo",null),z=t([v("esri.widgets.Print.PrintViewModel")],z);const V=z;export{V as default};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{id as e}from"../../kernel.js";import i from"../../request.js";import{isSome as o}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import{JSONMap as a}from"../../core/jsonMap.js";import{clone as l}from"../../core/lang.js";import n from"../../core/Loadable.js";import{isAbortError as p}from"../../core/promiseUtils.js";import{watch as m,initial as u}from"../../core/reactiveUtils.js";import{createScreenPoint as h}from"../../core/screenUtils.js";import{convertUnit as c,getMetersPerUnitForSR as d,inchesPerMeter as y}from"../../core/unitUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import{formatDate as w,convertDateFormatToIntlOptions as T}from"../../intl/date.js";import{getLanguage as _}from"../../intl/locale.js";import I from"../../portal/Portal.js";import g from"../../portal/PortalQueryParams.js";import{execute as b}from"../../rest/geoprocessor/execute.js";import{submitJob as O}from"../../rest/geoprocessor/submitJob.js";import{execute as P,getTasks as x,getMode as L}from"../../rest/print.js";import{fromJSON as S}from"../../rest/support/fileFormat.js";import{fromJSON as j}from"../../rest/support/layoutTemplate.js";import U from"../../rest/support/PrintParameters.js";import E from"../../rest/support/PrintTemplate.js";import{getExtent as k}from"../../views/2d/viewpointUtils.js";import{ViewEventPriorities as C}from"../../views/input/InputManager.js";import H from"../../views/overlay/BoxOverlayItem.js";import D from"./CustomTemplate.js";import F from"./TemplateOptions.js";import M from"../../geometry/Extent.js";const N=/(\/GPServer\/).+/i,W=new a({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),A=r.ofType(D);function z(t){t.layoutOptions??={},t.layoutOptions.customTextElements??=[];const e="date";if(!t.layoutOptions.customTextElements.find((t=>e in t))){const{customTextElements:e}=t.layoutOptions;let i=w(Date.now(),T("short-date"));"ar"===_()&&(i=""+i),e.push({date:i})}}let V=class extends n{constructor(t){super(t),this._serviceTemplateCustomTextElements=null,this._templateToLayoutInfo=new Map,this._isFreeHand=!1,this._freeHandWidth=0,this._freehandHeight=0,this._asyncPrintTaskUrl=null,this._layoutInfoTaskUrl=null,this.allowedFormats="all",this.allowedLayouts="all",this.browseTemplates=new A,this.defaultTemplates=new A,this.error=null,this.extraParameters=null,this.includeDefaultTemplates=!0,this.portal=I.getDefault(),this.portalTemplateIds=[],this.printPreviewEnabled=!1,this.printServiceUrl=null,this.printTimeout=12e4,this.templatesInfo=null,this.updateDelay=1e3,this.view=null,this.templateCustomTextElements=null,this.templateOptions=new F}initialize(){this.addHandles(m((()=>this.printPreviewEnabled),(t=>{t?this._enablePrintPreview():(this.removeHandles("overlay-handler"),this.view?.overlay?.removeItem(this._getOverlayItem()))})))}destroy(){this.removeHandles("overlay-handler"),this.view&&(this._overlayItem&&(this.view.overlay?.removeItem(this._overlayItem),this._overlayItem.destroy(),this._overlayItem=null),this.view=null)}get effectivePrintServiceUrl(){return this.printServiceUrl??null}get effectiveTemplateCustomTextElements(){if(!this._serviceTemplateCustomTextElements)return{};const t=l(this._serviceTemplateCustomTextElements);return this.templateCustomTextElements&&Object.keys(this.templateCustomTextElements).forEach((e=>{const i=t[e];if(i){const t=this.templateCustomTextElements?.[e];i.forEach((e=>{const[i]=Object.entries(e)[0];t?.forEach((t=>{const[o,r]=Object.entries(t)[0];i===o&&(e[i]=r)}))}))}})),Object.freeze(t)}get layoutTemplateInfo(){const t=this.templateOptions.layoutItem?.id??this.templateOptions.layout;return t?this._templateToLayoutInfo.get(t):null}get state(){return"loading"===this.loadStatus?"initializing":"failed"===this.loadStatus||this.error?"error":"loaded"===this.loadStatus&&this.view?.ready?"ready":"disabled"}get layoutTemplateNorthArrowInfo(){return this.layoutTemplateInfo?.layoutOptions?.mapSurroundInfos?this.layoutTemplateInfo.layoutOptions.mapSurroundInfos.find((t=>"CIMMarkerNorthArrow"===t.type)):null}async load(t){return this.addResolvingPromise(this._loadResources(t).catch((t=>this.error=t))),this}async print(t){const{view:e,extraParameters:i,updateDelay:o}=this;if(!e)throw new s("print:view-required","view is not set");z(t);const r=this._getOverlayItem(),a=t.scalePreserved||!this.printPreviewEnabled?void 0:k(new M,e.viewpoint,"MAP_ONLY"===t.layout?[t.exportOptions.width,t.exportOptions.height]:[r.boxWidth,r.boxHeight]),l=new U({view:e,template:t,extent:a,extraParameters:i,updateDelay:o});try{const e=!!t.layoutItem?.id&&(this.portalTemplateIds.includes(t.layoutItem.id)||this.browseTemplates.some((e=>e.layoutItem?.id===t.layoutItem?.id)));return await P(e&&this._asyncPrintTaskUrl?this._asyncPrintTaskUrl:this.effectivePrintServiceUrl,l,{timeout:this.printTimeout})}catch(n){throw new s("print:export-error","An error occurred while exporting the web map.",{error:n})}}toPrintTemplate({attributionEnabled:t,author:e,copyright:i,customTextElements:o,dpi:r,forceFeatureAttributes:a,format:l,height:n,includeTables:p,layout:m,layoutItem:u,legendEnabled:h,northArrowEnabled:c,scale:d,scaleEnabled:y,title:f,width:v}){if(!m)throw new s("print:layout-required","layout is not set");const w=new E({attributionVisible:t,forceFeatureAttributes:a,format:l,includeTables:p,layout:m,layoutItem:u,layoutOptions:{authorText:e||"",copyrightText:i||"",customTextElements:o,titleText:f||""},outScale:d??0,scalePreserved:y});v&&(w.exportOptions.width=v),n&&(w.exportOptions.height=n),r&&(w.exportOptions.dpi=r),!h&&w.layoutOptions&&(w.layoutOptions.legendLayers=[]);const T=this.layoutTemplateNorthArrowInfo;if(T){!(T.visible===c)&&w.layoutOptions&&(w.layoutOptions.elementOverrides={[T.name]:{visible:c}})}return w}async fetchLayoutTemplateInfo(t,e){if(!t.layoutItem?.id)return;const i=await this._fetchPortalLayoutTemplateInfo(t.layoutItem,e);this._templateToLayoutInfo.set(t.layoutItem.id,i),t.layoutTemplateInfo=i;const{hasLegend:o,mapSurroundInfos:r}=i.layoutOptions,s=r.some((({type:t,visible:e})=>"CIMMarkerNorthArrow"===t&&e));t.layoutOptions={legend:o,northArrow:s}}getPageSizeLabel(t){if(!t)return;const e=this._templateToLayoutInfo.get(t);return e?`${e.pageSize.join(" x ")} ${W.fromJSON(e.pageUnits.toLowerCase())}`:void 0}async addPortalTemplate(t){const e=new D({label:t.title,layoutItem:t});this.browseTemplates.add(e)}removePortalTemplate(t){t.layoutItem?.id&&this.templateOptions.layoutItem?.id===t.layoutItem.id&&(this.templateOptions.layout=this.defaultTemplates.length||this.browseTemplates.length?null:this.templatesInfo?.layout?.defaultValue,this.templateOptions.layoutItem=null),this._templateToLayoutInfo.delete(t.layoutItem.id),this.browseTemplates.remove(t)}async _loadResources(t){let e=[];if(!this.printServiceUrl){if(this.destroyed)return;try{await this.portal.load(t)}catch(l){throw new s("print:could-not-load-portal","Cannot load print resource information from portal",{error:l,url:this.effectivePrintServiceUrl})}if(this.portal.helperServices){const{asyncPrintTask:i,layoutInfoTask:o,printTask:r}=this.portal.helperServices;if(r&&(this._set("effectivePrintServiceUrl",r.url),e=r.templates?.map((t=>D.fromJSON(t)))??[]),this._asyncPrintTaskUrl=i?.url,o?.url){const e=(await x(o.url,t)).find((t=>t.includes("Get Layout Templates Info")));e&&(this._layoutInfoTaskUrl=o.url.replace(N,`$1${encodeURI(e)}`))}}}this.defaultTemplates.addMany(e);const i=this.effectivePrintServiceUrl?.toLowerCase().split("/");if(!i?.includes("gpserver"))throw new s("print:invalid-print-service-url","Can't fetch print templates information from provided URL",{url:this.effectivePrintServiceUrl});const[o,r,a]=await Promise.all([this._getPrintServiceLayouts(t),this._getPrintServiceTemplates(t),this._getPortalCustomTemplates(t)]);this._processPrintServiceLayouts(o),this._processPrintServiceTemplates(r),this._processPortalTemplates(a)}async _getPortalCustomTemplates(t){if(this.printServiceUrl)return[];const{layoutGroupQuery:e}=this.portal;if(!e)return[];const i=new g({query:e,disableExtraQuery:!0}),o=await this.portal.queryGroups(i,t);if(!o.total)return[];const r=o.results[0],s=new g({num:100,query:"type:Layout"}),a=(await r.queryItems(s,t)).results;return a.length?a.map((t=>new D({label:t.title,layoutItem:t}))):[]}async _fetchPortalLayoutTemplateInfo(t,i){const{id:o}=t;if(!this._layoutInfoTaskUrl)throw new s("print:invalid-layout-info-task-url","Can't fetch layout template info",{url:this._layoutInfoTaskUrl});"public"!==t.access&&e&&await e.getCredential(this._layoutInfoTaskUrl);const r={Layout_Item_ID:JSON.stringify({id:o})},{results:a}=await b(this._layoutInfoTaskUrl,r,null,i);return a[0].value[0]}_processPortalTemplates(t){this.defaultTemplates.addMany(t);for(const e of t)e.layoutItem?.id&&this.portalTemplateIds.push(e.layoutItem.id)}_processPrintServiceTemplates(t){this._set("templatesInfo",t)}async _getPrintServiceLayouts(t){let e=[];const i=async e=>{const i=await L(this.effectivePrintServiceUrl);if(this._printServiceLayoutsUrl=this.effectivePrintServiceUrl.replace(N,`$1${encodeURI(e)}`),"async"===i){const e=await O(this._printServiceLayoutsUrl,void 0,void 0,t||void 0);await e.waitForJobCompletion({interval:1e3});return(await e.fetchResultData("Output_JSON")).value}return(await b(this._printServiceLayoutsUrl,null,null,t)).results[0].value},o=(await x(this.effectivePrintServiceUrl,t)).find((t=>t.includes("Get Layout Templates Info")));if(o)try{e=await i(o)}catch{}return e}_processPrintServiceLayouts(t){const e={};for(const i of t){const{layoutTemplate:t,layoutOptions:o}=i,r=j(t);this._templateToLayoutInfo.set(r,i),e[r]=o.customTextElements}this._serviceTemplateCustomTextElements=Object.freeze(e)}async _getPrintServiceTemplates(t){let e;try{({data:e}=await i(this.effectivePrintServiceUrl,{...t,query:{f:"json"},timeout:this.printTimeout}))}catch(l){throw p(l)?l:new s("print:unavailable-service-info","Can't fetch templates info from service",{error:l})}const{parameters:o}=e,r=o.find((({name:t})=>"Format"===t)),a=o.find((({name:t})=>"Layout_Template"===t));return{format:this._getFormat(r),layout:this._getLayout(a)}}_getFormat(t){const e="all"===this.allowedFormats?t.choiceList:t.choiceList.filter((t=>this.allowedFormats.includes(S(t)))),i=(e.length?e:t.choiceList).map(S).filter(o),r=S(t.defaultValue),s=i.includes(r)?r:i[0];return{choiceList:i,defaultValue:s}}_getLayout(t){const e=t.choiceList.filter((t=>"map_only"!==t.toLowerCase())),i="all"===this.allowedLayouts?e:e.filter((t=>this.allowedLayouts.includes(j(t)))),r=(i.length?i:e).map(j).filter(o),s=j(t.defaultValue),a=r.includes(s)?s:r.find((t=>/(?=.*letter)(?=.*landscape)/i.test(t)))??r.find((t=>/(?=.*a4)(?=.*landscape)/i.test(t)))??r[0];return{choiceList:r,defaultValue:a}}_getOverlayItem(){return this._overlayItem||(this._overlayItem=new H({strokeDash:[5],strokeWidth:2,strokeColor:[30,144,255,255]})),this._overlayItem}_enablePrintPreview(){if(!this.view?.overlay)return;const t=this.templateOptions,e=this._getOverlayItem();this.addHandles([m((()=>[t.width,t.height,t.scaleEnabled,t.scale,t.layout,t.layoutItem,this.view?.scale,this.view?.size,this.view?.state.paddedViewState.size,this.view?.state.padding]),(()=>this._updateOverLayItem()),u),this.view?.on("drag",["Shift"],(t=>this._handleDrag(t)),C.WIDGET),this.view?.on("key-down",["Escape"],(()=>this._resetDrag()),C.WIDGET)],"overlay-handler"),this.view.overlay.addItem(e)}_updateOverLayItem(){if(!this.view)return;const t=this.templateOptions,e=this._getOverlayItem(),i=t.layoutItem?.id??t.layout,o=this.view,r=o.spatialReference,[s,a]=o.state.paddedViewState.size,l=o.state.padding;let n=0,p=0;if("MAP_ONLY"===i)null!=t.width&&null!=t.height&&(n=t.width,p=t.height);else if(i){const{webMapFrameSize:e,pageUnits:o}=this._templateToLayoutInfo.get(i)??{};if(e&&o)if(this._isFreeHand){const t=e[0]/e[1];n=this._freeHandWidth,p=this._freehandHeight,n>p?p=n/t:n=p*t}else{const t=W.fromJSON(o.toLowerCase()),i=r.unit;n=c(e[0],t,i),p=c(e[1],t,i)}if(!this._isFreeHand)if(t.scaleEnabled&&t.scale){const e=d(r)*y*t.dpi;n*=e,p*=e}else if(0===n||0===p)n=s,p=a;else{const t=(s-.1*s)/n,e=(a-.1*a)/p,i=Math.min(t,e);n*=i,p*=i}}const{scaleEnabled:m,scale:u}=t,h=m&&u?u/this.view.scale:1;e.boxWidth=n*h,e.boxHeight=p*h,l&&(e.padding=l),e.backgroundWidth=s??0,e.backgroundHeight=a??0}_resetDrag(){this._isFreeHand=!1,this._updateOverLayItem()}_handleDrag(t){switch(t.action){case"start":this._start();break;case"update":this._update(t);break;case"end":this._end()}t.stopPropagation()}_start(){this._isFreeHand=!0}_update(t){const e=this._getOverlayItem(),{x:i,y:o}=t,{x:r,y:s}=t.origin;i>r?(e.x=r,e.boxWidth=i-r):(e.x=i,e.boxWidth=r-i),o>s?(e.y=s,e.boxHeight=o-s):(e.y=o,e.boxHeight=s-o)}_end(){const t=this._getOverlayItem();if(!this.view||null==t.x||null==t.y)return;const e=this.view,i=e.toMap(h(t.x+.5*t.boxWidth,t.y+.5*t.boxHeight));t.x=null,t.y=null,e.goTo({center:i}),this._freeHandWidth=t.boxWidth,this._freehandHeight=t.boxHeight,"MAP_ONLY"===this.templateOptions.layout&&(this.templateOptions.width=this._freeHandWidth,this.templateOptions.height=this._freehandHeight),this.templateOptions.scale=this.view.scale,this._updateOverLayItem()}};t([f()],V.prototype,"_serviceTemplateCustomTextElements",void 0),t([f()],V.prototype,"_templateToLayoutInfo",void 0),t([f()],V.prototype,"allowedFormats",void 0),t([f()],V.prototype,"allowedLayouts",void 0),t([f({type:A})],V.prototype,"browseTemplates",void 0),t([f({type:A})],V.prototype,"defaultTemplates",void 0),t([f()],V.prototype,"error",void 0),t([f()],V.prototype,"extraParameters",void 0),t([f()],V.prototype,"includeDefaultTemplates",void 0),t([f({readOnly:!0})],V.prototype,"effectivePrintServiceUrl",null),t([f()],V.prototype,"effectiveTemplateCustomTextElements",null),t([f()],V.prototype,"layoutTemplateInfo",null),t([f({type:I})],V.prototype,"portal",void 0),t([f()],V.prototype,"portalTemplateIds",void 0),t([f()],V.prototype,"printPreviewEnabled",void 0),t([f()],V.prototype,"printServiceUrl",void 0),t([f()],V.prototype,"printTimeout",void 0),t([f({readOnly:!0})],V.prototype,"state",null),t([f({readOnly:!0})],V.prototype,"templatesInfo",void 0),t([f()],V.prototype,"updateDelay",void 0),t([f()],V.prototype,"view",void 0),t([f()],V.prototype,"templateCustomTextElements",void 0),t([f({type:F})],V.prototype,"templateOptions",void 0),t([f()],V.prototype,"layoutTemplateNorthArrowInfo",null),V=t([v("esri.widgets.Print.PrintViewModel")],V);const q=V;export{q as default};
|
package/widgets/Print.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import{clone as i}from"../core/lang.js";import{watch as a}from"../core/reactiveUtils.js";import{addProxy as l,hasSameOrigin as o}from"../core/urlUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{getToken as r}from"../rest/utils.js";import{toJSON as c}from"../rest/support/fileFormat.js";import p from"./Widget.js";import d from"./Print/FileLink.js";import u from"./Print/PrintViewModel.js";import{loadCalciteComponents as h}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import{Heading as b}from"./support/Heading.js";import{legacyIcon as _}from"./support/legacyIcon.js";import{isActivationKey as y}from"./support/widgetUtils.js";import{messageBundle as f}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";const v=t.ofType(d),w="MAP_ONLY";var T;!function(e){e.layout="layoutTab",e.mapOnly="mapOnlyTab",e.export="exportTab"}(T||(T={}));const x="esri-print",C=`${x}__advanced-options-button`,O={base:x,headerTitle:`${x}__header-title`,inputText:`${x}__input-text`,layoutTabList:`${x}__layout-tab-list`,layoutTab:`${x}__layout-tab`,layoutSection:`${x}__layout-section`,mapOnlySection:`${x}__map-only-section`,scaleInput:`${x}__scale-input`,panelItemsCentered:`${x}__panel-items--centered`,loader:`${x}__loader`,advancedOptionsButton:C,advancedOptionsButtonContainer:`${C}-container`,advancedOptionsButtonTitle:`${C}-title`,advancedOptionsButtonIconOpened:`${C}-icon--opened`,advancedOptionsButtonIconClosed:`${C}-icon--closed`,advancedOptionsButtonIconClosed_RTL:`${C}-icon--closed-rtl`,refreshButton:`${x}__refresh-button`,swapButton:`${x}__swap-button`,printButton:`${x}__export-button`,templateSelectContainer:`${x}__template-select-container`,templateSelectBlock:`${x}__template-select-block`,templateSelectIcon:`${x}__template-select-icon`,formSectionContainer:`${x}__form-section-container`,formInputLabel:`${x}__form-input-label`,formCheckboxLabel:`${x}__form-checkbox-label`,advancedOptionsSection:`${x}__advanced-options-section`,advancedOptionsContainer:`${x}__advanced-options-container`,authorInfoContainer:`${x}__author-info-container`,browseTemplateButtonContainer:`${x}__browse-template-button-container`,copyrightInfoContainer:`${x}__copyright-info-container`,exportedFilesContainer:`${x}__export-panel-container`,exportedFilesTitle:`${x}__export-title`,exportedFile:`${x}__exported-file`,exportedFileLink:`${x}__exported-file-link`,exportedFileLinkTitle:`${x}__exported-file-link-title`,exportedFilesEmpty:`${x}__exported-files-empty`,legendInfoContainer:`${x}__legend-info-container`,printWidgetContainer:`${x}__container`,content:`${x}__content`,panelContainer:`${x}__panel-container`,scaleInfoContainer:`${x}__scale-info-container`,scaleInputContainer:`${x}__scale-input-container`,sizeContainer:`${x}__size-container`,panelError:`${x}__panel--error`,exportedFileError:`${x}__exported-file--error`,exportSection:`${x}__export-section`,exportSectionCentered:`${x}__export-section--centered`,templateButtonContainer:`${x}__template-button-container`,templateDoneButton:`${x}__template-done-button`};function I(e,t,i,a){const l=i/t,o=a/t;return{width:Math.round(e*l),height:Math.round(e*o)}}function k(e){return!isNaN(e)&&e>0}function $(e){return e?.toUpperCase()===w}function L(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}let M=class extends p{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._exportedFileNameMap={},this._selectedTab=T.layout,this._pendingExportScroll=!1,this._rootNode=null,this._showTemplates=!1,this._selectedLayout=null,this._abortController=null,this.browseTemplateButtonOnClick=null,this.exportedLinks=new v,this.headingLevel=3,this.viewModel=new u,this._onInput=e=>{this._selectedTab===T.layout?this.templateOptions.title=e.target.value:this._selectedTab===T.mapOnly&&(this.templateOptions.fileName=e.target.value)},this._removeLink=e=>{const t=e.currentTarget["data-item"];t&&"error"===t.state&&this.exportedLinks.remove(t)},this._handleLinkClick=e=>{const t=e.currentTarget,{href:i}=t,a=r(this.viewModel.effectivePrintServiceUrl);if(!a)return;if(!e.isTrusted)return void e.stopPropagation();e.preventDefault();const l=new URL(i);l.searchParams.set("token",a),t.href=l.href,t.click(),t.href=i},this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([a((()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format.defaultValue]),(([e,t])=>{if(t&&!e)return void(this.templateOptions.format=t);if(!e||!t||!this.viewModel.templatesInfo)return;if(this.viewModel.templatesInfo.format.choiceList.includes(e))return;const i=this.viewModel.templatesInfo.format.choiceList.find((t=>t.toUpperCase().includes(`(${e.toUpperCase()})`)));this.templateOptions.format=i??t})),a((()=>[this.templateOptions.layout,this.viewModel.templatesInfo?.layout.defaultValue]),(([e,t])=>{if(t&&!e)return void(this.templateOptions.layout=t);if(!e||!t||!this.viewModel.templatesInfo)return;if(this._selectedTab=$(e)?T.mapOnly:T.layout,this._selectedTab!==T.layout)return;this._selectedLayout=e;const a=this.viewModel.effectiveTemplateCustomTextElements[this.templateOptions.layout];this.templateOptions.customTextElements=a?i(a):null})),a((()=>this.templateOptions.dpi),(e=>{e<=0&&(this.templateOptions.dpi=1)})),a((()=>this.viewModel.view?.scale),(e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const l=setTimeout((()=>{this._awaitingServerResponse=!0,this.scheduleRender()}),500);this.viewModel.load().then((()=>{clearTimeout(l),this._awaitingServerResponse=!1}))}loadDependencies(){return h({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),block:()=>import("@esri/calcite-components/dist/components/calcite-block.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox.js"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox.js"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),input:()=>import("@esri/calcite-components/dist/components/calcite-input.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group.js"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:p,layout:d,legendEnabled:u,northArrowEnabled:h,scaleEnabled:y,scale:f,width:v}=t,w="ready"!==i.state||this._awaitingServerResponse,x=this._renderTitleOrFileNameSection(),C=g("div",{class:O.formSectionContainer},g("calcite-label",null,e.fileFormatTitle,g("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({target:e})=>{this.templateOptions.format=e.selectedItems[0].value}},i.templatesInfo?.format?.choiceList.sort().map(((e,t)=>g("calcite-combobox-item",{key:`file-format-${t}`,selected:e===this.templateOptions.format,textLabel:c(e),value:e})))))),I=g("div",{class:O.formSectionContainer},g("calcite-label",null,e.template,g("div",{class:O.templateSelectContainer,onclick:()=>{this._showTemplates=!0}},g("calcite-block",{class:O.templateSelectBlock,description:this.viewModel.getPageSizeLabel(d),heading:this._getTemplateLabel()}),g("calcite-icon",{class:O.templateSelectIcon,icon:"chevron-right",scale:"s"})))),k=g("div",{class:O.formSectionContainer},g("label",{class:O.formInputLabel},e.dpi,g("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"dpi",min:"1",onchange:this._handleDPIChange,tabIndex:0,type:"number",value:`${s}`}))),$=g("div",{class:this.classes(O.scaleInfoContainer,O.formSectionContainer)},g("calcite-label",{layout:"inline"},g("calcite-checkbox",{bind:this,checked:y,"data-option-name":"scaleEnabled",tabIndex:0,onCalciteCheckboxChange:this._toggleInputValue}),e.scale),g("div",{class:O.scaleInputContainer},g("input",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:this.classes(O.inputText,m.input,O.scaleInput),"data-input-name":"scale",disabled:!y,onchange:this._updateInputValue,role:"spinbutton",tabIndex:0,type:"number",value:`${f}`}),g("button",{"aria-label":e.reset,bind:this,class:this.classes(m.widgetButton,O.refreshButton,_.refresh),onclick:this._resetToCurrentScale,tabIndex:0,type:"button"}))),L=g("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:O.advancedOptionsContainer},$,this.viewModel.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?g("div",{class:this.classes(O.authorInfoContainer,O.formSectionContainer)},g("label",{class:O.formInputLabel},e.author,g("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"author",onchange:this._updateInputValue,tabIndex:0,type:"text",value:o??""}))):null,this.viewModel.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?g("div",{class:this.classes(O.copyrightInfoContainer,O.formSectionContainer),key:d},g("label",{class:O.formInputLabel},e.copyright,g("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"copyright",onchange:this._updateInputValue,tabIndex:0,type:"text",value:n??""}))):null,k,this.viewModel.layoutTemplateInfo?.layoutOptions?.hasLegend??1?g("div",{class:this.classes(O.legendInfoContainer,O.formSectionContainer)},g("calcite-label",{layout:"inline"},g("calcite-checkbox",{bind:this,checked:u,"data-option-name":"legendEnabled",tabIndex:0,onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this.viewModel.layoutTemplateNorthArrowInfo?g("div",{class:this.classes(O.legendInfoContainer,O.formSectionContainer),key:"north-arrow"},g("calcite-label",{layout:"inline"},g("calcite-checkbox",{bind:this,checked:h,"data-option-name":"northArrowEnabled",tabIndex:0,onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._renderCustomTextElementSection()),M=g("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:O.advancedOptionsContainer},$,k,g("div",{class:O.formSectionContainer},g("calcite-label",{layout:"inline"},g("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",tabIndex:0,onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),S=g("calcite-label",{layout:"inline-space-between"},e.printPreview,g("calcite-switch",{checked:this.viewModel.printPreviewEnabled,onCalciteSwitchChange:e=>{this.viewModel.printPreviewEnabled=!!e.target.checked}})),E=this.exportedLinks.toArray(),F=this._renderExportedLink(E),j={[O.exportSectionCentered]:!E.length},P=this._selectedTab===T.layout?g("section",{"aria-labelledby":`${this.id}__layoutTab`,class:O.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},g("div",{class:O.panelContainer},this.viewModel.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?x:null,I,this._selectedTab===T.layout?C:null,S),g("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(O.panelContainer,O.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForLayout"},L)):this._selectedTab===T.mapOnly?g("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:O.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},g("div",{class:O.panelContainer},x,C,g("div",{class:this.classes(O.sizeContainer,O.formSectionContainer)},g("label",{class:O.formInputLabel},e.width,g("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"width",onchange:this._updateInputValue,tabIndex:0,type:"number",value:`${v}`})),g("label",{class:O.formInputLabel},e.height,g("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"height",onchange:this._updateInputValue,tabIndex:0,type:"number",value:`${p}`})),g("button",{"aria-label":e.swap,bind:this,class:this.classes(m.widgetButton,O.swapButton,_.swap),onclick:this._switchInput,tabIndex:0,type:"button"})),S,g("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(O.panelContainer,O.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly"},M))):g("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(O.exportSection,j),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},g("div",{class:O.panelContainer},g("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:O.exportedFilesContainer},0===E.length?g("div",{class:O.exportedFilesEmpty},g("calcite-icon",{icon:"file",scale:"l"}),g("div",null,g(b,{class:O.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),g("div",null,e.exportHint))):F))),A={[m.buttonDisabled]:w||!d&&!r},B=!a||"2d"!==a.type,D=g("div",{class:O.panelError},B?e.sceneViewError:e.serviceError),N=E.some((({state:e})=>"pending"===e)),V=g("div",{class:O.content},g("ul",{bind:this,class:O.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},g("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===T.layout}`,class:O.layoutTab,"data-tab-id":T.layout,id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),g("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===T.mapOnly}`,class:O.layoutTab,"data-tab-id":T.mapOnly,id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),g("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===T.export}`,class:O.layoutTab,"data-tab-id":T.export,id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},N?g("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),P,this._selectedTab!==T.export?g("button",{"aria-label":e.exportDescription,bind:this,class:this.classes(O.printButton,m.button,A),disabled:w,onclick:this._handlePrintMap,tabIndex:0,type:"button"},e.export):null),U=g("calcite-flow",{key:"root-flow"},g("calcite-flow-item",{bind:this,closable:!1,key:"root-flow-item"},g("div",{class:O.printWidgetContainer},g("header",{class:O.headerTitle},e.export),this.error||B||!a?D:V)),this._renderChooseTemplateFlowItem()),R="initializing"===i.state,z=R?this._renderLoader():U,H={[O.panelItemsCentered]:R};return g("div",{bind:this,class:this.classes(O.base,m.widget,m.panel,H)},z)}_getTemplateLabel(){const{messages:e,includeDefaultTemplates:t,templateOptions:i,viewModel:a}=this,{layout:l}=i,o=(t?a.defaultTemplates.find((({layoutItem:e})=>l===e?.id)):null)??a.browseTemplates.find((({layoutItem:e})=>l===e?.id));return o?.label?.replaceAll("_"," ")??e[l]??l.replaceAll("_"," ")??e.selectTemplate}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{includeDefaultTemplates:e,messages:t,viewModel:i}=this,{defaultTemplates:a,templatesInfo:l,browseTemplates:o}=i,n=o.length?o.toArray().sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)).map(((e,a)=>{const l=e.layoutItem?.id??e.layout,o=i.getPageSizeLabel(l),n=l===this.templateOptions.layout;return g("calcite-list-item",{description:o,key:`browse-template-${a}`,label:e?.label?.replaceAll("_"," ")??t.untitled,selected:n,title:e.description??"",value:l},!o&&n&&e.layoutItem?.id?g("calcite-loader",{inline:!0,label:"loading",scale:"s",slot:"content-end"}):null,g("calcite-action",{icon:"trash",onclick:()=>i.removePortalTemplate(e),slot:"actions-end",text:"delete"}))})):null,s=a.length&&e?a.toArray().filter((({label:e})=>!$(e))).sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)).map(((e,a)=>{const l=e.layoutItem?.id??e.layout,o=i.getPageSizeLabel(l),n=l===this.templateOptions.layout;return g("calcite-list-item",{description:o,key:`default-template-${a}`,label:e?.label?.replaceAll("_"," ")??t.untitled,selected:n,title:e.description??"",value:l},!o&&n&&e.layoutItem?.id?g("calcite-loader",{inline:!0,label:"loading",scale:"s",slot:"content-end"}):null)})):null,r=!l?.layout?.choiceList.length||e&&a.length?null:l.layout.choiceList.map((e=>({label:t[e]??e.replaceAll("_"," "),value:e}))).sort(((e,t)=>e.label>t.label?1:0)).map((({label:e,value:t},a)=>g("calcite-list-item",{description:i.getPageSizeLabel(t),key:`service-template-${a}`,label:e,selected:t===this.templateOptions.layout,value:t}))),c=(n?.length||0)+(s?.length||0)+(r?.length||0)>15;return g("calcite-flow-item",{bind:this,closable:!1,heading:t.chooseTemplate,key:"template-flow-item",onCalciteFlowItemBack:()=>{this._showTemplates=!1}},this.browseTemplateButtonOnClick?g("calcite-button",{appearance:"outline",class:O.browseTemplateButtonContainer,onclick:this.browseTemplateButtonOnClick},"Browse Templates"):null,g("calcite-list",{filterEnabled:c,selectionMode:"single-persist",onCalciteListChange:({target:e})=>this._applyTemplate(e.selectedItems[0].value)},n?.length?g("calcite-list-item-group",{heading:t.organizationTemplates,key:"org-templates"},n):null,n?.length?s?.length?g("calcite-list-item-group",{heading:t.defaultTemplates,key:"default-templates"},s):null:s,n?.length?r?.length?g("calcite-list-item-group",{heading:t.defaultTemplates,key:"service-templates"},r):null:r),g("div",{class:O.templateButtonContainer},g("calcite-button",{class:O.templateDoneButton,onclick:()=>this._showTemplates=!1},"Done")))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?g("div",{class:O.formSectionContainer,key:"custom-text-elements"},e.map((e=>{const[t,i]=Object.entries(e)[0];return"date"===t?null:g("label",{key:t},t,g("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-custom":!0,"data-input-name":t,onchange:this._updateInputValue,type:"text",value:i}))}))):null}async _applyTemplate(e){if(this._abortController&&(this._abortController.abort(),this._abortController=null),!e)return;const t=this.viewModel.defaultTemplates.find((({layoutItem:t})=>e===t?.id))??this.viewModel.browseTemplates.find((({layoutItem:t})=>e===t?.id));if(!t)return this.templateOptions.layout=e,void(this.templateOptions.layoutItem=null);const{format:i,layoutItem:a}=t,l=a?.id??t.layout??this.templateOptions.layout;if(this.templateOptions.layout=l,!t.layoutOptions)try{this._abortController=new AbortController,await this.viewModel.fetchLayoutTemplateInfo(t,{signal:this._abortController.signal})}catch(s){return}finally{this._abortController=null}const o=t.layoutOptions?.legend??this.templateOptions.legendEnabled,n=t.layoutOptions?.northArrow??this.templateOptions.northArrowEnabled;this.templateOptions.set({format:i,layout:l,layoutItem:a,legendEnabled:o,northArrowEnabled:n})}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l=this._selectedTab===T.layout?e:t,o=this._selectedTab===T.layout?i:a,n=this._selectedTab===T.layout?this.templateOptions.title:this.templateOptions.fileName;return g("div",{class:O.formSectionContainer,key:l},g("calcite-label",null,l,g("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&this._selectedTab===T.layout||"mapOnlyTab"===t&&this._selectedTab===T.mapOnly||"exportTab"===t&&this._selectedTab===T.export)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[O.loader]:this._awaitingServerResponse};return g("div",{class:this.classes(e),key:"loader"})}_createFileLink(e,t){const i=t||this.messages.untitled,a=e.format.toLowerCase(),l=a.includes("png")?"png":a,o=i+l;return void 0!==this._exportedFileNameMap[o]?this._exportedFileNameMap[o]++:this._exportedFileNameMap[o]=0,new d({name:i,extension:l,count:this._exportedFileNameMap[o]})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find((e=>{const[i]=Object.entries(e)[0];return i===t}))[t]=i}_updateInputValue(e){const t=e.target,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;if(a)return void this._updateCustomTextElementValue(l.customTextElements,i,t.value);let o;if("number"===t.type){if(!k(t.valueAsNumber)){const e=l[i];return void(t.value=`${e}`)}o=t.valueAsNumber}else o=t.value;l[i]=o}_handleDPIChange(e){const{templateOptions:t}=this,i=t.dpi;this._updateInputValue(e);const a=e.currentTarget.valueAsNumber,{height:l,width:o}=I(a,i,t.width,t.height);t.height=l,t.width=o}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t=this.viewModel.toPrintTemplate(e),i=this._selectedTab===T.layout?t.layoutOptions?.titleText:e.fileName,a=this._createFileLink(t,i);this.exportedLinks.add(a),this.emit("submit",{link:a}),this._selectedTab=T.export,this.viewModel.print(t).then((e=>{a.set({url:e&&e.url,state:"ready"})})).catch((e=>{a.set({error:e,state:"error"})})).then((()=>{this.emit("complete",{link:a}),this.scheduleRender()}))}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&(this.templateOptions[i]||this._resetToCurrentScale())}_renderExportedLink(e){const t=this.messages,i=e.map((e=>{const{error:i,url:a,state:n}=e,s=e.formattedName??"",r="error"===n,c="pending"===n,p="ready"===n;let d=a||null;d&&(d=l(d));const u=o(a,location.href);let h;h=c?t.pending:p?t.ready:t.errorMessage;const b=r?"print-task:cim-symbol-unsupported"===i?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return g("calcite-list-item",{"aria-label":h,class:O.exportedFile,"data-item":e,description:c?t.generatingExport:b||t.linkReady,key:s,label:s,onclick:this._removeLink,title:b},g("calcite-icon",{class:c?m.rotating:"",icon:L(e),scale:"s",slot:"content-start"}),p?g("a",{"aria-label":`${s}. ${t.linkReady}`,download:s,href:d??"",onclick:this._handleLinkClick,rel:"noreferrer",slot:"content-end",tabIndex:0,target:"_blank"},g("calcite-action",{"aria-label":`${s}. ${t.linkReady}`,icon:u?"download-to":"launch",onclick:this._handleLinkClick,text:s})):null)}));return g("calcite-list",{filterEnabled:e?.length>10},i)}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){this._selectedTab=e,this._selectedTab!==T.export&&(this.templateOptions.layout=this._selectedTab===T.layout?this._selectedLayout??this.viewModel.templatesInfo?.layout?.defaultValue??"letter-ansi-a-landscape":w,this.templateOptions.layoutItem=null),t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(y(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case T.layout:this._toggleTab("ArrowLeft"===t?T.export:T.mapOnly);break;case T.mapOnly:this._toggleTab("ArrowLeft"===t?T.layout:T.export);break;case T.export:this._toggleTab("ArrowLeft"===t?T.mapOnly:T.layout)}e.preventDefault(),e.stopPropagation()}}};e([n()],M.prototype,"allowedFormats",null),e([n()],M.prototype,"allowedLayouts",null),e([n()],M.prototype,"browseTemplateButtonOnClick",void 0),e([n()],M.prototype,"error",null),e([n({type:v})],M.prototype,"exportedLinks",void 0),e([n()],M.prototype,"extraParameters",null),e([n()],M.prototype,"headingLevel",void 0),e([n()],M.prototype,"icon",null),e([n()],M.prototype,"includeDefaultTemplates",null),e([n()],M.prototype,"label",null),e([n(),f("esri/widgets/Print/t9n/Print")],M.prototype,"messages",void 0),e([n()],M.prototype,"portal",null),e([n()],M.prototype,"printServiceUrl",null),e([n()],M.prototype,"templateCustomTextElements",null),e([n()],M.prototype,"templateOptions",null),e([n()],M.prototype,"view",null),e([n({type:u})],M.prototype,"viewModel",void 0),M=e([s("esri.widgets.Print")],M);const S=M;export{S as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import{clone as l}from"../core/lang.js";import{watch as i}from"../core/reactiveUtils.js";import{addProxy as a,hasSameOrigin as o}from"../core/urlUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{getToken as r}from"../rest/utils.js";import{toJSON as c}from"../rest/support/fileFormat.js";import p from"./Widget.js";import d from"./Print/FileLink.js";import u from"./Print/PrintViewModel.js";import{loadCalciteComponents as h}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import{Heading as b}from"./support/Heading.js";import{legacyIcon as _}from"./support/legacyIcon.js";import{isActivationKey as y}from"./support/widgetUtils.js";import{messageBundle as g}from"./support/decorators/messageBundle.js";import{tsx as f}from"./support/jsxFactory.js";const v=t.ofType(d),w="MAP_ONLY";var T;!function(e){e.layout="layoutTab",e.mapOnly="mapOnlyTab",e.export="exportTab"}(T||(T={}));const x="esri-print",C=`${x}__advanced-options-button`,O={base:x,headerTitle:`${x}__header-title`,inputText:`${x}__input-text`,layoutTabList:`${x}__layout-tab-list`,layoutTab:`${x}__layout-tab`,layoutSection:`${x}__layout-section`,mapOnlySection:`${x}__map-only-section`,scaleInput:`${x}__scale-input`,panelItemsCentered:`${x}__panel-items--centered`,loader:`${x}__loader`,advancedOptionsButton:C,advancedOptionsButtonContainer:`${C}-container`,advancedOptionsButtonTitle:`${C}-title`,advancedOptionsButtonIconOpened:`${C}-icon--opened`,advancedOptionsButtonIconClosed:`${C}-icon--closed`,advancedOptionsButtonIconClosed_RTL:`${C}-icon--closed-rtl`,refreshButton:`${x}__refresh-button`,swapButton:`${x}__swap-button`,printButton:`${x}__export-button`,templateSelectContainer:`${x}__template-select-container`,templateSelectBlock:`${x}__template-select-block`,templateSelectIcon:`${x}__template-select-icon`,formSectionContainer:`${x}__form-section-container`,formInputLabel:`${x}__form-input-label`,formCheckboxLabel:`${x}__form-checkbox-label`,advancedOptionsSection:`${x}__advanced-options-section`,advancedOptionsContainer:`${x}__advanced-options-container`,authorInfoContainer:`${x}__author-info-container`,browseTemplateButtonContainer:`${x}__browse-template-button-container`,copyrightInfoContainer:`${x}__copyright-info-container`,exportedFilesContainer:`${x}__export-panel-container`,exportedFilesTitle:`${x}__export-title`,exportedFile:`${x}__exported-file`,exportedFileLink:`${x}__exported-file-link`,exportedFileLinkTitle:`${x}__exported-file-link-title`,exportedFilesEmpty:`${x}__exported-files-empty`,legendInfoContainer:`${x}__legend-info-container`,printWidgetContainer:`${x}__container`,content:`${x}__content`,panelContainer:`${x}__panel-container`,scaleInfoContainer:`${x}__scale-info-container`,scaleInputContainer:`${x}__scale-input-container`,sizeContainer:`${x}__size-container`,panelError:`${x}__panel--error`,exportedFileError:`${x}__exported-file--error`,exportSection:`${x}__export-section`,exportSectionCentered:`${x}__export-section--centered`,templateButtonContainer:`${x}__template-button-container`,templateDoneButton:`${x}__template-done-button`};function I(e,t,l,i){const a=l/t,o=i/t;return{width:Math.round(e*a),height:Math.round(e*o)}}function k(e){return!isNaN(e)&&e>0}function $(e){return e?.toUpperCase()===w}function L(e){const{state:t,extension:l}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return l?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}function M(e,t){return!!t&&e.some((e=>e.layoutItem?.id===t||e.layout===t))}let S=class extends p{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._exportedFileNameMap={},this._selectedTab=T.layout,this._pendingExportScroll=!1,this._rootNode=null,this._selectedLayout=null,this._abortController=null,this._showTemplates=!1,this.browseTemplateButtonOnClick=null,this.exportedLinks=new v,this.headingLevel=3,this.viewModel=new u,this._onInput=e=>{this._selectedTab===T.layout?this.templateOptions.title=e.target.value:this._selectedTab===T.mapOnly&&(this.templateOptions.fileName=e.target.value)},this._removeLink=e=>{const t=e.currentTarget["data-item"];t&&"error"===t.state&&this.exportedLinks.remove(t)},this._handleLinkClick=e=>{const t=e.currentTarget,{href:l}=t,i=r(this.viewModel.effectivePrintServiceUrl);if(!i)return;if(!e.isTrusted)return void e.stopPropagation();e.preventDefault();const a=new URL(l);a.searchParams.set("token",i),t.href=a.href,t.click(),t.href=l},this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([i((()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format.defaultValue]),(([e,t])=>{if(t&&!e)return void(this.templateOptions.format=t);if(!e||!t||!this.viewModel.templatesInfo)return;if(this.viewModel.templatesInfo.format.choiceList.includes(e))return;const l=this.viewModel.templatesInfo.format.choiceList.find((t=>t.toUpperCase().includes(`(${e.toUpperCase()})`)));this.templateOptions.format=l??t})),i((()=>[this.templateOptions.layout,this.viewModel.templatesInfo?.layout.defaultValue]),(([e,t])=>{if(this._selectedTab=$(e)?T.mapOnly:T.layout,this._selectedTab!==T.layout)return;const{includeDefaultTemplates:i,viewModel:a,_selectedLayout:o}=this,{portalTemplateIds:n,browseTemplates:s,templatesInfo:r}=a,c=a.defaultTemplates.filter((({layoutItem:e})=>n.includes(e?.id))),p=a.defaultTemplates.filter((({layoutItem:e})=>!n.includes(e?.id))),d=i&&p.length;if(e){(d?M(p,e):r?.layout.choiceList.includes(e))||M(c,e)||M(s,e)||(this.templateOptions.layout=null)}else{const e=o&&((d?M(p,o):r?.layout.choiceList.includes(o))||M(c,o)||M(s,o));this.templateOptions.layout=e?o:null,this.templateOptions.layout||d||!t||(this.templateOptions.layout=t)}this._selectedLayout=this.templateOptions.layout,this._selectedLayout||(this.viewModel.printPreviewEnabled=!1);const u=!!this.templateOptions.layout&&this.viewModel.effectiveTemplateCustomTextElements[this.templateOptions.layout];this.templateOptions.customTextElements=u?l(u):null})),i((()=>this.templateOptions.dpi),(e=>{e<=0&&(this.templateOptions.dpi=1)})),i((()=>this.viewModel.view?.scale),(e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const a=setTimeout((()=>{this._awaitingServerResponse=!0,this.scheduleRender()}),500);this.viewModel.load().then((()=>{clearTimeout(a),this._awaitingServerResponse=!1}))}loadDependencies(){return h({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),block:()=>import("@esri/calcite-components/dist/components/calcite-block.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox.js"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox.js"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),input:()=>import("@esri/calcite-components/dist/components/calcite-input.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),"list-item-group":()=>import("@esri/calcite-components/dist/components/calcite-list-item-group.js"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:l,view:i}=this,{attributionEnabled:a,author:o,copyright:n,dpi:s,format:r,height:p,layout:d,legendEnabled:u,northArrowEnabled:h,scaleEnabled:y,scale:g,width:v}=t,w="ready"!==l.state||this._awaitingServerResponse||!d,x=this._renderTitleOrFileNameSection(),C=f("div",{class:O.formSectionContainer},f("calcite-label",null,e.fileFormatTitle,f("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({target:e})=>{this.templateOptions.format=e.selectedItems[0].value}},l.templatesInfo?.format?.choiceList.sort().map(((e,t)=>f("calcite-combobox-item",{key:`file-format-${t}`,selected:e===this.templateOptions.format,textLabel:c(e),value:e})))))),I=f("div",{class:O.formSectionContainer},f("calcite-label",null,e.template,f("div",{class:O.templateSelectContainer,onclick:()=>{this._showTemplates=!0}},f("calcite-block",{class:O.templateSelectBlock,description:this.viewModel.getPageSizeLabel(d),heading:this._getTemplateLabel()}),f("calcite-icon",{class:O.templateSelectIcon,icon:"chevron-right",scale:"s"})))),k=f("div",{class:O.formSectionContainer},f("label",{class:O.formInputLabel},e.dpi,f("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"dpi",min:"1",onchange:this._handleDPIChange,tabIndex:0,type:"number",value:`${s}`}))),$=f("div",{class:this.classes(O.scaleInfoContainer,O.formSectionContainer)},f("calcite-label",{layout:"inline"},f("calcite-checkbox",{bind:this,checked:y,"data-option-name":"scaleEnabled",tabIndex:0,onCalciteCheckboxChange:this._toggleInputValue}),e.scale),f("div",{class:O.scaleInputContainer},f("input",{"aria-label":e.scaleLabel,"aria-valuenow":`${g}`,bind:this,class:this.classes(O.inputText,m.input,O.scaleInput),"data-input-name":"scale",disabled:!y,onchange:this._updateInputValue,role:"spinbutton",tabIndex:0,type:"number",value:`${g}`}),f("button",{"aria-label":e.reset,bind:this,class:this.classes(m.widgetButton,O.refreshButton,_.refresh),onclick:this._resetToCurrentScale,tabIndex:0,type:"button"}))),L=f("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:O.advancedOptionsContainer},$,this.viewModel.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?f("div",{class:this.classes(O.authorInfoContainer,O.formSectionContainer)},f("label",{class:O.formInputLabel},e.author,f("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"author",onchange:this._updateInputValue,tabIndex:0,type:"text",value:o??""}))):null,this.viewModel.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?f("div",{class:this.classes(O.copyrightInfoContainer,O.formSectionContainer),key:"copyright-text"},f("label",{class:O.formInputLabel},e.copyright,f("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"copyright",onchange:this._updateInputValue,tabIndex:0,type:"text",value:n??""}))):null,k,this.viewModel.layoutTemplateInfo?.layoutOptions?.hasLegend??1?f("div",{class:this.classes(O.legendInfoContainer,O.formSectionContainer)},f("calcite-label",{layout:"inline"},f("calcite-checkbox",{bind:this,checked:u,"data-option-name":"legendEnabled",tabIndex:0,onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this.viewModel.layoutTemplateNorthArrowInfo??1?f("div",{class:this.classes(O.legendInfoContainer,O.formSectionContainer),key:"north-arrow"},f("calcite-label",{layout:"inline"},f("calcite-checkbox",{bind:this,checked:h,"data-option-name":"northArrowEnabled",tabIndex:0,onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._renderCustomTextElementSection()),M=f("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:O.advancedOptionsContainer},$,k,f("div",{class:O.formSectionContainer},f("calcite-label",{layout:"inline"},f("calcite-checkbox",{bind:this,checked:a,"data-option-name":"attributionEnabled",tabIndex:0,onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),S=f("calcite-label",{layout:"inline-space-between"},e.printPreview,f("calcite-switch",{checked:this.viewModel.printPreviewEnabled,disabled:!d,onCalciteSwitchChange:e=>{this.viewModel.printPreviewEnabled=!!e.target.checked}})),E=this.exportedLinks.toArray(),F=this._renderExportedLink(E),j={[O.exportSectionCentered]:!E.length},P=this._selectedTab===T.layout?f("section",{"aria-labelledby":`${this.id}__layoutTab`,class:O.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},f("div",{class:O.panelContainer},this.viewModel.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?x:null,I,this._selectedTab===T.layout?C:null,S),f("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(O.panelContainer,O.advancedOptionsSection),collapsible:!0,disabled:!d,heading:e.advancedOptions,id:"advancedOptionsForLayout"},L)):this._selectedTab===T.mapOnly?f("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:O.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},f("div",{class:O.panelContainer},x,C,f("div",{class:this.classes(O.sizeContainer,O.formSectionContainer)},f("label",{class:O.formInputLabel},e.width,f("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"width",onchange:this._updateInputValue,tabIndex:0,type:"number",value:`${v}`})),f("label",{class:O.formInputLabel},e.height,f("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-name":"height",onchange:this._updateInputValue,tabIndex:0,type:"number",value:`${p}`})),f("button",{"aria-label":e.swap,bind:this,class:this.classes(m.widgetButton,O.swapButton,_.swap),onclick:this._switchInput,tabIndex:0,type:"button"})),S,f("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(O.panelContainer,O.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly"},M))):f("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(O.exportSection,j),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},f("div",{class:O.panelContainer},f("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:O.exportedFilesContainer},0===E.length?f("div",{class:O.exportedFilesEmpty},f("calcite-icon",{icon:"file",scale:"l"}),f("div",null,f(b,{class:O.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),f("div",null,e.exportHint))):F))),A={[m.buttonDisabled]:w||!d&&!r},B=!i||"2d"!==i.type,D=f("div",{class:O.panelError},B?e.sceneViewError:e.serviceError),N=E.some((({state:e})=>"pending"===e)),V=f("div",{class:O.content},f("ul",{bind:this,class:O.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},f("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===T.layout}`,class:O.layoutTab,"data-tab-id":T.layout,id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),f("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===T.mapOnly}`,class:O.layoutTab,"data-tab-id":T.mapOnly,id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),f("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===T.export}`,class:O.layoutTab,"data-tab-id":T.export,id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},N?f("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),P,this._selectedTab!==T.export?f("button",{"aria-label":e.exportDescription,bind:this,class:this.classes(O.printButton,m.button,A),disabled:w,onclick:this._handlePrintMap,tabIndex:0,type:"button"},e.export):null),U=f("calcite-flow",{key:"root-flow"},f("calcite-flow-item",{bind:this,closable:!1,key:"root-flow-item"},f("div",{class:O.printWidgetContainer},f("header",{class:O.headerTitle},e.export),this.error||B||!i?D:V)),this._renderChooseTemplateFlowItem()),R="initializing"===l.state,z=R?this._renderLoader():U,H={[O.panelItemsCentered]:R};return f("div",{bind:this,class:this.classes(O.base,m.widget,m.panel,H)},z)}_getTemplateLabel(){const{messages:e,includeDefaultTemplates:t,templateOptions:l,viewModel:i}=this,{layout:a}=l,o=(t?i.defaultTemplates.find((({layoutItem:e})=>a===e?.id)):null)??i.browseTemplates.find((({layoutItem:e})=>a===e?.id));return o?.label?.replaceAll("_"," ")??e[a]??a?.replaceAll("_"," ")??e.selectTemplate}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{includeDefaultTemplates:e,messages:t,viewModel:l}=this,{defaultTemplates:i,templatesInfo:a,browseTemplates:o,portalTemplateIds:n}=l,s=o.length?o.toArray().sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)).map(((e,i)=>{const a=e.layoutItem?.id??e.layout,o=l.getPageSizeLabel(a),n=a===this.templateOptions.layout;return f("calcite-list-item",{description:o,key:`browse-template-${i}`,label:e?.label?.replaceAll("_"," ")??t.untitled,selected:n,title:e.description??"",value:a},!o&&n&&e.layoutItem?.id?f("calcite-loader",{inline:!0,label:"loading",scale:"s",slot:"content-end"}):null,f("calcite-action",{icon:"trash",onclick:()=>l.removePortalTemplate(e),slot:"actions-end",text:"delete"}))})):null,r=i.length&&e?i.toArray().filter((({label:e,layoutItem:t})=>!$(e)&&n.includes(t?.id))).sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)).map(((e,i)=>{const a=e.layoutItem?.id??e.layout,o=l.getPageSizeLabel(a),n=a===this.templateOptions.layout;return f("calcite-list-item",{description:o,key:`default-template-${i}`,label:e?.label?.replaceAll("_"," ")??t.untitled,selected:n,title:e.description??"",value:a},!o&&n&&e.layoutItem?.id?f("calcite-loader",{inline:!0,label:"loading",scale:"s",slot:"content-end"}):null)})):null,c=i.length&&e?i.toArray().filter((({label:e,layoutItem:t})=>!$(e)&&!n.includes(t?.id))).sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)).map(((e,i)=>{const a=e.layoutItem?.id??e.layout,o=l.getPageSizeLabel(a),n=a===this.templateOptions.layout;return f("calcite-list-item",{description:o,key:`default-template-${i}`,label:e?.label?.replaceAll("_"," ")??t.untitled,selected:n,title:e.description??"",value:a},!o&&n&&e.layoutItem?.id?f("calcite-loader",{inline:!0,label:"loading",scale:"s",slot:"content-end"}):null)})):null,p=!a?.layout?.choiceList.length||e&&c?.length?null:a.layout.choiceList.map((e=>({label:t[e]??e.replaceAll("_"," "),value:e}))).sort(((e,t)=>e.label>t.label?1:0)).map((({label:e,value:t},i)=>f("calcite-list-item",{description:l.getPageSizeLabel(t),key:`service-template-${i}`,label:e,selected:t===this.templateOptions.layout,value:t}))),d=(s?.length??0)+(r?.length??0)+(c?.length??0)+(p?.length??0)>15;return f("calcite-flow-item",{bind:this,closable:!1,heading:t.chooseTemplate,key:"template-flow-item",onCalciteFlowItemBack:()=>{this._showTemplates=!1}},this.browseTemplateButtonOnClick?f("calcite-button",{appearance:"outline",class:O.browseTemplateButtonContainer,onclick:this.browseTemplateButtonOnClick},"Browse Templates"):null,f("calcite-list",{filterEnabled:d,selectionMode:"single-persist",onCalciteListChange:({target:e})=>this._applyTemplate(e.selectedItems[0].value)},s?.length?f("calcite-list-item-group",{heading:t.myTemplates,key:"my-templates"},s):null,r?.length?f("calcite-list-item-group",{heading:t.organizationTemplates,key:"org-templates"},r):null,s?.length||r?.length?c?.length?f("calcite-list-item-group",{heading:t.defaultTemplates,key:"default-templates"},c):null:c,s?.length||r?.length?p?.length?f("calcite-list-item-group",{heading:t.defaultTemplates,key:"service-templates"},p):null:p),f("div",{class:O.templateButtonContainer},f("calcite-button",{class:O.templateDoneButton,onclick:()=>this._showTemplates=!1},"Done")))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?f("div",{class:O.formSectionContainer,key:"custom-text-elements"},e.map((e=>{const[t,l]=Object.entries(e)[0];return"date"===t?null:f("label",{key:t},t,f("input",{bind:this,class:this.classes(O.inputText,m.input),"data-input-custom":!0,"data-input-name":t,onchange:this._updateInputValue,type:"text",value:l}))}))):null}async _applyTemplate(e){if(this._abortController&&(this._abortController.abort(),this._abortController=null),!e)return;const t=this.viewModel.defaultTemplates.find((({layoutItem:t})=>e===t?.id))??this.viewModel.browseTemplates.find((({layoutItem:t})=>e===t?.id));if(!t)return this.templateOptions.layout=e,void(this.templateOptions.layoutItem=null);const{format:l,layoutItem:i}=t,a=i?.id??t.layout??this.templateOptions.layout;if(this.templateOptions.layout=a,!t.layoutOptions)try{this._abortController=new AbortController,await this.viewModel.fetchLayoutTemplateInfo(t,{signal:this._abortController.signal})}catch(s){return}finally{this._abortController=null}const o=t.layoutOptions?.legend??this.templateOptions.legendEnabled,n=t.layoutOptions?.northArrow??this.templateOptions.northArrowEnabled;this.templateOptions.set({format:l,layout:a,layoutItem:i,legendEnabled:o,northArrowEnabled:n})}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:l,fileNamePlaceHolder:i}=this.messages,a=this._selectedTab===T.layout?e:t,o=this._selectedTab===T.layout?l:i,n=this._selectedTab===T.layout?this.templateOptions.title:this.templateOptions.fileName;return f("div",{class:O.formSectionContainer,key:a},f("calcite-label",null,a,f("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&this._selectedTab===T.layout||"mapOnlyTab"===t&&this._selectedTab===T.mapOnly||"exportTab"===t&&this._selectedTab===T.export)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[O.loader]:this._awaitingServerResponse};return f("div",{class:this.classes(e),key:"loader"})}_createFileLink(e,t){const l=t||this.messages.untitled,i=e.format.toLowerCase(),a=i.includes("png")?"png":i,o=l+a;return void 0!==this._exportedFileNameMap[o]?this._exportedFileNameMap[o]++:this._exportedFileNameMap[o]=0,new d({name:l,extension:a,count:this._exportedFileNameMap[o]})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,l){e.find((e=>{const[l]=Object.entries(e)[0];return l===t}))[t]=l}_updateInputValue(e){const t=e.target,l=t.getAttribute("data-input-name"),i=!!t["data-input-custom"],{templateOptions:a}=this;if(i)return void this._updateCustomTextElementValue(a.customTextElements,l,t.value);let o;if("number"===t.type){if(!k(t.valueAsNumber)){const e=a[l];return void(t.value=`${e}`)}o=t.valueAsNumber}else o=t.value;a[l]=o}_handleDPIChange(e){const{templateOptions:t}=this,l=t.dpi;this._updateInputValue(e);const i=e.currentTarget.valueAsNumber,{height:a,width:o}=I(i,l,t.width,t.height);t.height=a,t.width=o}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t=this.viewModel.toPrintTemplate(e),l=this._selectedTab===T.layout?t.layoutOptions?.titleText:e.fileName,i=this._createFileLink(t,l);this.exportedLinks.add(i),this.emit("submit",{link:i}),this._selectedTab=T.export,this.viewModel.print(t).then((e=>{i.set({url:e&&e.url,state:"ready"})})).catch((e=>{i.set({error:e,state:"error"})})).then((()=>{this.emit("complete",{link:i}),this.scheduleRender()}))}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:l}=e,i=l-t;i>0&&(e.scrollTop=i)}_toggleInputValue(e){const t=e.target,l=t.getAttribute("data-option-name");this.templateOptions[l]=t.checked,"scaleEnabled"===l&&(this.templateOptions[l]||this._resetToCurrentScale())}_renderExportedLink(e){const t=this.messages,l=e.map((e=>{const{error:l,url:i,state:n}=e,s=e.formattedName??"",r="error"===n,c="pending"===n,p="ready"===n;let d=i||null;d&&(d=a(d));const u=o(i,location.href);let h;h=c?t.pending:p?t.ready:t.errorMessage;const b=r?"print-task:cim-symbol-unsupported"===l?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return f("calcite-list-item",{"aria-label":h,class:O.exportedFile,"data-item":e,description:c?t.generatingExport:b||t.linkReady,key:s,label:s,onclick:this._removeLink,title:b},f("calcite-icon",{class:c?m.rotating:"",icon:L(e),scale:"s",slot:"content-start"}),p?f("a",{"aria-label":`${s}. ${t.linkReady}`,download:s,href:d??"",onclick:this._handleLinkClick,rel:"noreferrer",slot:"content-end",tabIndex:0,target:"_blank"},f("calcite-action",{"aria-label":`${s}. ${t.linkReady}`,icon:u?"download-to":"launch",onclick:this._handleLinkClick,text:s})):null)}));return f("calcite-list",{filterEnabled:e?.length>10},l)}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){this._selectedTab=e,this._selectedTab!==T.export&&(this.templateOptions.layout=this._selectedTab===T.layout?this._selectedLayout??(this.includeDefaultTemplates&&this.viewModel.defaultTemplates.length)?null:this.viewModel.templatesInfo?.layout?.defaultValue:w,this.templateOptions.layoutItem=null),t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,l=e.target.getAttribute("data-tab-id");if(y(t))return this._toggleTab(l),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(l){case T.layout:this._toggleTab("ArrowLeft"===t?T.export:T.mapOnly);break;case T.mapOnly:this._toggleTab("ArrowLeft"===t?T.layout:T.export);break;case T.export:this._toggleTab("ArrowLeft"===t?T.mapOnly:T.layout)}e.preventDefault(),e.stopPropagation()}}};e([n()],S.prototype,"_showTemplates",void 0),e([n()],S.prototype,"allowedFormats",null),e([n()],S.prototype,"allowedLayouts",null),e([n()],S.prototype,"browseTemplateButtonOnClick",void 0),e([n()],S.prototype,"error",null),e([n({type:v})],S.prototype,"exportedLinks",void 0),e([n()],S.prototype,"extraParameters",null),e([n()],S.prototype,"headingLevel",void 0),e([n()],S.prototype,"icon",null),e([n()],S.prototype,"includeDefaultTemplates",null),e([n()],S.prototype,"label",null),e([n(),g("esri/widgets/Print/t9n/Print")],S.prototype,"messages",void 0),e([n()],S.prototype,"portal",null),e([n()],S.prototype,"printServiceUrl",null),e([n()],S.prototype,"templateCustomTextElements",null),e([n()],S.prototype,"templateOptions",null),e([n()],S.prototype,"view",null),e([n({type:u})],S.prototype,"viewModel",void 0),S=e([s("esri.widgets.Print")],S);const E=S;export{E as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8438],{5503:(e,t,i)=>{i.d(t,{A:()=>D});var r,n=i(90237),a=i(98291),s=i(65529),o=i(36563),h=i(4718),l=i(93687);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(r||(r={}));var c,d=i(11932),m=i(56507),u=i(62788),g=i(10107),f=i(7695),_=i(40608),T=i(95488);class p{constructor(e,t,i,r,n){this.target=e,this.added=t,this.removed=i,this.start=r,this.deleteCount=n}}const A=new l.A(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function v(e){return e?e instanceof P?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function S(e){if(e?.length)return e[0]}function y(e,t,i,r){const n=Math.min(e.length-i,t.length-r);let a=0;for(;a<n&&e[i+a]===t[r+a];)a++;return a}function E(e,t,i,r){t&&t.forEach(((t,n,a)=>{e.push(t),E(e,i.call(r,t,n,a),i,r)}))}const b=new Set,C=new Set,M=new Set,w=new Map;let k=0,P=c=class extends s.A.EventedAccessor{static isCollection(e){return null!=e&&e instanceof c}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new T.I,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:k++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof c?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove()}*[Symbol.iterator](){yield*this.items}get items(){return(0,u.gc)(this._observable),this._items}set items(e){this._emitBeforeChanges(r.ADD)||(this._splice(0,this.length,v(e)),this._emitAfterChanges(r.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,i={removed:!1,callback:t};return e.push(i),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),(0,o.hA)((()=>{i.removed=!0,e.splice(e.indexOf(i),1)}))}return this._emitter.on(e,t)}once(e,t){const i="deref"in t?()=>t.deref():()=>t,r=this.on(e,(e=>{i()?.call(null,e),r.remove()}));return r}add(e,t){if((0,u.gc)(this._observable),this._emitBeforeChanges(r.ADD))return this;const i=this.getNextIndex(t??null);return this._splice(i,0,[e]),this._emitAfterChanges(r.ADD),this}addMany(e,t=this._items.length){if((0,u.gc)(this._observable),!e?.length)return this;if(this._emitBeforeChanges(r.ADD))return this;const i=this.getNextIndex(t);return this._splice(i,0,v(e)),this._emitAfterChanges(r.ADD),this}at(e){if((0,u.gc)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,u.gc)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(r.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,u.gc)(this._observable),this._createNewInstance({items:this._items.map(h.o8)})}concat(...e){(0,u.gc)(this._observable);const t=e.map(v);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,u.gc)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const i=this._splice(0,this.length),n=i.length;for(let r=0;r<n;r++)e.call(t,i[r],r,i);this._emitAfterChanges(r.REMOVE)}every(e,t){return(0,u.gc)(this._observable),this._items.every(e,t)}filter(e,t){let i;return(0,u.gc)(this._observable),i=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:i})}find(e,t){return(0,u.gc)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,u.gc)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,u.gc)(this._observable);const i=[];return E(i,this,e,t),new c(i)}forEach(e,t){return(0,u.gc)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,u.gc)(this._observable),this._items[e]}getNextIndex(e){(0,u.gc)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,u.gc)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,u.gc)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,u.gc)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,u.gc)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,u.gc)(this._observable);const i=this._items.map(e,t);return new c({items:i})}reorder(e,t=this.length-1){(0,u.gc)(this._observable);const i=this.indexOf(e);if(-1!==i){if(t<0?t=0:t>=this.length&&(t=this.length-1),i!==t){if(this._emitBeforeChanges(r.MOVE))return e;this._splice(i,1),this._splice(t,0,[e]),this._emitAfterChanges(r.MOVE)}return e}}pop(){if((0,u.gc)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const e=S(this._splice(this.length-1,1));return this._emitAfterChanges(r.REMOVE),e}push(...e){return(0,u.gc)(this._observable),this._emitBeforeChanges(r.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(r.ADD)),this.length}reduce(e,t){(0,u.gc)(this._observable);const i=this._items;return 2===arguments.length?i.reduce(e,t):i.reduce(e)}reduceRight(e,t){(0,u.gc)(this._observable);const i=this._items;return 2===arguments.length?i.reduceRight(e,t):i.reduceRight(e)}remove(e){return(0,u.gc)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,u.gc)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(r.REMOVE))return;const t=S(this._splice(e,1));return this._emitAfterChanges(r.REMOVE),t}removeMany(e){if((0,u.gc)(this._observable),!e?.length||this._emitBeforeChanges(r.REMOVE))return[];const t=e instanceof c?e.toArray():e,i=this._items,n=[],a=t.length;for(let e=0;e<a;e++){const r=t[e],a=i.indexOf(r);if(a>-1){const r=1+y(t,i,e+1,a+1),s=this._splice(a,r);s&&s.length>0&&n.push.apply(n,s),e+=r-1}}return this._emitAfterChanges(r.REMOVE),n}reverse(){if((0,u.gc)(this._observable),this._emitBeforeChanges(r.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(r.MOVE),this}shift(){if((0,u.gc)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const e=S(this._splice(0,1));return this._emitAfterChanges(r.REMOVE),e}slice(e=0,t=this.length){return(0,u.gc)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,u.gc)(this._observable),this._items.some(e,t)}sort(e){if((0,u.gc)(this._observable),!this.length||this._emitBeforeChanges(r.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(r.MOVE),this}splice(e,t,...i){(0,u.gc)(this._observable);const n=(t?r.REMOVE:0)|(i.length?r.ADD:0);if(this._emitBeforeChanges(n))return[];const a=this._splice(e,t,i)||[];return this._emitAfterChanges(n),a}toArray(){return(0,u.gc)(this._observable),this._items.slice()}toJSON(){return(0,u.gc)(this._observable),this.toArray()}toLocaleString(){return(0,u.gc)(this._observable),this._items.toLocaleString()}toString(){return(0,u.gc)(this._observable),this._items.toString()}unshift(...e){return(0,u.gc)(this._observable),!e.length||this._emitBeforeChanges(r.ADD)||(this._splice(0,0,e),this._emitAfterChanges(r.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,i){const r=this._items,n=this.itemType;let a,s;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=(0,d._)((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(s=r.splice(e,t),this.hasEventListener("before-remove")){const t=A.acquire();t.target=this,t.cancellable=!0;for(let i=0,n=s.length;i<n;i++)a=s[i],t.reset(a),this.emit("before-remove",t),t.defaultPrevented&&(s.splice(i,1),r.splice(e,0,a),e+=1,i-=1,n-=1);A.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=A.acquire();e.target=this,e.cancellable=!1;const t=s.length;for(let i=0;i<t;i++)e.reset(s[i]),this.emit("after-remove",e);A.release(e)}}if(i?.length){if(n){const e=[];for(const t of i){const i=n.ensureType(t);null==i&&null!=t||e.push(i)}i=e}const t=this.hasEventListener("before-add"),a=this.hasEventListener("after-add"),s=e===this.length;if(t||a){const n=A.acquire();n.target=this,n.cancellable=!0;const o=A.acquire();o.target=this,o.cancellable=!1;for(const h of i)t?(n.reset(h),this.emit("before-add",n),n.defaultPrevented||(s?r.push(h):r.splice(e++,0,h),this._set("length",r.length),a&&(o.reset(h),this.emit("after-add",o)))):(s?r.push(h):r.splice(e++,0,h),this._set("length",r.length),o.reset(h),this.emit("after-add",o));A.release(o),A.release(n)}else{if(s)for(const e of i)r.push(e);else r.splice(e,0,...i);this._set("length",r.length)}}if((i?.length||s?.length)&&this._notifyChangeEvent(i,s),this.hasEventListener("after-splice")){const r=new p(this,i,s,e,t);this.emit("after-splice",r)}return s}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const i=A.acquire();i.target=this,i.cancellable=!0,i.type=e,this.emit("before-changes",i),t=i.defaultPrevented,A.release(i)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=A.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),A.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;b.clear(),C.clear(),M.clear();for(const{added:t,removed:i}of e){if(t)if(0===M.size&&0===C.size)for(const e of t)b.add(e);else for(const e of t)C.has(e)?(M.add(e),C.delete(e)):M.has(e)||b.add(e);if(i)if(0===M.size&&0===b.size)for(const e of i)C.add(e);else for(const e of i)b.has(e)?b.delete(e):(M.delete(e),C.add(e))}const i=a.A.acquire();b.forEach((e=>{i.push(e)}));const r=a.A.acquire();C.forEach((e=>{r.push(e)}));const n=this._items,s=t.items,o=a.A.acquire();if(M.forEach((e=>{s.indexOf(e)!==n.indexOf(e)&&o.push(e)})),t.listeners&&(i.length||r.length||o.length)){const e={target:this,added:i,removed:r,moved:o},n=t.listeners.length;for(let i=0;i<n;i++){const r=t.listeners[i];r.removed||r.callback.call(this,e)}}a.A.release(i),a.A.release(r),a.A.release(o)}b.clear(),C.clear(),M.clear()}};P.ofType=e=>{if(!e)return c;if(w.has(e))return w.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const i in e.typeMap){const r=e.typeMap[i].prototype.declaredClass;t?t+=` | ${r}`:t=r}let i=class extends c{};return(0,n._)([(0,f.u)({Type:e,ensureType:"function"==typeof e?(0,m.dp)(e):(0,m.aq)(e)})],i.prototype,"itemType",void 0),i=(0,n._)([(0,_.$)(`esri.core.Collection<${t}>`)],i),w.set(e,i),i},(0,n._)([(0,g.MZ)()],P.prototype,"_updating",void 0),(0,n._)([(0,g.MZ)()],P.prototype,"length",void 0),(0,n._)([(0,g.MZ)()],P.prototype,"items",null),(0,n._)([(0,g.MZ)({readOnly:!0})],P.prototype,"updating",null),P=c=(0,n._)([(0,_.$)("esri.core.Collection")],P);const D=P},65529:(e,t,i)=>{i.d(t,{A:()=>h});var r=i(90237),n=i(69622),a=i(36563),s=i(40608);class o{constructor(){this._emitter=new o.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this._target=e,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(e,t){let i=this._listenersMap?.get(e);if(!i)return!1;const r=this._target||this;let n=!1;for(const e of i.slice()){const i="deref"in e?e.deref():e;i?i?.call(r,t):n=!0}return n&&(i=i.filter((e=>!("deref"in e)||null!=e.deref())),this._listenersMap.set(e,i)),i.length>0}on(e,t){if(Array.isArray(e)){const i=e.map((e=>this.on(e,t)));return(0,a.vE)(i)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const i=this._listenersMap.get(e)||[];return i.push(t),this._listenersMap.set(e,i),(0,a.hA)((()=>{const i=this._listenersMap?.get(e),r=i?.indexOf(t)??-1;r>=0&&i.splice(r,1)}))}once(e,t){const i=this.on(e,(e=>{i.remove();const r="deref"in t?t.deref():t;r?.call(null,e)}));return i}hasEventListener(e){const t=this._listenersMap?.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let i=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return i=(0,r._)([(0,s.$)("esri.core.Evented")],i),i};let i=class extends n.A{constructor(){super(...arguments),this._emitter=new o.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};i=(0,r._)([(0,s.$)("esri.core.Evented.EventedAccessor")],i),e.EventedAccessor=i}(o||(o={}));const h=o},61893:(e,t,i)=>{i.d(t,{Z:()=>d,g:()=>c});var r,n,a=i(90237),s=i(69622),o=i(74887),h=i(40608);(n=r||(r={}))[n.PENDING=0]="PENDING",n[n.RESOLVED=1]="RESOLVED",n[n.REJECTED=2]="REJECTED";class l{constructor(){this._resolver=(0,o.Tw)(),this._status=r.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=r.RESOLVED,this._cleanUp()}),(()=>{this._status=r.REJECTED,this._cleanUp()})),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===r.RESOLVED}isRejected(){return this._status===r.REJECTED}isFulfilled(){return this._status!==r.PENDING}abort(){this._resolver.reject((0,o.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,o.Tw)(),t=[...this._resolvingPromises,e.promise],i=this._allPromise=Promise.all(t);i.then((()=>{this.isFulfilled()||this._allPromise!==i||this._resolver.resolve()}),(e=>{this.isFulfilled()||this._allPromise!==i||(0,o.zf)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new l,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then((()=>this)).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}};return t=(0,a._)([(0,h.$)("esri.core.Promise")],t),t};let d=class extends(c(s.A)){};d=(0,a._)([(0,h.$)("esri.core.Promise")],d)},7695:(e,t,i)=>{function r(e){return(t,i)=>{t[i]=e}}i.d(t,{u:()=>r})},95488:(e,t,i)=>{i.d(t,{I:()=>n});var r=i(11406);class n extends r.T{notify(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const e of t)e.onInvalidated(),e.onCommitted()}}}},60999:(e,t,i)=>{i.d(t,{DZ:()=>g,Ke:()=>u,Tj:()=>c,UT:()=>f,jJ:()=>l});var r=i(90237),n=i(69622),a=i(97768),s=i(74887),o=i(10107),h=i(40608);function l(e,t,i){return(0,s.Lx)(e.map(((e,r)=>t.apply(i,[e,r]))))}async function c(e,t,i){return(await(0,s.Lx)(e.map(((e,r)=>t.apply(i,[e,r]))))).map((e=>e.value))}function d(e){return{ok:!0,value:e}}function m(e){return{ok:!1,error:e}}async function u(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return d(await e)}catch(e){return m(e)}}async function g(e){try{return d(await e)}catch(e){return(0,s.QP)(e),m(e)}}function f(e,t){return new _(e,t)}let _=class extends n.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,a.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then((e=>{this._result=d(e),this._cleanup()}),(e=>{this._result=m(e),this._cleanup()})),this._abortHandle=(0,s.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,a.xt)(this._abortHandle),this._abortController=null}};(0,r._)([(0,o.MZ)()],_.prototype,"value",null),(0,r._)([(0,o.MZ)()],_.prototype,"error",null),(0,r._)([(0,o.MZ)()],_.prototype,"finished",null),(0,r._)([(0,o.MZ)()],_.prototype,"promise",void 0),(0,r._)([(0,o.MZ)()],_.prototype,"_result",void 0),_=(0,r._)([(0,h.$)("esri.core.asyncUtils.ReactiveTask")],_)},47566:(e,t,i)=>{i(97770),i(18047),i(71754),i(73444);var r=i(10838),n=i(78888),a=i(49186);async function s(e){if(null!=o.fetchBundleAsset)return o.fetchBundleAsset(e);const t=await(0,n.A)(e,{responseType:"text"});return JSON.parse(t.data)}const o={};var h,l=i(2741);(0,r.ao)((h={pattern:"esri/",location:l.s},new class{constructor({base:e="",pattern:t,location:i=new URL(window.location.href)}){let r;r="string"==typeof i?e=>new URL(e,new URL(i,window.location.href)).href:i instanceof URL?e=>new URL(e,i).href:i,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=r,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,i,n){const o=t.exec(i);if(!o)throw new a.A("esri-intl:invalid-bundle",`Bundle id "${i}" is not compatible with the pattern "${t}"`);const h=o[1]?`${o[1]}/`:"",l=o[2],c=(0,r.xO)(n),d=`${h}${l}.json`,m=c?`${h}${l}_${c}.json`:d;let u;try{u=await s(e(m))}catch(t){if(m===d)throw new a.A("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:t});try{u=await s(e(d))}catch(e){throw new a.A("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:e})}}return u}(this.getAssetUrl,this.matcher,e,t)}}(h)))},97770:(e,t,i)=>{i.d(t,{J2:()=>v,Yq:()=>S,_v:()=>_,wj:()=>y});var r=i(66552),n=i(73444),a=i(56400);i(96285),a.n$;const s={year:"numeric",month:"numeric",day:"numeric"},o={year:"numeric",month:"long",day:"numeric"},h={year:"numeric",month:"short",day:"numeric"},l={year:"numeric",month:"long",weekday:"long",day:"numeric"},c={hour:"numeric",minute:"numeric"},d={...c,second:"numeric"},m={hourCycle:"h23"},u={...c,...m},g={...d,...m},f={"short-date":s,"short-date-short-time":{...s,...c},"short-date-short-time-24":{...s,...u},"short-date-long-time":{...s,...d},"short-date-long-time-24":{...s,...g},"short-date-le":s,"short-date-le-short-time":{...s,...c},"short-date-le-short-time-24":{...s,...u},"short-date-le-long-time":{...s,...d},"short-date-le-long-time-24":{...s,...g},"long-month-day-year":o,"long-month-day-year-short-time":{...o,...c},"long-month-day-year-short-time-24":{...o,...u},"long-month-day-year-long-time":{...o,...d},"long-month-day-year-long-time-24":{...o,...g},"day-short-month-year":h,"day-short-month-year-short-time":{...h,...c},"day-short-month-year-short-time-24":{...h,...u},"day-short-month-year-long-time":{...h,...d},"day-short-month-year-long-time-24":{...h,...g},"long-date":l,"long-date-short-time":{...l,...c},"long-date-short-time-24":{...l,...u},"long-date-long-time":{...l,...d},"long-date-long-time-24":{...l,...g},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":c,"long-time":d},_=(0,r.O)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),T={ar:"ar-u-nu-latn-ca-gregory"};let p=new WeakMap;const A=f["short-date-short-time"];function v(e){return f[e]}function S(e,t=A){return function(e){let t=p.get(e);if(!t){const i=(0,n.JK)(),r=T[i]||i,s=y(e.timeZone??a.qU),o={...e,timeZone:s};t=new Intl.DateTimeFormat(r,o),p.set(e,t)}return t}(t).format(e)}function y(e){switch(e){case a.qU:return a.N5;case a.L5:return a.n$;default:return e}}(0,n.Ml)((()=>{p=new WeakMap}))},73444:(e,t,i)=>{i.d(t,{JK:()=>o,Ml:()=>m,Z0:()=>h,oQ:()=>c});var r=i(36563);let n;const a=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function s(){return a??globalThis.navigator?.language??"en"}function o(){return void 0===n&&(n=s()),n}function h(e=o()){const t=/^([a-zA-Z]{2,3})(?:[_-]\w+)*$/.exec(e);return t?.[1].toLowerCase()}const l=[];function c(e){return l.push(e),(0,r.hA)((()=>l.splice(l.indexOf(e),1)))}const d=[];function m(e){return d.push(e),(0,r.hA)((()=>d.splice(d.indexOf(e),1)))}globalThis.addEventListener?.("languagechange",(function(){const e=s();n!==e&&([...d].forEach((t=>t(e))),n=e,[...l].forEach((t=>t(e))))}))},10838:(e,t,i)=>{i.d(t,{ao:()=>u,ud:()=>g,xO:()=>f});var r=i(49186),n=i(36563),a=i(74887),s=i(73444);const o=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,h={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function l(e){return e in h}const c=[],d=new Map;function m(e){for(const t of d.keys())_(e.pattern,t)&&d.delete(t)}function u(e){return c.includes(e)||(m(e),c.unshift(e)),(0,n.hA)((()=>{const t=c.indexOf(e);t>-1&&(c.splice(t,1),m(e))}))}async function g(e){const t=(0,s.JK)();d.has(e)||d.set(e,async function(e,t){const i=[];for(const r of c)if(_(r.pattern,e))try{return await r.fetchMessageBundle(e,t)}catch(e){i.push(e)}if(i.length)throw new r.A("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:i});throw new r.A("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const i=d.get(e);return i&&await T.add(i),i}function f(e){if(!o.test(e))return null;const t=o.exec(e);if(null===t)return null;const[,i,r]=t,n=i+(r?"-"+r.toUpperCase():"");return l(n)?n:l(i)?i:null}function _(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,s.Ml)((()=>{d.clear()}));const T=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,a.Tw)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},18047:(e,t,i)=>{i.d(t,{ZV:()=>o});var r=i(73444);const n={ar:"ar-u-nu-latn"};let a=new WeakMap,s={};function o(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||s;if(!a.has(t)){const i=(0,r.JK)(),s=n[(0,r.JK)()]||i;a.set(t,new Intl.NumberFormat(s,e))}return a.get(t)}(t).format(e)}(0,r.Ml)((()=>{a=new WeakMap,s={}})),new Map},71754:(e,t,i)=>{i.d(t,{V:()=>l});var r=i(53966),n=i(93637),a=i(799),s=i(97770),o=i(18047);const h=()=>r.A.getLogger("esri.intl.substitute");function l(e,t,i={}){const{format:r={}}=i;return(0,a.HC)(e,(e=>function(e,t,i){let r,a;const s=e.indexOf(":");if(-1===s?r=e.trim():(r=e.slice(0,s).trim(),a=e.slice(s+1).trim()),!r)return"";const o=(0,n.wc)(r,t);if(null==o)return"";const h=(a?i?.[a]:null)??i?.[r];return h?c(o,h):a?d(o,a):m(o)}(e,t,r)))}function c(e,t){switch(t.type){case"date":return(0,s.Yq)(e,t.intlOptions);case"number":return(0,o.ZV)(e,t.intlOptions);default:return h().warn("missing format descriptor for key {key}"),m(e)}}function d(e,t){switch(t.toLowerCase()){case"dateformat":return(0,s.Yq)(e);case"numberformat":return(0,o.ZV)(e);default:return h().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,s.Yq)(e):/^numberformat/i.test(t)?(0,o.ZV)(e):m(e)}}function m(e){switch(typeof e){case"string":return e;case"number":return(0,o.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,s.Yq)(e):""}}},56400:(e,t,i)=>{i.d(t,{ZS:()=>c,qU:()=>a,N5:()=>h,P6:()=>l,L5:()=>s,n$:()=>o});const r=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Bishkek"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);var n=i(96285);const a="system",s="unknown",o="UTC",h=Intl.DateTimeFormat().resolvedOptions().timeZone;function l(e,t=!1){return{json:{read:{source:e,reader:(t,i)=>i[e]?c(i[e]):null},write:!!t&&{allowNull:!0,writer(t,i){i[e]=t?function(e){return{timeZoneIANA:e}}(t):null}}}}}function c(e,t=a){return e?function(e){return"timeZoneIANA"in e}(e)?e.timeZoneIANA:function(e,t=a){if(!e||!r.has(e.timeZone))return t;const i=r.get(e.timeZone);return function(e){return e.startsWith("UTC")}(e.timeZone)||e.respectsDaylightSaving?i:function(e){const t=n.c9.local().setZone(e),i=Math.min(t.set({month:1,day:1}).offset,t.set({month:5}).offset);return 0===i?"Etc/UTC":`Etc/GMT${n.mQ.instance(-i).formatOffset(0,"narrow")}`}(i)}(e,t):t}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7656],{70668:(e,t,r)=>{r.d(t,{A:()=>y});var i=r(90237),s=r(69540),o=r(25482),a=r(88930),n=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),d=r(40608),u=r(73133);let p=class extends((0,s.O)(o.oY)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,a.t)(this.value,this.unit,"milliseconds")}};(0,i._)([(0,l.e)(u.j,{nonNullable:!0})],p.prototype,"unit",void 0),(0,i._)([(0,n.MZ)({type:Number,json:{write:!0},nonNullable:!0})],p.prototype,"value",void 0),p=(0,i._)([(0,d.$)("esri.TimeInterval")],p);const y=p},83960:(e,t,r)=>{r.d(t,{X_:()=>a,zx:()=>n});var i=r(34727),s=r(83047);const o=96;function a(e,t){const r=t||e.extent,i=e.width,a=(0,s.GA)(r?.spatialReference);return r&&i?r.width/i*a*s.dy*o:0}function n(e,t,r){return function(e,t){return 0===t||(0,i.Sp)(e,t)||e<t}(e,t)&&function(e,t){return 0===t||(0,i.Sp)(e,t)||e>t}(e,r)}},7656:(e,t,r)=>{r.r(t),r.d(t,{default:()=>C});var i=r(90237),s=r(78888),o=r(60945),a=r(49186),n=r(81583),l=r(92071),d=r(74887),u=r(10107),p=r(56507),y=(r(87811),r(44208),r(36005)),m=r(40608),c=r(43937),h=r(35666),f=r(5443),v=r(83960),g=r(21325),b=r(4146),_=r(52136),x=r(98534),w=r(18768),I=r(63074),S=r(69208),M=r(16131),T=r(8303),Z=r(54310),O=r(25036),E=r(91921),A=r(82935),L=r(10873),P=r(69622),U=r(39516);function j(e,t){return"floorInfo"in t&&t.floorInfo?.floorField?function(e,t){if(!e?.length)return null;const r=e.filter((e=>""!==e)).map((e=>`'${e}'`));return r.push("''"),`${t} IN (${r.join(",")}) OR ${t} IS NULL`}(e,t.floorInfo.floorField):null}r(53966);var N=r(63389);const F={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let D=class extends P.A{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map((e=>{const t=j(this.floors,e);return e.toExportImageJSON(t)}));return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&(0,N.Sk)(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",(()=>this.notifyChange("visibleSublayers"))),e.on("sublayer-update",(e=>this.notifyChange(F[e.propertyName])))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map((e=>e.id)).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,t=this.visibleSublayers.filter((t=>null!=t.definitionExpression||e&&null!=t.floorInfo));return t.length?JSON.stringify(t.reduce(((e,t)=>{const r=j(this.floors,t),i=(0,U.m)(r,t.definitionExpression);return null!=i&&(e[t.id]=i),e}),{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const t=this.layer.sublayers,r=this.scale,i=t=>{t.visible&&(0===r||(0,v.zx)(r,t.minScale,t.maxScale))&&(t.sublayers?t.sublayers.forEach(i):e.unshift(t))};t&&t.forEach(i);const s=this._get("visibleSublayers");return!s||s.length!==e.length||s.some(((t,r)=>e[r]!==t))?e:s}toJSON(){const e=this.layer;let t={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?t.dynamicLayers=this.dynamicLayers:t={...t,layers:this.layers,layerDefs:this.layerDefs},t}};(0,i._)([(0,u.MZ)({readOnly:!0})],D.prototype,"dynamicLayers",null),(0,i._)([(0,u.MZ)()],D.prototype,"floors",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],D.prototype,"hasDynamicLayers",null),(0,i._)([(0,u.MZ)()],D.prototype,"layer",null),(0,i._)([(0,u.MZ)({readOnly:!0})],D.prototype,"layers",null),(0,i._)([(0,u.MZ)({readOnly:!0})],D.prototype,"layerDefs",null),(0,i._)([(0,u.MZ)({type:Number})],D.prototype,"scale",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],D.prototype,"version",null),(0,i._)([(0,u.MZ)({readOnly:!0})],D.prototype,"visibleSublayers",null),D=(0,i._)([(0,m.$)("esri.layers.support.ExportImageParameters")],D);var R=r(33446),J=r(60410),k=r(91908),V=r(56400);let $=class extends((0,I.dM)((0,A.e)((0,O.j)((0,E.I)((0,x.V)((0,w.b)((0,M.q)((0,T.A)((0,l.P)((0,Z.J)((0,_.p)((0,S.d)(b.A))))))))))))){constructor(...e){super(...e),this._exportImageParameters=new D({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(d.QP).then((()=>this._fetchService(t)))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("PNG32")?"png32":"png24"}writeSublayers(e,t,r,i){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray();let o=!1;if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){const e=(0,h.aB)(i.origin);if(e===h.Gr.PORTAL_ITEM){const e=this.createSublayersForOrigin("service").sublayers;o=(0,N.Zx)(s,e,h.Gr.SERVICE)}else if(e>h.Gr.PORTAL_ITEM){const e=this.createSublayersForOrigin("portal-item");o=(0,N.Zx)(s,e.sublayers,(0,h.aB)(e.origin))}}const a=[],n={writeSublayerStructure:o,...i};let l=o;s.forEach((e=>{const t=e.write({},n);a.push(t),l=l||"user"===e.originOf("visible")})),a.some((e=>Object.keys(e).length>1))&&(t.layers=a),l&&(t.visibleLayers=s.filter((e=>e.visible)).map((e=>e.id)))}createExportImageParameters(e,t,r,i){const s=i?.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian()),this._exportImageParameters.floors=i?.floors??null,this._exportImageParameters.scale=(0,v.X_)({extent:e,width:t})*s;const o=this._exportImageParameters.toJSON(),a=!i?.rotation||this.version<10.3?{}:{rotation:-i.rotation},n=e?.spatialReference,l=(0,g.YX)(n);o.dpi*=s;const d={};if(i?.timeExtent){const{start:e,end:t}=i.timeExtent.toJSON();d.time=e&&t&&e===t?""+e:`${e??"null"},${t??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(d.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:l,imageSR:l,size:t+","+r,...o,...a,...d}}async fetchImage(e,t,r,i){const{data:s}=await this._fetchImage("image",e,t,r,i);return s}async fetchImageBitmap(e,t,r,i){const{data:s,url:o}=await this._fetchImage("blob",e,t,r,i);return(0,R.m)(s,o,i?.signal)}async fetchRecomputedExtents(e={}){const t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:r}=await(0,s.A)(this.url,t),{extent:i,fullExtent:a,timeExtent:n}=r,l=i||a;return{fullExtent:l&&f.A.fromJSON(l),timeExtent:n&&o.A.fromJSON({start:n[0],end:n[1]})}}loadAll(){return(0,n.g)(this,(e=>{e(this.allSublayers)}))}serviceSupportsSpatialReference(e){return(0,k.D)(this,e)}async _fetchImage(e,t,r,i,o){const n={responseType:e,signal:o?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,r,i,o),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(null!=n.query?.dynamicLayers&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new a.A("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:n.query});try{const{data:e}=await(0,s.A)(l,n);return{data:e,url:l}}catch(e){if((0,d.zf)(e))throw e;throw new a.A("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:e})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:r}=await(0,s.A)(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});r&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}};(0,i._)([(0,u.MZ)((0,V.P6)("dateFieldsTimeReference"))],$.prototype,"dateFieldsTimeZone",void 0),(0,i._)([(0,u.MZ)({type:Boolean})],$.prototype,"datesInUnknownTimezone",void 0),(0,i._)([(0,u.MZ)()],$.prototype,"dpi",void 0),(0,i._)([(0,u.MZ)()],$.prototype,"gdbVersion",void 0),(0,i._)([(0,u.MZ)()],$.prototype,"imageFormat",void 0),(0,i._)([(0,y.w)("imageFormat",["supportedImageFormatTypes"])],$.prototype,"readImageFormat",null),(0,i._)([(0,u.MZ)({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],$.prototype,"imageMaxHeight",void 0),(0,i._)([(0,u.MZ)({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],$.prototype,"imageMaxWidth",void 0),(0,i._)([(0,u.MZ)()],$.prototype,"imageTransparency",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],$.prototype,"isReference",void 0),(0,i._)([(0,u.MZ)({json:{read:!1,write:!1}})],$.prototype,"labelsVisible",void 0),(0,i._)([(0,u.MZ)({type:["ArcGISMapServiceLayer"]})],$.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.MZ)({json:{read:!1,write:!1}})],$.prototype,"popupEnabled",void 0),(0,i._)([(0,u.MZ)((0,V.P6)("preferredTimeReference"))],$.prototype,"preferredTimeZone",void 0),(0,i._)([(0,u.MZ)()],$.prototype,"sourceJSON",void 0),(0,i._)([(0,u.MZ)({json:{write:{ignoreOrigin:!0}}})],$.prototype,"sublayers",void 0),(0,i._)([(0,c.K)("sublayers",{layers:{type:[J.A]},visibleLayers:{type:[p.jz]}})],$.prototype,"writeSublayers",null),(0,i._)([(0,u.MZ)({type:["show","hide","hide-children"]})],$.prototype,"listMode",void 0),(0,i._)([(0,u.MZ)({json:{read:!1},readOnly:!0,value:"map-image"})],$.prototype,"type",void 0),(0,i._)([(0,u.MZ)(L.OZ)],$.prototype,"url",void 0),$=(0,i._)([(0,m.$)("esri.layers.MapImageLayer")],$);const C=$},82935:(e,t,r)=>{r.d(t,{B:()=>m,e:()=>c});var i=r(90237),s=r(60945),o=r(70668),a=r(10107),n=(r(44208),r(53966),r(87811),r(36005)),l=r(40608),d=r(89317),u=r(30524),p=r(96184),y=r(73133);const m={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:d.K}}},c=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const r=t.timeInfo.exportOptions;if(!r)return null;const i=r.timeOffset,s=y.j.fromJSON(r.timeOffsetUnits);return i&&s?new o.A({value:i,unit:s}):null}set timeInfo(e){(0,u.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,i._)([(0,a.MZ)({type:s.A,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,i._)([(0,a.MZ)({type:o.A})],t.prototype,"timeOffset",void 0),(0,i._)([(0,n.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,i._)([(0,a.MZ)({value:null,type:p.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,i._)([(0,a.MZ)(m)],t.prototype,"useViewTime",void 0),t=(0,i._)([(0,l.$)("esri.layers.mixins.TemporalLayer")],t),t}},96184:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(90237),s=r(60945),o=r(70668),a=r(69540),n=r(25482),l=r(10107),d=(r(44208),r(53966),r(87811),r(36005)),u=r(40608),p=r(43937),y=r(56400);function m(e,t){return o.A.fromJSON({value:e,unit:t})}let c=class extends((0,a.O)(n.oY)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?s.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?m(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?m(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,i._)([(0,l.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],c.prototype,"cumulative",void 0),(0,i._)([(0,l.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],c.prototype,"endField",void 0),(0,i._)([(0,l.MZ)({type:s.A,json:{write:{enabled:!0,allowNull:!0}}})],c.prototype,"fullTimeExtent",void 0),(0,i._)([(0,d.w)("fullTimeExtent",["timeExtent"])],c.prototype,"readFullTimeExtent",null),(0,i._)([(0,p.K)("fullTimeExtent")],c.prototype,"writeFullTimeExtent",null),(0,i._)([(0,l.MZ)({type:Boolean,json:{write:!0}})],c.prototype,"hasLiveData",void 0),(0,i._)([(0,l.MZ)({type:o.A,json:{write:{enabled:!0,allowNull:!0}}})],c.prototype,"interval",void 0),(0,i._)([(0,d.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],c.prototype,"readInterval",null),(0,i._)([(0,p.K)("interval")],c.prototype,"writeInterval",null),(0,i._)([(0,l.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],c.prototype,"startField",void 0),(0,i._)([(0,l.MZ)((0,y.P6)("timeReference",!0))],c.prototype,"timeZone",void 0),(0,i._)([(0,l.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],c.prototype,"trackIdField",void 0),(0,i._)([(0,l.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],c.prototype,"useTime",void 0),(0,i._)([(0,l.MZ)({type:[Date],json:{read:!1}})],c.prototype,"stops",void 0),c=(0,i._)([(0,u.$)("esri.layers.support.TimeInfo")],c);const h=c},91908:(e,t,r)=>{r.d(t,{D:()=>o});var i=r(60694);const s=[];function o(e,t){if((0,i.Wo)(e.url??""))return!0;const{wkid:r}=t;for(const t of s){if((e.version??0)>=t[0])return!0;if("function"==typeof t[1]&&(t[1]=t[1]()),t[1].has(r))return!1}return!0}s.push([10.91,()=>{const e=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)e.add(t);for(let t=9748;t<=9749;t++)e.add(t);for(let t=20904;t<=20932;t++)e.add(t);for(let t=21004;t<=21032;t++)e.add(t);for(let t=21207;t<=21264;t++)e.add(t);for(let t=21307;t<=21364;t++)e.add(t);for(let t=23301;t<=23333;t++)e.add(t);for(let t=102759;t<=102760;t++)e.add(t);for(let t=102934;t<=102955;t++)e.add(t);return e}]),s.push([10.9,()=>{const e=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)e.add(t);for(let t=9404;t<=9407;t++)e.add(t);for(let t=9476;t<=9482;t++)e.add(t);for(let t=9487;t<=9494;t++)e.add(t);for(let t=9697;t<=9699;t++)e.add(t);return e}]),s.push([10.81,()=>{const e=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)e.add(t);for(let t=9271;t<=9273;t++)e.add(t);for(let t=9284;t<=9285;t++)e.add(t);for(let t=21453;t<=21463;t++)e.add(t);return e}]),s.push([10.8,()=>{const e=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)e.add(t);for(let t=8455;t<=8456;t++)e.add(t);for(let t=8518;t<=8529;t++)e.add(t);for(let t=8533;t<=8536;t++)e.add(t);for(let t=8538;t<=8540;t++)e.add(t);for(let t=8677;t<=8679;t++)e.add(t);for(let t=8902;t<=8903;t++)e.add(t);for(let t=8907;t<=8910;t++)e.add(t);for(let t=8949;t<=8951;t++)e.add(t);for(let t=8972;t<=8987;t++)e.add(t);for(let t=9039;t<=9040;t++)e.add(t);for(let t=9068;t<=9069;t++)e.add(t);for(let t=9140;t<=9141;t++)e.add(t);for(let t=9148;t<=9150;t++)e.add(t);for(let t=9153;t<=9159;t++)e.add(t);for(let t=9205;t<=9218;t++)e.add(t);for(let t=9221;t<=9222;t++)e.add(t);for(let t=54098;t<=54101;t++)e.add(t);return e}]),s.push([10.71,()=>{const e=new Set([6316]);for(let t=8351;t<=8353;t++)e.add(t);for(let t=9294;t<=9297;t++)e.add(t);for(let t=22619;t<=22621;t++)e.add(t);for(let t=103586;t<=103594;t++)e.add(t);return e}])},73133:(e,t,r)=>{r.d(t,{j:()=>i});const i=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})}}]);
|