@esri/solutions-components 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. package/dist/assets/t9n/public-notification/resources.json +1 -1
  2. package/dist/assets/t9n/public-notification/resources_ar.json +5 -4
  3. package/dist/assets/t9n/public-notification/resources_bg.json +5 -4
  4. package/dist/assets/t9n/public-notification/resources_bs.json +5 -4
  5. package/dist/assets/t9n/public-notification/resources_ca.json +5 -4
  6. package/dist/assets/t9n/public-notification/resources_cs.json +5 -4
  7. package/dist/assets/t9n/public-notification/resources_da.json +5 -4
  8. package/dist/assets/t9n/public-notification/resources_de.json +5 -4
  9. package/dist/assets/t9n/public-notification/resources_el.json +5 -4
  10. package/dist/assets/t9n/public-notification/resources_en.json +1 -1
  11. package/dist/assets/t9n/public-notification/resources_es.json +5 -4
  12. package/dist/assets/t9n/public-notification/resources_et.json +5 -4
  13. package/dist/assets/t9n/public-notification/resources_fi.json +5 -4
  14. package/dist/assets/t9n/public-notification/resources_fr.json +5 -4
  15. package/dist/assets/t9n/public-notification/resources_he.json +5 -4
  16. package/dist/assets/t9n/public-notification/resources_hr.json +5 -4
  17. package/dist/assets/t9n/public-notification/resources_hu.json +5 -4
  18. package/dist/assets/t9n/public-notification/resources_id.json +5 -4
  19. package/dist/assets/t9n/public-notification/resources_it.json +5 -4
  20. package/dist/assets/t9n/public-notification/resources_ja.json +5 -4
  21. package/dist/assets/t9n/public-notification/resources_ko.json +5 -4
  22. package/dist/assets/t9n/public-notification/resources_lt.json +5 -4
  23. package/dist/assets/t9n/public-notification/resources_lv.json +5 -4
  24. package/dist/assets/t9n/public-notification/resources_nb.json +5 -4
  25. package/dist/assets/t9n/public-notification/resources_nl.json +5 -4
  26. package/dist/assets/t9n/public-notification/resources_pl.json +5 -4
  27. package/dist/assets/t9n/public-notification/resources_pt-BR.json +5 -4
  28. package/dist/assets/t9n/public-notification/resources_pt-PT.json +5 -4
  29. package/dist/assets/t9n/public-notification/resources_ro.json +5 -4
  30. package/dist/assets/t9n/public-notification/resources_ru.json +5 -4
  31. package/dist/assets/t9n/public-notification/resources_sk.json +5 -4
  32. package/dist/assets/t9n/public-notification/resources_sl.json +5 -4
  33. package/dist/assets/t9n/public-notification/resources_sr.json +5 -4
  34. package/dist/assets/t9n/public-notification/resources_sv.json +5 -4
  35. package/dist/assets/t9n/public-notification/resources_th.json +5 -4
  36. package/dist/assets/t9n/public-notification/resources_tr.json +5 -4
  37. package/dist/assets/t9n/public-notification/resources_uk.json +5 -4
  38. package/dist/assets/t9n/public-notification/resources_vi.json +5 -4
  39. package/dist/assets/t9n/public-notification/resources_zh-CN.json +5 -4
  40. package/dist/assets/t9n/public-notification/resources_zh-HK.json +5 -4
  41. package/dist/assets/t9n/public-notification/resources_zh-TW.json +5 -4
  42. package/dist/cjs/buffer-tools_4.cjs.entry.js +3 -3
  43. package/dist/cjs/calcite-input-text_5.cjs.entry.js +6 -11
  44. package/dist/cjs/{downloadUtils-4ef4b28b.js → downloadUtils-7a0fd3c0.js} +77 -20
  45. package/dist/cjs/{index.es-cbe67d5b.js → index.es-9965b78c.js} +1 -1
  46. package/dist/cjs/layer-table_2.cjs.entry.js +8 -3
  47. package/dist/cjs/loader.cjs.js +1 -1
  48. package/dist/cjs/public-notification.cjs.entry.js +56 -21
  49. package/dist/cjs/solutions-components.cjs.js +1 -1
  50. package/dist/collection/components/buffer-tools/buffer-tools.css +4 -0
  51. package/dist/collection/components/buffer-tools/buffer-tools.js +1 -1
  52. package/dist/collection/components/layer-table/layer-table.js +7 -2
  53. package/dist/collection/components/map-draw-tools/map-draw-tools.css +4 -0
  54. package/dist/collection/components/map-select-tools/map-select-tools.js +18 -1
  55. package/dist/collection/components/pdf-download/pdf-download.js +3 -9
  56. package/dist/collection/components/public-notification/public-notification.js +57 -21
  57. package/dist/collection/demos/new-public-notification.html +6 -4
  58. package/dist/collection/utils/downloadUtils.js +74 -19
  59. package/dist/collection/utils/downloadUtils.ts +93 -26
  60. package/dist/collection/utils/interfaces.ts +2 -2
  61. package/dist/components/buffer-tools2.js +2 -2
  62. package/dist/components/downloadUtils.js +75 -20
  63. package/dist/components/layer-table2.js +7 -2
  64. package/dist/components/map-draw-tools2.js +1 -1
  65. package/dist/components/map-select-tools2.js +3 -1
  66. package/dist/components/pdf-download2.js +3 -9
  67. package/dist/components/public-notification.js +57 -21
  68. package/dist/esm/buffer-tools_4.entry.js +3 -3
  69. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  70. package/dist/esm/calcite-input-text_5.entry.js +7 -12
  71. package/dist/esm/{downloadUtils-2ebeb46d.js → downloadUtils-a447bab1.js} +77 -22
  72. package/dist/esm/{index.es-6dd27a48.js → index.es-b9cb902a.js} +2 -2
  73. package/dist/esm/layer-table_2.entry.js +9 -4
  74. package/dist/esm/loader.js +1 -1
  75. package/dist/esm/{mapViewUtils-ebbd4733.js → mapViewUtils-27dfdc29.js} +1 -1
  76. package/dist/esm/public-notification.entry.js +57 -22
  77. package/dist/esm/solutions-components.js +1 -1
  78. package/dist/solutions-components/demos/new-public-notification.html +6 -4
  79. package/dist/solutions-components/p-2f4e1ddf.entry.js +6 -0
  80. package/dist/solutions-components/{p-657caece.js → p-345f517c.js} +5 -5
  81. package/dist/solutions-components/{p-390d7de8.js → p-4b426bab.js} +1 -1
  82. package/dist/solutions-components/{p-b4d4b50a.entry.js → p-52b747fa.entry.js} +3 -3
  83. package/dist/solutions-components/p-62492a2d.entry.js +17 -0
  84. package/dist/solutions-components/{p-ad82c173.js → p-80757ebd.js} +1 -1
  85. package/dist/solutions-components/p-cf00a2ef.entry.js +6 -0
  86. package/dist/solutions-components/{p-83e3db8e.entry.js → p-db099e05.entry.js} +1 -1
  87. package/dist/solutions-components/solutions-components.esm.js +1 -1
  88. package/dist/solutions-components/utils/downloadUtils.ts +93 -26
  89. package/dist/solutions-components/utils/interfaces.ts +2 -2
  90. package/dist/types/components/map-select-tools/map-select-tools.d.ts +5 -0
  91. package/dist/types/components/public-notification/public-notification.d.ts +18 -11
  92. package/dist/types/components.d.ts +8 -0
  93. package/dist/types/utils/downloadUtils.d.ts +22 -8
  94. package/dist/types/utils/interfaces.d.ts +2 -2
  95. package/package.json +1 -1
  96. package/dist/solutions-components/p-6f27bea2.entry.js +0 -17
  97. package/dist/solutions-components/p-db82a9ce.entry.js +0 -6
  98. package/dist/solutions-components/p-deb90ce7.entry.js +0 -6
