@esri/solutions-components 0.7.7 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +3 -3
- package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-action-pad_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-alert_3.cjs.entry.js +2 -2
- package/dist/cjs/calcite-combobox_6.cjs.entry.js +2 -2
- package/dist/cjs/calcite-input-date-picker_3.cjs.entry.js +16 -9
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +6 -6
- package/dist/cjs/card-manager_3.cjs.entry.js +2 -2
- package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
- package/dist/cjs/{helpers-ff831524.js → helpers-a0719076.js} +1 -1
- package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +10 -10
- package/dist/cjs/instant-apps-control-panel.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-export.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-header.cjs.entry.js +2 -2
- package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +7 -7
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +6 -6
- package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-landing-page.cjs.entry.js +1 -1
- package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +8 -8
- package/dist/cjs/instant-apps-language-translator.cjs.entry.js +7 -7
- package/dist/cjs/instant-apps-measurement.cjs.entry.js +4 -4
- package/dist/cjs/instant-apps-popover.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +3 -3
- package/dist/cjs/instant-apps-splash.cjs.entry.js +3 -3
- package/dist/cjs/{languageSwitcher-cae609d9.js → languageSwitcher-7de41e17.js} +1 -1
- package/dist/cjs/layout-manager.cjs.entry.js +1 -1
- package/dist/cjs/{loadModules-1d0f0316.js → loadModules-51c30ab9.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{locale-56c3447b.js → locale-9b9d0e94.js} +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/{utils-41eb3a01.js → utils-35b31785.js} +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +5 -5
- package/dist/collection/components/edit-card/edit-card.css +3 -3
- package/dist/collection/components/info-card/info-card.css +2 -2
- package/dist/collection/components/json-editor/json-editor.css +3 -123
- package/dist/collection/components/layer-table/layer-table.css +9 -12
- package/dist/collection/components/layer-table/layer-table.js +1 -1
- package/dist/collection/components/layout-manager/layout-manager.css +73 -73
- package/dist/collection/components/map-draw-tools/map-draw-tools.css +1 -1
- package/dist/collection/components/map-layer-picker/map-layer-picker.css +5 -3
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
- package/dist/collection/components/map-picker/map-picker.css +3 -3
- package/dist/collection/components/map-search/map-search.css +24 -24
- package/dist/collection/components/map-select-tools/map-select-tools.css +5 -5
- package/dist/collection/components/map-tools/map-tools.css +1 -1
- package/dist/collection/components/public-notification/public-notification.css +11 -11
- package/dist/collection/components/public-notification/public-notification.js +1 -1
- package/dist/collection/components/refine-selection/refine-selection.css +2 -2
- package/dist/collection/components/solution-item-details/solution-item-details.css +0 -148
- package/dist/collection/components/solution-item-icon/solution-item-icon.css +2 -124
- package/dist/collection/components/solution-item-sharing/solution-item-sharing.css +5 -125
- package/dist/collection/components/solution-organization-variables/solution-organization-variables.css +6 -126
- package/dist/collection/components/solution-resource-item/solution-resource-item.css +6 -126
- package/dist/collection/components/solution-variables/solution-variables.css +9 -129
- package/dist/collection/demos/browse-solutions.html +2 -0
- package/dist/collection/demos/buffer-tools.html +1 -1
- package/dist/collection/demos/card-manager.html +2 -2
- package/dist/collection/demos/crowdsource-manager.html +3 -3
- package/dist/collection/demos/crowdsource-reporter.html +5 -5
- package/dist/collection/demos/deduct-calculator.html +1 -1
- package/dist/collection/demos/info-card.html +2 -2
- package/dist/collection/demos/layer-table.html +2 -2
- package/dist/collection/demos/list-item.html +2 -2
- package/dist/collection/demos/map-card.html +2 -2
- package/dist/collection/demos/map-draw-tools.html +1 -1
- package/dist/collection/demos/map-layer-picker.html +1 -1
- package/dist/collection/demos/map-select-tools.html +1 -1
- package/dist/collection/demos/new-public-notification.html +5 -5
- package/dist/collection/demos/pci-calculator.html +1 -1
- package/dist/components/crowdsource-manager.js +1 -1
- package/dist/components/edit-card2.js +1 -1
- package/dist/components/info-card2.js +1 -1
- package/dist/components/instant-apps-ckeditor-wrapper2.js +2 -2
- package/dist/components/instant-apps-control-panel.js +1 -1
- package/dist/components/instant-apps-export.js +2 -2
- package/dist/components/instant-apps-filter-list2.js +4 -2
- package/dist/components/instant-apps-header2.js +2 -2
- package/dist/components/instant-apps-interactive-legend-classic2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-count2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-group-legend-element-caption.js +5 -5
- package/dist/components/instant-apps-interactive-legend-group-legend-element2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-layer-element-caption2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-layer-element2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-legend-element-caption2.js +1 -1
- package/dist/components/instant-apps-interactive-legend-relationship2.js +1 -1
- package/dist/components/instant-apps-interactive-legend.js +1 -1
- package/dist/components/instant-apps-keyboard-shortcuts.js +1 -1
- package/dist/components/instant-apps-landing-page.js +1 -1
- package/dist/components/instant-apps-language-switcher.js +4 -4
- package/dist/components/instant-apps-language-translator-item2.js +4 -4
- package/dist/components/instant-apps-language-translator-search2.js +1 -1
- package/dist/components/instant-apps-language-translator2.js +3 -3
- package/dist/components/instant-apps-measurement.js +2 -2
- package/dist/components/instant-apps-popover.js +1 -1
- package/dist/components/instant-apps-scoreboard.js +1 -1
- package/dist/components/instant-apps-social-share2.js +11 -5
- package/dist/components/instant-apps-splash.js +1 -1
- package/dist/components/json-editor2.js +1 -1
- package/dist/components/layer-table2.js +2 -2
- package/dist/components/layout-manager.js +1 -1
- package/dist/components/loadModules2.js +1 -1
- package/dist/components/map-draw-tools2.js +1 -1
- package/dist/components/map-layer-picker2.js +2 -2
- package/dist/components/map-picker2.js +1 -1
- package/dist/components/map-search2.js +1 -1
- package/dist/components/map-select-tools2.js +1 -1
- package/dist/components/map-tools2.js +1 -1
- package/dist/components/public-notification.js +2 -2
- package/dist/components/refine-selection2.js +1 -1
- package/dist/components/solution-item-details2.js +1 -1
- package/dist/components/solution-item-icon2.js +1 -1
- package/dist/components/solution-item-sharing2.js +1 -1
- package/dist/components/solution-organization-variables2.js +1 -1
- package/dist/components/solution-resource-item2.js +1 -1
- package/dist/components/solution-variables2.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +3 -3
- package/dist/esm/buffer-tools_3.entry.js +1 -1
- package/dist/esm/calcite-action-pad_2.entry.js +1 -1
- package/dist/esm/calcite-alert_3.entry.js +2 -2
- package/dist/esm/calcite-combobox_6.entry.js +2 -2
- package/dist/esm/calcite-input-date-picker_3.entry.js +16 -9
- package/dist/esm/calcite-shell-panel_14.entry.js +6 -6
- package/dist/esm/card-manager_3.entry.js +2 -2
- package/dist/esm/crowdsource-manager.entry.js +1 -1
- package/dist/esm/{helpers-e8282221.js → helpers-078591d2.js} +1 -1
- package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +10 -10
- package/dist/esm/instant-apps-control-panel.entry.js +2 -2
- package/dist/esm/instant-apps-export.entry.js +4 -4
- package/dist/esm/instant-apps-header.entry.js +2 -2
- package/dist/esm/instant-apps-interactive-legend-classic.entry.js +3 -3
- package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +4 -4
- package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +7 -7
- package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +6 -6
- package/dist/esm/instant-apps-interactive-legend.entry.js +4 -4
- package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +3 -3
- package/dist/esm/instant-apps-landing-page.entry.js +1 -1
- package/dist/esm/instant-apps-language-switcher.entry.js +8 -8
- package/dist/esm/instant-apps-language-translator.entry.js +7 -7
- package/dist/esm/instant-apps-measurement.entry.js +4 -4
- package/dist/esm/instant-apps-popover.entry.js +3 -3
- package/dist/esm/instant-apps-scoreboard.entry.js +3 -3
- package/dist/esm/instant-apps-splash.entry.js +3 -3
- package/dist/esm/{languageSwitcher-75765d90.js → languageSwitcher-62232826.js} +1 -1
- package/dist/esm/layout-manager.entry.js +1 -1
- package/dist/esm/{loadModules-037feea8.js → loadModules-b677d6d7.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{locale-53d724b5.js → locale-89b49505.js} +1 -1
- package/dist/esm/map-select-tools_3.entry.js +2 -2
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solution-item-icon.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/{utils-06bace50.js → utils-b1bd777e.js} +1 -1
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-export/instant-apps-export.css +20 -20
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-filter-list/instant-apps-filter-list.css +3 -3
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-header/instant-apps-header.css +3 -3
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-classic/instant-apps-interactive-legend-classic.css +4 -4
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-count/instant-apps-interactive-legend-count.css +1 -1
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-group-legend-element-caption/instant-apps-interactive-legend-group-legend-element-caption.css +5 -7
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-layer-element-caption/instant-apps-interactive-legend-layer-element-caption.css +5 -7
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-legend-element-caption/instant-apps-interactive-legend-legend-element-caption.css +4 -5
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend-relationship/instant-apps-interactive-legend-relationship.css +1 -1
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-interactive-legend/instant-apps-interactive-legend.css +2 -2
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-keyboard-shortcuts/instant-apps-keyboard-shortcuts.css +4 -4
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-landing-page/instant-apps-landing-page.css +6 -6
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-language-switcher/instant-apps-language-switcher.css +4 -4
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-language-translator/instant-apps-language-translator-item/instant-apps-language-translator-item.css +7 -7
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-language-translator/instant-apps-language-translator-search/instant-apps-language-translator-search.css +2 -2
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-language-translator/instant-apps-language-translator.css +2 -2
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-measurement/instant-apps-measurement.css +2 -2
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-popover/instant-apps-popover.css +3 -3
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-scoreboard/instant-apps-scoreboard.css +4 -4
- package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-social-share/instant-apps-social-share.css +6 -6
- package/dist/solutions-components/demos/browse-solutions.html +2 -0
- package/dist/solutions-components/demos/buffer-tools.html +1 -1
- package/dist/solutions-components/demos/card-manager.html +2 -2
- package/dist/solutions-components/demos/crowdsource-manager.html +3 -3
- package/dist/solutions-components/demos/crowdsource-reporter.html +5 -5
- package/dist/solutions-components/demos/deduct-calculator.html +1 -1
- package/dist/solutions-components/demos/info-card.html +2 -2
- package/dist/solutions-components/demos/layer-table.html +2 -2
- package/dist/solutions-components/demos/list-item.html +2 -2
- package/dist/solutions-components/demos/map-card.html +2 -2
- package/dist/solutions-components/demos/map-draw-tools.html +1 -1
- package/dist/solutions-components/demos/map-layer-picker.html +1 -1
- package/dist/solutions-components/demos/map-select-tools.html +1 -1
- package/dist/solutions-components/demos/new-public-notification.html +5 -5
- package/dist/solutions-components/demos/pci-calculator.html +1 -1
- package/dist/solutions-components/{p-bab0aa05.js → p-00f9774c.js} +1 -1
- package/dist/solutions-components/p-14097810.entry.js +6 -0
- package/dist/solutions-components/{p-019f0baa.entry.js → p-166d5bcc.entry.js} +1 -1
- package/dist/solutions-components/{p-9270f6da.entry.js → p-1b9709ce.entry.js} +1 -1
- package/dist/solutions-components/p-3bf0115f.entry.js +6 -0
- package/dist/solutions-components/{p-796ce3a2.entry.js → p-3ea18af7.entry.js} +1 -1
- package/dist/solutions-components/p-4f1c4004.entry.js +6 -0
- package/dist/solutions-components/{p-8c7d5880.entry.js → p-546a3d3c.entry.js} +1 -1
- package/dist/solutions-components/p-60d212df.entry.js +6 -0
- package/dist/solutions-components/{p-bd3f4aa6.entry.js → p-627c19b5.entry.js} +1 -1
- package/dist/solutions-components/{p-84034340.js → p-62e92138.js} +1 -1
- package/dist/solutions-components/{p-149d80ad.js → p-68434a63.js} +1 -1
- package/dist/solutions-components/{p-b2a9bae3.entry.js → p-75f7bfe3.entry.js} +1 -1
- package/dist/solutions-components/{p-188483e2.entry.js → p-789f606f.entry.js} +1 -1
- package/dist/solutions-components/{p-a7a06d6a.js → p-83225907.js} +1 -1
- package/dist/solutions-components/{p-c3fa8a3d.entry.js → p-95ebc2e5.entry.js} +1 -1
- package/dist/solutions-components/p-98fe7b5d.entry.js +6 -0
- package/dist/solutions-components/p-99ca7674.entry.js +6 -0
- package/dist/solutions-components/p-a0b8cecf.entry.js +6 -0
- package/dist/solutions-components/{p-7eec285c.entry.js → p-a5d924a9.entry.js} +1 -1
- package/dist/solutions-components/{p-0ad0b29a.js → p-a8a0187d.js} +1 -1
- package/dist/solutions-components/p-a9f21aaf.entry.js +6 -0
- package/dist/solutions-components/{p-a2467088.entry.js → p-b42bde59.entry.js} +1 -1
- package/dist/solutions-components/p-baf82bab.entry.js +6 -0
- package/dist/solutions-components/p-c504529e.entry.js +6 -0
- package/dist/solutions-components/p-c556ed60.entry.js +6 -0
- package/dist/solutions-components/p-c99843aa.entry.js +6 -0
- package/dist/solutions-components/p-cc774829.entry.js +6 -0
- package/dist/solutions-components/p-ced4e208.entry.js +6 -0
- package/dist/solutions-components/{p-9e92fd19.entry.js → p-d78f13cb.entry.js} +1 -1
- package/dist/solutions-components/{p-10e99d5d.entry.js → p-d8b3d156.entry.js} +1 -1
- package/dist/solutions-components/p-db3ca38d.entry.js +17 -0
- package/dist/solutions-components/p-dcd6e7b9.entry.js +6 -0
- package/dist/solutions-components/{p-811313d1.entry.js → p-dd48cc25.entry.js} +1 -1
- package/dist/solutions-components/p-e8011829.entry.js +47 -0
- package/dist/solutions-components/solutions-components.css +1 -7
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/package.json +2 -2
- package/dist/solutions-components/p-0103dee1.entry.js +0 -6
- package/dist/solutions-components/p-2f496e4c.entry.js +0 -6
- package/dist/solutions-components/p-3977568f.entry.js +0 -17
- package/dist/solutions-components/p-3c3c2587.entry.js +0 -6
- package/dist/solutions-components/p-4b3ebd24.entry.js +0 -6
- package/dist/solutions-components/p-59407d94.entry.js +0 -6
- package/dist/solutions-components/p-7283bfe4.entry.js +0 -6
- package/dist/solutions-components/p-74a89c71.entry.js +0 -6
- package/dist/solutions-components/p-81c5c5f2.entry.js +0 -6
- package/dist/solutions-components/p-847193e7.entry.js +0 -6
- package/dist/solutions-components/p-a1c924c0.entry.js +0 -47
- package/dist/solutions-components/p-a44f1e85.entry.js +0 -6
- package/dist/solutions-components/p-abab359e.entry.js +0 -6
- package/dist/solutions-components/p-ad5f374e.entry.js +0 -6
- package/dist/solutions-components/p-afd9d486.entry.js +0 -6
- package/dist/solutions-components/p-f4742b64.entry.js +0 -6
- package/dist/solutions-components/p-f7042c6a.entry.js +0 -6
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as i,c as t,h as s,H as e,g as a}from"./p-78780f63.js";import{l}from"./p-48ff9cea.js";import{g as h,h as n,d as o,e as r,f as d,i as c,j as p,k as g}from"./p-b7e2c75b.js";import{c as b,e as u,f as v}from"./p-4af32c75.js";import{s as y}from"./p-8684a905.js";import{a as m,g as w}from"./p-6b943f52.js";import{d as f,a as S}from"./p-d6050d57.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-225c4ca4.js";import"./p-d89fff3a.js";import"./p-a230b270.js";import"./p-220ec0d1.js";const _=class{constructor(s){i(this,s),this.selectionSetChange=t(this,"selectionSetChange",7),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectionLayerIds=[],this.selectLayerView=void 0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._numSelected=0,this._searchDistanceEnabled=!1,this._searchTerm=void 0,this._selectionLoading=!1,this._translations=void 0,this._useLayerFeaturesEnabled=!1}async watchGeometriesHandler(i,t){if(i!==t){const t=0===i.length;if(await this._clearResults(t,t),i.length>0)return this._highlightWithOIDsOrGeoms()}}async watchSearchConfigurationHandler(i,t){JSON.stringify(i)!==JSON.stringify(t)&&this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this._searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this._useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(i){this.searchConfiguration=i.detail}async distanceChanged(i){await this._distanceChanged(i.detail)}async unitChanged(i){i.detail.newValue!==i.detail.oldValue&&(this._unit=i.detail.newValue,await this._updateLabel())}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){await this._init(),await this._searchWidget.when((()=>{var i;this._searchWidget.allPlaceholder=(null===(i=this.searchConfiguration)||void 0===i?void 0:i.allPlaceholder)&&"find address or place"!==this.searchConfiguration.allPlaceholder.toLowerCase()?this.searchConfiguration.allPlaceholder:this._translations.placeholder}))}render(){return s(e,null,this._getMapLayerPicker(),s("div",{class:"border-bottom"}),s("div",{class:"padding-top-sides-1"},s("div",{class:"search-widget",ref:i=>{this._searchElement=i}}),s("div",{class:"padding-top-1"},s("map-draw-tools",{active:!0,editGraphicsEnabled:!this._useLayerFeaturesEnabled,graphics:this._graphics,mapView:this.mapView,onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,ref:i=>{this._drawTools=i}})),this._getBufferOptions(),this._getUseLayerFeaturesOptions(),this._getNumSelected()),s("div",{class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){var i,t;const e=this._searchDistanceEnabled?"search-distance":"div-not-visible",a="number"==typeof(null===(i=this.selectionSet)||void 0===i?void 0:i.distance)?this.selectionSet.distance:this.defaultBufferDistance;return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.searchDistance,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"search-distance-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"search-distance-icon"},s("span",{class:"tooltip-message"},this._translations.useSearchDistanceTootip)),s("calcite-switch",{checked:this._searchDistanceEnabled,onCalciteSwitchChange:()=>this._searchDistanceEnabled=!this._searchDistanceEnabled})),s("div",{class:e},s("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:a,geometries:this.geometries,onBufferComplete:i=>this._bufferComplete(i),ref:i=>this._bufferTools=i,unit:(null===(t=this.selectionSet)||void 0===t?void 0:t.unit)||this.defaultBufferUnit})))}_getUseLayerFeaturesOptions(){const i=this._useLayerFeaturesEnabled?"div-visible":"div-not-visible";return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.useLayerFeatures,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"use-layer-features-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"use-layer-features-icon"},s("span",{class:"tooltip-message"},this._translations.useLayerFeaturesTooltip)),s("calcite-switch",{checked:this._useLayerFeaturesEnabled,onCalciteSwitchChange:()=>{this._useLayerFeaturesEnabledChanged()}})),s("div",{class:i+" padding-top-1"},s("map-layer-picker",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedIds:this.layerViews.map((i=>i.layer.id)),showTables:!1})))}_getNumSelected(){const i=m(this.el),t=i&&"en"===i?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return s("div",{class:"padding-top-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?s("div",null,s("calcite-loader",{class:"info-blue",inline:!0,label:t,scale:"m",type:"indeterminate"})):s("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),s("calcite-input-message",{class:"info-blue",scale:"m"},this._selectionLoading?t:this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())))}_getNameInput(){return s("div",{class:"padding-sides-1 padding-top-1 "+(this.customLabelEnabled?"":"display-none")},s("calcite-label",{class:"font-bold"},this._translations.listName,s("calcite-input",{onInput:()=>{this._selectionLabel=this._labelName.value},placeholder:this._translations.listNamePlaceholder,ref:i=>{this._labelName=i},value:this._selectionLabel||""})))}_getMapLayerPicker(){return s("div",{class:"display-flex padding-sides-1 padding-bottom-1"},s("calcite-label",{class:"font-bold width-full label-margin-0"},this._translations.inputLayer,s("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>this._inputLayerSelectionChange(i),selectedIds:this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet?[this.selectionSet.layerView.layer.id]:[],showTables:!1})))}async _initModules(){const[i,t,s,e,a]=await l(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=s,this._geometryEngine=e,this.FeatureLayer=a}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),this._initSearchWidget()}async _initSelectionSet(){var i,t,s,e;this.selectionSet&&(this._searchTerm=null===(i=this.selectionSet.searchResult)||void 0===i?void 0:i.name,this._searchResult=this.selectionSet.searchResult,this._selectLayers=this.selectionSet.selectLayers,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs,this._searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this._useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...(null===(t=this.selectionSet)||void 0===t?void 0:t.geometries)||[]],this._graphics=this.geometries.map((i=>new this.Graphic({geometry:i,symbol:"point"===i.type?this.sketchPointSymbol:"polyline"===i.type?this.sketchLineSymbol:this.sketchPolygonSymbol}))),this._selectionLabel=null===(s=this.selectionSet)||void 0===s?void 0:s.label,this._useLayerFeaturesEnabled||null===(e=this._drawTools)||void 0===e||e.updateGraphics(),await h(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}_initSearchWidget(){if(this.mapView&&this._searchElement){const i=this._getSearchConfig(this.searchConfiguration,this.mapView),t=Object.assign({view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm},i);this._searchWidget=new this.Search(t),this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.on("search-clear",(()=>{const i=this._searchClearLabel();this._clearResults(!1,i)})),this._searchWidget.on("select-result",(i=>{var t,s;if(i.result){this._searchResult=i.result;const e=(null===(s=null===(t=i.source)||void 0===t?void 0:t.layer)||void 0===s?void 0:s.id)&&i.source.layer.id===this.selectLayerView.layer.id,a=e?[i.result.feature.getObjectId()]:void 0;this._workflowType=b.SEARCH,this._updateLabel();const l=[i.result.feature];this._updateSelection(l,e,a),this._drawTools.graphics=l,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}}))}}_searchClearLabel(){var i;return(null===(i=this._searchResult)||void 0===i?void 0:i.name)&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const s=null==i?void 0:i.sources;return(null==s?void 0:s.length)>0?(i.includeDefaultSources=!1,s.forEach((i=>{var s,e;if(i.hasOwnProperty("layer")){const a=i,l=null===(s=a.layer)||void 0===s?void 0:s.id,h=l?t.map.findLayerById(l):null,n=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;h?a.layer=h:n&&(a.layer=new this.FeatureLayer(n))}})),null==s||s.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===(null==t?void 0:t.name)&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i=Object.assign(Object.assign({},i),{includeDefaultSources:!0}),i}_initGraphicsLayer(){const i=this._translations.bufferLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));if(t>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(t);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),y.managedLayers.push(i);const t=this.mapView.map.layers.findIndex((i=>i.title===this._translations.sketchLayer));t>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,t):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}async _sketchGraphicsChanged(i,t=!1){const s=i.detail.graphics;if(s.length>0&&s[0])if(t||(this._sketchGraphic=s[0]),this._workflowType=this._useLayerFeaturesEnabled?b.SELECT:b.SKETCH,this._workflowType===b.SKETCH&&this._drawTools.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(s)?s.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=s.reduce(((i,t)=>{var s;return(null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.objectIdField)?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i}),[]),e=i.detail.useOIDs&&t.length>0;this._updateSelection(s,e,t),e&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){var i;return(null===(i=this._skipGeomOIDs)||void 0===i?void 0:i.length)>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(i){y.removeHandles(),i.length>0&&y.highlightHandles.push(await n(i,this.selectLayerView,this.mapView)),this._numSelected=i.length,this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectionLoading=!0,this._selectedIds=await o(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,s=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),s=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:s})}_geomQuery(i){const t=r(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){var s;this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),y.removeHandles(),(null===(s=this._drawTools)||void 0===s?void 0:s.clear)&&(this._graphics=[],await this._drawTools.clear()),this.selectionSetChange.emit(this._selectedIds.length)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,s){this._selectedIds=t&&s?s:this._selectedIds,this._skipGeomOIDs=t?s:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}async _updateLabel(){var i,t;const s=this._selectionLabel.indexOf(this._translations.sketch)>-1,e=this._selectionLabel.indexOf(this._translations.select)>-1,a=this._selectionLabel.indexOf(null===(i=this._searchResult)||void 0===i?void 0:i.name)>-1,l=this._workflowType===b.SEARCH?null===(t=this._searchResult)||void 0===t?void 0:t.name:this._workflowType===b.SELECT?this._translations.select:this._translations.sketch,h=this._unit?this._unit:this._bufferTools.unit,n=await this._bufferTools.getTranslatedUnit(h),o=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=s||e||a||!this._selectionLabel?`${l} ${o} ${n}`:this._selectionLabel,this._labelName.value=this._selectionLabel}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){const t=i.detail.map((i=>d(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i,this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}))}}async _inputLayerSelectionChange(i){var t;const s=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";this.selectLayerView&&s===this.selectLayerView.layer.id||(this.selectLayerView=await d(this.mapView,s),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(i){i.newValue!==i.oldValue&&(this._distance=i.newValue,await this._updateLabel())}async _selectLayerFeatures(i){this._selectionLoading=!0;const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],c(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((s=>{t=t.concat(i[s])}))}));let s=!1;t.forEach((i=>{var t;const e=i.geometry;i.symbol="point"===e.type?this.sketchPointSymbol:"polyline"===e.type?this.sketchLineSymbol:"polygon"===e.type?this.sketchPolygonSymbol:void 0,s=(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.hasOwnProperty("objectIdField"))||i.hasOwnProperty("getObjectId")}));const e=this.layerViews[0].layer.title===this.selectLayerView.layer.title&&s;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:e}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await w(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};_.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{border-inline-end:1px solid var(--calcite-ui-border-2)}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:0.5rem}.icon{--calcite-ui-icon-color:var(--calcite-ui-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}';const L=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]}),P=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}async downloadCSV(i,t,s,e=!0){return f(i,t,!0,s,e)}async downloadPDF(i,t,s=!1,e="",a=""){var l;return S(i,t,null===(l=this._labelInfoElement.selectedOption)||void 0===l?void 0:l.value,s,e,a)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return s(e,null,s("calcite-select",{disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidLoad(){this._renderOptions()}async _initModules(){const[i]=await l(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="‎"+i.descriptionPDF.labelWidthDisplay+" x "+i.descriptionPDF.labelHeightDisplay+"‏";return this._translations.pdfLabel.replace("{{n}}",i.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",t)}async _getTranslations(){const i=await w(this.el);this._translations=i[0]}_renderOptions(){(L.default||L).sort(((i,t)=>{const s=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),e=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return s<e?-1:s>e?1:0})).forEach(((i,t)=>{const s=document.createElement("calcite-option");s.value=i,s.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(s),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(s.selected=!0,this._labelInfoElement.selectedOption=s)}))}get el(){return a(this)}};P.style=":host{display:block}";const x=class{constructor(s){i(this,s),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this._addEnabled=!0,this._refineSets=[],this._enabledLayerIds=[],this._featuresCollection={},this.addresseeLayer=void 0,this.enabledLayerIds=[],this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=u.ADD,this._refineLayer=void 0}async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){var i,t;return s(e,null,s("div",{class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},s("div",{class:"display-flex"},s("calcite-label",{class:"font-bold width-full label-margin-0"},s("div",{class:"display-flex"},this._translations.inputLayer,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"refine-input-layer",scale:"s"})),s("map-layer-picker",{enabledLayerIds:this._enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},ref:i=>{this._layerPicker=i},selectedIds:[this._refineLayer.layer.id],showTables:!1})),s("calcite-popover",{closable:!0,label:"",referenceElement:"refine-input-layer"},s("span",{class:"tooltip-message"},this._translations.inputLayerTip)))),s("div",{class:"padding-1"},s("div",{class:"padding-bottom-1"},s("calcite-segmented-control",{class:"w-100"},s("calcite-segmented-control-item",{checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(u.ADD),value:u.ADD},s("span",{class:"font-weight-500"},this._translations.add)),s("calcite-segmented-control-item",{checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(u.REMOVE),value:u.REMOVE},s("span",{class:"font-weight-500"},this._translations.remove)))),s("div",null,s("map-draw-tools",{active:!0,drawMode:v.REFINE,mapView:this.mapView,onDrawRedo:()=>this._redo(),onDrawUndo:()=>this._undo(),onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,redoEnabled:(null===(i=this._refineSelectionSet)||void 0===i?void 0:i.redoStack.length)>0,ref:i=>{this._drawTools=i},undoEnabled:(null===(t=this._refineSelectionSet)||void 0===t?void 0:t.undoStack.length)>0})),s("br",null),s("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){var t;const s=null===(t=i.detail)||void 0===t?void 0:t.graphics[0].geometry;this._selectFeatures(s)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{var s;const e=null===(s=null==t?void 0:t.layerView)||void 0===s?void 0:s.layer.id;return e&&i.indexOf(e)<0?i.push(e):t.workflowType===b.REFINE&&Object.keys(t.refineInfos).forEach((t=>{i.indexOf(t)<0&&i.push(t)})),i}),[])}async _setRefineSet(i){this.selectionSets.some((t=>{if(t.workflowType===b.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const s={};s[i]={addIds:[],removeIds:[],layerView:await d(this.mapView,i)},t?t.refineInfos=Object.assign(Object.assign({},t.refineInfos),s):(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:b.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:s,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===u.ADD?u.REMOVE:u.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===u.ADD?u.REMOVE:u.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===b.REFINE)return t=i,!0}));let e=0,a=0;return Object.keys(t.refineInfos).forEach((i=>{e+=t.refineInfos[i].addIds.length,a+=t.refineInfos[i].removeIds.length})),[s("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",e.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getTotal(i){const t=p(i);return Object.keys(t).reduce(((i,s)=>i+t[s].ids.length),0)}async _getTranslations(){const i=await w(this.el);this._translations=i[0]}async _selectFeatures(i){var t,s;this.selectionLoadingChange.emit(!0),this._featuresCollection[null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id]=[];const e=await c(0,null===(s=this._refineLayer)||void 0===s?void 0:s.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let a=[];Object.keys(e).forEach((i=>{var t;i===(null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id)&&(a=a.concat(e[i]))}));const l=Array.isArray(a)?a.map((i=>{var t;return i.attributes[null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.objectIdField]})):[];await this._updateIds(l,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),y.highlightHandles=await g(this.selectionSets)}_clearHighlight(){y.removeHandles()}async _updateIds(i,t,s,e){let a=!1;const l=this._refineSelectionSet.refineInfos,h=e.layer.id,n={};n[h]={addIds:[],removeIds:[],layerView:e};const o=Object.keys(l).indexOf(h)>-1?l[h]:n[h];if(t===u.ADD)o.addIds=[...new Set([...i,...o.addIds])],o.addIds.length>0&&s.push({ids:i,mode:t,layerView:e}),o.removeIds.length>0&&(o.removeIds=o.removeIds.filter((t=>i.indexOf(t)<0)));else{const l=this.selectionSets.reduce(((t,s)=>(i.forEach((i=>{s.workflowType!==b.REFINE?s.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(s.refineInfos).some((a=>{const l=s.refineInfos[a];if(l.layerView.layer.id===e.layer.id&&l.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);o.removeIds=[...new Set([...l,...o.removeIds])],o.addIds=o.addIds.filter((i=>l.indexOf(i)<0)),o.removeIds.length>0&&s.push({ids:l,mode:t,layerView:e}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==b.REFINE&&t.layerView.layer.id===e.layer.id?(t.selectedIds=t.selectedIds.filter((i=>o.removeIds.indexOf(i)<0)),t.selectedIds.length>0?i.push(t):a=!0):i.push(t),i)),[])}this._refineSelectionSet.refineInfos[h]=o,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}get el(){return a(this)}};x.style=':host{display:block}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.border{outline:1px solid var(--calcite-ui-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:var(--calcite-ui-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110,110,110,.3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110,110,110,.3)}.display-flex{display:flex}.font-bold{font-weight:bold}.width-full{width:100%}.label-margin-0{--calcite-label-margin-bottom:0}.padding-start-1-2{padding-inline-start:0.5rem}.font-weight-500{font-weight:500}.word-wrap-anywhere{word-wrap:anywhere}';export{_ as map_select_tools,P as pdf_download,x as refine_selection}
|
6
|
+
import{r as i,c as t,h as s,H as e,g as a}from"./p-78780f63.js";import{l}from"./p-48ff9cea.js";import{g as h,h as n,d as o,e as r,f as d,i as c,j as p,k as g}from"./p-b7e2c75b.js";import{c as b,e as u,f as v}from"./p-4af32c75.js";import{s as y}from"./p-8684a905.js";import{a as m,g as w}from"./p-6b943f52.js";import{d as f,a as S}from"./p-d6050d57.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-225c4ca4.js";import"./p-d89fff3a.js";import"./p-a230b270.js";import"./p-220ec0d1.js";const _=class{constructor(s){i(this,s),this.selectionSetChange=t(this,"selectionSetChange",7),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectionLayerIds=[],this.selectLayerView=void 0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._numSelected=0,this._searchDistanceEnabled=!1,this._searchTerm=void 0,this._selectionLoading=!1,this._translations=void 0,this._useLayerFeaturesEnabled=!1}async watchGeometriesHandler(i,t){if(i!==t){const t=0===i.length;if(await this._clearResults(t,t),i.length>0)return this._highlightWithOIDsOrGeoms()}}async watchSearchConfigurationHandler(i,t){JSON.stringify(i)!==JSON.stringify(t)&&this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this._searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this._useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(i){this.searchConfiguration=i.detail}async distanceChanged(i){await this._distanceChanged(i.detail)}async unitChanged(i){i.detail.newValue!==i.detail.oldValue&&(this._unit=i.detail.newValue,await this._updateLabel())}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){await this._init(),await this._searchWidget.when((()=>{var i;this._searchWidget.allPlaceholder=(null===(i=this.searchConfiguration)||void 0===i?void 0:i.allPlaceholder)&&"find address or place"!==this.searchConfiguration.allPlaceholder.toLowerCase()?this.searchConfiguration.allPlaceholder:this._translations.placeholder}))}render(){return s(e,null,this._getMapLayerPicker(),s("div",{class:"border-bottom"}),s("div",{class:"padding-top-sides-1"},s("div",{class:"search-widget",ref:i=>{this._searchElement=i}}),s("div",{class:"padding-top-1"},s("map-draw-tools",{active:!0,editGraphicsEnabled:!this._useLayerFeaturesEnabled,graphics:this._graphics,mapView:this.mapView,onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,ref:i=>{this._drawTools=i}})),this._getBufferOptions(),this._getUseLayerFeaturesOptions(),this._getNumSelected()),s("div",{class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){var i,t;const e=this._searchDistanceEnabled?"search-distance":"div-not-visible",a="number"==typeof(null===(i=this.selectionSet)||void 0===i?void 0:i.distance)?this.selectionSet.distance:this.defaultBufferDistance;return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.searchDistance,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"search-distance-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"search-distance-icon"},s("span",{class:"tooltip-message"},this._translations.useSearchDistanceTootip)),s("calcite-switch",{checked:this._searchDistanceEnabled,onCalciteSwitchChange:()=>this._searchDistanceEnabled=!this._searchDistanceEnabled})),s("div",{class:e},s("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:a,geometries:this.geometries,onBufferComplete:i=>this._bufferComplete(i),ref:i=>this._bufferTools=i,unit:(null===(t=this.selectionSet)||void 0===t?void 0:t.unit)||this.defaultBufferUnit})))}_getUseLayerFeaturesOptions(){const i=this._useLayerFeaturesEnabled?"div-visible":"div-not-visible";return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.useLayerFeatures,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"use-layer-features-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"use-layer-features-icon"},s("span",{class:"tooltip-message"},this._translations.useLayerFeaturesTooltip)),s("calcite-switch",{checked:this._useLayerFeaturesEnabled,onCalciteSwitchChange:()=>{this._useLayerFeaturesEnabledChanged()}})),s("div",{class:i+" padding-top-1"},s("map-layer-picker",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedIds:this.layerViews.map((i=>i.layer.id)),showTables:!1})))}_getNumSelected(){const i=m(this.el),t=i&&"en"===i?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return s("div",{class:"padding-top-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?s("div",null,s("calcite-loader",{class:"info-blue",inline:!0,label:t,scale:"m",type:"indeterminate"})):s("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),s("calcite-input-message",{class:"info-blue",scale:"m"},this._selectionLoading?t:this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())))}_getNameInput(){return s("div",{class:"padding-sides-1 padding-top-1 "+(this.customLabelEnabled?"":"display-none")},s("calcite-label",{class:"font-bold"},this._translations.listName,s("calcite-input",{onInput:()=>{this._selectionLabel=this._labelName.value},placeholder:this._translations.listNamePlaceholder,ref:i=>{this._labelName=i},value:this._selectionLabel||""})))}_getMapLayerPicker(){return s("div",{class:"display-flex padding-sides-1 padding-bottom-1"},s("calcite-label",{class:"font-bold width-full label-margin-0"},this._translations.inputLayer,s("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>this._inputLayerSelectionChange(i),selectedIds:this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet?[this.selectionSet.layerView.layer.id]:[],showTables:!1})))}async _initModules(){const[i,t,s,e,a]=await l(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=s,this._geometryEngine=e,this.FeatureLayer=a}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),this._initSearchWidget()}async _initSelectionSet(){var i,t,s,e;this.selectionSet&&(this._searchTerm=null===(i=this.selectionSet.searchResult)||void 0===i?void 0:i.name,this._searchResult=this.selectionSet.searchResult,this._selectLayers=this.selectionSet.selectLayers,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs,this._searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this._useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...(null===(t=this.selectionSet)||void 0===t?void 0:t.geometries)||[]],this._graphics=this.geometries.map((i=>new this.Graphic({geometry:i,symbol:"point"===i.type?this.sketchPointSymbol:"polyline"===i.type?this.sketchLineSymbol:this.sketchPolygonSymbol}))),this._selectionLabel=null===(s=this.selectionSet)||void 0===s?void 0:s.label,this._useLayerFeaturesEnabled||null===(e=this._drawTools)||void 0===e||e.updateGraphics(),await h(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}_initSearchWidget(){if(this.mapView&&this._searchElement){const i=this._getSearchConfig(this.searchConfiguration,this.mapView),t=Object.assign({view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm},i);this._searchWidget=new this.Search(t),this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.on("search-clear",(()=>{const i=this._searchClearLabel();this._clearResults(!1,i)})),this._searchWidget.on("select-result",(i=>{var t,s;if(i.result){this._searchResult=i.result;const e=(null===(s=null===(t=i.source)||void 0===t?void 0:t.layer)||void 0===s?void 0:s.id)&&i.source.layer.id===this.selectLayerView.layer.id,a=e?[i.result.feature.getObjectId()]:void 0;this._workflowType=b.SEARCH,this._updateLabel();const l=[i.result.feature];this._updateSelection(l,e,a),this._drawTools.graphics=l,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}}))}}_searchClearLabel(){var i;return(null===(i=this._searchResult)||void 0===i?void 0:i.name)&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const s=null==i?void 0:i.sources;return(null==s?void 0:s.length)>0?(i.includeDefaultSources=!1,s.forEach((i=>{var s,e;if(i.hasOwnProperty("layer")){const a=i,l=null===(s=a.layer)||void 0===s?void 0:s.id,h=l?t.map.findLayerById(l):null,n=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;h?a.layer=h:n&&(a.layer=new this.FeatureLayer(n))}})),null==s||s.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===(null==t?void 0:t.name)&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i=Object.assign(Object.assign({},i),{includeDefaultSources:!0}),i}_initGraphicsLayer(){const i=this._translations.bufferLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));if(t>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(t);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),y.managedLayers.push(i);const t=this.mapView.map.layers.findIndex((i=>i.title===this._translations.sketchLayer));t>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,t):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}async _sketchGraphicsChanged(i,t=!1){const s=i.detail.graphics;if(s.length>0&&s[0])if(t||(this._sketchGraphic=s[0]),this._workflowType=this._useLayerFeaturesEnabled?b.SELECT:b.SKETCH,this._workflowType===b.SKETCH&&this._drawTools.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(s)?s.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=s.reduce(((i,t)=>{var s;return(null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.objectIdField)?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i}),[]),e=i.detail.useOIDs&&t.length>0;this._updateSelection(s,e,t),e&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){var i;return(null===(i=this._skipGeomOIDs)||void 0===i?void 0:i.length)>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(i){y.removeHandles(),i.length>0&&y.highlightHandles.push(await n(i,this.selectLayerView,this.mapView)),this._numSelected=i.length,this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectionLoading=!0,this._selectedIds=await o(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,s=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),s=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:s})}_geomQuery(i){const t=r(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){var s;this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),y.removeHandles(),(null===(s=this._drawTools)||void 0===s?void 0:s.clear)&&(this._graphics=[],await this._drawTools.clear()),this.selectionSetChange.emit(this._selectedIds.length)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,s){this._selectedIds=t&&s?s:this._selectedIds,this._skipGeomOIDs=t?s:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}async _updateLabel(){var i,t;const s=this._selectionLabel.indexOf(this._translations.sketch)>-1,e=this._selectionLabel.indexOf(this._translations.select)>-1,a=this._selectionLabel.indexOf(null===(i=this._searchResult)||void 0===i?void 0:i.name)>-1,l=this._workflowType===b.SEARCH?null===(t=this._searchResult)||void 0===t?void 0:t.name:this._workflowType===b.SELECT?this._translations.select:this._translations.sketch,h=this._unit?this._unit:this._bufferTools.unit,n=await this._bufferTools.getTranslatedUnit(h),o=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=s||e||a||!this._selectionLabel?`${l} ${o} ${n}`:this._selectionLabel,this._labelName.value=this._selectionLabel}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){const t=i.detail.map((i=>d(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i,this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}))}}async _inputLayerSelectionChange(i){var t;const s=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";this.selectLayerView&&s===this.selectLayerView.layer.id||(this.selectLayerView=await d(this.mapView,s),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(i){i.newValue!==i.oldValue&&(this._distance=i.newValue,await this._updateLabel())}async _selectLayerFeatures(i){this._selectionLoading=!0;const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],c(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((s=>{t=t.concat(i[s])}))}));let s=!1;t.forEach((i=>{var t;const e=i.geometry;i.symbol="point"===e.type?this.sketchPointSymbol:"polyline"===e.type?this.sketchLineSymbol:"polygon"===e.type?this.sketchPolygonSymbol:void 0,s=(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.hasOwnProperty("objectIdField"))||i.hasOwnProperty("getObjectId")}));const e=this.layerViews[0].layer.title===this.selectLayerView.layer.title&&s;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:e}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await w(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};_.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{border-inline-end:1px solid var(--calcite-color-border-2)}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:0.5rem}.icon{--calcite-color-icon-color:var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}';const L=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]}),P=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}async downloadCSV(i,t,s,e=!0){return f(i,t,!0,s,e)}async downloadPDF(i,t,s=!1,e="",a=""){var l;return S(i,t,null===(l=this._labelInfoElement.selectedOption)||void 0===l?void 0:l.value,s,e,a)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return s(e,null,s("calcite-select",{disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidLoad(){this._renderOptions()}async _initModules(){const[i]=await l(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="‎"+i.descriptionPDF.labelWidthDisplay+" x "+i.descriptionPDF.labelHeightDisplay+"‏";return this._translations.pdfLabel.replace("{{n}}",i.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",t)}async _getTranslations(){const i=await w(this.el);this._translations=i[0]}_renderOptions(){(L.default||L).sort(((i,t)=>{const s=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),e=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return s<e?-1:s>e?1:0})).forEach(((i,t)=>{const s=document.createElement("calcite-option");s.value=i,s.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(s),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(s.selected=!0,this._labelInfoElement.selectedOption=s)}))}get el(){return a(this)}};P.style=":host{display:block}";const x=class{constructor(s){i(this,s),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this._addEnabled=!0,this._refineSets=[],this._enabledLayerIds=[],this._featuresCollection={},this.addresseeLayer=void 0,this.enabledLayerIds=[],this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=u.ADD,this._refineLayer=void 0}async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){var i,t;return s(e,null,s("div",{class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},s("div",{class:"display-flex"},s("calcite-label",{class:"font-bold width-full label-margin-0"},s("div",{class:"display-flex"},this._translations.inputLayer,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"refine-input-layer",scale:"s"})),s("map-layer-picker",{enabledLayerIds:this._enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},ref:i=>{this._layerPicker=i},selectedIds:[this._refineLayer.layer.id],showTables:!1})),s("calcite-popover",{closable:!0,label:"",referenceElement:"refine-input-layer"},s("span",{class:"tooltip-message"},this._translations.inputLayerTip)))),s("div",{class:"padding-1"},s("div",{class:"padding-bottom-1"},s("calcite-segmented-control",{class:"w-100"},s("calcite-segmented-control-item",{checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(u.ADD),value:u.ADD},s("span",{class:"font-weight-500"},this._translations.add)),s("calcite-segmented-control-item",{checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(u.REMOVE),value:u.REMOVE},s("span",{class:"font-weight-500"},this._translations.remove)))),s("div",null,s("map-draw-tools",{active:!0,drawMode:v.REFINE,mapView:this.mapView,onDrawRedo:()=>this._redo(),onDrawUndo:()=>this._undo(),onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,redoEnabled:(null===(i=this._refineSelectionSet)||void 0===i?void 0:i.redoStack.length)>0,ref:i=>{this._drawTools=i},undoEnabled:(null===(t=this._refineSelectionSet)||void 0===t?void 0:t.undoStack.length)>0})),s("br",null),s("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){var t;const s=null===(t=i.detail)||void 0===t?void 0:t.graphics[0].geometry;this._selectFeatures(s)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{var s;const e=null===(s=null==t?void 0:t.layerView)||void 0===s?void 0:s.layer.id;return e&&i.indexOf(e)<0?i.push(e):t.workflowType===b.REFINE&&Object.keys(t.refineInfos).forEach((t=>{i.indexOf(t)<0&&i.push(t)})),i}),[])}async _setRefineSet(i){this.selectionSets.some((t=>{if(t.workflowType===b.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const s={};s[i]={addIds:[],removeIds:[],layerView:await d(this.mapView,i)},t?t.refineInfos=Object.assign(Object.assign({},t.refineInfos),s):(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:b.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:s,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===u.ADD?u.REMOVE:u.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===u.ADD?u.REMOVE:u.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===b.REFINE)return t=i,!0}));let e=0,a=0;return Object.keys(t.refineInfos).forEach((i=>{e+=t.refineInfos[i].addIds.length,a+=t.refineInfos[i].removeIds.length})),[s("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",e.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getTotal(i){const t=p(i);return Object.keys(t).reduce(((i,s)=>i+t[s].ids.length),0)}async _getTranslations(){const i=await w(this.el);this._translations=i[0]}async _selectFeatures(i){var t,s;this.selectionLoadingChange.emit(!0),this._featuresCollection[null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id]=[];const e=await c(0,null===(s=this._refineLayer)||void 0===s?void 0:s.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let a=[];Object.keys(e).forEach((i=>{var t;i===(null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id)&&(a=a.concat(e[i]))}));const l=Array.isArray(a)?a.map((i=>{var t;return i.attributes[null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.objectIdField]})):[];await this._updateIds(l,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),y.highlightHandles=await g(this.selectionSets)}_clearHighlight(){y.removeHandles()}async _updateIds(i,t,s,e){let a=!1;const l=this._refineSelectionSet.refineInfos,h=e.layer.id,n={};n[h]={addIds:[],removeIds:[],layerView:e};const o=Object.keys(l).indexOf(h)>-1?l[h]:n[h];if(t===u.ADD)o.addIds=[...new Set([...i,...o.addIds])],o.addIds.length>0&&s.push({ids:i,mode:t,layerView:e}),o.removeIds.length>0&&(o.removeIds=o.removeIds.filter((t=>i.indexOf(t)<0)));else{const l=this.selectionSets.reduce(((t,s)=>(i.forEach((i=>{s.workflowType!==b.REFINE?s.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(s.refineInfos).some((a=>{const l=s.refineInfos[a];if(l.layerView.layer.id===e.layer.id&&l.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);o.removeIds=[...new Set([...l,...o.removeIds])],o.addIds=o.addIds.filter((i=>l.indexOf(i)<0)),o.removeIds.length>0&&s.push({ids:l,mode:t,layerView:e}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==b.REFINE&&t.layerView.layer.id===e.layer.id?(t.selectedIds=t.selectedIds.filter((i=>o.removeIds.indexOf(i)<0)),t.selectedIds.length>0?i.push(t):a=!0):i.push(t),i)),[])}this._refineSelectionSet.refineInfos[h]=o,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}get el(){return a(this)}};x.style=':host{display:block}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.border{outline:1px solid var(--calcite-color-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:var(--calcite-color-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110,110,110,.3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110,110,110,.3)}.display-flex{display:flex}.font-bold{font-weight:bold}.width-full{width:100%}.label-margin-0{--calcite-label-margin-bottom:0}.padding-start-1-2{padding-inline-start:0.5rem}.font-weight-500{font-weight:500}.word-wrap-anywhere{word-wrap:anywhere}';export{_ as map_select_tools,P as pdf_download,x as refine_selection}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{e as s}from"./p-d918ec36.js";const a=async(a,t)=>(s.setDefaultOptions({url:"https://
|
6
|
+
import{e as s}from"./p-d918ec36.js";const a=async(a,t)=>(s.setDefaultOptions({url:"https://jsdev.arcgis.com/4.29/"}),(await s.loadModules(a,t)).map((s=>s.__esModule&&s.default?s.default:s)));export{a as l}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as e,h as a,H as s,g as i}from"./p-78780f63.js";import{g as h}from"./p-14a48b14.js";import{S as n}from"./p-a230b270.js";import{w as o}from"./p-abea8ef5.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const r={base:"instant-apps-header--standard",headerContainer:"instant-apps-header__header-container",headerContent:"instant-apps-header__header-content",flipRtl:"instant-apps-header--rtl",logoScale:"instant-apps-header__logo-scale--",logoHeight:"instant-apps-header__logo-height--",standardHeight:"instant-apps-header__standard-height",alignment:{center:"instant-apps-header__header-content--center",right:"instant-apps-header__header-content--right"}},d=class{constructor(a){t(this,a),this.infoIsOpenChanged=e(this,"infoIsOpenChanged",6),this._sanitizer=new n({whiteList:{h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],img:["style","src","width","height"],pre:["style"],p:["id","class","style"],div:["id","class","style","role"],span:["id","class","style","role"],figure:["class","style"],header:["id","class","style","role"]}},!0),this.dir=void 0,this.titleText=void 0,this.titleTextLink=void 0,this.backgroundColor=void 0,this.textColor=void 0,this.logoImage=void 0,this.logoScale="m",this.logoImageAltText=void 0,this.logoLink=void 0,this.infoButton=!1,this.infoIsOpen=!1,this.infoTitleText=void 0,this.customHeaderHtml=void 0,this.headerAlignment="left",this.customHeaderCss=void 0,this.fontFamily="var(--calcite-sans-family);",this.mobileWidthBreakpoint=o.medium[1],this.initialScale="m"}sanitizeCustomHeaderHtml(){this.customHeaderHtml=this._sanitizer.sanitize(this.customHeaderHtml)}componentWillLoad(){this.dir=h(this.el),this.handleMobileBreakpoints(),this.dir=h(this.el),this.customHeaderHtml=this._sanitizer.sanitize(this.customHeaderHtml)}render(){var t,e,i,h;const n="undefined"===this.logoImage||"undefined"===(null===(e=null===(t=this.logoImage)||void 0===t?void 0:t.split("?"))||void 0===e?void 0:e[0])||""===(null===(h=null===(i=this.logoImage)||void 0===i?void 0:i.split("?"))||void 0===h?void 0:h[0])||!this.logoImage,o=this.renderLogo(n),d=this.renderTitle(),l="right"===this.headerAlignment||"center"===this.headerAlignment?r.headerContent.concat(" ",r.alignment[this.headerAlignment]):r.headerContent,p=null==this.fontFamily?'"Avenir Next","Avenir","Helvetica Neue",sans-serif':this.fontFamily;return a(s,null,this.customHeaderHtml?[a("style",null,this.customHeaderCss),a("div",{id:"customHeader",innerHTML:this.customHeaderHtml})]:a("header",{class:`${r.base}${"rtl"===this.dir?` ${r.flipRtl}`:""}${this.logoImage&&!n?` ${r.logoHeight}${this.logoScale}`:` ${r.standardHeight}`}`,style:{backgroundColor:this.backgroundColor,fontFamily:p}},a("div",{class:r.headerContainer},a("span",{class:l},o,d,this.infoButton?a("calcite-button",{style:{"--calcite-color-text-1":this.textColor},id:"infoButton",alignment:"start",appearance:"transparent",kind:"neutral","icon-start":"information-f",scale:"s",label:this.infoTitleText,title:this.infoTitleText,onClick:this.toggleInfo.bind(this)}):null),a("slot",{name:"actions-end"}))))}renderLogo(t){return t?"":this.logoImage&&this.logoLink?a("a",{href:`${this.logoLink}`,target:"_blank"},a("img",{class:`${r.logoScale}${this.logoScale}`,src:`${this.logoImage}`,alt:`${this.logoImageAltText}`})):this.logoImage?a("img",{class:`${r.logoScale}${this.logoScale}`,src:`${this.logoImage}`,alt:this.logoImageAltText}):""}renderTitle(){return this.titleText&&this.titleTextLink?a("a",{style:{color:this.textColor},href:`${this.titleTextLink}`,rel:"noopener noreferrer",target:"_blank"},a("h1",{style:{color:this.textColor}},this.titleText)):a("h1",{style:{color:this.textColor}},this.titleText)}toggleInfo(){this.infoIsOpen=!this.infoIsOpen,this.infoIsOpenChanged.emit(this.infoIsOpen)}mqlCallback(){return t=>{const{matches:e}=t;this.logoScale=e?"s":this.initialScale}}handleMobileBreakpoints(){this.initialScale=this.logoScale;const t=window.matchMedia(`(max-width: ${this.mobileWidthBreakpoint}px)`);t.matches&&(this.logoScale="s"),t.addEventListener("change",this.mqlCallback())}get el(){return i(this)}static get watchers(){return{customHeaderHtml:["sanitizeCustomHeaderHtml"]}}};d.style=":host{--instant-apps-header-height:auto;--instant-apps-header-min-height:50px;--instant-apps-header-title-text-link-decoration:underline;--instant-apps-header-height--logo-scale--s:55px;--instant-apps-header-logo-width--logo-scale--s:35px;--instant-apps-header-logo-height--logo-scale--s:35px;--instant-apps-header-height--logo-scale--m:70px;--instant-apps-header-logo-width--logo-scale--m:50px;--instant-apps-header-logo-height--logo-scale--m:50px;--instant-apps-header-height--logo-scale--l:80px;--instant-apps-header-logo-width--logo-scale--l:60px;--instant-apps-header-logo-height--logo-scale--l:60px;width:100%}:host .instant-apps-header--standard{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;width:100%;height:var(--instant-apps-header-height);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);font-family:var(--calcite-sans-family);min-height:var(--instant-apps-header-min-height)}:host .instant-apps-header--standard .instant-apps-header__header-container{display:flex;align-items:center;width:100%;height:inherit}:host .instant-apps-header--standard .instant-apps-header__header-container slot{display:flex;height:inherit}:host .instant-apps-header--standard .instant-apps-header__header-container ::slotted(*){display:flex;min-height:var(--instant-apps-header-min-height);height:var(--instant-apps-header-height)}:host .instant-apps-header--standard .instant-apps-header__header-container ::slotted(*) calcite-button{height:100%}:host .instant-apps-header--standard .instant-apps-header__header-content{box-sizing:border-box;display:flex;align-items:center;width:100%;min-width:0;height:inherit;padding:5px 10px}:host .instant-apps-header--standard .instant-apps-header__header-content a{display:flex;align-items:center;-webkit-text-decoration:var(--instant-apps-header-title-text-link-decoration);text-decoration:var(--instant-apps-header-title-text-link-decoration)}:host .instant-apps-header--standard .instant-apps-header__header-content a img{padding-right:0}:host .instant-apps-header--standard .instant-apps-header__header-content img{margin:10px}:host .instant-apps-header--standard .instant-apps-header__header-content h1{margin:0;font-size:1.25rem;color:var(--calcite-color-text-1);font-weight:430;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .instant-apps-header--standard .instant-apps-header__header-content #infoButton{margin-inline-start:10px}:host .instant-apps-header--standard .instant-apps-header__header-content--center{justify-content:center}:host .instant-apps-header--standard .instant-apps-header__header-content--right{justify-content:end}:host .instant-apps-header__logo-height--s{height:var(--instant-apps-header-height--logo-scale--s)}:host .instant-apps-header__logo-height--s .instant-apps-header__header-content h1{font-size:1.125rem}:host .instant-apps-header__logo-scale--s{width:var(--instant-apps-header-logo-width--logo-scale--s);height:var(--instant-apps-header-logo-height--logo-scale--s)}:host .instant-apps-header__logo-height--m{height:var(--instant-apps-header-height--logo-scale--m)}:host .instant-apps-header__logo-scale--m{width:var(--instant-apps-header-logo-width--logo-scale--m);height:var(--instant-apps-header-logo-height--logo-scale--m)}:host .instant-apps-header__logo-height--l{height:var(--instant-apps-header-height--logo-scale--l)}:host .instant-apps-header__logo-height--l .instant-apps-header__header-content h1{font-size:1.375rem}:host .instant-apps-header__logo-scale--l{width:var(--instant-apps-header-logo-width--logo-scale--l);height:var(--instant-apps-header-logo-height--logo-scale--l)}:host .instant-apps-header__logo-height--s,:host .instant-apps-header__logo-height--m,:host .instant-apps-header__logo-height--l{padding-right:10px}:host .instant-apps-header--rtl.instant-apps-header__logo-height--s,:host .instant-apps-header--rtl.instant-apps-header__logo-height--m,:host .instant-apps-header--rtl.instant-apps-header__logo-height--l{padding-right:0;padding-left:10px}";export{d as instant_apps_header}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as i,h as o,H as s,g as e}from"./p-78780f63.js";import{c as a,d as n}from"./p-1be63b50.js";import{s as r}from"./p-ca97465b.js";import{s as d,a as c,c as l}from"./p-f10944e6.js";import{c as h,d as p}from"./p-ede84883.js";import{u,c as m,d as v,s as g}from"./p-79ba73cb.js";import{t as x,E as b}from"./p-b170916e.js";import{c as f}from"./p-5b566d55.js";import{l as w}from"./p-
|
6
|
+
import{r as t,c as i,h as o,H as s,g as e}from"./p-78780f63.js";import{c as a,d as n}from"./p-1be63b50.js";import{s as r}from"./p-ca97465b.js";import{s as d,a as c,c as l}from"./p-f10944e6.js";import{c as h,d as p}from"./p-ede84883.js";import{u,c as m,d as v,s as g}from"./p-79ba73cb.js";import{t as x,E as b}from"./p-b170916e.js";import{c as f}from"./p-5b566d55.js";import{l as w}from"./p-a8a0187d.js";import"./p-fcefdfff.js";import"./p-29d68474.js";import"./p-1e2ffee3.js";import"./p-428554b4.js";import"./p-ea83d12d.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";
|
7
7
|
/*!
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as e,c as n,h as t,g as i}from"./p-78780f63.js";import{v as a,g as s}from"./p-68434a63.js";import"./p-a8a0187d.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-225c4ca4.js";const p=class{constructor(t){e(this,t),this.groupLayerCaptionElementExpandUpdatedEvent=n(this,"groupLayerCaptionElementExpandUpdated",7),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}render(){var e,n,i;const p=a(this.activeLayerInfo),{expanded:l}=this,r=l?null===(e=this.messages)||void 0===e?void 0:e.collapse:null===(n=this.messages)||void 0===n?void 0:n.expand,c=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return t("header",{class:`instant-apps-interactive-legend__header ${s(this.el)}`,style:{borderLeft:"1px solid var(--calcite-color-border-3)"}},t("span",null,t("span",{class:"instant-apps-interactive-legend__header-action-container"},t("calcite-action",{onClick:this.toggleExpanded(),icon:l?"chevron-down":"chevron-up",appearance:"transparent",text:r,label:r,scale:"s"}),t("h3",{class:`esri-widget__heading esri-legend__service-label${c}`},null===(i=this.activeLayerInfo)||void 0===i?void 0:i.title)),this.featureCount&&p?t("instant-apps-interactive-legend-count",{activeLayerInfo:this.activeLayerInfo,"show-total":!0,messages:this.messages,legendvm:this.legendvm}):null))}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.groupLayerCaptionElementExpandUpdatedEvent.emit(this.expanded)}}get el(){return i(this)}};p.style=".sc-instant-apps-interactive-legend-group-legend-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption{overflow:hidden;margin:0;overflow-x:hidden;display:inline-block;font-size:var(--instant-apps-interactive-legend-heading-font-size);font-weight:var(--instant-apps-interactive-legend-heading-font-weight)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption header.sc-instant-apps-interactive-legend-group-legend-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption{display:flex;text-align:left;padding:var(--instant-apps-interactive-legend-ui-padding);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption h3.sc-instant-apps-interactive-legend-group-legend-element-caption{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal;color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption .instant-apps-interactive-legend__heading-text--group-item.sc-instant-apps-interactive-legend-group-legend-element-caption{-webkit-line-clamp:2;line-clamp:2}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption span.sc-instant-apps-interactive-legend-group-legend-element-caption{width:100%;font-size:var(--instant-apps-interactive-legend-total-feature-count-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h header.sc-instant-apps-interactive-legend-group-legend-element-caption .instant-apps-interactive-legend__header-action-container.sc-instant-apps-interactive-legend-group-legend-element-caption{display:flex;align-items:center}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-group-legend-element-caption header.sc-instant-apps-interactive-legend-group-legend-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-group-legend-element-caption-h .esri-widget--panel.sc-instant-apps-interactive-legend-group-legend-element-caption{margin:0}.calcite-mode-dark.sc-instant-apps-interactive-legend-group-legend-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-group-legend-element-caption{background-color:#242424;color:var(--calcite-color-text-1)}.calcite-mode-light.sc-instant-apps-interactive-legend-group-legend-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-group-legend-element-caption{background-color:#ffffff;color:var(--calcite-color-text-1)}";export{p as instant_apps_interactive_legend_group_legend_element_caption}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as e,f as t,h as i,g as n,c as s}from"./p-78780f63.js";import{g as a,l,s as o,i as r,b as d,z as c,m as p,k as h,n as v,u as g,o as u,p as m}from"./p-68434a63.js";import{l as f}from"./p-a8a0187d.js";import"./p-225c4ca4.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const y=class{constructor(t){e(this,t),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}layerCaptionElementExpandUpdatedEmitted(){var e;this.expanded=!!(null===(e=this.layerCaption)||void 0===e?void 0:e.expanded)}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0})}render(){return i("div",{style:{borderLeft:"1px solid var(--calcite-color-border-3)"},class:"esri-legend__service esri-legend__group-layer"},i("instant-apps-interactive-legend-layer-element-caption",{ref:e=>this.layerCaption=e,class:a(this.el),legendvm:this.legendvm,"feature-count":this.featureCount,activeLayerInfo:this.activeLayerInfo,messages:this.messages,isChild:this.isChild}),i("div",{class:"esri-legend__group-content "+(!1===this.expanded?"hide":"show")},i("slot",{name:"content"})))}get el(){return n(this)}};y.style=".sc-instant-apps-interactive-legend-group-legend-element-h{display:block}.sc-instant-apps-interactive-legend-group-legend-element-h .esri-legend__service.sc-instant-apps-interactive-legend-group-legend-element{margin:0;padding:0}.sc-instant-apps-interactive-legend-group-legend-element-h .hide.sc-instant-apps-interactive-legend-group-legend-element{display:none}";const _=class{constructor(t){e(this,t),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=void 0,this.expanded=!0}layerCaptionElementExpandUpdatedEmitted(){this.expanded=this.layerCaption.expanded}componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0})}render(){var e,t;return i("div",{style:{borderLeft:"1px solid var(--calcite-color-border-3)"},class:"esri-legend__service"+(this.activeLayerInfo.parent?" esri-legend__group-layer-child":""),tabIndex:0},i("instant-apps-interactive-legend-layer-element-caption",{ref:e=>this.layerCaption=e,legendvm:this.legendvm,"feature-count":this.featureCount,activeLayerInfo:this.activeLayerInfo,messages:this.messages,isChild:!!this.isChild,class:a(this.el)}),i("div",{id:`${null===(t=null===(e=this.activeLayerInfo)||void 0===e?void 0:e.layer)||void 0===t?void 0:t.id}-legend-layer`,class:"esri-legend__layer"+(!1===this.expanded?" hide":" show")},i("slot",{name:"content"})))}get el(){return n(this)}};_.style=".sc-instant-apps-interactive-legend-layer-element-h{display:block}.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__service.sc-instant-apps-interactive-legend-layer-element{padding:0}.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-body.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__group-layer-child.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-child-table.sc-instant-apps-interactive-legend-layer-element{margin:0;overflow:hidden}.sc-instant-apps-interactive-legend-layer-element-h .hide.sc-instant-apps-interactive-legend-layer-element{display:none}";const b=class{constructor(t){e(this,t),this.activeLayerInfo=void 0,this.isSizeRamp=void 0,this.isChild=void 0,this.isColorRamp=void 0,this.isRelationshipRamp=void 0,this.isInteractive=void 0,this.zoomTo=void 0,this.legendElement=void 0,this.titleText=void 0,this.legendvm=void 0,this.legendElementIndex=void 0,this.messages=void 0,this.expanded=!0}legendLayerExpandUpdatedEmitted(){this.expanded=this.legendLayerCaption.expanded}render(){var e,t,n,s,a,r,d,c,p;const h=this.isChild?"esri-legend__layer-child-table":"esri-legend__layer-table",v=1===(null===(t=null===(e=this.legendElement)||void 0===e?void 0:e.infos)||void 0===t?void 0:t.length)&&!(null===(a=null===(s=null===(n=this.activeLayerInfo)||void 0===n?void 0:n.layer)||void 0===s?void 0:s.renderer)||void 0===a?void 0:a.field),g=!this.isSizeRamp&&this.isChild||this.isColorRamp?"":" esri-legend__layer-table--size-ramp",u=this.isInteractive?"":" instant-apps-interactive-legend__non-interactive",m=l(this.activeLayerInfo)?" instant-apps-interactive-legend__nested-unique-symbol":"";let f=!(!v||this.expanded||this.zoomTo)||this.expanded;return this.isRelationshipRamp&&(f=o.get("relationshipRampExpandStates")[this.activeLayerInfo.layer.id]),i("div",{class:`${h}${g}${u}${m}`},i("div",{id:`${null===(d=null===(r=this.activeLayerInfo)||void 0===r?void 0:r.layer)||void 0===d?void 0:d.id}-legend-element-caption`,class:this.isRelationshipRamp||!this.titleText&&!this.zoomTo&&v?"hide":"show"},i("instant-apps-interactive-legend-legend-element-caption",{ref:e=>this.legendLayerCaption=e,legendvm:this.legendvm,activeLayerInfo:this.activeLayerInfo,layer:this.activeLayerInfo.layer,titleText:this.titleText,legendElement:this.legendElement,legendElementIndex:this.legendElementIndex,zoomTo:this.zoomTo,isInteractive:this.isInteractive,messages:this.messages})),i("div",{key:"content",id:`${null===(p=null===(c=this.activeLayerInfo)||void 0===c?void 0:c.layer)||void 0===p?void 0:p.id}-legend-element-content-${this.legendElementIndex}`,class:!1===f?"hide":"show"},i("slot",{name:"content"})))}};b.style=".sc-instant-apps-interactive-legend-legend-element-h{display:block}.sc-instant-apps-interactive-legend-legend-element-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-legend-element,.sc-instant-apps-interactive-legend-legend-element-h .instant-apps-interactive-legend__nested-unique-symbol.sc-instant-apps-interactive-legend-legend-element{margin:0}.sc-instant-apps-interactive-legend-legend-element-h .hide.sc-instant-apps-interactive-legend-legend-element{display:none}";const L=class{constructor(t){e(this,t),this.showAllSelectedEvent=s(this,"showAllSelected",7),this.legendLayerExpandUpdatedEvent=s(this,"legendLayerExpandUpdated",7),this.legendvm=void 0,this.activeLayerInfo=void 0,this.layer=void 0,this.titleText=void 0,this.legendElementIndex=void 0,this.zoomTo=void 0,this.isInteractive=void 0,this.legendElement=void 0,this.expanded=!0,this.messages=void 0}render(){var e,t,n,s;const a=l(this.activeLayerInfo),o=p(this.activeLayerInfo),{expanded:r}=this;return a&&!this.titleText?null:i("div",{class:"esri-legend__layer-caption"},i("calcite-action",{onClick:this.toggleExpanded(),icon:!1===r?"chevron-up":"chevron-down",appearance:"transparent",text:!1===r?null===(e=this.messages)||void 0===e?void 0:e.expand:null===(t=this.messages)||void 0===t?void 0:t.collapse,label:!1===r?null===(n=this.messages)||void 0===n?void 0:n.expand:null===(s=this.messages)||void 0===s?void 0:s.collapse,scale:"s"}),this.isInteractive||o?this.renderLegendElementCaptionControls():null,this.titleText?i("span",{class:"instant-apps-interactive-legend__legend-layer-caption-text"},this.titleText):null)}renderLegendElementCaptionControls(){var e,t,n,s,a,l,o,d,c,p;const h=this.titleText?"":" instant-apps-interactive-legend__layer-caption-btn-container--no-text",v=(null===(s=null===(n=null===(e=r.data)||void 0===e?void 0:e[null===(t=this.layer)||void 0===t?void 0:t.id])||void 0===n?void 0:n.categories)||void 0===s?void 0:s.size)>1?i("calcite-button",{key:"show-all-button",id:"showAll",onClick:this.handleShowAll(),"icon-start":"list-check-all",appearance:"outline",round:!0,label:null===(a=this.messages)||void 0===a?void 0:a.showAll}):null,g=i("calcite-button",{key:"zoom-to-button",id:"zoomTo",onClick:this.handleZoomTo(),"icon-start":"magnifying-glass-plus",appearance:"outline",round:!0,label:null===(l=this.messages)||void 0===l?void 0:l.zoomTo});return i("div",{key:"layer-caption-btn-container",class:`instant-apps-interactive-legend__layer-caption-btn-container${h}`},v,i("calcite-tooltip",{"reference-element":"showAll",placement:"top",label:null===(o=this.messages)||void 0===o?void 0:o.showAll},null===(d=this.messages)||void 0===d?void 0:d.showAll),this.zoomTo?[g,i("calcite-tooltip",{"reference-element":"zoomTo",placement:"top",label:null===(c=this.messages)||void 0===c?void 0:c.zoomTo},null===(p=this.messages)||void 0===p?void 0:p.zoomTo)]:null)}toggleExpanded(){return()=>{var e,t;this.expanded=!this.expanded,this.legendLayerExpandUpdatedEvent.emit(),(null===(t=null===(e=this.activeLayerInfo)||void 0===e?void 0:e.legendElements)||void 0===t?void 0:t.filter((e=>"relationship-ramp"===e.type))).length>0&&o.set("relationshipRampExpandStates",Object.assign(Object.assign({},r.relationshipRampExpandStates),{[this.activeLayerInfo.layer.id]:this.expanded}))}}handleZoomTo(){return()=>{const e=h(this.layer),t=d(e,this.legendElement);c(e,this.legendvm.view,t)}}handleShowAll(){return()=>{var e,t;const i=null===(e=r.data)||void 0===e?void 0:e[null===(t=this.layer)||void 0===t?void 0:t.id];d(i,this.legendElement)?(()=>{const e=v(i,this.legendElement.title);g({intLegendLayerData:e,layerId:this.layer.id})})():((()=>{const e=u(i);g({intLegendLayerData:e,layerId:this.layer.id})})(),this.showAllSelectedEvent.emit())}}get el(){return n(this)}};L.style=".sc-instant-apps-interactive-legend-legend-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-caption-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-field-name-font-size:1rem;--instant-apps-interactive-legend-total-feature-count-font-size:0.875rem;--instant-apps-interactive-legend-info-font-size:0.875rem;--instant-apps-interactive-legend-info-item-background--selected:#c7ebff;--instant-apps-interactive-legend-info-item-color--selected:var(--calcite-color-text-2);--instant-apps-interactive-legend-secondary-background-color:var(--calcite-color-background);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption calcite-action.sc-instant-apps-interactive-legend-legend-element-caption{margin-left:20px}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__legend-layer-caption-text.sc-instant-apps-interactive-legend-legend-element-caption{display:inline-block;margin-left:5px;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption{white-space:nowrap}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption calcite-button.sc-instant-apps-interactive-legend-legend-element-caption{margin:2px}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption{font-weight:var(--instant-apps-interactive-legend-caption-font-weight);padding:var(--instant-apps-interactive-legend-ui-padding)}html[dir=rtl] .sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption calcite-action.sc-instant-apps-interactive-legend-legend-element-caption{margin-left:unset;margin-right:20px}";const $=".esri-relationship-ramp--diamond__middle-column--ramp svg g",x=class{constructor(t){e(this,t),this.cellNodeCounter=0,this.filterMode=void 0,this.activeLayerInfo=void 0,this.legendElement=void 0,this.messages=void 0}applyInteractivity(){this.applyRelationshipRampInteractivity()}showAllSelectedEmitted(){const e=0===r.data[this.activeLayerInfo.layer.id].queryExpressions.length,t=this.relationshipRamp.querySelector($).children,i=t?Array.from(t):null;e&&(null==i||i.forEach((e=>{e.removeAttribute("stroke"),e.removeAttribute("stroke-width"),e.removeAttribute("stroke-opacity"),e.classList.remove("esri-interactive-legend--selected-cell")})))}async componentWillLoad(){const[e]=await f(["esri/symbols/support/symbolUtils"]);this.symbolUtils=e}render(){var e,t;return i("div",{ref:e=>{if(!(null==e?void 0:e.querySelector("relationshipStyles"))){const t=document.createElement("style");t.id="relationshipStyles",t.innerHTML="\n rect:hover {\n cursor: pointer;\n opacity: 0.8;\n }\n ",null==e||e.appendChild(t)}}},i("span",{class:"instant-apps-interactive-legend-relationship__instructional-text"},null===(t=null===(e=this.messages)||void 0===e?void 0:e.relationship)||void 0===t?void 0:t.instructionalText),this.renderRelationshipRamp())}renderRelationshipRamp(){var e;const t=(null===(e=this.activeLayerInfo)||void 0===e?void 0:e.layer).renderer,n=this.symbolUtils.renderRelationshipRampPreviewHTML(t);return i("div",{ref:e=>{this.relationshipRamp=e,this.applyRelationshipRampInteractivity()},key:"relationship-ramp-diamond",innerHTML:`${null==n?void 0:n.outerHTML}`})}applyRelationshipRampInteractivity(){if(!(this.relationshipRamp&&this.activeLayerInfo&&this.legendElement&&r.data))return;let e=setInterval((()=>{const t=this.relationshipRamp.querySelector($);t&&(clearInterval(e),this.setupRelationshipDrawingStyle(t.children))}),10)}setupRelationshipDrawingStyle(e){const t=e?Array.from(e):null;if(!t)return;t.map(((e,t)=>{var i,n;const s=(null===(n=null===(i=this.activeLayerInfo)||void 0===i?void 0:i.layer)||void 0===n?void 0:n.renderer).uniqueValueInfos;if(s[t]){const i=s[t].symbol.color;s.forEach(((t,n)=>{const s=t.symbol.color;i.r===s.r&&i.g===s.g&&i.b===s.b&&i.a===s.a&&this.setCellAttributes(e,n)})),e.classList.add("esri-interactive-legend__svg-rect-element")}}));const i=this.reorderCellNodes(t);this.attachFeatureIndexes(i),this.applyEventHandlers()}setCellAttributes(e,t){const i=this.activeLayerInfo.layer.renderer.uniqueValueInfos,n=this.generateIndexPattern(t);i[n]&&(e.setAttribute("data-color",`${i[n].symbol.color}`),e.setAttribute("data-cell-index",`${n}`),e.setAttribute("tabindex","0"))}generateIndexPattern(e){const{focus:t,numClasses:i}=this.legendElement;return"HL"===t?e:2===i?this.twoClasses(e,t):3===i?this.threeClasses(e,t):4===i?this.fourClasses(e,t):null}twoClasses(e,t){return"HH"===t||null===t?0===e||2===e?e+1:1===e||3===e?e-1:null:"LH"===t?0===e?e+3:1===e?e+1:2===e?e-1:3===e?e-3:4===e?e+0:null:"LL"===t?0===e||1===e?e+2:2===e||3===e?e-2:null:void 0}threeClasses(e,t){return"HH"===t||null===t?0===e||3===e||6===e?e+2:2===e||5===e||8===e?e-2:e:"LH"===t?0===e?e+8:1===e?e+6:2===e?e+4:3===e?e+2:5===e?e-2:6===e?e-4:7===e?e-6:8===e?e-8:e:"LL"===t?0===e||1===e||2===e?e+6:6===e||7===e||8===e?e-6:e:void 0}fourClasses(e,t){return"HH"===t||null===t?0===e||4===e||8===e||12===e?e+3:1===e||5===e||9===e||13===e?e+1:2===e||6===e||10===e||14===e?e-1:3===e||7===e||11===e||15===e?e-3:null:"LH"===t?0===e?e+15:1===e?e+13:2===e?e+11:3===e?e+9:4===e?e+7:5===e?e+5:6===e?e+3:7===e?e+1:8===e?e-1:9===e?e-3:10===e?e-5:11===e?e-7:12===e?e-9:13===e?e-11:14===e?e-13:15===e?e-15:null:"LL"===t?0===e||1===e||2===e||3===e?e+12:4===e||5===e||6===e||7===e?e+4:8===e||9===e||10===e||11===e?e-4:12===e||13===e||14===e||15===e?e-12:null:void 0}reorderCellNodes(e){const t=[];for(;this.cellNodeCounter<=e.length-1;)e.map((e=>{parseInt(e.getAttribute("data-cell-index"))===this.cellNodeCounter&&t.push(e)})),this.cellNodeCounter++;return this.cellNodeCounter=0,t}attachFeatureIndexes(e){const{focus:t,numClasses:i}=this.legendElement;"HH"===t||null===t?this.relationshipFocusIsHighHigh(e,i):"LL"===t?this.relationshipFocusIsLowLow(e,i):"LH"===t?this.relationshipFocusIsLowHigh(e,i):"HL"===t&&this.relationshipFocusIsHighLow(e,i),this.cellNodeCounter=0}relationshipFocusIsHighHigh(e,t){for(let i=t-1;i>=0;i--)for(let n=t-1;n>=0;n--)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsLowLow(e,t){for(let i=0;i<t;i++)for(let n=0;n<t;n++)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsLowHigh(e,t){for(let i=0;i<t;i++)for(let n=t-1;n>=0;n--)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsHighLow(e,t){for(let i=t-1;i>=0;i--)for(let n=0;n<t;n++)this.setDataAttributes(e,n,i,t),this.cellNodeCounter++}setDataAttributes(e,t,i,n){const s=e[this.cellNodeCounter];2===n?this.twoClassAttributes(s,t,i):3===n?this.threeClassAttributes(s,t,i):this.fourClassAttributes(s,t,i)}twoClassAttributes(e,t,i){const{legendElement:n}=this;"HL"===n.focus?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i)}threeClassAttributes(e,t,i){const{legendElement:n}=this;1===this.cellNodeCounter||3===this.cellNodeCounter||5===this.cellNodeCounter||7===this.cellNodeCounter?"HL"===n.focus?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i):"HL"!==n.focus?this.setDataFeatureIndexes(e,t,i):this.swapDataFeatureIndexes(e,t,i)}fourClassAttributes(e,t,i){const{legendElement:n}=this,{focus:s}=n;1===this.cellNodeCounter||2===this.cellNodeCounter||4===this.cellNodeCounter||5===this.cellNodeCounter||7===this.cellNodeCounter||8===this.cellNodeCounter||10===this.cellNodeCounter||11===this.cellNodeCounter||13===this.cellNodeCounter||14===this.cellNodeCounter?"HL"===s?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i):"HL"!==s?this.setDataFeatureIndexes(e,t,i):this.swapDataFeatureIndexes(e,t,i)}setDataFeatureIndexes(e,t,i){e.setAttribute("data-feature-i",`${t}`),e.setAttribute("data-feature-j",`${i}`),this.setDataCellFocus(e,t,i)}swapDataFeatureIndexes(e,t,i){e.setAttribute("data-feature-i",`${i}`),e.setAttribute("data-feature-j",`${t}`),this.setDataCellFocus(e,i,t)}setDataCellFocus(e,t,i){const{numClasses:n}=this.legendElement;2===n?this.setDataCellFocusForTwoClasses(e,t,i):3===n?this.setDataCellFocusForThreeClasses(e,t,i):4===n&&this.setDataCellFocusForFourClasses(e,t,i)}setDataCellFocusForTwoClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","HL"):1===t&&1===i&&e.setAttribute("data-cell-focus","HH")}setDataCellFocusForThreeClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LM"):0===t&&2===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","ML"):1===t&&1===i?e.setAttribute("data-cell-focus","MM"):1===t&&2===i?e.setAttribute("data-cell-focus","MH"):2===t&&0===i?e.setAttribute("data-cell-focus","HL"):2===t&&1===i?e.setAttribute("data-cell-focus","HM"):2===t&&2===i&&e.setAttribute("data-cell-focus","HH")}setDataCellFocusForFourClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LM1"):0===t&&2===i?e.setAttribute("data-cell-focus","LM2"):0===t&&3===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","M1L"):1===t&&1===i?e.setAttribute("data-cell-focus","M1M1"):1===t&&2===i?e.setAttribute("data-cell-focus","M1M2"):1===t&&3===i?e.setAttribute("data-cell-focus","M1H"):2===t&&0===i?e.setAttribute("data-cell-focus","M2L"):2===t&&1===i?e.setAttribute("data-cell-focus","M2M1"):2===t&&2===i?e.setAttribute("data-cell-focus","M2M2"):2===t&&3===i?e.setAttribute("data-cell-focus","M2H"):3===t&&0===i?e.setAttribute("data-cell-focus","HL"):3===t&&1===i?e.setAttribute("data-cell-focus","HM1"):3===t&&2===i?e.setAttribute("data-cell-focus","HM2"):3===t&&3===i&&e.setAttribute("data-cell-focus","HH")}applyEventHandlers(){const e=document.querySelectorAll(".esri-interactive-legend__svg-rect-element");Array.from(e).map((e=>{const t=e.getAttribute("data-feature-i"),i=e.getAttribute("data-feature-j"),n=e.getAttribute("data-cell-focus");e.onclick=()=>{this.handleFilter(t,i,n),this.handleSelectedElement(e)},e.onkeydown=s=>{const{key:a}=s;("Enter"===a||"Space"===a)&&(this.handleFilter(t,i,n),this.handleSelectedElement(e))}}))}async handleFilter(e,t,i){var n,s,a,l,o;const d=this.activeLayerInfo.layer,{authoringInfo:c}=d.renderer,{field1:p,field2:h}=c,{queryExpressions:v,fLayerView:g}=r.data[this.activeLayerInfo.layer.id];if("relationship-ramp"===this.legendElement.type&&c&&p&&h){const r=this.generateExpressionParams(p,h,c,e,t,i),d=this.generateExpressionForRelationship(r);0===v.length?v[0]=d:-1===v.indexOf(d)?v.push(d):v.splice(v.indexOf(d),1);const u=v.join(" OR "),y=null!==(s=null===(n=null==g?void 0:g.filter)||void 0===n?void 0:n.timeExtent)&&void 0!==s?s:null,[_,b]=await f(["esri/layers/support/FeatureFilter","esri/layers/support/FeatureEffect"]);if("filter"===(null===(a=this.filterMode)||void 0===a?void 0:a.type))g.filter=new _({where:u,timeExtent:(null===(l=null==g?void 0:g.filter)||void 0===l?void 0:l.timeExtent)?g.filter.timeExtent:null});else if(null===(o=this.filterMode)||void 0===o?void 0:o.effect){const{includedEffect:e,excludedEffect:t}=this.filterMode.effect,i=await m(t,g,"excludedEffect"),n=await m(e,g,"includedEffect");g.featureEffect=new b({filter:new _({where:u,timeExtent:y}),includedEffect:n,excludedEffect:i})}}}generateExpressionParams(e,t,i,n,s,a){const l=[],o=e.field,r=t.field,d=e.classBreakInfos,c=t.classBreakInfos,p=i.field1.hasOwnProperty("normalizationField")?i.field1.normalizationField:null,h=i.field2.hasOwnProperty("normalizationField")?i.field2.normalizationField:null;return d.forEach(((e,t)=>{const i=[];c.forEach(((e,n)=>{i.push([d[t],c[n]])})),l.push(i)})),{data:l,i:n,j:s,field1:p?`(${o}/${p})`:`${o}`,field2:h?`(${r}/${h})`:`${r}`,focus:a}}generateExpressionForRelationship(e){const{focus:t,field1:i,field2:n,data:s,i:a,j:l}=e;return"LL"===t?`${i} >= ${s[a][l][0].minValue} AND ${i} <= ${s[a][l][0].maxValue} AND ${n} >= ${s[a][l][1].minValue} AND ${n} <= ${s[a][l][1].maxValue}`:"LM"===t||"LM1"===t||"LM2"===t||"LH"===t?`${i} >= ${s[a][l][0].minValue} AND ${i} <= ${s[a][l][0].maxValue} AND ${n} > ${s[a][l][1].minValue} AND ${n} <= ${s[a][l][1].maxValue}`:"ML"===t||"M1L"===t||"M2L"===t||"HL"===t?`${i} > ${s[a][l][0].minValue} AND ${i} <= ${s[a][l][0].maxValue} AND ${n} >= ${s[a][l][1].minValue} AND ${n} <= ${s[a][l][1].maxValue}`:`${i} > ${s[a][l][0].minValue} AND ${i} <= ${s[a][l][0].maxValue} AND ${n} > ${s[a][l][1].minValue} AND ${n} <= ${s[a][l][1].maxValue}`}handleSelectedElement(e){const t=e.classList;t.contains("esri-interactive-legend--selected-cell")?(e.removeAttribute("stroke"),e.removeAttribute("stroke-width"),e.removeAttribute("stroke-opacity"),t.remove("esri-interactive-legend--selected-cell")):(t.add("esri-interactive-legend--selected-cell"),e.setAttribute("stroke","black"),e.setAttribute("stroke-width","3px"),e.setAttribute("stroke-opacity","1"))}};x.style=".sc-instant-apps-interactive-legend-relationship-h{display:block}.sc-instant-apps-interactive-legend-relationship-h .instant-apps-interactive-legend-relationship__instructional-text.sc-instant-apps-interactive-legend-relationship{display:inline-block;width:100%;text-align:center;margin-bottom:10px;background-color:#d2e9f9}.calcite-mode-dark .sc-instant-apps-interactive-legend-relationship-h .instant-apps-interactive-legend-relationship__instructional-text.sc-instant-apps-interactive-legend-relationship{background-color:var(--calcite-color-brand);color:#151515}";export{y as instant_apps_interactive_legend_group_legend_element,_ as instant_apps_interactive_legend_layer_element,b as instant_apps_interactive_legend_legend_element,L as instant_apps_interactive_legend_legend_element_caption,x as instant_apps_interactive_legend_relationship}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,h as i,H as s,g as e,c as a}from"./p-78780f63.js";import{l as h}from"./p-48ff9cea.js";import{g as n}from"./p-6b943f52.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const o=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,null,i("div",{ref:t=>{this._basemapElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t,i]=await h(["esri/widgets/BasemapGallery","esri/widgets/BasemapGallery/support/PortalBasemapsSource"]);this.BasemapGallery=t,this.PortalBasemapsSource=i}async _initBaseMapGallery(t){var i;if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const s=new this.PortalBasemapsSource({query:(null===(i=this.basemapConfig)||void 0===i?void 0:i.basemapGroupId)?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await s.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:s})}}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};o.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.enabled=void 0,this.floorFilterWidget=void 0,this.mapView=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initFloorFilter(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,null,i("div",{ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/FloorFilter"]);this.FloorFilter=t}_initFloorFilter(t){var i;t&&this.enabled&&this.FloorFilter&&(null===(i=null==t?void 0:t.map)||void 0===i?void 0:i.floorInfo)&&(this.floorFilterWidget?this.floorFilterWidget.view=t:this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};r.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.fullscreenStateChange=a(this,"fullscreenStateChange",7),this.mapView=void 0,this.fullscreenWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}async componentWillLoad(){await this._initModules()}render(){return i(s,null,i("div",{class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){await this._initFullscreenWidget()}async componentDidLoad(){await this._initFullscreenWidget()}async _initModules(){const[t,i]=await h(["esri/widgets/Fullscreen","esri/core/reactiveUtils"]);this.Fullscreen=t,this.reactiveUtils=i}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?(this.fullscreenWidget=new this.Fullscreen({view:this.mapView}),await this.fullscreenWidget.when((()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=this.reactiveUtils.watch((()=>this.fullscreenWidget.viewModel.state),(t=>this.fullscreenStateChange.emit(t)))}))):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,null,i("div",{ref:t=>{this._legendElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,view:t}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};c.style=":host{display:block}";const d=class{constructor(i){t(this,i),this.mapInfoChange=a(this,"mapInfoChange",7),this._loadedId="",this.mapInfos=[],this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=null==t?void 0:t.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t){var i;const s=null===(i=this.mapInfos)||void 0===i?void 0:i.filter((i=>i.id===t));t&&(null==s?void 0:s.length)>0&&this._webMapSelected(s[0])}async componentWillLoad(){await this._getTranslations()}render(){return i(s,null,this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){var t;const s="map-picker-expand-toggle";return i("div",{class:"width-full"},i("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",id:s,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},null===(t=this._webMapInfo)||void 0===t?void 0:t.name),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":s},i("span",null,this._translations.switchMap)))}_getToolbar(){return i("div",{class:"display-flex"},i("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return i("div",{class:t?"map-list":"display-none"},i("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>i("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapInfo=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};d.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.align-center{align-items:center}";const p=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return i(s,null,i("div",{class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};if(this.searchConfiguration){const i=this._getSearchConfig(this.searchConfiguration,this.mapView);t=Object.assign({},i)}this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return(null==s?void 0:s.length)>0?(t.includeDefaultSources=!1,s.forEach((t=>{var s,e;if(t.hasOwnProperty("layer")){const a=t,h=null===(s=a.layer)||void 0===s?void 0:s.id,n=h?i.map.findLayerById(h):null,o=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;n?a.layer=n:o&&(a.layer=new this.FeatureLayer(o))}})),null==s||s.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===(null==i?void 0:i.name)&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t=Object.assign(Object.assign({},t),{includeDefaultSources:!0}),t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}";const u=class{constructor(i){t(this,i),this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.layout="vertical",this.mapView=void 0,this.searchConfiguration=void 0,this._hasFloorInfo=!1,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}async mapViewWatchHandler(){await this.mapView.when((()=>{var t,i;this._hasFloorInfo=null===(i=null===(t=this.mapView)||void 0===t?void 0:t.map)||void 0===i?void 0:i.floorInfo}))}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFloorFilterWatchHandler(t){const i=this._floorFilterElement.floorFilterWidget;t?this.mapView.ui.add(i,{position:"top-right",index:1}):this.mapView.ui.remove(i)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?"ready"===i.viewModel.state&&i.viewModel.enter():"active"===i.viewModel.state&&i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:"top-right",index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations()}render(){const t=this._showTools?"":"display-none",e=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",n=this._showFloorFilter?"":"display-none",o=this._showFullscreen?"":"display-none",r=this._showFullscreen?"full-screen-exit":"full-screen",l=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return i(s,null,i("div",{class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},i("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))),i("div",{class:`margin-top-1-2 box-shadow ${t}`},this.enableLegend?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):void 0,this.enableSearch?this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())):void 0,this.enableFullscreen?this._getActionGroup(r,!1,l,(()=>this._expand())):void 0,this.enableBasemap?this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())):void 0,this.enableFloorFilter&&this._hasFloorInfo?this._getActionGroup("urban-model",!1,this._translations.floorFilter,(()=>this._toggleFloorFilter())):void 0)),i("basemap-gallery",{basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),i("map-search",{class:e,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),i("map-legend",{class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),i("map-fullscreen",{class:o,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),i("floor-filter",{class:n,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,s,e,a){return i("div",{class:"border-bottom"},i("calcite-action",{alignment:"center",class:"square-40",compact:!1,disabled:s,icon:t,id:t,onClick:a,scale:"s",text:""},i("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),i("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},i("span",null,e)))}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};u.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-40{width:40px;height:40px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}";export{o as basemap_gallery,r as floor_filter,l as map_fullscreen,c as map_legend,d as map_picker,p as map_search,u as map_tools}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as n,h as i,H as s,g as e}from"./p-78780f63.js";import{g as o}from"./p-83225907.js";import{l as a}from"./p-a8a0187d.js";import{g as r}from"./p-c96eb2db.js";import"./p-14a48b14.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const p="instant-apps-export calcite-mode-light",l="instant-apps-export-print",c="instant-apps-export-print__extra-container",h="instant-apps-export-print__legend-container",d="instant-apps-export-print__compass-container",u="instant-apps-export-print__scale-bar-container",x="instant-apps-export-print__popup-container",v="instant-apps-export-print__popup-content",_="instant-apps-export-print__popup-title",g="instant-apps-export-print__view",b="instant-apps-export-print__view-container",f="instant-apps-export-print__view-wrapper",m=class{constructor(i){t(this,i),this.exportOutputUpdated=n(this,"exportOutputUpdated",7),this.output=void 0,this.beforeExport=()=>Promise.resolve(),this.popoverIcon="export",this.extraContent=void 0,this.extraContentLabel=void 0,this.headerTitle="",this.includeExtraContent=!0,this.includeLegend=!0,this.includeMap=!0,this.includePopup=!1,this.mode="popover",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.scale="m",this.showHeaderTitle=!0,this.showIncludeLegend=!0,this.showIncludeMap=!1,this.showIncludePopup=!0,this.showScaleBar=!0,this.view=void 0,this.baseClass=p,this.exportIsLoading=void 0,this.messages=void 0}watchIncludeMap(t){t&&this.updateLegend()}componentWillLoad(){this.baseClass="dark"===r(this.el)?"instant-apps-export calcite-mode-dark":p,o(this),this.initializeModules()}componentDidLoad(){this.printContainerEl.prepend(this.printEl)}disconnectedCallback(){var t,n;null===(t=this.handles)||void 0===t||t.removeAll(),null===(n=this.handles)||void 0===n||n.destroy(),this.handles=null}async initializeModules(){const[t]=await a(["esri/core/Handles"]);return this.handles=new t,Promise.resolve()}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel(),n=this.renderCompass();return i(s,null,i("div",{class:this.baseClass,onMouseEnter:this.handleWidgetCreation.bind(this),onFocusin:this.handleWidgetCreation.bind(this)},t,i("div",{class:"instant-apps-export__visually-hidden"},n)))}renderPopover(){var t,n,s;const e=this.renderPanel();return[i("calcite-popover",{referenceElement:"export-popover-btn",label:null===(t=this.messages)||void 0===t?void 0:t.exportPopover,overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t},e),i("calcite-action",{id:"export-popover-btn",alignment:"center",icon:this.popoverIcon,scale:this.scale,title:null===(n=this.messages)||void 0===n?void 0:n.exportBtn,text:null===(s=this.messages)||void 0===s?void 0:s.exportBtn})]}renderPanel(){var t;const n=this.showHeaderTitle?this.renderTitle():null,s=null!=this.extraContent?this.renderSwitch("includeExtraContent",this.extraContentLabel):null,e=this.showIncludeMap?this.renderSwitch("includeMap"):null,o=this.includeMap?this.renderMapOptions():null,a=this.renderPrint();return i("div",{class:"inline"===this.mode?"instant-apps-export__inline-container":"instant-apps-export__popover-container"},n,s,e,o,i("calcite-button",{width:"full",onClick:this.exportOnClick.bind(this),loading:this.exportIsLoading,disabled:this.exportIsLoading},null===(t=this.messages)||void 0===t?void 0:t.export),a)}renderTitle(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.title,i("calcite-input",{value:this.headerTitle,onCalciteInputInput:this.updateHeaderTitle.bind(this)}))}renderSwitch(t,n){var s;const e=null!=n?n:null===(s=this.messages)||void 0===s?void 0:s[t];return i("calcite-label",{layout:"inline-space-between"},e,i("calcite-switch",{checked:this[t],value:t,onCalciteSwitchChange:this.optionOnChange.bind(this)}))}renderMapOptions(){const t=this.showIncludeLegend?this.renderSwitch("includeLegend"):null,n=this.showIncludePopup?this.renderSwitch("includePopup"):null;return i("div",null,t,n)}renderPrint(){const t=this.includeMap?this.renderPrintMap():null,n=this.renderExtraContent(),s=this.includeMap&&this.showIncludeLegend?this.renderLegend():null,e=this.includeMap&&this.showIncludePopup?this.renderPopup():null;return i("div",{ref:t=>this.printContainerEl=t},i("div",{class:l,ref:t=>this.printEl=t},t,s,e,n))}renderPrintMap(){const t=this.renderScaleBar();return i("div",{class:b,ref:t=>this.viewContainerEl=t},i("div",{class:f,ref:t=>this.viewWrapperEl=t},this.headerTitle?i("instant-apps-header",{titleText:this.headerTitle,backgroundColor:"#fff",textColor:"#323232"}):null,i("div",{class:g,ref:t=>this.viewEl=t}),t))}renderLegend(){return i("div",{class:h,ref:t=>this.legendContainerEl=t})}renderCompass(){return i("div",{class:d,ref:t=>this.compassContainerEl=t})}renderScaleBar(){return i("div",{class:u,ref:t=>this.scaleBarContainerEl=t})}renderPopup(){return i("div",{class:x,ref:t=>this.popupContainerEl=t},i("div",{ref:t=>this.popupTitleEl=t,class:_}),i("div",{ref:t=>this.popupContentEl=t,class:v}))}renderExtraContent(){return i("div",{class:c,id:"export-content",ref:t=>this.extraContainerEl=t})}optionOnChange(t){const{checked:n,value:i}=t.target;this[i]=n,this.updateExportOutput()}updateHeaderTitle(t){this.headerTitle=t.target.value,this.updateExportOutput()}async exportOnClick(){await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}async handleViewExportOnClick(){null!=this.view?(this.addPrintStyling(),document.body.prepend(this.printEl),this.handleExtraContent(),this.includeMap?(null!=this.viewContainerEl&&(this.viewContainerEl.style.display="flex"),this.updatePopupToPrint(),this.viewScreenshot(),this.handleImgLoaded()):this.handleImgLoaded()):null!=this.popoverEl&&(this.popoverEl.open=!1)}addPrintStyling(){null==this.printStyleEl&&(this.printStyleEl=document.createElement("style"),this.printStyleEl.innerHTML='\n @media print {\n @page {\n size: Portrait;\n margin: .25in;\n }\n\n html, body {\n padding: 0;\n margin: 0;\n height: 100%;\n width: 100%;\n }\n\n body > *:not(.instant-apps-export-print) { display: none; }\n }\n\n * {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n }\n\n\n .instant-apps-export-print {\n height: 100%;\n width: 100%;\n position: absolute;\n z-index: -999;\n color: #323232 !important;\n display: flex;\n flex-flow: row wrap;\n align-content: flex-start;\n gap: 36px;\n --esri-calcite-mode-name: "light";\n }\n\n .instant-apps-export-print, .instant-apps-export-print * {\n box-sizing: border-box;\n }\n\n .instant-apps-export-print__view-section {\n height: 100%;\n }\n\n .instant-apps-export-print__view-container {\n height: 60%;\n width: 100%;\n display: flex;\n justify-content: center;\n }\n\n .instant-apps-export-print__view-wrapper {\n position: relative;\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n border: 2pt solid #323232;\n }\n\n .instant-apps-export-print__view {\n height: 100%;\n width: 100%;\n background-position: center;\n background-repeat: no-repeat;\n }\n\n .instant-apps-export-print__popup-container {\n height: min-content;\n max-width: 350px;\n display: none;\n color: #323232;\n background: #fff;\n border: 1pt solid #323232;\n break-inside: avoid;\n }\n\n .instant-apps-export-print__popup-title {\n border-bottom: 1pt solid #323232;\n }\n\n .instant-apps-export-print__popup-content {\n background: #fff;\n padding-top: 8pt;\n }\n\n .instant-apps-export-print__popup-content .esri-feature-media__chart {\n background: #fff;\n }\n\n .instant-apps-export-print__legend-container {\n height: min-content;\n max-width: 300px;\n background: #fff;\n }\n\n .esri-legend--card, .esri-legend--card__service-content {\n flex-flow: row wrap;\n }\n\n .instant-apps-export-print .esri-widget > *:not(.instant-apps-export-print__scale-bar-container > *) {\n background: #fff;\n color: #323232;\n }\n\n .instant-apps-export-print__popup-content * {\n color: #323232;\n }\n\n .instant-apps-export-print .esri-widget__heading {\n margin: 2pt 7pt;\n padding: 0;\n color: #323232;\n }\n\n .instant-apps-export-print .esri-legend__ramp-label:before {\n border-color: rgba(0,0,0,0) rgba(50,50,50,.8) rgba(0,0,0,0) rgba(0,0,0,0);\n }\n\n .instant-apps-export-print .esri-legend--card__section {\n padding: 4pt 0 4pt;\n min-width: unset;\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__section:first-child {\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service {\n border: none;\n flex: 0 1 auto;\n break-inside: avoid;\n }\n\n .instant-apps-export-print .esri-legend--card {\n border: none;\n gap: 6pt 12pt;\n }\n\n .instant-apps-export-print .esri-legend--card:not(:first-child),\n .instant-apps-export-print .esri-compass.esri-widget:not(:first-child) {\n display: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-container {\n height: unset;\n padding: 0;\n border-bottom: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-text {\n padding-bottom: 0;\n }\n\n .instant-apps-export-print__compass-container {\n position: absolute;\n top: 65px;\n left: 15px;\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n --calcite-ui-icon-color: #000;\n border-radius: 50%;\n height: fit-content;\n }\n\n .instant-apps-export-print__compass-container .esri-compass {\n background: #fff;\n }\n\n .instant-apps-export-print__compass-container .esri-compass__icon.esri-icon-compass {\n color: #000;\n }\n\n .instant-apps-export-print__compass-container.esri-compass.esri-widget--button {\n background: #fff;\n }\n\n .instant-apps-export-print__scale-bar-container {\n position: absolute;\n bottom: 15px;\n left: 15px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__bar-container:nth-child(1n+3) {\n display: none;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line {\n background-color: rgba(255, 255, 255, 0.66);\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top {\n border-bottom: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {\n color: #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:after,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:after {\n background-color: #323232;\n border-right: 2px solid #323232;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__item-navigation {\n display: none;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__chart.esri-feature-media__chart--rendered * {\n width: 100%!important;\n }\n\n .instant-apps-export-print__popup-content .esri-popup__content {\n margin: 0;\n }',document.body.prepend(this.printStyleEl))}handleImgLoaded(){this.exportIsLoading=!0,setTimeout((()=>{this.exportIsLoading=void 0,this.setupViewPrintElements()}),1500)}handleExtraContent(){const t=this.printEl.querySelector("#export-content");null!=t&&(t.innerHTML="",null!=this.extraContent&&this.includeExtraContent?(t.style.display="block",t.append(this.extraContent.cloneNode(!0))):t.style.display="none")}resetPrintContent(){var t,n;if(null!=this.view){null===(t=this.printContainerEl)||void 0===t||t.prepend(this.printEl),null===(n=this.printStyleEl)||void 0===n||n.remove(),this.printStyleEl=void 0;const i=this.printEl.querySelector("#export-content");i&&(i.innerHTML="")}}async updatePopupToPrint(){var t,n;if(null!=this.view&&(null!=this.popupContainerEl&&(this.popupContainerEl.style.display=this.includePopup&&this.view.popup.visible?"block":"none",this.checkPopupOpen()),this.view.popup.visible&&null!=this.view.popup.selectedFeature)){const i=document.createElement(`h${null!==(t=this.view.popup.headingLevel)&&void 0!==t?t:2}`);i.innerHTML=null!==(n=this.view.popup.title)&&void 0!==n?n:"",i.className="esri-widget__heading esri-popup__header-title",null!=this.popupTitleEl&&(this.popupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupTitleEl.innerHTML="",this.popupTitleEl.prepend(i))}}updateExportOutput(){this.output={},this.showHeaderTitle&&(this.output.headerTitle=this.headerTitle),this.showIncludeLegend&&(this.output.includeLegend=this.includeLegend),this.showIncludeMap&&(this.output.includeMap=this.includeMap),this.showIncludePopup&&(this.output.includePopup=this.includePopup),this.exportOutputUpdated.emit()}setupViewPrintElements(){if(null!=this.view){this.handleLegendSetup();const t=document.title;this.showHeaderTitle&&this.headerTitle&&(document.title=this.headerTitle),window.print(),document.title=t,setTimeout((()=>{this.resetPrintContent()}),1e3)}}handleLegendSetup(){this.showIncludeLegend&&null!=this.view&&this.includeMap&&null!=this.legendContainerEl&&(this.legendContainerEl.style.display=this.includeLegend?"block":"none")}handleWidgetCreation(){this.handleLegendCreation(),this.handleCompassCreation(),this.handleScaleBarCreation()}handleLegendCreation(){var t,n;if(this.includeMap&&null!=this.view&&this.showIncludeLegend&&null!=this.legendContainerEl){const i=this.view.map,s=null===(n=null===(t=this.legend)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null==i?void 0:i.portalItem.id)===(null==s?void 0:s.portalItem.id)||this.updateLegend()}}updateLegend(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;if(null===(n=this.legend)||void 0===n||n.destroy(),null!=this.legendContainerEl){this.legendContainerEl.innerHTML="";const[n]=await a(["esri/widgets/Legend"]);this.legend=new n({container:this.legendContainerEl,view:t,style:{type:"card",layout:"side-by-side"}})}}))}handleCompassCreation(){var t,n;if(this.includeMap&&null!=this.view&&null!=this.compassContainerEl){const i=this.view.map,s=null===(n=null===(t=this.compass)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null==i?void 0:i.portalItem.id)===(null==s?void 0:s.portalItem.id)||this.updateCompass()}}updateCompass(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.compass)||void 0===n||n.destroy(),this.compass=null;const i=document.createElement("div");this.compassContainerEl.append(i);const[s]=await a(["esri/widgets/Compass"]);this.compass=new s({container:i,view:t})}))}handleScaleBarCreation(){var t,n;if(this.showScaleBar&&this.includeMap&&null!=this.view&&"2d"===this.view.type&&null!=this.scaleBarContainerEl){const i=this.view.map,s=null===(n=null===(t=this.scaleBar)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null==i?void 0:i.portalItem.id)===(null==s?void 0:s.portalItem.id)&&this.scaleBarContainerEl.innerHTML||this.updateScaleBar()}}updateScaleBar(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.scaleBar)||void 0===n||n.destroy(),this.scaleBar=null,this.scaleBarContainerEl.innerHTML="";const[i]=await a(["esri/widgets/ScaleBar"]);this.scaleBar=new i({container:this.scaleBarContainerEl,unit:"dual",view:t})}))}async viewScreenshot(){if(null!=this.view&&this.includeMap){const t=await this.view.takeScreenshot({width:this.view.width,height:this.view.height}),n=494;null!=this.viewEl&&null!=this.viewWrapperEl&&(this.view.width<800?(this.viewWrapperEl.style.width=`${this.view.width}px`,this.viewWrapperEl.style.maxWidth=""):(this.viewWrapperEl.style.maxWidth=`${this.view.width}px`,this.viewWrapperEl.style.width=""),this.viewWrapperEl.style.height=this.view.height<n?`${this.view.height}px`:"",this.viewEl.style.backgroundImage=`url("${t.dataUrl}")`)}}checkPopupOpen(){if(null!=this.view){const t=this.view.popup.container,n=null==t?void 0:t.querySelector(".esri-popup .esri-feature__main-container");if(null!=n){const t=n.querySelectorAll("canvas");this.popupContentEl.innerHTML="",this.popupContentEl.append(n.cloneNode(!0));const i=this.popupContentEl.querySelectorAll("canvas");t.forEach(((t,n)=>{var s;const e=t.toDataURL(),o=document.createElement("img");o.src=e;const a=t.getAttribute("style");a&&o.setAttribute("style",a);const r=i[n];null!=r&&(r.replaceWith(o),document.querySelector("link[href*='esri/themes/dark/main.css']")&&null!=(null===(s=o.parentElement)||void 0===s?void 0:s.parentElement)&&(o.parentElement.style.background="#242424",o.parentElement.parentElement.style.background="#242424"))}))}}}get el(){return e(this)}static get watchers(){return{includeMap:["watchIncludeMap"]}}};m.style=":host{display:block;--instant-apps-export-action-background:var(--calcite-color-foreground-1);--instant-apps-export-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-export-action-background-press:var(--calcite-color-foreground-3);--instant-apps-export-action-height:100%;--instant-apps-export-action-width:fit-content;--instant-apps-export-action-icon-color:var(--calcite-color-text-3);--instant-apps-export-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-export-background:var(--calcite-color-foreground-1);--instant-apps-export-text-color:var(--calcite-color-text-1);--instant-apps-export-popover-width:250px}.instant-apps-export{height:100%}.instant-apps-export *{box-sizing:border-box}.instant-apps-export__popover-container,.instant-apps-export__inline-container{padding:12px;background:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export__popover-container{width:var(--instant-apps-export-popover-width)}.instant-apps-export calcite-action{height:var(--instant-apps-export-action-height);width:var(--instant-apps-export-action-width);--calcite-color-foreground-1:var(--instant-apps-export-action-background);--calcite-color-foreground-2:var(--instant-apps-export-action-background-hover);--calcite-color-foreground-3:var(--instant-apps-export-action-background-press);--calcite-color-text-3:var(--instant-apps-export-action-icon-color);--calcite-color-text-1:var(--instant-apps-export-action-icon-hover-color)}.instant-apps-export .instant-apps-export-print{display:none}.instant-apps-export__visually-hidden{position:absolute;top:0;z-index:-1;visibility:hidden}.instant-apps-export calcite-input{--calcite-color-foreground-1:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export calcite-popover{--calcite-color-foreground-1:var(--instant-apps-export-background)}.instant-apps-export calcite-switch{--calcite-color-foreground-1:#fff;--calcite-color-foreground-2:#f3f3f3}.instant-apps-export .calcite-mode-dark calcite-switch{--calcite-color-foreground-1:#2b2b2b;--calcite-color-foreground-2:#202020}.instant-apps-export__compass-container.esri-widget{background:#fff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.instant-apps-export__compass-container.esri-widget .esri-compass__icon.esri-icon-compass{color:#6e6e6e}";export{m as instant_apps_export}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as i,h as o,g as s}from"./p-78780f63.js";import{g as e}from"./p-62e92138.js";import{l}from"./p-a8a0187d.js";import{a as n}from"./p-83225907.js";import{g as a,f as r}from"./p-00f9774c.js";import"./p-225c4ca4.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-14a48b14.js";const d=class{constructor(o){t(this,o),this.selectedLanguageUpdated=i(this,"selectedLanguageUpdated",7),this.icon="language",this.portalItem=void 0,this.view=void 0,this.locales=[],this.defaultLocale=void 0,this.messages=void 0,this.selectedLanguage=null,this.t9nData=null}async componentWillLoad(){var t,i,o,s,d,c,h,u,v,p,w;const[m,g,f]=await l(["esri/intl","esri/WebMap","esri/request"]);this.intl=m,this.request=f,this.messages=await e(document.createElement("instant-apps-language-translator"));try{this.portalItemResource=await a(this.portalItem);const t=await r(f,this.portalItemResource);this.t9nData=null!=t?t:{}}catch(t){this.t9nData={},console.error("NO PORTAL ITEM RESOURCE AVAILABLE.")}finally{this.userLocale=this.defaultLocale;const e=new URLSearchParams(window.location.search).get("locale"),l=(null===(o=null===(i=null===(t=this.locales)||void 0===t?void 0:t.map((t=>null==t?void 0:t.locale)))||void 0===i?void 0:i.filter((t=>t===e)))||void 0===o?void 0:o.length)>0,a=n(m,this.portalItem.portal),r=(null===(c=null===(d=null===(s=this.locales)||void 0===s?void 0:s.map((t=>null==t?void 0:t.locale)))||void 0===d?void 0:d.filter((t=>t===a)))||void 0===c?void 0:c.length)>0;this.selectedLanguage=l?e:r?a:this.userLocale;const f=this.selectedLanguage;if(f!==this.userLocale&&(this.calciteDropdownItemSelectCallback(f)(),this.selectedLanguageUpdated.emit({locale:f,data:null!==(u=null===(h=this.t9nData)||void 0===h?void 0:h[f])&&void 0!==u?u:null})),this.view){this.defaultWebMapId=this.view.map.portalItem.id;const t=null===(w=null===(p=null===(v=this.locales)||void 0===v?void 0:v.filter((t=>(null==t?void 0:t.webmap)&&(null==t?void 0:t.webmap)!==this.defaultWebMapId&&(null==t?void 0:t.locale)===this.selectedLanguage)))||void 0===p?void 0:p[0])||void 0===w?void 0:w.webmap;t&&(this.view.map=new g({portalItem:{id:t}}))}}}render(){const t=this.renderTrigger(),i=this.renderDropdownItems(),s=this.renderDefaultLocale();return o("calcite-dropdown",{onCalciteDropdownBeforeOpen:()=>this.trigger.iconEnd="chevron-up",onCalciteDropdownBeforeClose:()=>this.trigger.iconEnd="chevron-down","width-scale":"m"},t,s,i)}renderDefaultLocale(){const{userLocale:t}=this;return o("calcite-dropdown-item",{key:`default-${t}`,onCalciteDropdownItemSelect:this.calciteDropdownItemSelectCallback(t),selected:this.selectedLanguage===this.userLocale},this.getSelectedLanguageText(t))}renderTrigger(){return o("calcite-button",{ref:t=>this.trigger=t,slot:"trigger","icon-start":this.icon,"icon-end":"chevron-down",width:"full",appearance:"outline"},this.getSelectedLanguageText(this.selectedLanguage))}renderDropdownItems(){var t,i;return null===(i=null===(t=this.locales)||void 0===t?void 0:t.map((t=>t.locale)))||void 0===i?void 0:i.map((t=>this.renderDropdownItem(t)))}renderDropdownItem(t){const i=this.getSelectedLanguageText(t);return o("calcite-dropdown-item",{key:t,selected:t===this.selectedLanguage,onCalciteDropdownItemSelect:this.calciteDropdownItemSelectCallback(t)},i)}calciteDropdownItemSelectCallback(t){return async()=>{var i,o,s,e,n;this.selectedLanguage=t;const{intl:a,selectedLanguage:r,t9nData:d,userLocale:c}=this,h=this.locales.filter((t=>t.locale===r))[0];r!==c&&(h.data=d[t]);const u=new URLSearchParams(window.location.search);if(r!==c?u.set("locale",this.selectedLanguage):u.delete("locale"),a.setLocale(r),this.view){const[t]=await l(["esri/WebMap"]),a=null===(o=null===(i=this.locales.filter((t=>t.locale===r)))||void 0===i?void 0:i[0])||void 0===o?void 0:o.webmap;if(a)this.view.map=new t({portalItem:{id:a}});else{const i=null===(n=null===(e=null===(s=this.view)||void 0===s?void 0:s.map)||void 0===e?void 0:e.portalItem)||void 0===n?void 0:n.id;i&&this.defaultWebMapId!==i&&(this.view.map=new t({portalItem:{id:this.defaultWebMapId}}))}}document.documentElement.setAttribute("lang",this.selectedLanguage),this.intl.prefersRTL()?document.documentElement.setAttribute("dir","rtl"):document.documentElement.setAttribute("dir","ltr"),window.history.replaceState({},"",decodeURIComponent(`${window.location.pathname}?${u}`)),this.selectedLanguageUpdated.emit(h)}}getSelectedLanguageText(t){const{messages:i}=this,o=null==i?void 0:i.translatedLanguageNames,s=null==i?void 0:i.languages;return`${null==o?void 0:o[t]} - ${null==s?void 0:s[t]}`}async refresh(){try{const t=await a(this.portalItem),i=await r(this.request,t);this.t9nData=i,this.selectedLanguageUpdated.emit({locale:this.selectedLanguage,data:i[this.selectedLanguage]})}catch(t){}}get el(){return s(this)}};d.style=":host{display:block;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);min-width:200px}:host calcite-dropdown{width:100%}:host calcite-button{--calcite-color-brand:var(--calcite-color-text-3);--calcite-color-brand-hover:var(--calcite-color-text-3)}";export{d as instant_apps_language_switcher}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,h as n,H as a,g as i}from"./p-78780f63.js";var e;!function(t){t.TopLeft="top-left",t.TopCenter="top-center",t.TopRight="top-right",t.CenterLeft="center-left",t.Center="center",t.CenterRight="center-right",t.BottomLeft="bottom-left",t.BottomCenter="bottom-center",t.BottomRight="bottom-right"}(e||(e={}));const s={s:" instant-apps-landing-page__icon-image-scale--s",m:" instant-apps-landing-page__icon-image-scale--m",l:" instant-apps-landing-page__icon-image-scale--l"},p=class{constructor(n){t(this,n),this.titleText=void 0,this.subtitleText=void 0,this.descriptionText=void 0,this.entryButtonText=void 0,this.iconImage=void 0,this.iconImageScale="m",this.iconImageAltText=void 0,this.alignment=e.Center,this.disableTransition=!0,this.backgroundImageSrc=void 0,this.open=!0,this.entryButtonScale="l"}render(){return n(a,null,this.renderLandingPageContent())}renderLandingPageContent(){const t=this.open?"":this.disableTransition?" instant-apps-landing-page--closed-no-transition":" instant-apps-landing-page--closed",a=this.getAlignmentClass();return n("div",{style:this.backgroundImageSrc?{backgroundSize:"cover",backgroundImage:`url("${this.backgroundImageSrc}")`,backgroundRepeat:"no-repeat"}:{},class:`instant-apps-landing-page${a}${t}${this.disableTransition?" instant-apps-landing-page__remove-transition":""}`},n("div",{class:"instant-apps-landing-page__content-container"},this.renderIconImage(),this.renderTitleText(),this.renderSubtitleText(),this.renderDescriptionText()),n("div",{class:"instant-apps-landing-page__button-container"},this.renderEntryButton(),n("slot",{name:"secondary-action"})))}renderIconImage(){return this.iconImage?n("img",{class:`instant-apps-landing-page__icon-image${this.getIconImageScale()}`,src:this.iconImage,alt:this.iconImageAltText}):null}renderTitleText(){return n("h1",{class:"instant-apps-landing-page__title-text"},this.titleText)}renderSubtitleText(){return n("span",{class:"instant-apps-landing-page__subtitle-text"},this.subtitleText)}renderDescriptionText(){return n("p",{class:"instant-apps-landing-page__description-text"},this.descriptionText)}renderEntryButton(){return n("calcite-button",{class:"instant-apps-landing-page__entry-button",onClick:()=>this.open=!1,scale:this.entryButtonScale,appearance:"outline-fill"},this.entryButtonText)}getAlignmentClass(){return` instant-apps-landing-page__alignment--${this.alignment}`}getIconImageScale(){const{iconImageScale:t}=this,{s:n,m:a,l:i}=s;return"l"===t?i:"s"===t?n:a}get el(){return i(this)}};p.style=":host{--instant-apps-landing-page-background-color:var(--calcite-color-brand);--instant-apps-landing-page-text-color:var(--calcite-color-text-inverse);--instant-apps-landing-page-entry-button-color:var(--calcite-color-brand);--instant-apps-landing-page-title-text-font-size:var(--calcite-font-size-6);--instant-apps-landing-page-subtitle-text-font-size:var(--calcite-font-size-3);--instant-apps-landing-page-description-text-font-size:var(--calcite-font-size-0);--instant-apps-landing-page-icon-image-scale--s:100px;--instant-apps-landing-page-icon-image-scale--m:250px;--instant-apps-landing-page-icon-image-scale--l:500px;--instant-apps-landing-page-entry-button-margin:0}:host .instant-apps-landing-page{box-sizing:border-box;position:absolute;top:0;left:0;z-index:9000;display:flex;flex-direction:column;width:100%;height:100%;padding:2.5%;transition:top 0.5s ease-in-out;background-color:var(--instant-apps-landing-page-background-color);color:var(--instant-apps-landing-page-text-color)}:host .instant-apps-landing-page__title-text{color:var(--instant-apps-landing-page-text-color);font-size:var(--instant-apps-landing-page-title-text-font-size);margin:0}:host .instant-apps-landing-page__subtitle-text{font-weight:var(--calcite-font-weight-medium);font-size:var(--instant-apps-landing-page-subtitle-text-font-size);text-align:center}:host .instant-apps-landing-page__description-text{font-size:var(--instant-apps-landing-page-description-text-font-size);width:50%;min-width:250px}:host .instant-apps-landing-page__title-text,:host .instant-apps-landing-page__subtitle-text{text-shadow:0px 4px 3px rgba(0, 0, 0, 0.4), 0px 8px 13px rgba(0, 0, 0, 0.1), 0px 18px 23px rgba(0, 0, 0, 0.1)}:host .instant-apps-landing-page__icon-image{margin-bottom:5px;max-width:50%}:host .instant-apps-landing-page__icon-image-scale--s{width:100px}:host .instant-apps-landing-page__icon-image-scale--m{width:250px}:host .instant-apps-landing-page__icon-image-scale--l{width:500px}:host .instant-apps-landing-page__button-container{display:flex}:host .instant-apps-landing-page__button-container .instant-apps-landing-page__entry-button{margin:var(--instant-apps-landing-page-entry-button-margin)}:host .instant-apps-landing-page__entry-button{--calcite-color-brand:var(--instant-apps-landing-page-entry-button-color);--calcite-color-brand-hover:var(--instant-apps-landing-page-entry-button-color);--calcite-color-brand-press:var(--instant-apps-landing-page-entry-button-color)}:host .instant-apps-landing-page__remove-transition{transition:none}:host .instant-apps-landing-page--closed-no-transition{display:none}:host .instant-apps-landing-page--closed{top:-100%}:host .instant-apps-landing-page__alignment--top-center{justify-content:flex-start;align-items:center}:host .instant-apps-landing-page__alignment--top-center .instant-apps-landing-page__content-container{display:flex;flex-direction:column;align-items:center;justify-content:center}:host .instant-apps-landing-page__alignment--top-center .instant-apps-landing-page__description-text{text-align:center}:host .instant-apps-landing-page__alignment--center{justify-content:center;align-items:center}:host .instant-apps-landing-page__alignment--center .instant-apps-landing-page__content-container{display:flex;flex-direction:column;align-items:center}:host .instant-apps-landing-page__alignment--center .instant-apps-landing-page__description-text{text-align:center}:host .instant-apps-landing-page__alignment--bottom-center{justify-content:flex-end;align-items:center}:host .instant-apps-landing-page__alignment--bottom-center .instant-apps-landing-page__content-container{display:flex;flex-direction:column;align-items:center}:host .instant-apps-landing-page__alignment--bottom-center .instant-apps-landing-page__description-text{text-align:center}:host .instant-apps-landing-page__alignment--top-left{justify-content:flex-start;align-items:flex-start}:host .instant-apps-landing-page__alignment--top-left .instant-apps-landing-page__description-text{text-align:left}:host .instant-apps-landing-page__alignment--center-left{justify-content:center;align-items:flex-start}:host .instant-apps-landing-page__alignment--center-left .instant-apps-landing-page__description-text{text-align:left}:host .instant-apps-landing-page__alignment--bottom-left{justify-content:flex-end;align-items:flex-start}:host .instant-apps-landing-page__alignment--bottom-left .instant-apps-landing-page__description-text{text-align:left}:host .instant-apps-landing-page__alignment--top-right{justify-content:flex-start;align-items:flex-end}:host .instant-apps-landing-page__alignment--top-right .instant-apps-landing-page__content-container{display:flex;flex-direction:column;align-items:flex-end}:host .instant-apps-landing-page__alignment--top-right .instant-apps-landing-page__description-text{text-align:right}:host .instant-apps-landing-page__alignment--center-right{justify-content:center;align-items:flex-end}:host .instant-apps-landing-page__alignment--center-right .instant-apps-landing-page__content-container{display:flex;flex-direction:column;align-items:flex-end}:host .instant-apps-landing-page__alignment--center-right .instant-apps-landing-page__description-text{text-align:right}:host .instant-apps-landing-page__alignment--bottom-right{justify-content:flex-end;align-items:flex-end}:host .instant-apps-landing-page__alignment--bottom-right .instant-apps-landing-page__content-container{display:flex;flex-direction:column;align-items:flex-end}:host .instant-apps-landing-page__alignment--bottom-right .instant-apps-landing-page__description-text{text-align:right}@media only screen and (max-width: 768px){:host .instant-apps-landing-page__icon-image{max-width:70%;margin-bottom:20px}:host .instant-apps-landing-page__description-text{width:80%}:host .instant-apps-landing-page__title-text{font-size:var(--calcite-font-size-3)}:host .instant-apps-landing-page__subtitle-text{font-size:var(--calcite-font-size-0)}:host .instant-apps-landing-page__content-container{display:flex;flex-direction:column;align-items:center;margin-top:auto}:host .instant-apps-landing-page__button-container{display:flex;flex-direction:column;width:100%;margin-top:auto}:host .instant-apps-landing-page__button-container .instant-apps-landing-page__entry-button{width:100%;margin-right:unset;margin-bottom:10px}}@media only screen and (max-width: 896px) and (orientation: landscape){:host .instant-apps-landing-page__icon-image{max-width:25%}}";export{p as instant_apps_landing_page}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,h as i,g as
|
6
|
+
import{r as t,h as i,g as o}from"./p-78780f63.js";import{g as n}from"./p-83225907.js";import"./p-a8a0187d.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-14a48b14.js";const s=class{constructor(i){t(this,i),this.popoverTitle=void 0,this.subtitle=void 0,this.content=void 0,this.imgSrc=void 0,this.imgAlt=void 0,this.mediaSrc=void 0,this.index=void 0,this.referenceElement=void 0,this.parent=void 0,this.placement="trailing-start",this.refId=void 0,this.pagination=!1,this.disableAction=!1,this.popoverAction=void 0,this.messages=void 0,this.messageOverrides=void 0}async componentDidLoad(){n(this),this.messages=Object.assign(Object.assign({},this.messages),this.messageOverrides)}componentDidUpdate(){this.popoverEl.referenceElement=this.referenceElement}render(){var t,o,n,s,a;return i("calcite-popover",{ref:t=>this.popoverEl=t,heading:this.popoverTitle,"auto-close":!0,placement:this.placement,messageOverrides:{close:null===(t=this.messages)||void 0===t?void 0:t.close},"trigger-disabled":!0,"ref-id":this.refId,closable:!0,referenceElement:this.referenceElement,label:this.popoverTitle},i("div",{class:"instant-apps-popover__content"+(this.disableAction?" instant-apps-popover--action-disabled":"")},this.disableAction?null:i("calcite-action",{key:"popover-action",class:"instant-apps-popover__action",onClick:this.popoverAction,icon:"rtl"===document.dir?"chevron-right":"chevron-left",compact:!0,"text-enabled":!0,text:(null===(o=this.messageOverrides)||void 0===o?void 0:o.popoverAction)?this.messageOverrides.popoverAction:this.messages.back}),i("section",null,i("span",{id:"subtitle"},this.subtitle),i("p",null,this.content),this.imgSrc?i("img",{key:`iac-popover-img-${this.refId}`,class:"instant-apps-popover__img",src:this.imgSrc,alt:this.imgAlt?this.imgAlt:""}):null),this.pagination?i("div",{key:`iac-popover-footer-${this.index}`,class:"instant-apps-popover__footer"},i("span",null,this.index+1," ",null===(n=this.messages)||void 0===n?void 0:n.of," ",null===(a=null===(s=this.parent)||void 0===s?void 0:s.instantAppsPopovers)||void 0===a?void 0:a.size),this.renderPagination()):null))}renderPagination(){var t,o;const{index:n,messages:s,parent:a}=this,e=n===(null===(o=null===(t=this.parent)||void 0===t?void 0:t.instantAppsPopovers)||void 0===o?void 0:o.size)-1;return i("div",{key:"pagination-button-container",class:"instant-apps-popover__button-container"},0===n?null:i("calcite-button",{key:"prev",onClick:()=>null==a?void 0:a.previous(),appearance:"outline",kind:"neutral"},null==s?void 0:s.back),i("calcite-button",{key:"next",onClick:()=>{e?null==a||a.done():null==a||a.next()}},e?null==s?void 0:s.done:null==s?void 0:s.next))}get el(){return o(this)}};s.style=":host{display:block}.instant-apps-popover__content{display:flex;flex-direction:column;padding:0 5% 5% 5%;max-width:35vw;font-family:var(--calcite-sans-family);font-size:0.875rem}.instant-apps-popover__content .instant-apps-popover__action{align-self:flex-start;--calcite-color-foreground-2:transparent}.instant-apps-popover__content span{display:inline-block;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);margin:0 0 10px 0;font-family:var(--calcite-sans-family)}.instant-apps-popover__content p{line-height:19.12px;margin:0;margin-bottom:10px;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.instant-apps-popover__content .instant-apps-popover__footer span{margin-bottom:0;font-weight:normal;font-size:0.875rem;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:first-child{--calcite-color-foreground-3:transparent}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:last-child{margin-left:5px}.instant-apps-popover__content .instant-apps-popover__img{width:100%;margin-bottom:10px}.instant-apps-popover__content.instant-apps-popover--action-disabled{padding:5%}.instant-apps-popover__content.instant-apps-popover--action-disabled #subtitle{margin:0 0 10px 0}";export{s as instant_apps_popover}
|
@@ -9,4 +9,4 @@ import{r as t,c as i,h as s,H as e,g as a}from"./p-78780f63.js";import{l as n}fr
|
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
10
10
|
* v2.0.0
|
11
11
|
*/
|
12
|
-
var d;c.style=':host{display:block}.c-container{display:inline-flex}.flex-1{flex:"1"}.padding-end-1{padding-inline-end:1rem}.w-50{width:50%}',function(t){t.valid="check-circle",t.invalid="exclamation-mark-triangle",t.idle="information"}(d||(d={}));const p=class{constructor(i){t(this,i),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=l(d,this.icon,this.status)}connectedCallback(){this.requestedIcon=l(d,this.icon,this.status)}render(){return s(e,{"calcite-hydrated-hidden":this.el.hidden},this.renderIcon(this.requestedIcon),s("slot",null))}renderIcon(t){if(t)return s("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:t,scale:"s"})}get el(){return a(this)}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}};p.style=":host([scale=m]),:host([scale=l]){--calcite-input-message-spacing-value:0.25rem}:host{visibility:hidden;box-sizing:border-box;display:flex;block-size:0px;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);visibility:visible;block-size:auto;opacity:1;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([scale=m]),:host([scale=l]){margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([status]){color:var(--calcite-color-text-1)}:host([status][scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([status][scale=m]){margin-block-start:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([status][scale=l]){margin-block-start:0.25rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}";const u=class{constructor(s){t(this,s),this.selectionLoadingChange=i(this,"selectionLoadingChange",7),this.sketchGraphicsChange=i(this,"sketchGraphicsChange",7),this.drawUndo=i(this,"drawUndo",7),this.drawRedo=i(this,"drawRedo",7),this.active=!1,this.drawMode=o.SKETCH,this.editGraphicsEnabled=!0,this.graphics=void 0,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.redoEnabled=!1,this.undoEnabled=!1,this._translations=void 0,this._selectionMode=void 0}graphicsWatchHandler(t,i){t&&t.length>0&&JSON.stringify(t)!==JSON.stringify(i)&&this._sketchGraphicsLayer&&(this._updateGraphicsSymbols(t),this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(t))}mapViewWatchHandler(t,i){t&&t!==i&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this._sketchWidget.cancel(),this._clearSketch()}render(){const t=this.drawMode===o.SKETCH?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return s(e,null,s("div",{class:this.drawMode===o.SKETCH?"border":"border esri-widget esri-sketch__panel"},s("div",{ref:t=>{this._sketchElement=t}}),s("div",{class:t},s("calcite-action",{disabled:!this.undoEnabled,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),s("calcite-action",{disabled:!this.redoEnabled,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo}))))}async _initModules(){const[t,i,s]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=t,this.Sketch=i,this.SketchViewModel=s}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){const t=this._translations.sketchLayer,i=this.mapView.map.layers.findIndex((i=>i.title===t));i>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(i):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:t,listMode:"hide"}),r.managedLayers.push(t),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initSketch(){const t={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};this._sketchWidget=new this.Sketch(Object.assign(Object.assign({},t),{container:this._sketchElement,creationMode:"single",visibleElements:{duplicateButton:!1,selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode===o.SKETCH}})),this._sketchViewModel=new this.SketchViewModel(Object.assign({},t)),this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol,this._sketchWidget.viewModel.pointSymbol=this.pointSymbol,this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol;let i=!1;this._sketchWidget.on("create",(t=>{"complete"===t.state&&(this.graphics=[t.graphic],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}),this.drawMode===o.REFINE&&(i=!0,this._sketchWidget.viewModel.create(t.tool))),"cancel"===t.state&&this.drawMode===o.REFINE&&i&&(i=!i,this._sketchWidget.viewModel.create(t.tool))})),this._sketchWidget.on("update",(t=>{var i;if(this.editGraphicsEnabled){const s=null===(i=null==t?void 0:t.toolEventInfo)||void 0===i?void 0:i.type;"reshape-stop"!==s&&"move-stop"!==s||(this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))}else this._sketchWidget.viewModel.cancel(),this._sketchViewModel.cancel()})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("undo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("redo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})}))}_clearSketch(){var t;this._sketchWidget.viewModel.cancel(),this.graphics=[],null===(t=this._sketchGraphicsLayer)||void 0===t||t.removeAll()}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout((()=>{1===this.graphics.length&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})}),100)}_updateGraphicsSymbols(t){const i=t[0].geometry.type,s="point"===i?this.pointSymbol:"polyline"===i?this.polylineSymbol:"polygon"===i?this.polygonSymbol:void 0;s&&t.forEach((t=>t.symbol=s))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};u.style=':host{display:block}.border{outline:1px solid var(--calcite-
|
12
|
+
var d;c.style=':host{display:block}.c-container{display:inline-flex}.flex-1{flex:"1"}.padding-end-1{padding-inline-end:1rem}.w-50{width:50%}',function(t){t.valid="check-circle",t.invalid="exclamation-mark-triangle",t.idle="information"}(d||(d={}));const p=class{constructor(i){t(this,i),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=l(d,this.icon,this.status)}connectedCallback(){this.requestedIcon=l(d,this.icon,this.status)}render(){return s(e,{"calcite-hydrated-hidden":this.el.hidden},this.renderIcon(this.requestedIcon),s("slot",null))}renderIcon(t){if(t)return s("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:t,scale:"s"})}get el(){return a(this)}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}};p.style=":host([scale=m]),:host([scale=l]){--calcite-input-message-spacing-value:0.25rem}:host{visibility:hidden;box-sizing:border-box;display:flex;block-size:0px;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);visibility:visible;block-size:auto;opacity:1;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([scale=m]),:host([scale=l]){margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([status]){color:var(--calcite-color-text-1)}:host([status][scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([status][scale=m]){margin-block-start:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([status][scale=l]){margin-block-start:0.25rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}";const u=class{constructor(s){t(this,s),this.selectionLoadingChange=i(this,"selectionLoadingChange",7),this.sketchGraphicsChange=i(this,"sketchGraphicsChange",7),this.drawUndo=i(this,"drawUndo",7),this.drawRedo=i(this,"drawRedo",7),this.active=!1,this.drawMode=o.SKETCH,this.editGraphicsEnabled=!0,this.graphics=void 0,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.redoEnabled=!1,this.undoEnabled=!1,this._translations=void 0,this._selectionMode=void 0}graphicsWatchHandler(t,i){t&&t.length>0&&JSON.stringify(t)!==JSON.stringify(i)&&this._sketchGraphicsLayer&&(this._updateGraphicsSymbols(t),this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(t))}mapViewWatchHandler(t,i){t&&t!==i&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this._sketchWidget.cancel(),this._clearSketch()}render(){const t=this.drawMode===o.SKETCH?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return s(e,null,s("div",{class:this.drawMode===o.SKETCH?"border":"border esri-widget esri-sketch__panel"},s("div",{ref:t=>{this._sketchElement=t}}),s("div",{class:t},s("calcite-action",{disabled:!this.undoEnabled,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),s("calcite-action",{disabled:!this.redoEnabled,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo}))))}async _initModules(){const[t,i,s]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=t,this.Sketch=i,this.SketchViewModel=s}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){const t=this._translations.sketchLayer,i=this.mapView.map.layers.findIndex((i=>i.title===t));i>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(i):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:t,listMode:"hide"}),r.managedLayers.push(t),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initSketch(){const t={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};this._sketchWidget=new this.Sketch(Object.assign(Object.assign({},t),{container:this._sketchElement,creationMode:"single",visibleElements:{duplicateButton:!1,selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode===o.SKETCH}})),this._sketchViewModel=new this.SketchViewModel(Object.assign({},t)),this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol,this._sketchWidget.viewModel.pointSymbol=this.pointSymbol,this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol;let i=!1;this._sketchWidget.on("create",(t=>{"complete"===t.state&&(this.graphics=[t.graphic],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}),this.drawMode===o.REFINE&&(i=!0,this._sketchWidget.viewModel.create(t.tool))),"cancel"===t.state&&this.drawMode===o.REFINE&&i&&(i=!i,this._sketchWidget.viewModel.create(t.tool))})),this._sketchWidget.on("update",(t=>{var i;if(this.editGraphicsEnabled){const s=null===(i=null==t?void 0:t.toolEventInfo)||void 0===i?void 0:i.type;"reshape-stop"!==s&&"move-stop"!==s||(this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))}else this._sketchWidget.viewModel.cancel(),this._sketchViewModel.cancel()})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("undo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("redo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})}))}_clearSketch(){var t;this._sketchWidget.viewModel.cancel(),this.graphics=[],null===(t=this._sketchGraphicsLayer)||void 0===t||t.removeAll()}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout((()=>{1===this.graphics.length&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})}),100)}_updateGraphicsSymbols(t){const i=t[0].geometry.type,s="point"===i?this.pointSymbol:"polyline"===i?this.polylineSymbol:"polygon"===i?this.polygonSymbol:void 0;s&&t.forEach((t=>t.symbol=s))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};u.style=':host{display:block}.border{outline:1px solid var(--calcite-color-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir="rtl"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0;justify-content:flex-start !important}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}';export{c as buffer_tools,p as calcite_input_message,u as map_draw_tools}
|