@@ -15,6 +15,7 @@
15
15
  */
16
16
  /// <reference types="arcgis-js-api" />
17
17
  import { ILabel } from "./pdfUtils";
18
+ import { IExportInfos } from "../utils/interfaces";
18
19
  export { ILabel } from "./pdfUtils";
19
20
  interface ILayerRelationshipQuery {
20
21
  layer: __esri.FeatureLayer;
@@ -32,29 +33,25 @@ interface IRelatedFeaturesQuery {
32
33
  /**
33
34
  * Downloads csv of mailing labels for the provided list of ids
34
35
  *
35
- * @param selectionSetNames Names of the selection sets used to provide ids
36
- * @param layer Layer providing features and attributes for download
37
- * @param ids List of ids to download
36
+ * @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
38
37
  * @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
39
38
  * all attributes are exported
40
39
  * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
41
40
  * @param addColumnTitle Indicates if column headings should be included in output
42
41
  * @returns Promise resolving when function is done
43
42
  */
44
- export declare function downloadCSV(selectionSetNames: string[], layer: __esri.FeatureLayer, ids: number[], formatUsingLayerPopup: boolean, removeDuplicates?: boolean, addColumnTitle?: boolean): Promise<void>;
43
+ export declare function downloadCSV(exportInfos: IExportInfos, formatUsingLayerPopup: boolean, removeDuplicates?: boolean, addColumnTitle?: boolean): Promise<void>;
45
44
  /**
46
45
  * Downloads csv of mailing labels for the provided list of ids
47
46
  *
48
- * @param selectionSetNames Names of the selection sets used to provide ids
49
- * @param layer Layer providing features and attributes for download
50
- * @param ids List of ids to download
47
+ * @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
51
48
  * @param labelPageDescription Provides PDF page layout info
52
49
  * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
53
50
  * @param title Title for each page
54
51
  * @param initialImageDataUrl Data URL of image for first page
55
52
  * @returns Promise resolving when function is done
56
53
  */
57
- export declare function downloadPDF(selectionSetNames: string[], layer: __esri.FeatureLayer, ids: number[], labelPageDescription: ILabel, removeDuplicates?: boolean, title?: string, initialImageDataUrl?: string): Promise<void>;
54
+ export declare function downloadPDF(exportInfos: IExportInfos, labelPageDescription: ILabel, removeDuplicates?: boolean, title?: string, initialImageDataUrl?: string): Promise<void>;
58
55
  /**
59
56
  * Converts a set of fieldInfos into template lines.
60
57
  *
@@ -88,3 +85,20 @@ export declare function _createFilename(selectionSetNames: string[]): string;
88
85
  * and the query for that layer
89
86
  */
90
87
  export declare function _createRelationshipQueries(layer: __esri.FeatureLayer): ILayerRelationshipQueryHash;
88
+ /**
89
+ * Remove any duplicate labels
90
+ *
91
+ * @param labels Labels to evaluate for duplicates
92
+ * @returns labels with duplicates removed
93
+ */
94
+ export declare function removeDuplicateLabels(labels: string[][]): string[][];
95
+ /**
96
+ * Create and consolidate labels from all layers
97
+ *
98
+ * @param exportInfos Key details about what to export (ids, layer, and selectionSetNames)
99
+ * @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
100
+ * all attributes are exported
101
+ * @param includeHeaderNames Add the label format at the front of the list of generated labels
102
+ * @returns selectionSetNames that will be used for export filenames
103
+ */
104
+ export declare function consolidateLabels(exportInfos: IExportInfos, formatUsingLayerPopup?: boolean, includeHeaderNames?: boolean, isCSVExport?: boolean): Promise<string[][]>;
@@ -376,9 +376,9 @@ export interface IMapInfo {
376
376
  name: string;
377
377
  }
378
378
  export interface IExportInfos {
379
- [key: string]: IExportLayerInfo;
379
+ [key: string]: IExportInfo;
380
380
  }
381
- export interface IExportLayerInfo {
381
+ export interface IExportInfo {
382
382
  ids: number[];
383
383
  layerView: __esri.FeatureLayerView;
384
384
  selectionSetNames: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solutions-components",
3
- "version": "0.5.9",
3
+ "version": "0.5.10",
4
4
  "description": "Web Components for Esri's Solutions Applications",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1,17 +0,0 @@
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 i,c as t,h as e,H as s,g as a}from"./p-f8be5d5f.js";import{a as n,e as o,g as l,b as r}from"./p-dd3d070d.js";import{s as c,c as h,d,H as p}from"./p-bf0c6866.js";import{u}from"./p-c0d3537c.js";import{c as m,d as g,g as b}from"./p-24cb0a19.js";import{s as v,a as f,c as y}from"./p-5b5ad89d.js";import{c as w,d as x}from"./p-0d207a2c.js";import{c as k}from"./p-631b6461.js";import{C as z}from"./p-062f1fe7.js";import{u as _,c as L,d as S,s as D}from"./p-6bbf6f62.js";import{c as I,d as C}from"./p-a4f08a98.js";import{K as P}from"./p-7f76303e.js";import{l as M}from"./p-d7ddd3a2.js";import{g as j,h as A,q as N,a as O,b as G,c as H,d as W,e as E}from"./p-390d7de8.js";import{c as F,e as R,f as V}from"./p-92de1de9.js";import{s as T}from"./p-a29ba58a.js";import{a as q,g as Y}from"./p-fc2277fe.js";import{d as $,a as B}from"./p-657caece.js";import"./p-d1bcb992.js";import"./p-89e6a976.js";import"./p-4ff653eb.js";import"./p-e1a4994d.js";
7
- /*!
8
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
10
- * v1.2.0
11
- */const K=class{constructor(e){i(this,e),this.calciteInternalInputTextFocus=t(this,"calciteInternalInputTextFocus",7),this.calciteInternalInputTextBlur=t(this,"calciteInternalInputTextBlur",7),this.calciteInputTextInput=t(this,"calciteInputTextInput",7),this.calciteInputTextChange=t(this,"calciteInputTextChange",7),this.previousValueOrigin="initial",this.mutationObserver=k("mutation",(()=>this.setDisabledAction())),this.userChangedValue=!1,this.keyDownHandler=i=>{this.readOnly||this.disabled||(this.isClearable&&"Escape"===i.key&&(this.clearInputTextValue(i),i.preventDefault()),"Enter"!==i.key||i.defaultPrevented||c(this)&&i.preventDefault())},this.clearInputTextValue=i=>{this.setValue({committing:!0,nativeEvent:i,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{"user"===this.previousValueOrigin&&this.value!==this.previousEmittedValue&&(this.calciteInputTextChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputTextBlurHandler=()=>{this.calciteInternalInputTextBlur.emit({element:this.childEl,value:this.value}),this.emitChangeIfUserModified()},this.clickHandler=i=>{const t=n(this.el,"action");i.target!==t&&this.setFocus()},this.inputTextFocusHandler=()=>{this.calciteInternalInputTextFocus.emit({element:this.childEl,value:this.value})},this.inputTextInputHandler=i=>{this.disabled||this.readOnly||this.setValue({nativeEvent:i,origin:"user",value:i.target.value})},this.inputTextKeyDownHandler=i=>{this.disabled||this.readOnly||"Enter"===i.key&&this.emitChangeIfUserModified()},this.hiddenInputChangeHandler=i=>{i.target.name===this.name&&this.setValue({value:i.target.value,origin:"direct"}),i.stopPropagation()},this.setChildElRef=i=>{this.childEl=i},this.setInputValue=i=>{this.childEl&&(this.childEl.value=i)},this.setPreviousEmittedValue=i=>{this.previousEmittedValue=i},this.setPreviousValue=i=>{this.previousValue=i},this.setValue=({committing:i=!1,nativeEvent:t,origin:e,previousValue:s,value:a})=>{this.setPreviousValue(null!=s?s:this.value),this.previousValueOrigin=e,this.userChangedValue="user"===e&&a!==this.value,this.value=a,"direct"===e&&(this.setInputValue(a),this.setPreviousEmittedValue(a)),t&&(this.calciteInputTextInput.emit().defaultPrevented?this.value=this.previousValue:i&&this.emitChangeIfUserModified())},this.alignment="start",this.autofocus=!1,this.clearable=!1,this.disabled=!1,this.form=void 0,this.hidden=!1,this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.loading=!1,this.maxLength=void 0,this.minLength=void 0,this.name=void 0,this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.autocomplete=void 0,this.inputMode="text",this.enterKeyHint=void 0,this.pattern=void 0,this.suffixText=void 0,this.editingEnabled=!1,this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0,this.slottedActionElDisabledInternally=!1}disabledWatcher(){this.setDisabledAction()}onMessagesChange(){}valueWatcher(i,t){this.userChangedValue||this.setValue({origin:"direct",previousValue:t,value:i||""}),this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=o({},this.icon,"text")}get isClearable(){return this.clearable&&this.value.length>0}effectiveLocaleChange(){_(this,this.effectiveLocale)}connectedCallback(){var i;w(this),L(this),this.scale=l(this.el,"scale",this.scale),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),m(this),h(this),null===(i=this.mutationObserver)||void 0===i||i.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}disconnectedCallback(){var i;g(this),d(this),x(this),S(this),null===(i=this.mutationObserver)||void 0===i||i.disconnect(),this.el.removeEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}async componentWillLoad(){v(this),this.requestedIcon=o({},this.icon,"text"),await D(this)}componentDidLoad(){f(this)}componentDidRender(){u(this)}async setFocus(){var i;await y(this),null===(i=this.childEl)||void 0===i||i.focus()}async selectText(){var i;null===(i=this.childEl)||void 0===i||i.select()}onLabelClick(){this.setFocus()}onFormReset(){this.setValue({origin:"reset",value:this.defaultValue})}syncHiddenFormInput(i){null!=this.minLength&&(i.minLength=this.minLength),null!=this.maxLength&&(i.maxLength=this.maxLength)}setDisabledAction(){const i=n(this.el,"action");i&&(this.disabled?(null==i.getAttribute("disabled")&&(this.slottedActionElDisabledInternally=!0),i.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(i.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}render(){const i=r(this.el),t=e("div",{class:"loader"},e("calcite-progress",{label:this.messages.loading,type:"indeterminate"})),a=e("button",{"aria-label":this.messages.clear,class:"clear-button",disabled:this.disabled||this.readOnly,onClick:this.clearInputTextValue,tabIndex:-1,type:"button"},e("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"})),n=e("calcite-icon",{class:"icon",flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:"l"===this.scale?"m":"s"}),o=e("div",{class:"prefix"},this.prefixText),l=e("div",{class:"suffix"},this.suffixText),c=e("input",{"aria-label":b(this),autocomplete:this.autocomplete,autofocus:!!this.autofocus||null,class:{"editing-enabled":this.editingEnabled,"inline-child":!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:!!this.disabled||null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,maxLength:this.maxLength,minLength:this.minLength,name:this.name,onBlur:this.inputTextBlurHandler,onFocus:this.inputTextFocusHandler,onInput:this.inputTextInputHandler,onKeyDown:this.inputTextKeyDownHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,required:!!this.required||null,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:"text",value:this.value,ref:this.setChildElRef});return e(s,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},e("div",{class:{wrapper:!0,[z.rtl]:"rtl"===i}},this.prefixText?o:null,e("div",{class:"element-wrapper"},c,this.isClearable?a:null,this.requestedIcon?n:null,this.loading?t:null),e("div",{class:"action-wrapper"},e("slot",{name:"action"})),this.suffixText?l:null,e(p,{component:this})))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{disabled:["disabledWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}};K.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}:host input{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}:host input::placeholder,:host input:-ms-input-placeholder,:host input::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}:host input:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}:host input[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}:host input[readonly]:focus{color:var(--calcite-ui-text-1)}:host calcite-icon{color:var(--calcite-ui-text-3)}input{outline-color:transparent}input:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host([status=invalid]) input{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:-2px}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{-webkit-padding-start:2rem;padding-inline-start:2rem}:host([icon][scale=m]) input{-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}:host([icon][scale=l]) input{-webkit-padding-start:3.5rem;padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;z-index:1;display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) input{text-align:start}:host([alignment=end]) input{text-align:end}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}.inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.inline-child .editing-enabled{background-color:inherit}.inline-child:not(.editing-enabled){display:flex;cursor:pointer;border-color:transparent;-webkit-padding-start:0;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
12
- /*!
13
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
15
- * v1.2.0
16
- */
17
- const J="actions-end",U=class{constructor(e){i(this,e),this.calciteNoticeClose=t(this,"calciteNoticeClose",6),this.calciteNoticeOpen=t(this,"calciteNoticeOpen",6),this.close=()=>{this.open=!1,this.calciteNoticeClose.emit()},this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=o(P,this.icon,this.kind)}connectedCallback(){I(this),w(this),L(this)}disconnectedCallback(){C(this),x(this),S(this)}async componentWillLoad(){v(this),this.requestedIcon=o(P,this.icon,this.kind),await D(this)}componentDidLoad(){f(this)}render(){const{el:i}=this,t=e("button",{"aria-label":this.messages.close,class:"notice-close",onClick:this.close,ref:i=>this.closeButton=i},e("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"})),s=n(i,J);return e("div",{class:"container"},this.requestedIcon?e("div",{class:"notice-icon"},e("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:"l"===this.scale?"m":"s"})):null,e("div",{class:"notice-content"},e("slot",{name:"title"}),e("slot",{name:"message"}),e("slot",{name:"link"})),s?e("div",{class:"actions-end"},e("slot",{name:J})):null,this.closable?t:null)}async setFocus(){await y(this);const i=this.el.querySelector("calcite-link");(this.closeButton||i)&&(i?i.setFocus():this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){_(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}};U.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;-webkit-border-start:0px solid;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);-webkit-margin-end:var(--calcite-notice-spacing-token-small);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){-webkit-padding-start:var(--calcite-notice-spacing-token-large);padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-color:var(--calcite-ui-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-color:var(--calcite-ui-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-ui-warning)}";const Q=class{constructor(e){i(this,e),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.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)||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}distanceChanged(i){this._distanceChanged(i.detail)}unitChanged(i){i.detail.newValue!==i.detail.oldValue&&(this._unit=i.detail.newValue,this._updateLabel())}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){return this._init()}render(){return e(s,null,this._getMapLayerPicker(),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("div",{class:"search-widget",ref:i=>{this._searchElement=i}}),e("div",{class:"padding-top-1"},e("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()),e("div",{class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){var i,t;const s=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 e("div",null,e("div",{class:"padding-top-1 display-flex"},e("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},e("div",{class:"tooltip-container"},this._translations.searchDistance,e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"search-distance-icon",scale:"s"}))),e("calcite-popover",{closable:!0,label:"",referenceElement:"search-distance-icon"},e("span",{class:"tooltip-message"},this._translations.useSearchDistanceTootip)),e("calcite-switch",{checked:this._searchDistanceEnabled,onCalciteSwitchChange:()=>this._searchDistanceEnabled=!this._searchDistanceEnabled})),e("div",{class:s},e("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 e("div",null,e("div",{class:"padding-top-1 display-flex"},e("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},e("div",{class:"tooltip-container"},this._translations.useLayerFeatures,e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"use-layer-features-icon",scale:"s"}))),e("calcite-popover",{closable:!0,label:"",referenceElement:"use-layer-features-icon"},e("span",{class:"tooltip-message"},this._translations.useLayerFeaturesTooltip)),e("calcite-switch",{checked:this._useLayerFeaturesEnabled,onCalciteSwitchChange:()=>{this._useLayerFeaturesEnabledChanged()}})),e("div",{class:i+" padding-top-1"},e("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedLayerIds:this.layerViews.map((i=>i.layer.id)),selectionMode:"single"})))}_getNumSelected(){const i=q(this.el),t=i&&"en"===i?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return e("div",{class:"padding-top-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?e("div",null,e("calcite-loader",{class:"info-blue",inline:!0,label:t,scale:"m",type:"indeterminate"})):e("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),e("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 e("div",{class:"padding-sides-1 padding-top-1 "+(this.customLabelEnabled?"":"display-none")},e("calcite-label",{class:"font-bold"},this._translations.listName,e("calcite-input",{onInput:()=>{this._selectionLabel=this._labelName.value},placeholder:this._translations.listNamePlaceholder,ref:i=>{this._labelName=i},value:this._selectionLabel||""})))}_getMapLayerPicker(){return e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-label",{class:"font-bold width-full label-margin-0"},this._translations.inputLayer,e("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>this._inputLayerSelectionChange(i),selectedLayerIds:this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet?[this.selectionSet.layerView.layer.id]:[],selectionMode:"single"})))}async _initModules(){const[i,t,e,s,a]=await M(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=e,this._geometryEngine=s,this.FeatureLayer=a}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),this._initSearchWidget()}async _initSelectionSet(){var i,t,e,s,a;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=[...(null===(e=this.selectionSet)||void 0===e?void 0:e.graphics)||[]],this._selectionLabel=null===(s=this.selectionSet)||void 0===s?void 0:s.label,this._useLayerFeaturesEnabled||null===(a=this._drawTools)||void 0===a||a.updateGraphics(),await j(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.on("search-clear",(()=>{const i=this._searchClearLabel();this._clearResults(!1,i)})),this._searchWidget.on("select-result",(i=>{var t,e;if(i.result){this._searchResult=i.result;const s=(null===(e=null===(t=i.source)||void 0===t?void 0:t.layer)||void 0===e?void 0:e.id)&&i.source.layer.id===this.selectLayerView.layer.id,a=s?[i.result.feature.getObjectId()]:void 0;this._workflowType=F.SEARCH,this._updateLabel();const n=[i.result.feature];this._updateSelection(n,s,a),this._drawTools.graphics=n,this._drawTools.updateGraphics()}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 e=null==i?void 0:i.sources;return(null==e?void 0:e.length)>0?(i.includeDefaultSources=!1,e.forEach((i=>{var e,s;if(i.hasOwnProperty("layer")){const a=i,n=null===(e=a.layer)||void 0===e?void 0:e.id,o=n?t.map.findLayerById(n):null,l=null===(s=null==a?void 0:a.layer)||void 0===s?void 0:s.url;o?a.layer=o:l&&(a.layer=new this.FeatureLayer(l))}})),null==e||e.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"}),T.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 e=i.detail.graphics;if(e.length>0&&e[0])if(t||(this._sketchGraphic=e[0]),this._workflowType=this._useLayerFeaturesEnabled?F.SELECT:F.SKETCH,this._workflowType===F.SKETCH&&this._drawTools.updateGraphics(),this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(e)?e.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=e.reduce(((i,t)=>{var e;return(null===(e=null==t?void 0:t.layer)||void 0===e?void 0:e.objectIdField)?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i}),[]),s=i.detail.useOIDs&&t.length>0;this._updateSelection(e,s,t),s&&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){T.removeHandles(),i.length>0&&T.highlightHandles.push(await A(i,this.selectLayerView,this.mapView)),this._numSelected=i.length,this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectionLoading=!0,this._selectedIds=await N(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,e=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),e=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();this._distanceChanged({oldValue:t,newValue:e})}_geomQuery(i){const t=O(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){var e;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(),T.removeHandles(),(null===(e=this._drawTools)||void 0===e?void 0:e.clear)&&(this._graphics=[],await this._drawTools.clear()),this.selectionSetChange.emit(this._selectedIds.length)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,e){this._selectedIds=t&&e?e:this._selectedIds,this._skipGeomOIDs=t?e:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}_updateLabel(){var i,t;const e=this._selectionLabel.indexOf(this._translations.sketch)>-1,s=this._selectionLabel.indexOf(this._translations.select)>-1,a=this._selectionLabel.indexOf(null===(i=this._searchResult)||void 0===i?void 0:i.name)>-1,n=this._workflowType===F.SEARCH?null===(t=this._searchResult)||void 0===t?void 0:t.name:this._workflowType===F.SELECT?this._translations.select:this._translations.sketch,o=this._unit?this._unit:this._bufferTools.unit,l=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=e||s||a||!this._selectionLabel?`${n} ${l} ${o}`: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=>G(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 e=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";this.selectLayerView&&e===this.selectLayerView.layer.id||(this.selectLayerView=await G(this.mapView,e),this._updateLabel(),await this._highlightWithOIDsOrGeoms())}_distanceChanged(i){i.newValue!==i.oldValue&&(this._distance=i.newValue,this._updateLabel())}async _selectLayerFeatures(i){this._selectionLoading=!0;const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],H(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((e=>{t=t.concat(i[e])}))}));let e=!1;t.forEach((i=>{var t;const s=i.geometry;i.symbol="point"===s.type?this.sketchPointSymbol:"polyline"===s.type?this.sketchLineSymbol:"polygon"===s.type?this.sketchPolygonSymbol:void 0,e=(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.hasOwnProperty("objectIdField"))||i.hasOwnProperty("getObjectId")}));const s=this.layerViews[0].layer.title===this.selectLayerView.layer.title&&e;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:s}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await Y(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};Q.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{-webkit-border-end:1px solid var(--calcite-ui-border-2);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{-webkit-padding-start:0.5rem;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 X=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}}]}),Z=class{constructor(t){i(this,t),this.disabled=!1,this._translations=void 0}async downloadCSV(i,t,e=!0){Object.keys(i).forEach((s=>{const a=i[s];$(a.selectionSetNames,a.layerView.layer,a.ids,!0,t,e)}))}async downloadPDF(i,t=!1,e="",s=""){Object.keys(i).forEach((a=>{const n=i[a];B(n.selectionSetNames,n.layerView.layer,n.ids,this._labelInfoElement.selectedOption.value,t,e,s)}))}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return e(s,null,e("calcite-select",{disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}},this._renderItems()))}async _initModules(){const[i]=await M(["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 Y(this.el);this._translations=i[0]}_renderItems(){return(X.default||X).sort(((i,t)=>{const e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),s=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<s?-1:e>s?1:0})).map((i=>e("calcite-option",{value:i},this._getLabelSizeText(i))))}get el(){return a(this)}};Z.style=":host{display:block}";const ii=class{constructor(e){i(this,e),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=R.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 e(s,null,e("div",{class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},e("div",{class:"display-flex"},e("calcite-label",{class:"font-bold width-full label-margin-0"},e("div",{class:"display-flex"},this._translations.inputLayer,e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"refine-input-layer",scale:"s"})),e("map-layer-picker",{enabledLayerIds:this._enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},ref:i=>{this._layerPicker=i},selectedLayerIds:[this._refineLayer.layer.id],selectionMode:"single"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"refine-input-layer"},e("span",{class:"tooltip-message"},this._translations.inputLayerTip)))),e("div",{class:"padding-1"},e("div",{class:"padding-bottom-1"},e("calcite-segmented-control",{class:"w-100"},e("calcite-segmented-control-item",{checked:this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(R.ADD),value:R.ADD},this._translations.add),e("calcite-segmented-control-item",{checked:!this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(R.REMOVE),value:R.REMOVE},this._translations.remove))),e("div",null,e("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})),e("br",null),e("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){var t;const e=null===(t=i.detail)||void 0===t?void 0:t.graphics[0].geometry;this._selectFeatures(e)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{var e;const s=null===(e=null==t?void 0:t.layerView)||void 0===e?void 0:e.layer.id;return s&&i.indexOf(s)<0?i.push(s):t.workflowType===F.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===F.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 e={};e[i]={addIds:[],removeIds:[],layerView:await G(this.mapView,i)},t?t.refineInfos=Object.assign(Object.assign({},t.refineInfos),e):(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:F.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:e,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===R.ADD?R.REMOVE:R.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===R.ADD?R.REMOVE:R.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===F.REFINE)return t=i,!0}));let s=0,a=0;return Object.keys(t.refineInfos).forEach((i=>{s+=t.refineInfos[i].addIds.length,a+=t.refineInfos[i].removeIds.length})),[e("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",s.toString()),"non-interactive":!0}),e("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),e("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getTotal(i){const t=W(i);return Object.keys(t).reduce(((i,e)=>i+t[e].ids.length),0)}async _getTranslations(){const i=await Y(this.el);this._translations=i[0]}async _selectFeatures(i){var t,e;this.selectionLoadingChange.emit(!0),this._featuresCollection[null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id]=[];const s=await H(0,null===(e=this._refineLayer)||void 0===e?void 0:e.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let a=[];Object.keys(s).forEach((i=>{var t;i===(null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id)&&(a=a.concat(s[i]))}));const n=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(n,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),T.highlightHandles=await E(this.selectionSets)}_clearHighlight(){T.removeHandles()}async _updateIds(i,t,e,s){let a=!1;const n=this._refineSelectionSet.refineInfos,o=s.layer.id,l={};l[o]={addIds:[],removeIds:[],layerView:s};const r=Object.keys(n).indexOf(o)>-1?n[o]:l[o];if(t===R.ADD)r.addIds=[...new Set([...i,...r.addIds])],r.addIds.length>0&&e.push({ids:i,mode:t,layerView:s}),r.removeIds.length>0&&(r.removeIds=r.removeIds.filter((t=>i.indexOf(t)<0)));else{const n=this.selectionSets.reduce(((t,e)=>(i.forEach((i=>{e.workflowType!==F.REFINE?e.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(e.refineInfos).some((a=>{const n=e.refineInfos[a];if(n.layerView.layer.id===s.layer.id&&n.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);r.removeIds=[...new Set([...n,...r.removeIds])],r.addIds=r.addIds.filter((i=>n.indexOf(i)<0)),r.removeIds.length>0&&e.push({ids:n,mode:t,layerView:s}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==F.REFINE&&t.layerView.layer.id===s.layer.id?(t.selectedIds=t.selectedIds.filter((i=>r.removeIds.indexOf(i)<0)),t.selectedIds.length>0?i.push(t):a=!0):i.push(t),i)),[])}this._refineSelectionSet.refineInfos[o]=r,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}get el(){return a(this)}};ii.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{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}';export{K as calcite_input_text,U as calcite_notice,Q as map_select_tools,Z as pdf_download,ii as refine_selection}
@@ -1,6 +0,0 @@
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 e,H as s,g as l}from"./p-f8be5d5f.js";import{a,b as n,c as o}from"./p-92de1de9.js";import{l as d}from"./p-d7ddd3a2.js";import{g as c,h as r}from"./p-390d7de8.js";import{s as h}from"./p-a29ba58a.js";import{g as p}from"./p-fc2277fe.js";import"./p-4ff653eb.js";import"./p-e1a4994d.js";const g=class{constructor(e){t(this,e),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._numSelected=0,this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._addMap=!1,this._addTitle=!1,this._downloadActive=!0,this._exportType=a.PDF,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}async mapViewWatchHandler(t){(null==t?void 0:t.popup)&&(this._popupsEnabled=null==t?void 0:t.popup.autoOpenEnabled)}async watchSearchConfigurationHandler(t,i){const e=JSON.stringify(t);e!==JSON.stringify(i)&&(this._searchConfiguration=JSON.parse(e),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){var e;if(this._checkPopups(),(null===(e=this.mapView)||void 0===e?void 0:e.popup)&&(this.mapView.popup.autoOpenEnabled=t===n.LIST&&this._popupsEnabled),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols()}render(){return e(s,null,e("calcite-shell",null,e("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async _initModules(){const[t,i]=await d(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils"]);this._geometryEngine=t,this._jsonUtils=i}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_getActionGroup(t,i,s){return e("calcite-action-group",{class:"action-center"+(this.showRefineSelection?" w-1-3":" w-1-2"),layout:"horizontal"},e("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""}),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},e("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1"),t?this._getSelectionSetList():null,e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},this._translations.add)))}_getSelectionSetList(){return e("div",{class:"padding-top-1-2 padding-bottom-1-2"},e("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{var l;const a=this._getSelectionSetIds(i);let n=!0;return i.workflowType===o.REFINE&&(n=Object.keys(i.refineInfos).reduce(((t,e)=>{const s=i.refineInfos[e];return t+(s.addIds.length+s.removeIds.length)}),0)>0),n&&t.push(e("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",a.length.toString()),label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(l=null==i?void 0:i.layerView)||void 0===l?void 0:l.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",a.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==o.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,e)=>[...i,...t.refineInfos[e].addIds]),[])}_hasSelections(t=!1){let i=[];const e=this._selectionSets.some((t=>{if(t.workflowType===o.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&e?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}_hasDuplicates(){const t=this._getSelectedIds();return this._getNumDuplicates(t)>0}_getNumDuplicates(t){return t.length-new Set(t).size}_getSelectedIds(){return this._selectionSets.reduce(((t,i)=>t.concat(i.download?i.selectedIds:[])),[])}_getSelectPage(){const t=this._translations.selectSearchTip;return e("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t),e("div",null,e("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.selectionLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._getNumDuplicates(this._getSelectedIds());return e("calcite-panel",null,e("div",null,this._getLabel(this._translations.export,!1),t?e("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),e("div",{class:"padding-sides-1"},e("div",{class:"display-flex"},e("calcite-label",{layout:"inline"},e("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),e("div",{class:"display-flex"},this._translations.removeDuplicate,e("div",{class:"info-message padding-start-1-2"},e("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",i.toString())}`)))),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"remove-duplicates-icon",scale:"s"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},e("span",{class:"tooltip-message"},this._translations.duplicatesTip))),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t)},e("calcite-segmented-control-item",{checked:this._exportType===a.PDF,class:"w-50 end-border",value:a.PDF},this._translations.pdf),e("calcite-segmented-control-item",{checked:this._exportType===a.CSV,class:"w-50",value:a.CSV},this._translations.csv))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive,onClick:()=>{this._export()},width:"full"},this._translations.export))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none";return e("div",{class:this._exportType===a.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:"padding-sides-1"},e("pdf-download",{disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.addTitle)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",placeholder:this._translations.titlePlaceholder,ref:t=>{this._title=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._addMap=!this._addMap}),this._translations.includeMap)))}_getRefinePage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?e("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),e("refine-selection",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,l,a,n){return e("div",null,e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},t)),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:a,onClick:n,width:"full"},l)))}_getNotice(t,i="padding-1"){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{const s=this._getSelectionSetIds(i),l=i.workflowType!==o.REFINE||s.length>0;return!this._downloadActive&&i.download&&l&&(this._downloadActive=!0),l&&t.push(e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),e("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},e("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",s.length.toString()),disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}})))),t}),[])||e("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((e=>(e.download=e.id===t?!e.download:e.download,i=!!e.download||i,e))),this._downloadActive=i,await this._highlightFeatures()}async _export(){const t=this._getSelectionIdsAndViews(this._selectionSets,!0);if(this._exportType===a.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=null==t?void 0:t.dataUrl}this._downloadTools.downloadPDF(t,this._removeDuplicates.checked,this._addTitle?this._title.value:"",i)}this._exportType===a.CSV&&this._downloadTools.downloadCSV(t,this._removeDuplicates.checked)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var e;if(i.workflowType===o.REFINE)Object.keys(i.refineInfos).forEach((e=>{const s=i.refineInfos[e];s.addIds&&(t=this._updateExportInfos(t,s.layerView.layer.id,i.label,s.addIds,s.layerView))}));else{const s=null===(e=null==i?void 0:i.layerView)||void 0===e?void 0:e.layer.id;t=this._updateExportInfos(t,s,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,e,s,l){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...s])],t[i].selectionSetNames.push(e)):i&&(t[i]={ids:s,layerView:l,selectionSetNames:[e]}),t}_getAction(t,i,s,l,a=!1,n=""){return e("calcite-action",{disabled:!t,icon:i,indicator:a,onClick:l,slot:n,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){var t,i;const e=await(null===(t=this._selectTools)||void 0===t?void 0:t.getSelection()),s=null===(i=this._selectTools)||void 0===i?void 0:i.isUpdate;return this._selectionSets=s?this._selectionSets.map((t=>t.id===e.id?e:t)):[...this._selectionSets,e],this._home()}async _clearSelection(){var t;await(null===(t=this._selectTools)||void 0===t?void 0:t.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,e)=>{if(e!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){c(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===o.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let e=0;e<i.length;e++){const s=t[i[e]];h.highlightHandles.push(await r(s.ids,s.layerView,this.mapView))}}_checkPopups(){var t;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(t=this.mapView)||void 0===t?void 0:t.popup.autoOpenEnabled)}_clearHighlight(){h&&h.highlightHandles&&h.removeHandles()}async _getTranslations(){const t=await p(this.el);this._translations=t[0]}get el(){return l(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};g.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{-webkit-padding-before:1rem;padding-block-start:1rem;-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-sides-1{-webkit-padding-start:1rem;padding-inline-start:1rem;-webkit-padding-end:1rem;padding-inline-end:1rem}.padding-end-1-2{-webkit-padding-end:.5rem;padding-inline-end:.5rem}.padding-top-1-2{-webkit-padding-before:.5rem;padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-ui-border-2)}.margin-sides-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.margin-start-1-2{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{-webkit-margin-before:0 !important;margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-ui-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-ui-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{-webkit-margin-before:0.125rem;margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}';export{g as public_notification}
@@ -1,6 +0,0 @@
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 e,g as s,c as a}from"./p-f8be5d5f.js";import{l as o}from"./p-d7ddd3a2.js";import{g as l}from"./p-fc2277fe.js";import{i as n,b as c,g as h,j as r}from"./p-390d7de8.js";import{d}from"./p-657caece.js";import{g as p}from"./p-92de1de9.js";import"./p-e1a4994d.js";const m=class{constructor(i){t(this,i),this._fieldNames=[],this._graphics=[],this.onTableNodeCreate=t=>{this._tableNode=t,this._getTable(t)},this.mapView=void 0,this._layerView=void 0,this._selectedIndexes=[],this._translations=void 0}async mapViewWatchHandler(){const t=await n(this.mapView);this._layerView=await c(this.mapView,t[0])}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return this._layerView?i(e,null,this._getTableControlRow(),i("div",{class:"table-div width-full"},i("calcite-panel",{class:"height-full width-full"},i("div",{ref:this.onTableNodeCreate}))),i("edit-record-modal",{ref:t=>this._editMultipleMpdal=t})):null}async _initModules(){const[t]=await o(["esri/widgets/FeatureTable"]);this.FeatureTable=t}_getTableControlRow(){const t=this._selectedIndexes.length>0,e=this._selectedIndexes.length>1;return i("div",{class:"display-flex table-border"},i("map-layer-picker",{mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t)}),i("div",null,i("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"magnifying-glass",onClick:()=>this._zoom()},this._translations.zoom),i("calcite-button",{appearance:"transparent",color:"neutral",disabled:!e,iconStart:"pencil",onClick:()=>this._editMultiple()},this._translations.editMultiple),i("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"trash",onClick:()=>this._delete()},this._translations.delete),i("calcite-split-button",{appearance:"transparent",color:"neutral","primary-text":this._translations.more},i("calcite-dropdown-group",{"selection-mode":"none"},i("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll(!0)},this._translations.selectAll),i("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._showSelected()},this._translations.showSelected),i("calcite-dropdown-item",{iconStart:"erase",onClick:()=>this._clearSelection()},this._translations.clearSelection),i("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._switchSelected()},this._translations.switchSelected),i("calcite-dropdown-item",{iconStart:"export",onClick:()=>this._exportToCSV()},this._translations.exportCSV)))))}_getTable(t){var i;(null===(i=this._layerView)||void 0===i?void 0:i.layer)&&(this._table=new this.FeatureTable({layer:this._layerView.layer,view:this.mapView,editingEnabled:!0,highlightOnRowSelectEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},container:t}))}_selectAll(t){this._selectedIndexes=t?this._graphics.map(((t,i)=>i)):[]}_showSelected(){console.log("_showSelected")}_clearSelection(){this._selectedIndexes=[]}_switchSelected(){const t=[...this._selectedIndexes];this._selectedIndexes=this._graphics.reduce(((i,e,s)=>(t.indexOf(s)<0&&i.push(s),i)),[])}_exportToCSV(){d([],this._layerView.layer,this._getSelectedIds(),!1,!1,!0)}_zoom(){const t=this._getSelectedIds();h(t,this._layerView,this.mapView,!0)}_editMultiple(){this._editMultipleMpdal.open=!0}_delete(){console.log("delete")}_getGraphics(t){return this._graphics.filter(((i,e)=>t.indexOf(e)>-1))}_getSelectedIds(){return this._getGraphics(this._selectedIndexes).map((t=>t.getObjectId()))}_rowSelected(t){const i=this._selectedIndexes.indexOf(t);i>-1?(this._selectedIndexes.splice(i,1),this._selectedIndexes=[...this._selectedIndexes]):this._selectedIndexes=[...this._selectedIndexes,t]}async _layerSelectionChanged(t){const i=t.detail[0];this._layerView=await c(this.mapView,i),this._fieldNames=this._layerView.layer.fields.map((t=>t.alias||t.name)),this._graphics=await r(0,this._layerView.layer,[]),this._selectedIndexes=[],this._table.layer=this._layerView.layer,this._table.render()}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};m.style=":host{display:block}.table-div{height:calc(100% - 35px)}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}";const u=class{constructor(i){t(this,i),this.expandMap=a(this,"expandMap",7),this.mapChanged=a(this,"mapChanged",7),this._loadedId="",this.mapInfos=[],this.mapView=void 0,this._mapListExpanded=!1,this._translations=void 0,this._webMapId=""}_webMapIdWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._loadMap(t)}mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._loadMap(t[0].id)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidRender(){this._loadMap(this._webMapId)}render(){return i(e,null,this._getToolbar(),this._getMapNameList(this._mapListExpanded),i("div",{class:"map-height",ref:t=>this._mapDiv=t}))}async _initModules(){const[t,i]=await o(["esri/WebMap","esri/views/MapView"]);this.WebMap=t,this.MapView=i}_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(),this._getActionGroup("home",!1,this._translations.home,(()=>this._goHome())),this._getActionGroup("list",!1,this._translations.list,(()=>this._showList())),this._getActionGroup("magnifying-glass-plus",!1,this._translations.search,(()=>this._search())),this._getActionGroup("plus",!1,this._translations.zoomIn,(()=>this._zoomIn())),this._getActionGroup("minus",!1,this._translations.zoomOut,(()=>this._zoomOut())),this._getActionGroup("expand",!1,this._translations.expand,(()=>this._expand()))))}_loadMap(t){if(""===t&&this.mapInfos.length>0&&(t=this.mapInfos[0].id),this._loadedId!==t){const i=new this.WebMap({portalItem:{id:t}});this.mapView=new this.MapView({container:this._mapDiv,map:i,resizeAlign:"top-left"}),this._loadedId=t,this.mapChanged.emit(this.mapView)}}_getActionGroup(t,e,s,a){return i("calcite-action-group",{class:"action-center width-1-6",layout:"horizontal"},i("calcite-action",{alignment:"center",class:"width-full height-full",compact:!1,disabled:e,icon:t,id:t,onClick:a,text:""},i("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},i("span",null,s)))}_getMapPicker(){const t=this._mapListExpanded?"chevron-up":"chevron-down";return i("calcite-action-group",{class:"action-center width-1-6",layout:"horizontal"},i("calcite-block",{class:"action-center block-button width-full height-full display-grid",heading:"",onClick:()=>this._chooseMap()},i("calcite-icon",{icon:"map",scale:"s",slot:"icon"}),i("calcite-icon",{icon:t,scale:"s",slot:"icon"}),i("calcite-tooltip",{label:"",placement:"bottom"},i("span",null,this._translations.mapName))))}_getMapNameList(t){return i("div",{class:t?"map-list":"display-none"},i("calcite-pick-list",{id:"mapList"},this.mapInfos.map((t=>i("calcite-pick-list-item",{label:t.name,onClick:()=>this._webMapSelected(t.id),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapId=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}_goHome(){alert("go home")}_showList(){alert("show list")}_search(){alert("search")}_zoomIn(){alert("zoom in")}_zoomOut(){alert("zoom out")}_expand(){this.expandMap.emit(p.EXPAND)}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{_webMapId:["_webMapIdWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};u.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.action-bar-size{height:3.5rem;width:100%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.width-1-7{width:14.28%}.width-1-6{width:16.66%}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.display-grid{display:inline-grid}.block-button{border-bottom:0}.block-button:hover{background-color:var(--calcite-ui-foreground-2)}.block-button:active{background-color:var(--calcite-ui-foreground-3)}.map-list{position:absolute;inset:3.5rem 0 0 0;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-scrim-background);z-index:1;width:100%;height:-moz-fit-content;height:fit-content}.map-height{height:calc(100% - 58px)}.display-none{display:none}.esri-zoom{display:none !important}";export{m as layer_table,u as map_card}