@esri/solutions-components 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/dist/cjs/buffer-tools_6.cjs.entry.js +4 -8
  2. package/dist/cjs/calcite-combobox_3.cjs.entry.js +61 -61
  3. package/dist/cjs/calcite-input-message_5.cjs.entry.js +297 -295
  4. package/dist/cjs/{downloadUtils-415ab342.js → downloadUtils-b85476e8.js} +1093 -1093
  5. package/dist/cjs/{index.es-98008aa0.js → index.es-3ba50626.js} +10682 -10682
  6. package/dist/cjs/layer-table.cjs.entry.js +22 -22
  7. package/dist/cjs/loader.cjs.js +30 -30
  8. package/dist/cjs/{mapViewUtils-f617ae9a.js → mapViewUtils-df63bfa4.js} +26 -26
  9. package/dist/cjs/public-notification.cjs.entry.js +109 -4
  10. package/dist/cjs/solutions-components.cjs.js +31 -31
  11. package/dist/collection/components/map-draw-tools/map-draw-tools.js +3 -7
  12. package/dist/collection/components/map-select-tools/map-select-tools.js +74 -14
  13. package/dist/collection/components/public-notification/public-notification.js +177 -3
  14. package/dist/collection/utils/queryUtils.js +2 -2
  15. package/dist/collection/utils/queryUtils.ts +2 -2
  16. package/dist/components/map-draw-tools2.js +3 -7
  17. package/dist/components/map-select-tools2.js +55 -50
  18. package/dist/components/public-notification.js +111 -3
  19. package/dist/components/queryUtils.js +12 -12
  20. package/dist/esm/buffer-tools_6.entry.js +4 -8
  21. package/dist/esm/calcite-combobox_3.entry.js +55 -55
  22. package/dist/esm/calcite-input-message_5.entry.js +289 -287
  23. package/dist/esm/{downloadUtils-606b0f0e.js → downloadUtils-f278742f.js} +1089 -1089
  24. package/dist/esm/{index.es-c736c805.js → index.es-6f3a1143.js} +10596 -10596
  25. package/dist/esm/layer-table.entry.js +18 -18
  26. package/dist/esm/loader.js +26 -26
  27. package/dist/esm/{mapViewUtils-4e945e07.js → mapViewUtils-bd1809f0.js} +14 -14
  28. package/dist/esm/public-notification.entry.js +109 -4
  29. package/dist/esm/solutions-components.js +26 -26
  30. package/dist/solutions-components/{p-72117a18.js → p-03e2c6fd.js} +60 -60
  31. package/dist/solutions-components/{p-5ee7b022.entry.js → p-045d3988.entry.js} +11 -11
  32. package/dist/solutions-components/{p-6a657ff6.js → p-40c12650.js} +436 -436
  33. package/dist/solutions-components/p-70e1d4d8.entry.js +17 -0
  34. package/dist/solutions-components/p-88e5a76d.js +36 -0
  35. package/dist/solutions-components/p-bc39f296.entry.js +6 -0
  36. package/dist/solutions-components/{p-84bbaebf.entry.js → p-c93d8e80.entry.js} +6 -6
  37. package/dist/solutions-components/{p-4f5641b4.entry.js → p-cbac29fb.entry.js} +2 -2
  38. package/dist/solutions-components/solutions-components.esm.js +1 -1
  39. package/dist/solutions-components/utils/queryUtils.ts +2 -2
  40. package/dist/types/components/map-select-tools/map-select-tools.d.ts +16 -1
  41. package/dist/types/components/public-notification/public-notification.d.ts +70 -0
  42. package/dist/types/components.d.ts +1601 -1553
  43. package/package.json +1 -1
  44. package/dist/solutions-components/p-88e28de2.js +0 -36
  45. package/dist/solutions-components/p-ac76d270.entry.js +0 -17
  46. package/dist/solutions-components/p-e162304e.entry.js +0 -6
@@ -0,0 +1,17 @@
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,h as t,H as e,g as a,c as s}from"./p-c2f00d41.js";import{s as n,g as o,a as l}from"./p-83166522.js";import{S as c}from"./p-6fe17794.js";import{c as r,d as h}from"./p-1c247f54.js";import{l as d}from"./p-4aa3ba60.js";import{g as m,h as p,d as g,e as u}from"./p-88e5a76d.js";import{E as v,f as b,g as f,c as y}from"./p-dbc9a5a8.js";import{s as w}from"./p-4557d5a8.js";import{g as k}from"./p-829e6d4f.js";import{d as x,a as S}from"./p-40c12650.js";import{a as _,g as D}from"./p-fc884dd6.js";import"./p-729708a3.js";import"./p-a80b3880.js";import"./p-9a9955db.js";import"./p-00444009.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.0.0-beta.97
11
+ */var z;!function(i){i.valid="check-circle",i.invalid="exclamation-mark-triangle",i.idle="information"}(z||(z={}));const P=class{constructor(t){i(this,t),this.active=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=n(z,this.icon,this.status)}connectedCallback(){this.status=o(this.el,"status",this.status),this.scale=o(this.el,"scale",this.scale),this.requestedIcon=n(z,this.icon,this.status)}render(){return t(e,{"calcite-hydrated-hidden":!this.active},this.renderIcon(this.requestedIcon),t("slot",null))}renderIcon(i){if(i)return t("calcite-icon",{class:"calcite-input-message-icon",icon:i,scale:"s"})}get el(){return a(this)}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}};P.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)}:host([hidden]){display:none}:host([active][scale=m]),:host([active][scale=l]){--calcite-input-message-spacing-value:0.25rem}:host{visibility:hidden;box-sizing:border-box;display:flex;block-size:0px;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([active]){visibility:visible;block-size:auto;opacity:1;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([active][scale=m]),:host([active][scale=l]){-webkit-margin-before:var(--calcite-input-message-spacing-value);margin-block-start:var(--calcite-input-message-spacing-value)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-ui-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-ui-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-ui-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-ui-brand)}:host([status][active]){color:var(--calcite-ui-text-1)}:host([status][scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([status][scale=m]){-webkit-margin-before:0.25rem;margin-block-start:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([status][scale=l]){-webkit-margin-before:0.25rem;margin-block-start:0.25rem;font-size:var(--calcite-font-size--1);line-height:1rem}";
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.0.0-beta.97
16
+ */
17
+ const L="actions-end",I=class{constructor(t){i(this,t),this.calciteNoticeClose=s(this,"calciteNoticeClose",6),this.calciteNoticeOpen=s(this,"calciteNoticeOpen",6),this.active=!1,this.open=!1,this.color="blue",this.dismissible=!1,this.closable=!1,this.intlClose="Close",this.scale="m",this.width="auto",this.close=()=>{this.open=!1,this.calciteNoticeClose.emit()}}activeHandler(i){this.open=i}openHandler(i){this.active=i}handleDismissible(i){this.closable=i}handleClosable(i){this.dismissible=i}updateRequestedIcon(){this.requestedIcon=n(c,this.icon,this.color)}connectedCallback(){r(this);const i=this.active||this.open;i&&(this.activeHandler(i),this.openHandler(i)),this.dismissible&&this.handleDismissible(this.dismissible),this.closable&&this.handleClosable(this.closable)}disconnectedCallback(){h(this)}componentWillLoad(){this.requestedIcon=n(c,this.icon,this.color)}render(){const{el:i}=this,e=t("button",{"aria-label":this.intlClose,class:"notice-close",onClick:this.close,ref:i=>this.closeButton=i},t("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"})),a=l(i,L);return t("div",{class:"container"},this.requestedIcon?t("div",{class:"notice-icon"},t("calcite-icon",{icon:this.requestedIcon,scale:"l"===this.scale?"m":"s"})):null,t("div",{class:"notice-content"},t("slot",{name:"title"}),t("slot",{name:"message"}),t("slot",{name:"link"})),a?t("div",{class:"actions-end"},t("slot",{name:L})):null,this.closable?e:null)}async setFocus(){const i=this.el.querySelector("calcite-link");(this.closeButton||i)&&(i?i.setFocus():this.closeButton&&this.closeButton.focus())}get el(){return a(this)}static get watchers(){return{active:["activeHandler"],open:["openHandler"],dismissible:["handleDismissible"],closable:["handleClosable"],icon:["updateRequestedIcon"],color:["updateRequestedIcon"]}}};I.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)}: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([color=blue]) .container{border-color:var(--calcite-ui-brand)}:host([color=blue]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([color=red]) .container{border-color:var(--calcite-ui-danger)}:host([color=red]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([color=yellow]) .container{border-color:var(--calcite-ui-warning)}:host([color=yellow]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([color=green]) .container{border-color:var(--calcite-ui-success)}:host([color=green]) .container .notice-icon{color:var(--calcite-ui-success)}";const C=class{constructor(t){i(this,t),this.selectionLoadingChange=s(this,"selectionLoadingChange",7),this.selectionSetChange=s(this,"selectionSetChange",7),this.sketchTypeChange=s(this,"sketchTypeChange",7),this.workflowTypeChange=s(this,"workflowTypeChange",7),this._selectedIds=[],this._selectionLabel="",this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.mapView=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectLayerView=void 0,this.showBufferTools=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._layerSelectChecked=void 0,this._searchTerm=void 0,this._translations=void 0,this._workflowType=void 0}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 workflowTypeHandler(i,t){i!==t&&(this.mapView.popup.autoOpenEnabled=["SELECT","SKETCH","REFINE","SEARCH"].indexOf(i)<0,this.workflowTypeChange.emit(i))}async clearSelection(){return this._clearResults()}async getSelection(){/\S+/gm.test(this._selectionLabel)||(this._selectionLabel=this._getSelectionBaseLabel());const i=this._selectionLabel===this._getSelectionBaseLabel();return{id:this.isUpdate?this.selectionSet.id:Date.now(),workflowType:this._workflowType,searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._selectionLabel&&!i?this._selectionLabel:`${this._selectionLabel} ${this._bufferTools.distance} ${this._bufferTools.unit}`,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,refineSelectLayers:this._refineTools.layerViews,skipGeomOIDs:this._skipGeomOIDs}}labelChange(i){this._selectionLabel=i.detail}searchConfigurationChangeChanged(i){this.searchConfiguration=i.detail}sketchGraphicsChange(i){this._updateSelection(v.SKETCH,i.detail,this._selectionLabel||this._translations.sketch,!1)}refineSelectionGraphicsChange(i){const t=i.detail.graphics,e=Array.isArray(t)?t.map((i=>i.attributes[i.layer.objectIdField])):[];return this._updateSelection(v.SELECT,t,this._selectionLabel||this._translations.select,i.detail.useOIDs,e),this._highlightFeatures(e)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){return this._init()}render(){var i,a;const s=this._workflowType===v.SEARCH,n=s?" div-visible-search":" div-not-visible",o=this._workflowType===v.SKETCH||this._workflowType===v.SELECT,l=this.showBufferTools?"search-distance":"div-not-visible",c=this._layerSelectChecked&&!s?" div-visible":" div-not-visible",r=this._layerSelectChecked||s?" div-not-visible":" div-visible",h=s?"div-not-visible":"div-visible",d="number"==typeof(null===(i=this.selectionSet)||void 0===i?void 0:i.distance)?this.selectionSet.distance:this.defaultBufferDistance;return t(e,null,t("div",{class:"padding-bottom-1"},t("calcite-radio-group",{class:"w-100",onCalciteRadioGroupChange:i=>this._workflowChange(i)},t("calcite-radio-group-item",{checked:s,class:"w-50 end-border",value:v.SEARCH},this._translations.search),t("calcite-radio-group-item",{checked:o,class:"w-50",value:v.SKETCH},this._translations.sketch))),t("div",{class:n},t("div",{class:"search-widget",ref:i=>{this._searchElement=i}})),t("div",{class:h},t("calcite-label",{layout:"inline"},t("calcite-checkbox",{checked:this._layerSelectChecked,onCalciteCheckboxChange:()=>this._layerSelectChanged(),ref:i=>this._selectFromLayerElement=i}),"Use layer features")),t("div",{class:r},t("map-draw-tools",{active:!0,border:!0,mapView:this.mapView,pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,ref:i=>{this._drawTools=i}})),t("div",{class:c},t("refine-selection-tools",{active:!0,border:!0,enabledLayerIds:this.enabledLayerIds,layerView:this.selectLayerView,layerViews:this._refineSelectLayers,mapView:this.mapView,mode:b.ADD,ref:i=>{this._refineTools=i},refineMode:f.SUBSET})),t("calcite-label",{class:l},this._translations.searchDistance,t("buffer-tools",{distance:d,geometries:this.geometries,onBufferComplete:i=>this._bufferComplete(i),ref:i=>this._bufferTools=i,unit:(null===(a=this.selectionSet)||void 0===a?void 0:a.unit)||this.defaultBufferUnit})),t("slot",null))}async _initModules(){const[i,t,e,a,s]=await d(["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=a,this.FeatureLayer=s}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),this._initSearchWidget()}async _initSelectionSet(){var i,t,e,a,s,n,o,l,c,r;this.selectionSet?(this._searchTerm=null===(t=null===(i=this.selectionSet)||void 0===i?void 0:i.searchResult)||void 0===t?void 0:t.name,this._workflowType=null===(e=this.selectionSet)||void 0===e?void 0:e.workflowType,this._searchResult=null===(a=this.selectionSet)||void 0===a?void 0:a.searchResult,this._refineSelectLayers=null===(s=this.selectionSet)||void 0===s?void 0:s.refineSelectLayers,this._selectedIds=null===(n=this.selectionSet)||void 0===n?void 0:n.selectedIds,this._skipGeomOIDs=null===(o=this.selectionSet)||void 0===o?void 0:o.skipGeomOIDs,this._layerSelectChecked=(null===(l=this.selectionSet)||void 0===l?void 0:l.workflowType)===v.SELECT,this.geometries=[...(null===(c=this.selectionSet)||void 0===c?void 0:c.geometries)||[]],this._selectionLabel=(null===(r=this.selectionSet)||void 0===r?void 0:r.label)||this._getSelectionBaseLabel(),await m(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1)):(this._workflowType=v.SEARCH,this.mapView.popup.autoOpenEnabled=!1)}_getSelectionBaseLabel(){var i,t;return this._workflowType===v.SKETCH?this._translations.sketch:this._workflowType===v.SELECT?this._translations.select:this._workflowType===v.SEARCH&&this._searchResult?null===(i=this._searchResult)||void 0===i?void 0:i.name:null===(t=this.selectionSet)||void 0===t?void 0:t.label}_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",(()=>{this._clearResults(!1)})),this._searchWidget.on("select-result",(i=>{var t,e,a;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,n=s?[i.result.feature.getObjectId()]:void 0;this._updateSelection(v.SEARCH,[i.result.feature],null===(a=null==i?void 0:i.result)||void 0===a?void 0:a.name,s,n)}else this._clearResults(!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,a;if(i.hasOwnProperty("layer")){const s=i,n=null===(e=s.layer)||void 0===e?void 0:e.id,o=n?t.map.findLayerById(n):null,l=null===(a=null==s?void 0:s.layer)||void 0===a?void 0:a.url;o?s.layer=o:l&&(s.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}),w.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)}}_layerSelectChanged(){this._layerSelectChecked=this._selectFromLayerElement.checked,this.sketchTypeChange.emit(this._layerSelectChecked?y.LAYER:y.INTERACTIVE)}_workflowChange(i){this._workflowType=i.detail}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){var t;null===(t=w.highlightHandle)||void 0===t||t.remove(),i.length>0&&(w.highlightHandle=await p(i,this.selectLayerView,this.mapView)),this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this.selectionLoadingChange.emit(!0),this._selectedIds=await g(i,this.selectLayerView.layer),this.selectionLoadingChange.emit(!1),this._drawTools.graphics=this.geometries.map((i=>new this.Graphic({geometry:i,symbol:"point"===i.type?this.sketchPointSymbol:"polyline"===i.type?this.sketchLineSymbol:"polygon"===i.type?this.sketchPolygonSymbol:void 0}))),await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){if(this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail,!this._bufferGeometry)return this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),this._highlightWithOIDsOrGeoms();{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)}}_geomQuery(i){const t=u(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!0){var e,a;this._selectedIds=[],t&&(this._selectionLabel=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._searchWidget.clear(),null===(e=w.highlightHandle)||void 0===e||e.remove(),(null===(a=this._drawTools)||void 0===a?void 0:a.clear)&&await this._drawTools.clear(),this.selectionSetChange.emit(this._selectedIds.length)}_updateSelection(i,t,e,a,s){this._selectedIds=a&&s?s:this._selectedIds,this._skipGeomOIDs=a?s:void 0,this.geometries=Array.isArray(t)?t.map((i=>i.geometry)):this.geometries,this._workflowType=i,this._selectionLabel=e}async _getTranslations(){const i=await k(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],searchConfiguration:["watchSearchConfigurationHandler"],_workflowType:["workflowTypeHandler"]}}};C.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}.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}';const A=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}}]}),M=class{constructor(t){i(this,t),this.disabled=!1,this.layerView=void 0,this._translations=void 0}async downloadCSV(i,t,e,a=!0){return x(i,this.layerView.layer,t,!0,e,a)}async downloadPDF(i,t,e){return S(i,this.layerView.layer,t,e,this._labelInfoElement.selectedOption.value)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return t(e,null,t("calcite-select",{disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}},this._renderItems()))}async _initModules(){const[i]=await d(["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 k(this.el);this._translations=i[0]}_renderItems(){return(A.default||A).sort(((i,t)=>{const e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),a=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<a?-1:e>a?1:0})).map((i=>t("calcite-option",{value:i},this._getLabelSizeText(i))))}get el(){return a(this)}};M.style=":host{display:block}";const H=class{constructor(t){i(this,t),this.selectionSetsChanged=s(this,"selectionSetsChanged",7),this._addEnabled=!0,this.addresseeLayer=void 0,this.enabledLayerIds=[],this.mapView=void 0,this.selectionSets=[],this.GraphicsLayer=void 0,this.SketchViewModel=void 0,this._translations=void 0}addresseeLayerWatchHandler(){const i=this.selectionSets.filter((i=>i.workflowType!==v.REFINE));this.selectionSets=this._initRefineSelectionSet(i)}refineSelectionIdsChange(i){var t,e;const a=(null===(t=i.detail)||void 0===t?void 0:t.addIds)||[],s=(null===(e=i.detail)||void 0===e?void 0:e.removeIds)||[];this._updateSelectionSets(s),this._updateRefineSelectionSet(a,s)}async componentWillLoad(){await this._getTranslations(),this._getRefineSelectionSet(this.selectionSets)||(this.selectionSets=this._initRefineSelectionSet(this.selectionSets))}render(){return t(e,null,t("div",{class:"padding-1"},t("div",null,t("calcite-radio-group",{class:"w-100",onCalciteRadioGroupChange:i=>this._modeChanged(i)},t("calcite-radio-group-item",{checked:this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(b.ADD),value:b.ADD},this._translations.add),t("calcite-radio-group-item",{checked:!this._addEnabled,class:"w-50",onClick:()=>this._setSelectionMode(b.REMOVE),value:b.REMOVE},this._translations.remove)),t("refine-selection-tools",{border:!0,enabledLayerIds:this.enabledLayerIds,ids:_(this.selectionSets),layerViews:[this.addresseeLayer],mapView:this.mapView,mode:this._addEnabled?b.ADD:b.REMOVE,ref:i=>{this._refineTools=i},refineMode:f.ALL,refineSelectionSet:this._getRefineSelectionSet(this.selectionSets),useLayerPicker:!1})),t("br",null),t("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_modeChanged(i){this._addEnabled=i.detail===b.ADD}_setSelectionMode(i){this._refineTools.mode=i}_getRefineSelectionSetList(){const i=D(this.selectionSets),e=this._getRefineSelectionSet(this.selectionSets),a=(null==e?void 0:e.refineIds.removeIds.length)||0;return[t("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",((null==e?void 0:e.refineIds.addIds.length)||0).toString()),"non-interactive":!0}),t("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),t("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getRefineSelectionSet(i){let t;return i.some((i=>{if(i.workflowType===v.REFINE)return t=i,!0})),t}_updateSelectionSets(i){i.length>0&&(this.selectionSets=this.selectionSets.reduce(((t,e)=>(e.selectedIds=e.selectedIds.filter((t=>i.indexOf(t)<0)),(e.selectedIds.length>0||e.workflowType===v.REFINE)&&t.push(e),t)),[]),this.selectionSetsChanged.emit(this.selectionSets))}_updateRefineSelectionSet(i,t){const e=this._getRefineSelectionSet(this.selectionSets);this._updateRefineIds(e,i,t),this.selectionSetsChanged.emit(this.selectionSets)}_updateRefineIds(i,t,e){i.refineIds.addIds=i.refineIds.addIds.filter((i=>e.indexOf(i)<0)),i.refineIds.removeIds=i.refineIds.removeIds.filter((i=>t.indexOf(i)<0));const a=[...new Set(i.refineIds.addIds.concat(t))],s=[...new Set(i.refineIds.removeIds.concat(e))];return i.refineIds={addIds:a.filter((i=>s.indexOf(i)<0)),removeIds:s.filter((i=>a.indexOf(i)<0))},i.selectedIds=i.refineIds.addIds.length>0?[...new Set(i.selectedIds.concat(i.refineIds.addIds))]:i.selectedIds.filter((t=>i.refineIds.removeIds.indexOf(t)<0)),this.selectionSets.map((t=>t.workflowType===v.REFINE?i:t))}_initRefineSelectionSet(i){return[...i,{buffer:void 0,distance:0,download:!0,geometries:[],id:Date.now(),label:"Refine",layerView:this.addresseeLayer,refineSelectLayers:[],searchResult:void 0,selectedIds:[],unit:"feet",workflowType:v.REFINE,refineIds:{addIds:[],removeIds:[]},redoStack:[],undoStack:[]}]}async _getTranslations(){const i=await k(this.el);this._translations=i[0]}_testAccess(i,t){switch(i){case"_modeChanged":return this._modeChanged(t);case"_setSelectionMode":return this._setSelectionMode(t)}return null}get el(){return a(this)}static get watchers(){return{addresseeLayer:["addresseeLayerWatchHandler"]}}};H.style=":host{display:block}";export{P as calcite_input_message,I as calcite_notice,C as map_select_tools,M as pdf_download,H as refine_selection}
@@ -0,0 +1,36 @@
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{E as n}from"./p-dbc9a5a8.js";
7
+ /** @license
8
+ * Copyright 2022 Esri
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */async function t(n,a,c){const s=a.capabilities.query.maxRecordCount,o=a.createQuery();o.start=n,o.num=s,o.where=a.definitionExpression||"1=1";const i=await a.queryFeatures(o);return c=c.concat(i.features),i.exceededTransferLimit?t(n+=s,a,c):Promise.resolve(c)}async function a(n,t){let a=[];const c=n?n.map((n=>async function(n,t){const a=t.createQuery();return a.spatialRelationship="intersects",a.geometry=n,t.queryObjectIds(a)}
22
+ /** @license
23
+ * Copyright 2022 Esri
24
+ *
25
+ * Licensed under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License.
27
+ * You may obtain a copy of the License at
28
+ *
29
+ * http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software
32
+ * distributed under the License is distributed on an "AS IS" BASIS,
33
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ * See the License for the specific language governing permissions and
35
+ * limitations under the License.
36
+ */(n,t))):[Promise.resolve()];return(await Promise.all(c)).forEach((n=>{a=[...a,...n||[]]})),a}async function c(n,t){const a=t.createQuery();return a.objectIds=n,t.queryFeatures(a)}async function s(n,t,a,c){const o=t.capabilities.query.maxRecordCount,i=t.createQuery();i.start=n,i.num=o,i.geometry=a;const r=await t.queryFeatures(i);return c[t.id]=c[t.id].concat(r.features),r.exceededTransferLimit?s(n+=o,t,a,c):Promise.resolve(c)}function o(n,t){return[...r(n,"polygon",t),...r(n,"polyline",t),...r(n,"point",t)]}function i(t,c){let s=Promise.resolve([]);return t.workflowType!==n.REFINE&&(s=a(t.buffer?[t.buffer]:o(t.geometries,c),t.layerView.layer)),s}function r(n,t,a){const c=(null==n?void 0:n.filter((n=>n.type===t)))||[];return c.length<=1?c:[a.union(c)]}async function e(n){let t={};return await n.when((()=>{t=n.map.allLayers.toArray().reduce(((n,t)=>("feature"===t.type&&(n[t.id]=t.title),n)),{})})),t}async function u(n){let t=[];return await n.when((()=>{t=n.map.allLayers.toArray().reduce(((n,t)=>("feature"===t.type&&n.push(t.id),n)),[])})),t}async function f(n,t){const a=await async function(n,t){let a=[];return await n.when((()=>{a=n.map.allLayers.toArray().filter((n=>n.id===t))})),a.length>0?a[0]:void 0}(n,t);return a?await n.whenLayerView(a):void 0}async function y(n,t,a,c=!1){return c&&await w(n,t,a,!1),t.highlight(n)}async function w(n,t,a,c=!0,s){const o=await async function(n,t){const a=t.createQuery();return a.objectIds=n,t.queryExtent(a)}(n,t.layer);await a.goTo(o.extent),c&&await async function(n,t,a){const c={objectIds:n};t.featureEffect=Object.assign(Object.assign({},a),{filter:c}),setTimeout((()=>{t.featureEffect=void 0}),1300)}(n,t,s)}export{f as a,c as b,i as c,a as d,o as e,s as f,w as g,y as h,u as i,e as j,t as q}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as i,c as t,h as s,H as e,g as a}from"./p-c2f00d41.js";import{b as l,c as n,E as o,d}from"./p-dbc9a5a8.js";import{l as h}from"./p-4aa3ba60.js";import{a as c,c as r,g as p,h as g}from"./p-88e5a76d.js";import{s as b}from"./p-4557d5a8.js";import{a as m,g as u}from"./p-829e6d4f.js";import{g as f,a as y}from"./p-fc884dd6.js";import"./p-00444009.js";import"./p-e1a4994d.js";const v=class{constructor(s){i(this,s),this.labelChange=t(this,"labelChange",7),this.searchConfigurationChange=t(this,"searchConfigurationChange",7),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.addresseeLayer=void 0,this._downloadActive=!0,this._numSelected=0,this._pageType=l.LIST,this._saveEnabled=!1,this._selectionLoading=!1,this._selectionSets=[],this._sketchType=n.INTERACTIVE,this._selectionWorkflowType=o.SEARCH,this._showLayerSelectionChangeModal=!1,this._translations=void 0}async mapViewWatchHandler(i){(null==i?void 0:i.popup)&&(this._popupsEnabled=null==i?void 0:i.popup.autoOpenEnabled)}async watchSearchConfigurationHandler(i,t){const s=JSON.stringify(i);s!==JSON.stringify(t)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async selectionSetsWatchHandler(i,t){i&&i!==t&&i.length>0&&0===i.filter((i=>i.workflowType!==o.REFINE)).length&&(this._selectionSets=[])}async sketchLineSymbolWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&this._setLineSymbol(i)}async sketchPointSymbolWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&this._setPointSymbol(i)}async sketchPolygonSymbolWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&this._setPolygonSymbol(i)}async pageTypeWatchHandler(i,t){if(this._checkPopups(),this._clearHighlight(),t!==l.SELECT&&t!==l.REFINE||await this._clearSelection(),i!==l.SELECT)return this._highlightFeatures()}distanceChanged(i){this._updateLabel(i,"distance"),this._distance=i.detail.newValue}selectionLoadingChange(i){this._selectionLoading=i.detail}selectionSetsChanged(i){this._selectionSets=[...i.detail]}sketchTypeChange(i){this._sketchType=i.detail}unitChanged(i){this._updateLabel(i,"unit"),this._unit=i.detail.newValue}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols()}render(){return s(e,null,s("calcite-shell",null,s("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getActionGroup("list-check",l.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",l.REFINE,this._translations.refineSelection):void 0,this._getActionGroup("file-pdf",l.PDF,this._translations.downloadPDF),this._getActionGroup("file-csv",l.CSV,this._translations.downloadCSV)),this._getPage(this._pageType)))}async _initModules(){const[i,t]=await h(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils"]);this._geometryEngine=i,this._jsonUtils=t}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(i){this.sketchLineSymbol="simple-line"===(null==i?void 0:i.type)?i:this._jsonUtils.fromJSON(i||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(i){this.sketchPointSymbol="simple-marker"===(null==i?void 0:i.type)?i:this._jsonUtils.fromJSON(i||{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(i){this.sketchPolygonSymbol="simple-fill"===(null==i?void 0:i.type)?i:this._jsonUtils.fromJSON(i||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_getActionGroup(i,t,e){return s("calcite-action-group",{class:this.showRefineSelection?"action-center w-1-4":"action-center w-1-3",layout:"horizontal"},s("calcite-action",{active:this._pageType===t,alignment:"center",class:"width-full height-full",compact:!1,icon:i,id:i,onClick:()=>{this._setPageType(t)},text:""}),s("calcite-tooltip",{label:"",placement:"bottom","reference-element":i},s("span",null,e)))}_setPageType(i){this._pageType=i}_getPage(i){let t;switch(i){case l.LIST:t=this._getListPage();break;case l.SELECT:t=this._getSelectPage();break;case l.REFINE:t=this._getRefinePage();break;case l.PDF:t=this._getPDFPage();break;case l.CSV:t=this._getCSVPage()}return t}_getListPage(){const i=this._selectionSets.filter((i=>i.workflowType!==o.REFINE)).length>0,t=f(this._selectionSets);return i?s("calcite-panel",null,s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold"},this._translations.myLists)),this._getNotice(this._translations.listHasSetsTip,"padding-sides-1 padding-bottom-1"),this._getMapLayerPicker(),s("div",{class:"display-block padding-sides-1 height-1-1-2"},s("div",{class:"display-block float-left"},s("calcite-label",{alignment:"start",class:"font-bold"},this._translations.notifications)),s("div",{class:"display-block float-right"},s("calcite-input-message",{active:!0,class:"info-blue margin-top-0",scale:"m"},this._translations.uniqueCout.replace("{{n}}",t.toString())))),i?this._getSelectionSetList():s("div",{class:"info-message"},s("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this._translations.noNotifications)),s("div",{class:"display-flex padding-1"},s("calcite-button",{onClick:()=>{this._setPageType(l.SELECT)},width:"full"},this._translations.add)),this._showModal(this._showLayerSelectionChangeModal)):s("calcite-panel",null,s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold"},this._translations.myLists)),s("div",{class:"padding-sides-1"},s("calcite-label",null,this._translations.notifications)),s("div",{class:"info-message padding-bottom-1"},s("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this._translations.noNotifications)),this._getNotice(this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1"),this._getMapLayerPicker(),s("div",{class:"display-flex padding-1"},s("calcite-button",{onClick:()=>{this._setPageType(l.SELECT)},width:"full"},this._translations.add)))}_getMapLayerPicker(){var i;return s("div",{class:"display-flex padding-sides-1"},s("calcite-label",{class:"font-bold width-full"},this._translations.addresseeLayer,s("map-layer-picker",{enabledLayerIds:this.addresseeLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>this._layerSelectionChange(i),selectedLayerIds:this.addresseeLayer?[null===(i=this.addresseeLayer)||void 0===i?void 0:i.layer.id]:[],selectionMode:"single"})))}_getSelectionSetList(){return s("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((i,t,e)=>(t.workflowType!==o.REFINE&&i.push(s("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",t.selectedIds.length.toString()),label:t.label,onClick:()=>this._gotoSelection(t,this.mapView)},this._getAction(!0,"pencil","",(i=>this._openSelection(t,i)),!1,"actions-end"),this._getAction(!0,"x","",(i=>this._deleteSelection(e,i)),!1,"actions-end"))),i)),[]))}_showModal(i){return s("calcite-modal",{"aria-labelledby":"modal-title","background-color":"grey",color:"red",open:i,scale:"s",width:"s"},s("div",{id:"modal-title",slot:"header"},this._translations.shouldProceed),s("div",{slot:"content"},this._translations.proceedInfo),s("calcite-button",{appearance:"outline",onClick:()=>this._cancelLayerChange(),slot:"secondary",width:"full"},this._translations.cancel),s("calcite-button",{onClick:()=>this._handleLayerChange(),slot:"primary",width:"full"},this._translations.proceed))}_cancelLayerChange(){this._layerSelectionChangeEvt.preventDefault(),this._layerSelectionChangeEvt.stopPropagation(),this._layerSelectionChangeEvt=void 0,this._showLayerSelectionChangeModal=!1}async _handleLayerChange(){var i,t;this._showLayerSelectionChangeModal=!1;const s=(null===(t=null===(i=this._layerSelectionChangeEvt)||void 0===i?void 0:i.detail)||void 0===t?void 0:t.length)>0?this._layerSelectionChangeEvt.detail[0]:"";await this._updateAddresseeLayer(s)}_hasSelections(){return this._selectionSets.length>0}_getSelectPage(){var i,t;const e=this._selectionWorkflowType===o.SELECT?this._translations.selectLayerTip:this._selectionWorkflowType===o.SKETCH?this._sketchType===n.INTERACTIVE?this._translations.selectSketchTip:this._translations.selectLayerTip:this._translations.selectSearchTip,a=this.customLabelEnabled?"":"display-none",l=m(this.el),d=l&&"en"===l?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return s("calcite-panel",null,this._getLabel(this._translations.stepTwoFull.replace("{{layer}}",null===(i=this.addresseeLayer)||void 0===i?void 0:i.layer.title)),this._getNotice(e),s("div",{class:"padding-top-sides-1"},s("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.selectionLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,onSelectionSetChange:i=>this._updateForSelection(i),onWorkflowTypeChange:i=>this._updateForWorkflowType(i),ref:i=>{this._selectTools=i},searchConfiguration:this._searchConfiguration,selectLayerView:this.addresseeLayer,selectionSet:this._activeSelection,showBufferTools:this.showSearchSettings,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),s("div",{class:"padding-sides-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?s("div",null,s("calcite-loader",{active:!0,class:"info-blue",inline:!0,label:d,scale:"m",type:"indeterminate"})):s("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),s("calcite-input-message",{active:!0,class:"info-blue",scale:"m"},this._selectionLoading?d:this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedAddresses.replace("{{n}}",this._numSelected.toString()).replace("{{layer}}",(null===(t=this.addresseeLayer)||void 0===t?void 0:t.layer.title)||""))),s("div",{class:"padding-sides-1 "+a},s("calcite-label",{class:"font-bold"},"List name",s("calcite-input",{onInput:()=>{this.labelChange.emit(this._labelName.value)},placeholder:"Insert label here...",ref:i=>{this._labelName=i},value:this._customLabel||""}))),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getRefinePage(){const i=this._hasSelections();return s("calcite-panel",null,this._getLabel(this._translations.refineSelection),i?s("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),s("refine-selection",{addresseeLayer:this.addresseeLayer,enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPDFPage(){return this._getDownloadPage(d.PDF)}_getCSVPage(){return this._getDownloadPage(d.CSV)}_getDownloadPage(i){const t=i===d.PDF,e=this._hasSelections();return s("calcite-panel",null,s("div",null,s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold"},t?this._translations.downloadPDF:this._translations.downloadCSV)),e?s("div",null,s("div",{class:"padding-top-sides-1"},s("calcite-label",null,this._translations.notifications)),this._getSelectionLists(),s("div",{class:"margin-side-1 padding-top-1 border-bottom"}),s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:t?"display-none":"",layout:"inline"},s("calcite-checkbox",{disabled:!this._downloadActive,ref:i=>{this._removeDuplicatesCSV=i}}),this._translations.removeDuplicate),s("calcite-label",{class:t?"":"display-none",layout:"inline"},s("calcite-checkbox",{disabled:!this._downloadActive,ref:i=>{this._removeDuplicatesPDF=i}}),this._translations.removeDuplicate)),s("div",{class:t?"":"display-none"},this._getLabel(this._translations.selectPDFLabelOption,!1),s("div",{class:"padding-sides-1"},s("pdf-download",{disabled:!this._downloadActive,layerView:this.addresseeLayer,ref:i=>{this._downloadTools=i}}))),s("div",{class:"padding-1 display-flex"},s("calcite-button",{disabled:!this._downloadActive,onClick:t?()=>this._downloadPDF():()=>this._downloadCSV(),width:"full"},t?this._translations.downloadPDF:this._translations.downloadCSV))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_getPageNavButtons(i,t,e,a,l,n){return s("div",null,s("div",{class:"display-flex padding-top-sides-1"},s("calcite-button",{disabled:t,onClick:e,width:"full"},i)),s("div",{class:"display-flex padding-top-1-2 padding-sides-1"},s("calcite-button",{appearance:"outline",disabled:l,onClick:n,width:"full"},a)))}_getNotice(i,t="padding-1"){return s("calcite-notice",{class:t,color:"green",icon:"lightbulb",open:!0},s("div",{slot:"message"},i))}_getLabel(i,t=!1){return s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold","disable-spacing":t},i))}_getSelectionLists(){return this._selectionSets.reduce(((i,t)=>(t.workflowType!==o.REFINE&&(!this._downloadActive&&t.download&&(this._downloadActive=!0),i.push(s("div",{class:"display-flex padding-sides-1 padding-bottom-1"},s("calcite-checkbox",{checked:t.download,class:"align-center",onClick:()=>{this._toggleDownload(t.id)}}),s("calcite-list",{class:"list-border margin-start-1-2 w-100",id:"download-list"},s("calcite-list-item",{description:this._translations.selectedFeatures.replace("{{n}}",t.selectedIds.length.toString()),disabled:!t.download,label:t.label,onClick:()=>{this._toggleDownload(t.id)}}))))),i)),[])||s("div",null)}async _toggleDownload(i){let t=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===i?!s.download:s.download,t=!!s.download||t,s))),this._downloadActive=t,await this._highlightFeatures()}_downloadPDF(){const i=y(this._getDownloadSelectionSets()),t=this._selectionSets.map((i=>i.label));this._downloadTools.downloadPDF(t,i,this._removeDuplicatesPDF.checked)}_downloadCSV(){const i=y(this._getDownloadSelectionSets()),t=this._selectionSets.map((i=>i.label));this._downloadTools.downloadCSV(t,i,this._removeDuplicatesCSV.checked)}_getDownloadSelectionSets(){return this._selectionSets.filter((i=>i.download||i.workflowType===o.REFINE))}_updateLabel(i,t){this._customLabel&&(this._customLabel=this._customLabel.replace("unit"===t?`${this._distance} ${i.detail.oldValue}`:`${i.detail.oldValue} ${this._unit}`,"unit"===t?`${this._distance} ${i.detail.newValue}`:`${i.detail.newValue} ${this._unit}`),this._labelName.value=this._customLabel,this.labelChange.emit(this._labelName.value))}_updateForWorkflowType(i){this._selectionWorkflowType=i.detail}_getAction(i,t,e,a,l=!1,n=""){return s("calcite-action",{disabled:!i,icon:t,indicator:l,onClick:a,slot:n,text:e})}_updateForSelection(i){this._numSelected=i.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),"boolean"==typeof this._popupsEnabled&&this.mapView.popup&&(this.mapView.popup.autoOpenEnabled=this._popupsEnabled),this._setPageType(l.LIST)}async _layerSelectionChange(i){var t,s,e;const a=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";a!==(null===(s=this.addresseeLayer)||void 0===s?void 0:s.layer.id)&&(this._showLayerSelectionChangeModal=void 0!==(null===(e=this.addresseeLayer)||void 0===e?void 0:e.layer.id)&&this._selectionSets.length>0,this._showLayerSelectionChangeModal?this._layerSelectionChangeEvt=i:await this._updateAddresseeLayer(a))}async _updateAddresseeLayer(i){this.addresseeLayer=await c(this.mapView,i),await this._updateSelectionSets(this.addresseeLayer)}async _updateSelectionSets(i){const t=this._selectionSets.filter((i=>i.workflowType!==o.REFINE)),s=[];return t.forEach((t=>{t.layerView=i,t.selectedIds=[],s.push(r(t,this._geometryEngine))})),Promise.all(s).then((async i=>{i.forEach(((i,s)=>{t[s].selectedIds=i})),await this._highlightFeatures(),this._selectionSets=[...t]}))}async _saveSelection(){var i,t;const s=await(null===(i=this._selectTools)||void 0===i?void 0:i.getSelection()),e=null===(t=this._selectTools)||void 0===t?void 0:t.isUpdate;return this._selectionSets=e?this._selectionSets.map((i=>i.id===s.id?s:i)):[...this._selectionSets,s],this._home()}async _clearSelection(){var i;await(null===(i=this._selectTools)||void 0===i?void 0:i.clearSelection()),this._numSelected=0,this._activeSelection=void 0,this._customLabel=void 0,this._distance=void 0,this._unit=void 0}_deleteSelection(i,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter(((t,s)=>{if(s!==i)return t})),this._highlightFeatures()}_gotoSelection(i,t){p(i.selectedIds,i.layerView,t,this.featureHighlightEnabled,this.featureEffect)}_openSelection(i,t){t.stopPropagation(),this._activeSelection=i,this._distance=this._activeSelection.distance,this._unit=this._activeSelection.unit,this._customLabel=this._activeSelection.label,this._pageType=l.SELECT}async _highlightFeatures(){this._clearHighlight();const i=y(this._selectionSets);i.length>0&&(b.highlightHandle=await g(i,this.addresseeLayer,this.mapView))}_checkPopups(){var i;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(i=this.mapView)||void 0===i?void 0:i.popup.autoOpenEnabled)}_clearHighlight(){var i;b&&b.highlightHandle&&(null===(i=b.highlightHandle)||void 0===i||i.remove())}async _getTranslations(){const i=await u(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],_selectionSets:["selectionSetsWatchHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};v.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-3{width:33.3%}.w-1-4{width:25%}.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}.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}.main-label{float:left}html[dir="rtl"] .main-label{float:right}.back-label:hover{cursor:pointer;color:var(--calcite-ui-brand-hover)}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.margin-side-1{-webkit-margin-start:1rem;margin-inline-start:1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.border-top{border-top:1px solid var(--calcite-ui-border-2)}.w-100{width:100%}.w-50{width:50%}.padding-1-2{padding: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)}.num-selected{align-items:center;display:flex}';export{v as public_notification}
@@ -1,6 +1,6 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,h as e,H as i,g as a}from"./p-c2f00d41.js";import{g as l}from"./p-829e6d4f.js";import{g as s,a as r,q as o}from"./p-88e28de2.js";import{d as c}from"./p-6a657ff6.js";import"./p-e1a4994d.js";import"./p-dbc9a5a8.js";import"./p-4aa3ba60.js";const n=class{constructor(e){t(this,e),this._graphics=[],this._fieldNames=[],this.mapView=void 0,this._translations=void 0,this._selectedIndexes=[]}async componentWillLoad(){await this._getTranslations()}render(){return e(i,null,this._getTableControlRow(),e("div",{class:"data-container"},e("div",{class:"table-container"},e("div",{class:"table"},this._getTableHeader(),this._getTableRows()))),e("edit-record-modal",{ref:t=>this._editMultipleMpdal=t}))}_getTableControlRow(){const t=this._selectedIndexes.length>0,i=this._selectedIndexes.length>1;return e("div",{class:"display-flex table-border"},e("map-layer-picker",{mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t)}),e("div",null,e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"magnifying-glass",onClick:()=>this._zoom()},this._translations.zoom),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!i,iconStart:"pencil",onClick:()=>this._editMultiple()},this._translations.editMultiple),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"trash",onClick:()=>this._delete()},this._translations.delete),e("calcite-split-button",{appearance:"transparent",color:"neutral","primary-text":this._translations.more},e("calcite-dropdown-group",{"selection-mode":"none"},e("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll(!0)},this._translations.selectAll),e("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._showSelected()},this._translations.showSelected),e("calcite-dropdown-item",{iconStart:"erase",onClick:()=>this._clearSelection()},this._translations.clearSelection),e("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._switchSelected()},this._translations.switchSelected),e("calcite-dropdown-item",{iconStart:"export",onClick:()=>this._exportToCSV()},this._translations.exportCSV)))))}_getTableHeader(){return e("div",{class:"header"},e("div",{class:"table-header-cell padding-3-4"},e("calcite-checkbox",{class:"display-flex justify-center",onClick:()=>this._selectAll(this._selectAllElement.checked),ref:t=>this._selectAllElement=t})),this._fieldNames.map((t=>this._getTableHeaderCell(t))))}_getTableHeaderCell(t){return e("div",{class:"table-header-cell field-width"},t)}_getTableRows(){return e("div",{class:"table-body"},this._graphics.map(((t,e)=>this._getTableRow(t,e))))}_getTableRow(t,i){const a=this._selectedIndexes.indexOf(i)>-1;return e("div",{class:"row"},e("div",{class:"table-cell table-border padding-3-4"},e("calcite-checkbox",{checked:a,class:"display-flex justify-center",onClick:()=>this._rowSelected(i),value:i})),this._fieldNames.map((e=>{const i=this._layerView.layer.fieldsIndex.get(e);return this._getTableRowCell(t.attributes[e],i,a)})))}_getTableRowCell(t,i,a){const l=i.editable&&a,s=this._getInputType(i.type);let r;const o=i.domain;return o&&(r="coded-value"===o.type?e("calcite-select",{label:""},o.codedValues.map((i=>e("calcite-option",{label:i.name,selected:t===i.code.toString(),value:i.code})))):e("calcite-input",{max:o.maxValue,min:o.minValue,type:"number",value:t})),e("div",{class:"table-cell table-border field-width"},l&&r?r:l?e("calcite-input",{type:s,value:t}):t)}_getInputType(t){const e={string:"text","small-integer":"number",integer:"number",single:"number",double:"number",long:"number",date:"datetime-local",oid:"number",guid:"text","global-id":"text"};return Object.keys(e).indexOf(t)>-1?e[t]:"text"}_selectAll(t){this._selectedIndexes=t?this._graphics.map(((t,e)=>e)):[]}_showSelected(){console.log("_showSelected")}_clearSelection(){this._selectedIndexes=[]}_switchSelected(){const t=[...this._selectedIndexes];this._selectedIndexes=this._graphics.reduce(((e,i,a)=>(t.indexOf(a)<0&&e.push(a),e)),[])}async _exportToCSV(){return c([],this._layerView.layer,this._getSelectedIds(),!1,!1,!0)}_zoom(){const t=this._getSelectedIds();s(t,this._layerView,this.mapView,!0)}_editMultiple(){this._editMultipleMpdal.open=!0}_delete(){console.log("delete")}_getGraphics(t){return this._graphics.filter(((e,i)=>t.indexOf(i)>-1))}_getSelectedIds(){return this._getGraphics(this._selectedIndexes).map((t=>t.getObjectId()))}_rowSelected(t){const e=this._selectedIndexes.indexOf(t);e>-1?(this._selectedIndexes.splice(e,1),this._selectedIndexes=[...this._selectedIndexes]):this._selectedIndexes=[...this._selectedIndexes,t]}async _layerSelectionChanged(t){const e=t.detail[0];this._layerView=await r(this.mapView,e),this._fieldNames=this._layerView.layer.fields.map((t=>t.alias||t.name)),this._graphics=await o(0,this._layerView.layer,[]),this._selectedIndexes=[]}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return a(this)}};n.style=":host{display:block}.table{display:table;width:100%}.header{display:table-header-group;background-color:#757575;font-weight:500;font-size:var(--calcite-font-size-0);color:var(--calcite-ui-text-inverse);position:sticky;top:0;z-index:1}.table-header-cell{display:table-cell;text-align:justify;border-right:1px solid var(--calcite-ui-border-2);padding:0.5rem}.table-body{display:table-row-group}.row{display:table-row}.table-cell{display:table-cell;padding:0.5rem}.display-table-header{display:table-header-group}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.justify-center{justify-content:center}.table-container{width:100%}.overflow-auto{overflow:auto}.data-container{overflow:auto;height:calc(100% - 35px)}.row:nth-child(odd){background:var(--calcite-ui-foreground-3)}.padding-3-4{padding:0.75rem}.field-width{white-space:nowrap;min-width:300px;max-width:300px;overflow:hidden}";export{n as layer_table}
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 e,H as i,g as a}from"./p-c2f00d41.js";import{g as l}from"./p-829e6d4f.js";import{g as s,a as r,q as o}from"./p-88e5a76d.js";import{d as c}from"./p-40c12650.js";import"./p-e1a4994d.js";import"./p-dbc9a5a8.js";import"./p-4aa3ba60.js";const n=class{constructor(e){t(this,e),this._graphics=[],this._fieldNames=[],this.mapView=void 0,this._translations=void 0,this._selectedIndexes=[]}async componentWillLoad(){await this._getTranslations()}render(){return e(i,null,this._getTableControlRow(),e("div",{class:"data-container"},e("div",{class:"table-container"},e("div",{class:"table"},this._getTableHeader(),this._getTableRows()))),e("edit-record-modal",{ref:t=>this._editMultipleMpdal=t}))}_getTableControlRow(){const t=this._selectedIndexes.length>0,i=this._selectedIndexes.length>1;return e("div",{class:"display-flex table-border"},e("map-layer-picker",{mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t)}),e("div",null,e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"magnifying-glass",onClick:()=>this._zoom()},this._translations.zoom),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!i,iconStart:"pencil",onClick:()=>this._editMultiple()},this._translations.editMultiple),e("calcite-button",{appearance:"transparent",color:"neutral",disabled:!t,iconStart:"trash",onClick:()=>this._delete()},this._translations.delete),e("calcite-split-button",{appearance:"transparent",color:"neutral","primary-text":this._translations.more},e("calcite-dropdown-group",{"selection-mode":"none"},e("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll(!0)},this._translations.selectAll),e("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._showSelected()},this._translations.showSelected),e("calcite-dropdown-item",{iconStart:"erase",onClick:()=>this._clearSelection()},this._translations.clearSelection),e("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._switchSelected()},this._translations.switchSelected),e("calcite-dropdown-item",{iconStart:"export",onClick:()=>this._exportToCSV()},this._translations.exportCSV)))))}_getTableHeader(){return e("div",{class:"header"},e("div",{class:"table-header-cell padding-3-4"},e("calcite-checkbox",{class:"display-flex justify-center",onClick:()=>this._selectAll(this._selectAllElement.checked),ref:t=>this._selectAllElement=t})),this._fieldNames.map((t=>this._getTableHeaderCell(t))))}_getTableHeaderCell(t){return e("div",{class:"table-header-cell field-width"},t)}_getTableRows(){return e("div",{class:"table-body"},this._graphics.map(((t,e)=>this._getTableRow(t,e))))}_getTableRow(t,i){const a=this._selectedIndexes.indexOf(i)>-1;return e("div",{class:"row"},e("div",{class:"table-cell table-border padding-3-4"},e("calcite-checkbox",{checked:a,class:"display-flex justify-center",onClick:()=>this._rowSelected(i),value:i})),this._fieldNames.map((e=>{const i=this._layerView.layer.fieldsIndex.get(e);return this._getTableRowCell(t.attributes[e],i,a)})))}_getTableRowCell(t,i,a){const l=i.editable&&a,s=this._getInputType(i.type);let r;const o=i.domain;return o&&(r="coded-value"===o.type?e("calcite-select",{label:""},o.codedValues.map((i=>e("calcite-option",{label:i.name,selected:t===i.code.toString(),value:i.code})))):e("calcite-input",{max:o.maxValue,min:o.minValue,type:"number",value:t})),e("div",{class:"table-cell table-border field-width"},l&&r?r:l?e("calcite-input",{type:s,value:t}):t)}_getInputType(t){const e={string:"text","small-integer":"number",integer:"number",single:"number",double:"number",long:"number",date:"datetime-local",oid:"number",guid:"text","global-id":"text"};return Object.keys(e).indexOf(t)>-1?e[t]:"text"}_selectAll(t){this._selectedIndexes=t?this._graphics.map(((t,e)=>e)):[]}_showSelected(){console.log("_showSelected")}_clearSelection(){this._selectedIndexes=[]}_switchSelected(){const t=[...this._selectedIndexes];this._selectedIndexes=this._graphics.reduce(((e,i,a)=>(t.indexOf(a)<0&&e.push(a),e)),[])}async _exportToCSV(){return c([],this._layerView.layer,this._getSelectedIds(),!1,!1,!0)}_zoom(){const t=this._getSelectedIds();s(t,this._layerView,this.mapView,!0)}_editMultiple(){this._editMultipleMpdal.open=!0}_delete(){console.log("delete")}_getGraphics(t){return this._graphics.filter(((e,i)=>t.indexOf(i)>-1))}_getSelectedIds(){return this._getGraphics(this._selectedIndexes).map((t=>t.getObjectId()))}_rowSelected(t){const e=this._selectedIndexes.indexOf(t);e>-1?(this._selectedIndexes.splice(e,1),this._selectedIndexes=[...this._selectedIndexes]):this._selectedIndexes=[...this._selectedIndexes,t]}async _layerSelectionChanged(t){const e=t.detail[0];this._layerView=await r(this.mapView,e),this._fieldNames=this._layerView.layer.fields.map((t=>t.alias||t.name)),this._graphics=await o(0,this._layerView.layer,[]),this._selectedIndexes=[]}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return a(this)}};n.style=":host{display:block}.table{display:table;width:100%}.header{display:table-header-group;background-color:#757575;font-weight:500;font-size:var(--calcite-font-size-0);color:var(--calcite-ui-text-inverse);position:sticky;top:0;z-index:1}.table-header-cell{display:table-cell;text-align:justify;border-right:1px solid var(--calcite-ui-border-2);padding:0.5rem}.table-body{display:table-row-group}.row{display:table-row}.table-cell{display:table-cell;padding:0.5rem}.display-table-header{display:table-header-group}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.justify-center{justify-content:center}.table-container{width:100%}.overflow-auto{overflow:auto}.data-container{overflow:auto;height:calc(100% - 35px)}.row:nth-child(odd){background:var(--calcite-ui-foreground-3)}.padding-3-4{padding:0.75rem}.field-width{white-space:nowrap;min-width:300px;max-width:300px;overflow:hidden}";export{n as layer_table}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as i,c as t,h as e,H as a,g as s}from"./p-c2f00d41.js";import{l as n}from"./p-4aa3ba60.js";import{g as l}from"./p-829e6d4f.js";import{b as r,g as h,t as o,i as c,h as d}from"./p-83166522.js";import{c as u,d as m}from"./p-bd67334c.js";import{a as b,c as p,d as g,H as f}from"./p-a33d73bb.js";import{u as v}from"./p-7daea1df.js";import{g as x}from"./p-a80b3880.js";import{d as k,c as y}from"./p-63f6e8f1.js";import{i as w}from"./p-73e23995.js";import{n as _,c as z,d as V}from"./p-9eba5c66.js";import{s as D}from"./p-4557d5a8.js";import{h as M,g as $,f as C}from"./p-dbc9a5a8.js";import{a as I,f as H,h as L}from"./p-88e28de2.js";import"./p-e1a4994d.js";import"./p-729708a3.js";import"./p-9a9955db.js";import"./p-00444009.js";const S=class{constructor(e){i(this,e),this.bufferComplete=t(this,"bufferComplete",7),this.distanceChanged=t(this,"distanceChanged",7),this.unitChanged=t(this,"unitChanged",7),this.appearance="text",this.distance=0,this.geometries=[],this.max=void 0,this.min=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this._translations=void 0}geometriesWatchHandler(){this._buffer()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return e(a,null,"text"===this.appearance?this._getTextBoxDisplay():this._getSliderDisplay())}async _initModules(){const[i]=await n(["esri/geometry/geometryEngine"]);this._geometryEngine=i}_getUnits(){const i={feet:this._translations.feet,meters:this._translations.meters,miles:this._translations.miles,kilometers:this._translations.kilometers};return Object.keys(i).map((t=>e("calcite-option",{label:i[t],selected:this.unit===t,value:t})))}_setDistance(i){const t=parseInt(i.detail.value,10);this.distance!==t&&t>=this.min&&(this.distanceChanged.emit({oldValue:this.distance,newValue:i.detail.value}),this.distance=t,this.distance>0?this._buffer():this.bufferComplete.emit(void 0))}_setUnit(i){this.unitChanged.emit({oldValue:this.unit,newValue:i}),this.unit=i,this._buffer()}_buffer(){this._bufferTimeout&&clearTimeout(this._bufferTimeout),this._bufferTimeout=setTimeout((()=>{var i;if((null===(i=this.geometries)||void 0===i?void 0:i.length)>0&&this.unit&&this.distance>0){const i=this._geometryEngine.geodesicBuffer(this.geometries,this.distance,this.unit,this.unionResults);this.bufferComplete.emit(i)}}),400)}_getTextBoxDisplay(){return e("div",{class:"c-container"},e("calcite-input",{class:"padding-end-1",max:this.max&&this.max>0?this.max:void 0,min:this.min,"number-button-type":"vertical",onCalciteInputInput:i=>this._setDistance(i),placeholder:"0",type:"number",value:this.distance?this.distance.toString():void 0}),e("calcite-select",{class:"flex-1",label:"label",onCalciteSelectChange:()=>this._setUnit(this._unitElement.value),ref:i=>{this._unitElement=i}},this._getUnits()))}_getSliderDisplay(){return e("div",null,e("calcite-slider",{labelHandles:!0,max:this.max&&this.max>0?this.max:void 0,min:this.min,ticks:this.sliderTicks}))}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}_testAccess(i,t){switch(i){case"_setUnit":return this._setUnit(t);case"_setDistance":return this._setDistance(t)}return null}get el(){return s(this)}static get watchers(){return{geometries:["geometriesWatchHandler"]}}};S.style=':host{display:block}.c-container{display:inline-flex}.flex-1{flex:"1"}.padding-end-1{-webkit-padding-end:1rem;padding-inline-end:1rem}';const A=class{constructor(e){i(this,e),this.calciteRadioGroupChange=t(this,"calciteRadioGroupChange",6),this.appearance="solid",this.disabled=!1,this.required=!1,this.layout="horizontal",this.scale="m",this.value=null,this.width="auto",this.handleClick=i=>{"calcite-radio-group-item"===i.target.localName&&this.selectItem(i.target,!0)}}valueHandler(i){this.getItems().forEach((t=>t.checked=t.value===i))}handleSelectedItemChange(i,t){if(this.value=null==i?void 0:i.value,i===t)return;const e=this.getItems(),a=Array.from(e).filter((t=>t===i)).pop();a?this.selectItem(a):e[0]&&(e[0].tabIndex=0)}componentWillLoad(){const i=this.getItems(),t=Array.from(i).filter((i=>i.checked)).pop();t?this.selectItem(t):i[0]&&(i[0].tabIndex=0)}componentDidLoad(){b(this,this.value)}connectedCallback(){u(this),p(this)}disconnectedCallback(){m(this),g(this)}componentDidRender(){v(this)}render(){return e(a,{onClick:this.handleClick,role:"radiogroup"},e("slot",null),e(f,{component:this}))}handleSelected(i){i.preventDefault(),this.selectItem(i.target),i.stopPropagation()}handleKeyDown(i){const{key:t}=i,{el:e,selectedItem:a}=this;if(-1===["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"," "].indexOf(t))return;let s=t;"rtl"===r(e)&&("ArrowRight"===t&&(s="ArrowLeft"),"ArrowLeft"===t&&(s="ArrowRight"));const n=this.getItems();let l=-1;switch(n.forEach(((i,t)=>{i===a&&(l=t)})),s){case"ArrowLeft":case"ArrowUp":i.preventDefault();const t=n.item(l<1?n.length-1:l-1);return void this.selectItem(t,!0);case"ArrowRight":case"ArrowDown":i.preventDefault();const e=-1===l?n.item(1):n.item(l+1)||n.item(0);return void this.selectItem(e,!0);case" ":return i.preventDefault(),void this.selectItem(i.target,!0);default:return}}async setFocus(){var i;null===(i=this.selectedItem||this.getItems()[0])||void 0===i||i.focus()}onLabelClick(){this.setFocus()}getItems(){return this.el.querySelectorAll("calcite-radio-group-item")}selectItem(i,t=!1){if(i===this.selectedItem)return;const e=this.getItems();let a=null;e.forEach((e=>{const s=e.value===i.value;(s&&!e.checked||!s&&e.checked)&&(e.checked=s),e.tabIndex=s?0:-1,s&&(a=e,t&&this.calciteRadioGroupChange.emit(a.value))})),this.selectedItem=a,a&&a.focus()}get el(){return s(this)}static get watchers(){return{value:["valueHandler"],selectedItem:["handleSelectedItemChange"]}}};A.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)}: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:flex;background-color:var(--calcite-ui-foreground-1);inline-size:-moz-fit-content;inline-size:fit-content;outline:1px solid var(--calcite-ui-border-input);outline-offset:-1px}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([layout=vertical]){flex-direction:column;align-items:flex-start;align-self:flex-start}:host([width=full]){inline-size:100%;min-inline-size:-moz-fit-content;min-inline-size:fit-content}:host([width=full]) ::slotted(calcite-radio-group-item){flex:1 1 auto}:host([width=full][layout=vertical]) ::slotted(calcite-radio-group-item){justify-content:flex-start}::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}";
6
+ import{r as i,c as t,h as e,H as a,g as s}from"./p-c2f00d41.js";import{l as n}from"./p-4aa3ba60.js";import{g as l}from"./p-829e6d4f.js";import{b as r,g as h,t as o,i as c,h as d}from"./p-83166522.js";import{c as u,d as m}from"./p-bd67334c.js";import{a as b,c as p,d as g,H as f}from"./p-a33d73bb.js";import{u as v}from"./p-7daea1df.js";import{g as x}from"./p-a80b3880.js";import{d as k,c as y}from"./p-63f6e8f1.js";import{i as w}from"./p-73e23995.js";import{n as _,c as z,d as V}from"./p-9eba5c66.js";import{s as D}from"./p-4557d5a8.js";import{h as M,g as $,f as C}from"./p-dbc9a5a8.js";import{a as I,f as H,h as L}from"./p-88e5a76d.js";import"./p-e1a4994d.js";import"./p-729708a3.js";import"./p-9a9955db.js";import"./p-00444009.js";const S=class{constructor(e){i(this,e),this.bufferComplete=t(this,"bufferComplete",7),this.distanceChanged=t(this,"distanceChanged",7),this.unitChanged=t(this,"unitChanged",7),this.appearance="text",this.distance=0,this.geometries=[],this.max=void 0,this.min=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this._translations=void 0}geometriesWatchHandler(){this._buffer()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return e(a,null,"text"===this.appearance?this._getTextBoxDisplay():this._getSliderDisplay())}async _initModules(){const[i]=await n(["esri/geometry/geometryEngine"]);this._geometryEngine=i}_getUnits(){const i={feet:this._translations.feet,meters:this._translations.meters,miles:this._translations.miles,kilometers:this._translations.kilometers};return Object.keys(i).map((t=>e("calcite-option",{label:i[t],selected:this.unit===t,value:t})))}_setDistance(i){const t=parseInt(i.detail.value,10);this.distance!==t&&t>=this.min&&(this.distanceChanged.emit({oldValue:this.distance,newValue:i.detail.value}),this.distance=t,this.distance>0?this._buffer():this.bufferComplete.emit(void 0))}_setUnit(i){this.unitChanged.emit({oldValue:this.unit,newValue:i}),this.unit=i,this._buffer()}_buffer(){this._bufferTimeout&&clearTimeout(this._bufferTimeout),this._bufferTimeout=setTimeout((()=>{var i;if((null===(i=this.geometries)||void 0===i?void 0:i.length)>0&&this.unit&&this.distance>0){const i=this._geometryEngine.geodesicBuffer(this.geometries,this.distance,this.unit,this.unionResults);this.bufferComplete.emit(i)}}),400)}_getTextBoxDisplay(){return e("div",{class:"c-container"},e("calcite-input",{class:"padding-end-1",max:this.max&&this.max>0?this.max:void 0,min:this.min,"number-button-type":"vertical",onCalciteInputInput:i=>this._setDistance(i),placeholder:"0",type:"number",value:this.distance?this.distance.toString():void 0}),e("calcite-select",{class:"flex-1",label:"label",onCalciteSelectChange:()=>this._setUnit(this._unitElement.value),ref:i=>{this._unitElement=i}},this._getUnits()))}_getSliderDisplay(){return e("div",null,e("calcite-slider",{labelHandles:!0,max:this.max&&this.max>0?this.max:void 0,min:this.min,ticks:this.sliderTicks}))}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}_testAccess(i,t){switch(i){case"_setUnit":return this._setUnit(t);case"_setDistance":return this._setDistance(t)}return null}get el(){return s(this)}static get watchers(){return{geometries:["geometriesWatchHandler"]}}};S.style=':host{display:block}.c-container{display:inline-flex}.flex-1{flex:"1"}.padding-end-1{-webkit-padding-end:1rem;padding-inline-end:1rem}';const A=class{constructor(e){i(this,e),this.calciteRadioGroupChange=t(this,"calciteRadioGroupChange",6),this.appearance="solid",this.disabled=!1,this.required=!1,this.layout="horizontal",this.scale="m",this.value=null,this.width="auto",this.handleClick=i=>{"calcite-radio-group-item"===i.target.localName&&this.selectItem(i.target,!0)}}valueHandler(i){this.getItems().forEach((t=>t.checked=t.value===i))}handleSelectedItemChange(i,t){if(this.value=null==i?void 0:i.value,i===t)return;const e=this.getItems(),a=Array.from(e).filter((t=>t===i)).pop();a?this.selectItem(a):e[0]&&(e[0].tabIndex=0)}componentWillLoad(){const i=this.getItems(),t=Array.from(i).filter((i=>i.checked)).pop();t?this.selectItem(t):i[0]&&(i[0].tabIndex=0)}componentDidLoad(){b(this,this.value)}connectedCallback(){u(this),p(this)}disconnectedCallback(){m(this),g(this)}componentDidRender(){v(this)}render(){return e(a,{onClick:this.handleClick,role:"radiogroup"},e("slot",null),e(f,{component:this}))}handleSelected(i){i.preventDefault(),this.selectItem(i.target),i.stopPropagation()}handleKeyDown(i){const{key:t}=i,{el:e,selectedItem:a}=this;if(-1===["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"," "].indexOf(t))return;let s=t;"rtl"===r(e)&&("ArrowRight"===t&&(s="ArrowLeft"),"ArrowLeft"===t&&(s="ArrowRight"));const n=this.getItems();let l=-1;switch(n.forEach(((i,t)=>{i===a&&(l=t)})),s){case"ArrowLeft":case"ArrowUp":i.preventDefault();const t=n.item(l<1?n.length-1:l-1);return void this.selectItem(t,!0);case"ArrowRight":case"ArrowDown":i.preventDefault();const e=-1===l?n.item(1):n.item(l+1)||n.item(0);return void this.selectItem(e,!0);case" ":return i.preventDefault(),void this.selectItem(i.target,!0);default:return}}async setFocus(){var i;null===(i=this.selectedItem||this.getItems()[0])||void 0===i||i.focus()}onLabelClick(){this.setFocus()}getItems(){return this.el.querySelectorAll("calcite-radio-group-item")}selectItem(i,t=!1){if(i===this.selectedItem)return;const e=this.getItems();let a=null;e.forEach((e=>{const s=e.value===i.value;(s&&!e.checked||!s&&e.checked)&&(e.checked=s),e.tabIndex=s?0:-1,s&&(a=e,t&&this.calciteRadioGroupChange.emit(a.value))})),this.selectedItem=a,a&&a.focus()}get el(){return s(this)}static get watchers(){return{value:["valueHandler"],selectedItem:["handleSelectedItemChange"]}}};A.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)}: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:flex;background-color:var(--calcite-ui-foreground-1);inline-size:-moz-fit-content;inline-size:fit-content;outline:1px solid var(--calcite-ui-border-input);outline-offset:-1px}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([layout=vertical]){flex-direction:column;align-items:flex-start;align-self:flex-start}:host([width=full]){inline-size:100%;min-inline-size:-moz-fit-content;min-inline-size:fit-content}:host([width=full]) ::slotted(calcite-radio-group-item){flex:1 1 auto}:host([width=full][layout=vertical]) ::slotted(calcite-radio-group-item){justify-content:flex-start}::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}";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
@@ -15,4 +15,4 @@ const j="radio-group-item-icon",T=class{constructor(e){i(this,e),this.calciteInt
15
15
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
16
16
  * v1.0.0-beta.97
17
17
  */
18
- const F="handle__label";function O(i){return Array.isArray(i)}const P=class{constructor(e){i(this,e),this.calciteSliderInput=t(this,"calciteSliderInput",6),this.calciteSliderChange=t(this,"calciteSliderChange",6),this.calciteSliderUpdate=t(this,"calciteSliderUpdate",6),this.disabled=!1,this.groupSeparator=!1,this.hasHistogram=!1,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.min=0,this.mirrored=!1,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.value=0,this.scale="m",this.activeProp="value",this.guid=`calcite-slider-${x()}`,this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[],this.dragUpdate=i=>{if(i.preventDefault(),this.dragProp){const t=this.translate(i.clientX||i.pageX);if(O(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const i=t-this.minValueDragRange,e=t+this.maxValueDragRange;e<=this.max&&i>=this.min&&e-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(e,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.pointerUpDragEnd=i=>{c(i)&&this.dragEnd(i)},this.dragEnd=i=>{this.removeDragListeners(),this.focusActiveHandle(i.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null},this.storeTrackRef=i=>{this.trackEl=i},this.determineGroupSeparator=i=>{if("number"==typeof i)return _.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},_.localize(i.toString())}}histogramWatcher(i){this.hasHistogram=!!i}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){z(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),u(this),p(this)}disconnectedCallback(){m(this),g(this),V(this),this.removeDragListeners()}componentWillLoad(){this.tickValues=this.generateTickValues(),O(this.value)||(this.value=this.clamp(this.value)),b(this,this.value),this.snap&&!O(this.value)&&(this.value=this.getClosestStep(this.value)),this.histogram&&(this.hasHistogram=!0)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),O(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),v(this)}render(){const i=this.el.id||this.guid,t=O(this.value)?"maxValue":"value",s=O(this.value)?this.maxValue:this.value,n=this.determineGroupSeparator(s),l=this.determineGroupSeparator(this.minValue),r=this.minValue||this.min,h=this.shouldUseMinValue(),o=100*this.getUnitInterval(h?this.minValue:r),c=100*this.getUnitInterval(s),d=this.shouldMirror(),u=`${d?100-o:o}%`,m=`${d?c:100-c}%`,b=O(this.value),p=`${F} handle__label--minValue`,g=`${F} handle__label--value`,v=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"})),x=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"})),k=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),y=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"}),e("div",{class:"handle-extension"})),w=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),_=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"}),e("div",{class:"handle-extension"})),z=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),V=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle"})),D=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l),e("div",{class:"handle"})),M=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l)),$=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),C=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l));return e(a,{id:i,onTouchStart:this.handleTouchStart},e("div",{class:{container:!0,"container--range":b,[`scale--${this.scale}`]:!0}},this.renderGraph(),e("div",{class:"track",ref:this.storeTrackRef},e("div",{class:"track__range",onPointerDown:i=>this.pointerDownDragStart(i,"minMaxValue"),style:{left:`${d?100-c:o}%`,right:`${d?o:100-c}%`}}),e("div",{class:"ticks"},this.tickValues.map((i=>{const t=100*this.getUnitInterval(i)+"%";let a=i>=r&&i<=s;return h&&(a=i>=this.minValue&&i<=this.maxValue),e("span",{class:{tick:!0,"tick--active":a},style:{left:d?"":t,right:d?t:""}},this.renderTickLabel(i))})))),e("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&b&&V,!this.hasHistogram&&!this.precise&&this.labelHandles&&b&&D,this.precise&&!this.labelHandles&&b&&$,this.precise&&this.labelHandles&&b&&C,this.hasHistogram&&!this.precise&&this.labelHandles&&b&&M,!this.precise&&!this.labelHandles&&v,!this.hasHistogram&&!this.precise&&this.labelHandles&&x,!this.hasHistogram&&this.precise&&!this.labelHandles&&y,this.hasHistogram&&this.precise&&!this.labelHandles&&w,!this.hasHistogram&&this.precise&&this.labelHandles&&_,this.hasHistogram&&!this.precise&&this.labelHandles&&k,this.hasHistogram&&this.precise&&this.labelHandles&&z,e(f,{component:this}))))}renderGraph(){return this.histogram?e("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:O(this.value)?this.maxValue:this.value,highlightMin:O(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(i){const t=O(this.value),a=i===this.min,s=i===this.max,n=this.determineGroupSeparator(i),l=e("span",{class:{tick__label:!0,"tick__label--min":a,"tick__label--max":s}},n);return this.labelTicks&&!this.hasHistogram&&!t||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&this.precise&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(a||s)?l:null}keyDownHandler(i){const t=this.shouldMirror(),{activeProp:e,max:a,min:s,pageStep:n,step:l}=this,r=this[e],{key:h}=i;if(w(h))return void i.preventDefault();let o;if("ArrowUp"===h||"ArrowRight"===h?o=r+l*(t&&"ArrowRight"===h?-1:1):"ArrowDown"===h||"ArrowLeft"===h?o=r-l*(t&&"ArrowLeft"===h?-1:1):"PageUp"===h?n&&(o=r+n):"PageDown"===h?n&&(o=r-n):"Home"===h?o=s:"End"===h&&(o=a),isNaN(o))return;i.preventDefault();const c=Number(o.toFixed(k(l)));this.setValue({[e]:this.clamp(c,e)})}pointerDownHandler(i){if(!c(i))return;const t=i.clientX||i.pageX,e=this.translate(t);let a="value";O(this.value)&&(a=e>=this.minValue&&e<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-e)<Math.abs(this.minValue-e)||e>this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[a]:this.clamp(e,a)}),this.focusActiveHandle(t)}handleTouchStart(i){i.preventDefault()}async setFocus(){const i=this.minHandle?this.minHandle:this.maxHandle;null==i||i.focus()}setValueFromMinMax(){const{minValue:i,maxValue:t}=this;"number"==typeof i&&"number"==typeof t&&(this.value=[i,t])}setMinMaxFromValue(){const{value:i}=this;O(i)&&(this.minValue=i[0],this.maxValue=i[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!O(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}generateTickValues(){const i=[];let t=this.min;for(;this.ticks&&t<this.max+this.ticks;)i.push(Math.min(t,this.max)),t+=this.ticks;return i}pointerDownDragStart(i,t){c(i)&&this.dragStart(t)}dragStart(i){this.dragProp=i,this.lastDragProp=this.dragProp,this.activeProp=i,document.addEventListener("pointermove",this.dragUpdate),document.addEventListener("pointerup",this.pointerUpDragEnd),document.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(i){switch(this.dragProp){case"minValue":this.minHandle.focus();break;case"maxValue":case"value":this.maxHandle.focus();break;case"minMaxValue":this.getClosestHandle(i).focus()}}emitInput(){this.calciteSliderInput.emit(),this.calciteSliderUpdate.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){document.removeEventListener("pointermove",this.dragUpdate),document.removeEventListener("pointerup",this.pointerUpDragEnd),document.removeEventListener("pointercancel",this.dragEnd)}setValue(i){let t;Object.keys(i).forEach((e=>{const a=i[e];t||(t=this[e]!==a),this[e]=a})),t&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(i,t){return i=y(i,this.min,this.max),"maxValue"===t&&(i=Math.max(i,this.minValue)),"minValue"===t&&(i=Math.min(i,this.maxValue)),i}translate(i){const t=this.max-this.min,{left:e,width:a}=this.trackEl.getBoundingClientRect(),s=(i-e)/a,n=this.shouldMirror(),l=this.clamp(this.min+t*(n?1-s:s));let r=Number(l.toFixed(k(this.step)));return this.snap&&this.step&&(r=this.getClosestStep(r)),r}getClosestStep(i){if(i=Number(this.clamp(i).toFixed(k(this.step))),this.step){const t=Math.round(i/this.step)*this.step;i=Number(this.clamp(t).toFixed(k(this.step)))}return i}getClosestHandle(i){return this.getDistanceX(this.maxHandle,i)>this.getDistanceX(this.minHandle,i)?this.minHandle:this.maxHandle}getDistanceX(i,t){return Math.abs(i.getBoundingClientRect().left-t)}getFontSizeForElement(i){return Number(window.getComputedStyle(i).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(i){return((i=this.clamp(i))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(i){const t=this.el.shadowRoot.querySelector(`.handle__label--${i}`),e=this.el.shadowRoot.querySelector(`.handle__label--${i}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${i}.transformed`),s=e.getBoundingClientRect(),n=this.getHostOffset(s.left,s.right);t.style.transform=`translateX(${n}px)`,a.style.transform=`translateX(${n}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:i}=this.el,t=this.shouldMirror(),e=t?"value":"minValue",a=t?"minValue":"value",s=i.querySelector(`.handle__label--${e}`),n=i.querySelector(`.handle__label--${e}.static`),l=i.querySelector(`.handle__label--${e}.transformed`),r=this.getHostOffset(n.getBoundingClientRect().left,n.getBoundingClientRect().right),h=i.querySelector(`.handle__label--${a}`),o=i.querySelector(`.handle__label--${a}.static`),c=i.querySelector(`.handle__label--${a}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),u=this.getFontSizeForElement(s),m=this.getRangeLabelOverlap(l,c),b=s,p=u/2;if(m>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===r){let i=m/2-p;i=-1===Math.sign(i)?Math.abs(i):-i;const t=this.getHostOffset(l.getBoundingClientRect().left+i-p,l.getBoundingClientRect().right+i-p);let e=m/2;const a=this.getHostOffset(c.getBoundingClientRect().left+e,c.getBoundingClientRect().right+e);0!==t&&(i+=t,e+=t),0!==a&&(i+=a,e+=a),s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`,h.style.transform=`translateX(${e}px)`,c.style.transform=`translateX(${e}px)`}else if(r>0||d>0)s.style.transform=`translateX(${r+p}px)`,h.style.transform=`translateX(${m+d}px)`,c.style.transform=`translateX(${m+d}px)`;else if(r<0||d<0){let i=Math.abs(r)+m-p;i=-1===Math.sign(i)?Math.abs(i):-i,s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`}}else b.classList.remove("hyphen","hyphen--wrap"),s.style.transform=`translateX(${r}px)`,l.style.transform=`translateX(${r}px)`,h.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const i=O(this.value);if(!(this.hasHistogram||i||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!i&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!i&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!i&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&i&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const t=this.el.shadowRoot.querySelector(".thumb--minValue"),e=this.el.shadowRoot.querySelector(".thumb--value"),a=this.el.shadowRoot.querySelector(".tick__label--min"),s=this.el.shadowRoot.querySelector(".tick__label--max");!t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,e)?"0":"1"),t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,t)||this.isMaxTickLabelObscured(s,e)&&this.hasHistogram?"0":"1")}getHostOffset(i,t){const e=this.el.getBoundingClientRect();return i+7<e.left?e.left-i-7:t-7>e.right?7-(t-e.right):0}getRangeLabelOverlap(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=this.getFontSizeForElement(i);return Math.max(e.right+s-a.left,0)}isMinTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return d(e,a)}isMaxTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return d(e,a)}get el(){return s(this)}static get watchers(){return{histogram:["histogramWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};P.style='@charset "UTF-8";@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)}: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)}.scale--s{--calcite-slider-handle-size:10px;--calcite-slider-handle-extension-height:6.5px;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:14px;--calcite-slider-handle-extension-height:8px;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:16px;--calcite-slider-handle-extension-height:10.5px;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n )}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-6px}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-8px}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-9px}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-2px}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-23px}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-30px}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-32px}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{-webkit-margin-before:0.5em;margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{-webkit-margin-after:0.5em;margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-33px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-44px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-49px}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;-webkit-margin-start:calc(-1 * 0.125rem);margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;-webkit-margin-before:0.875rem;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{-webkit-padding-after:calc(0.875rem + var(--calcite-slider-container-font-size));padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + 1em);padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{-webkit-padding-after:calc(var(--calcite-slider-handle-size) * 0.5 + 1em);padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{-webkit-padding-before:var(--calcite-slider-full-handle-height);padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::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}';const R=class{constructor(e){i(this,e),this.sketchGraphicsChange=t(this,"sketchGraphicsChange",7),this.active=!1,this.border=!1,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.graphics=[],this._translations=void 0}graphicsWatchHandler(i,t){i&&i.length>0&&JSON.stringify(i)!==JSON.stringify(t)&&this._sketchGraphicsLayer&&(this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(i))}mapViewWatchHandler(i,t){i&&i!==t&&this._init()}async clear(){this._clearSketch()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}render(){return e(a,null,e("div",{class:this.border?"border":""},e("div",{ref:i=>{this._sketchElement=i}})))}async _initModules(){const[i,t]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch"]);this.GraphicsLayer=i,this.Sketch=t}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initDrawTools())}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i}),D.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initDrawTools(){this._sketchWidget=new this.Sketch({layer:this._sketchGraphicsLayer,view:this.mapView,container:this._sketchElement,creationMode:"single",defaultCreateOptions:{mode:"hybrid"}}),this.pointSymbol=this._sketchWidget.viewModel.pointSymbol,this.polylineSymbol=this._sketchWidget.viewModel.polylineSymbol,this.polygonSymbol=this._sketchWidget.viewModel.polygonSymbol,this._sketchWidget.visibleElements={selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1},this._sketchWidget.on("update",(i=>{"start"===i.state&&(this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)),"active"===i.state&&(clearTimeout(this._selectionTimer),this._selectionTimer=setTimeout((()=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)}),500))})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("undo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("redo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("create",(i=>{"complete"===i.state&&(this.graphics=[i.graphic],this.sketchGraphicsChange.emit(this.graphics))}))}_clearSketch(){var i;this.graphics=[],null===(i=this._sketchGraphicsLayer)||void 0===i||i.removeAll()}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};R.style=":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}";const X=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.refineSelectionGraphicsChange=t(this,"refineSelectionGraphicsChange",7),this.refineSelectionIdsChange=t(this,"refineSelectionIdsChange",7),this._featuresCollection={},this.active=!1,this.border=!1,this.enabledLayerIds=[],this.graphics=void 0,this.ids=[],this.layerView=void 0,this.layerViews=[],this.mapView=void 0,this.mode=void 0,this.refineMode=void 0,this.refineSelectionSet=void 0,this.useLayerPicker=!0,this._selectEnabled=!1,this._selectionMode=void 0,this._translations=void 0}idsWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&this._highlightFeatures(i)}async reset(){this.ids=[]}async clearHighlight(){this._clearHighlight()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this.active=!1}connectedCallback(){this.active=!0,this.ids.length>0&&(this._selectEnabled=!0,this._highlightFeatures(this.ids))}render(){var i,t;const s=this.border?" border":"",n=this.refineMode===$.ALL?"div-visible":"div-not-visible";return e(a,null,e("div",null,e("map-layer-picker",{class:this.useLayerPicker?"div-visible":"div-not-visible",enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedLayerIds:this.layerViews.map((i=>i.layer.id)),selectionMode:"single"}),e("div",{class:"margin-top-1"+s},e("div",{class:"esri-sketch esri-widget"},e("div",{class:"esri-sketch__panel"},e("div",{class:"esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:!this._selectEnabled,icon:"pin",onClick:()=>this._setSelectionMode(M.POINT),scale:"s",text:this._translations.select}),e("calcite-action",{disabled:!this._selectEnabled,icon:"line",onClick:()=>this._setSelectionMode(M.LINE),scale:"s",text:this._translations.selectLine}),e("calcite-action",{disabled:!this._selectEnabled,icon:"polygon",onClick:()=>this._setSelectionMode(M.POLY),scale:"s",text:this._translations.selectPolygon}),e("calcite-action",{disabled:!this._selectEnabled,icon:"rectangle",onClick:()=>this._setSelectionMode(M.RECT),scale:"s",text:this._translations.selectRectangle})),e("div",{class:n+" esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:!(null===(i=this.refineSelectionSet)||void 0===i?void 0:i.undoStack)||0===this.refineSelectionSet.undoStack.length,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),e("calcite-action",{disabled:!(null===(t=this.refineSelectionSet)||void 0===t?void 0:t.redoStack)||0===this.refineSelectionSet.redoStack.length,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo})))))))}_init(){this._initGraphicsLayer(),this._initSketchViewModel()}async _initModules(){const[i,t]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=i,this.SketchViewModel=t}_initSketchViewModel(){this._sketchViewModel=new this.SketchViewModel({layer:this._sketchGraphicsLayer,defaultUpdateOptions:{tool:"reshape",toggleToolOnClick:!1},view:this.mapView}),this._sketchViewModel.on("create",(i=>{"complete"===i.state&&this.active&&(this._featuresCollection={},this._sketchGeometry=i.graphic.geometry,this._selectFeatures(this._sketchGeometry))}))}_clear(){this._sketchGeometry=null,this._sketchViewModel.cancel(),this._sketchGraphicsLayer.removeAll()}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i}),D.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initHitTest(){this._hitTestHandle&&this._hitTestHandle.remove(),this._hitTestHandle=this.mapView.on("click",(i=>{i.stopPropagation();const t={include:this.layerViews.map((i=>i.layer))};this.mapView.hitTest(i,t).then((i=>{let t=[];i.results.length>0&&(t=i.results.reduce(((i,t)=>{const e=null==t?void 0:t.graphic;return e&&i.push(e),i}),[])),this.refineSelectionGraphicsChange.emit({graphics:t,useOIDs:!1}),this._clear()}))}))}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){this._selectEnabled=!0;const t=i.detail.map((i=>I(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i}))}this._selectEnabled=!1}_setSelectionMode(i){switch(this._selectionMode=i,this._hitTestHandle&&this._hitTestHandle.remove(),this._selectionMode){case M.POINT:this._sketchViewModel.create("point");break;case M.LINE:this._sketchViewModel.create("polyline");break;case M.POLY:this._sketchViewModel.create("polygon");break;case M.RECT:this._sketchViewModel.create("rectangle")}}async _selectFeatures(i){this.selectionLoadingChange.emit(!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.selectionLoadingChange.emit(!1);let t=[];if(i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))})),this.refineMode===$.SUBSET)this.refineSelectionGraphicsChange.emit({graphics:t,useOIDs:this.layerViews[0].layer.title===this.layerView.layer.title});else{const i=Array.isArray(t)?t.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(i,this.mode,this.refineSelectionSet.undoStack,this.mode)}this._clear()}))}async _highlightFeatures(i,t=!1){this._clearHighlight(),i.length>0&&(D.highlightHandle=await L(i,this.layerViews[0],this.mapView,t))}_clearHighlight(){var i;null===(i=D.highlightHandle)||void 0===i||i.remove()}async _updateIds(i,t,e,a){const s={addIds:[],removeIds:[]};t===C.ADD?(s.addIds=i.filter((i=>this.ids.indexOf(i)<0)),this.ids=[...this.ids,...s.addIds],s.addIds.length>0&&e.push({mode:a,ids:s.addIds})):(s.removeIds=i.filter((i=>this.ids.indexOf(i)>-1)),this.ids=this.ids.filter((i=>s.removeIds.indexOf(i)<0)),s.removeIds.length>0&&e.push({mode:a,ids:s.removeIds})),await this._highlightFeatures(this.ids).then((()=>{this.refineSelectionIdsChange.emit(s)}))}_undo(){const i=this.refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===C.ADD?C.REMOVE:C.ADD,this.refineSelectionSet.redoStack,i.mode)}_redo(){const i=this.refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode,this.refineSelectionSet.undoStack,i.mode)}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{ids:["idsWatchHandler"]}}};X.style=':host{display:block}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.border{outline:1px solid var(--calcite-ui-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:var(--calcite-ui-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110,110,110,.3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110,110,110,.3)}';export{S as buffer_tools,A as calcite_radio_group,T as calcite_radio_group_item,P as calcite_slider,R as map_draw_tools,X as refine_selection_tools}
18
+ const F="handle__label";function O(i){return Array.isArray(i)}const P=class{constructor(e){i(this,e),this.calciteSliderInput=t(this,"calciteSliderInput",6),this.calciteSliderChange=t(this,"calciteSliderChange",6),this.calciteSliderUpdate=t(this,"calciteSliderUpdate",6),this.disabled=!1,this.groupSeparator=!1,this.hasHistogram=!1,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.min=0,this.mirrored=!1,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.value=0,this.scale="m",this.activeProp="value",this.guid=`calcite-slider-${x()}`,this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[],this.dragUpdate=i=>{if(i.preventDefault(),this.dragProp){const t=this.translate(i.clientX||i.pageX);if(O(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const i=t-this.minValueDragRange,e=t+this.maxValueDragRange;e<=this.max&&i>=this.min&&e-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(e,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.pointerUpDragEnd=i=>{c(i)&&this.dragEnd(i)},this.dragEnd=i=>{this.removeDragListeners(),this.focusActiveHandle(i.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null},this.storeTrackRef=i=>{this.trackEl=i},this.determineGroupSeparator=i=>{if("number"==typeof i)return _.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},_.localize(i.toString())}}histogramWatcher(i){this.hasHistogram=!!i}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){z(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),u(this),p(this)}disconnectedCallback(){m(this),g(this),V(this),this.removeDragListeners()}componentWillLoad(){this.tickValues=this.generateTickValues(),O(this.value)||(this.value=this.clamp(this.value)),b(this,this.value),this.snap&&!O(this.value)&&(this.value=this.getClosestStep(this.value)),this.histogram&&(this.hasHistogram=!0)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),O(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),v(this)}render(){const i=this.el.id||this.guid,t=O(this.value)?"maxValue":"value",s=O(this.value)?this.maxValue:this.value,n=this.determineGroupSeparator(s),l=this.determineGroupSeparator(this.minValue),r=this.minValue||this.min,h=this.shouldUseMinValue(),o=100*this.getUnitInterval(h?this.minValue:r),c=100*this.getUnitInterval(s),d=this.shouldMirror(),u=`${d?100-o:o}%`,m=`${d?c:100-c}%`,b=O(this.value),p=`${F} handle__label--minValue`,g=`${F} handle__label--value`,v=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"})),x=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"})),k=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),y=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"}),e("div",{class:"handle-extension"})),w=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),_=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"}),e("div",{class:"handle-extension"})),z=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),V=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle"})),D=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l),e("div",{class:"handle"})),M=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l)),$=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),C=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l));return e(a,{id:i,onTouchStart:this.handleTouchStart},e("div",{class:{container:!0,"container--range":b,[`scale--${this.scale}`]:!0}},this.renderGraph(),e("div",{class:"track",ref:this.storeTrackRef},e("div",{class:"track__range",onPointerDown:i=>this.pointerDownDragStart(i,"minMaxValue"),style:{left:`${d?100-c:o}%`,right:`${d?o:100-c}%`}}),e("div",{class:"ticks"},this.tickValues.map((i=>{const t=100*this.getUnitInterval(i)+"%";let a=i>=r&&i<=s;return h&&(a=i>=this.minValue&&i<=this.maxValue),e("span",{class:{tick:!0,"tick--active":a},style:{left:d?"":t,right:d?t:""}},this.renderTickLabel(i))})))),e("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&b&&V,!this.hasHistogram&&!this.precise&&this.labelHandles&&b&&D,this.precise&&!this.labelHandles&&b&&$,this.precise&&this.labelHandles&&b&&C,this.hasHistogram&&!this.precise&&this.labelHandles&&b&&M,!this.precise&&!this.labelHandles&&v,!this.hasHistogram&&!this.precise&&this.labelHandles&&x,!this.hasHistogram&&this.precise&&!this.labelHandles&&y,this.hasHistogram&&this.precise&&!this.labelHandles&&w,!this.hasHistogram&&this.precise&&this.labelHandles&&_,this.hasHistogram&&!this.precise&&this.labelHandles&&k,this.hasHistogram&&this.precise&&this.labelHandles&&z,e(f,{component:this}))))}renderGraph(){return this.histogram?e("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:O(this.value)?this.maxValue:this.value,highlightMin:O(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(i){const t=O(this.value),a=i===this.min,s=i===this.max,n=this.determineGroupSeparator(i),l=e("span",{class:{tick__label:!0,"tick__label--min":a,"tick__label--max":s}},n);return this.labelTicks&&!this.hasHistogram&&!t||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&this.precise&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(a||s)?l:null}keyDownHandler(i){const t=this.shouldMirror(),{activeProp:e,max:a,min:s,pageStep:n,step:l}=this,r=this[e],{key:h}=i;if(w(h))return void i.preventDefault();let o;if("ArrowUp"===h||"ArrowRight"===h?o=r+l*(t&&"ArrowRight"===h?-1:1):"ArrowDown"===h||"ArrowLeft"===h?o=r-l*(t&&"ArrowLeft"===h?-1:1):"PageUp"===h?n&&(o=r+n):"PageDown"===h?n&&(o=r-n):"Home"===h?o=s:"End"===h&&(o=a),isNaN(o))return;i.preventDefault();const c=Number(o.toFixed(k(l)));this.setValue({[e]:this.clamp(c,e)})}pointerDownHandler(i){if(!c(i))return;const t=i.clientX||i.pageX,e=this.translate(t);let a="value";O(this.value)&&(a=e>=this.minValue&&e<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-e)<Math.abs(this.minValue-e)||e>this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[a]:this.clamp(e,a)}),this.focusActiveHandle(t)}handleTouchStart(i){i.preventDefault()}async setFocus(){const i=this.minHandle?this.minHandle:this.maxHandle;null==i||i.focus()}setValueFromMinMax(){const{minValue:i,maxValue:t}=this;"number"==typeof i&&"number"==typeof t&&(this.value=[i,t])}setMinMaxFromValue(){const{value:i}=this;O(i)&&(this.minValue=i[0],this.maxValue=i[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!O(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}generateTickValues(){const i=[];let t=this.min;for(;this.ticks&&t<this.max+this.ticks;)i.push(Math.min(t,this.max)),t+=this.ticks;return i}pointerDownDragStart(i,t){c(i)&&this.dragStart(t)}dragStart(i){this.dragProp=i,this.lastDragProp=this.dragProp,this.activeProp=i,document.addEventListener("pointermove",this.dragUpdate),document.addEventListener("pointerup",this.pointerUpDragEnd),document.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(i){switch(this.dragProp){case"minValue":this.minHandle.focus();break;case"maxValue":case"value":this.maxHandle.focus();break;case"minMaxValue":this.getClosestHandle(i).focus()}}emitInput(){this.calciteSliderInput.emit(),this.calciteSliderUpdate.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){document.removeEventListener("pointermove",this.dragUpdate),document.removeEventListener("pointerup",this.pointerUpDragEnd),document.removeEventListener("pointercancel",this.dragEnd)}setValue(i){let t;Object.keys(i).forEach((e=>{const a=i[e];t||(t=this[e]!==a),this[e]=a})),t&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(i,t){return i=y(i,this.min,this.max),"maxValue"===t&&(i=Math.max(i,this.minValue)),"minValue"===t&&(i=Math.min(i,this.maxValue)),i}translate(i){const t=this.max-this.min,{left:e,width:a}=this.trackEl.getBoundingClientRect(),s=(i-e)/a,n=this.shouldMirror(),l=this.clamp(this.min+t*(n?1-s:s));let r=Number(l.toFixed(k(this.step)));return this.snap&&this.step&&(r=this.getClosestStep(r)),r}getClosestStep(i){if(i=Number(this.clamp(i).toFixed(k(this.step))),this.step){const t=Math.round(i/this.step)*this.step;i=Number(this.clamp(t).toFixed(k(this.step)))}return i}getClosestHandle(i){return this.getDistanceX(this.maxHandle,i)>this.getDistanceX(this.minHandle,i)?this.minHandle:this.maxHandle}getDistanceX(i,t){return Math.abs(i.getBoundingClientRect().left-t)}getFontSizeForElement(i){return Number(window.getComputedStyle(i).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(i){return((i=this.clamp(i))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(i){const t=this.el.shadowRoot.querySelector(`.handle__label--${i}`),e=this.el.shadowRoot.querySelector(`.handle__label--${i}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${i}.transformed`),s=e.getBoundingClientRect(),n=this.getHostOffset(s.left,s.right);t.style.transform=`translateX(${n}px)`,a.style.transform=`translateX(${n}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:i}=this.el,t=this.shouldMirror(),e=t?"value":"minValue",a=t?"minValue":"value",s=i.querySelector(`.handle__label--${e}`),n=i.querySelector(`.handle__label--${e}.static`),l=i.querySelector(`.handle__label--${e}.transformed`),r=this.getHostOffset(n.getBoundingClientRect().left,n.getBoundingClientRect().right),h=i.querySelector(`.handle__label--${a}`),o=i.querySelector(`.handle__label--${a}.static`),c=i.querySelector(`.handle__label--${a}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),u=this.getFontSizeForElement(s),m=this.getRangeLabelOverlap(l,c),b=s,p=u/2;if(m>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===r){let i=m/2-p;i=-1===Math.sign(i)?Math.abs(i):-i;const t=this.getHostOffset(l.getBoundingClientRect().left+i-p,l.getBoundingClientRect().right+i-p);let e=m/2;const a=this.getHostOffset(c.getBoundingClientRect().left+e,c.getBoundingClientRect().right+e);0!==t&&(i+=t,e+=t),0!==a&&(i+=a,e+=a),s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`,h.style.transform=`translateX(${e}px)`,c.style.transform=`translateX(${e}px)`}else if(r>0||d>0)s.style.transform=`translateX(${r+p}px)`,h.style.transform=`translateX(${m+d}px)`,c.style.transform=`translateX(${m+d}px)`;else if(r<0||d<0){let i=Math.abs(r)+m-p;i=-1===Math.sign(i)?Math.abs(i):-i,s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`}}else b.classList.remove("hyphen","hyphen--wrap"),s.style.transform=`translateX(${r}px)`,l.style.transform=`translateX(${r}px)`,h.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const i=O(this.value);if(!(this.hasHistogram||i||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!i&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!i&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!i&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&i&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const t=this.el.shadowRoot.querySelector(".thumb--minValue"),e=this.el.shadowRoot.querySelector(".thumb--value"),a=this.el.shadowRoot.querySelector(".tick__label--min"),s=this.el.shadowRoot.querySelector(".tick__label--max");!t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,e)?"0":"1"),t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,t)||this.isMaxTickLabelObscured(s,e)&&this.hasHistogram?"0":"1")}getHostOffset(i,t){const e=this.el.getBoundingClientRect();return i+7<e.left?e.left-i-7:t-7>e.right?7-(t-e.right):0}getRangeLabelOverlap(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=this.getFontSizeForElement(i);return Math.max(e.right+s-a.left,0)}isMinTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return d(e,a)}isMaxTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return d(e,a)}get el(){return s(this)}static get watchers(){return{histogram:["histogramWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};P.style='@charset "UTF-8";@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)}: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)}.scale--s{--calcite-slider-handle-size:10px;--calcite-slider-handle-extension-height:6.5px;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:14px;--calcite-slider-handle-extension-height:8px;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:16px;--calcite-slider-handle-extension-height:10.5px;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n )}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-6px}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-8px}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-9px}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-2px}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-23px}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-30px}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-32px}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{-webkit-margin-before:0.5em;margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{-webkit-margin-after:0.5em;margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-33px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-44px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-49px}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;-webkit-margin-start:calc(-1 * 0.125rem);margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;-webkit-margin-before:0.875rem;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{-webkit-padding-after:calc(0.875rem + var(--calcite-slider-container-font-size));padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + 1em);padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{-webkit-padding-after:calc(var(--calcite-slider-handle-size) * 0.5 + 1em);padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{-webkit-padding-before:var(--calcite-slider-full-handle-height);padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::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}';const R=class{constructor(e){i(this,e),this.sketchGraphicsChange=t(this,"sketchGraphicsChange",7),this.active=!1,this.border=!1,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.graphics=[],this._translations=void 0}graphicsWatchHandler(i,t){i&&i.length>0&&JSON.stringify(i)!==JSON.stringify(t)&&this._sketchGraphicsLayer&&(this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(i))}mapViewWatchHandler(i,t){i&&i!==t&&this._init()}async clear(){this._clearSketch()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}render(){return e(a,null,e("div",{class:this.border?"border":""},e("div",{ref:i=>{this._sketchElement=i}})))}async _initModules(){const[i,t]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch"]);this.GraphicsLayer=i,this.Sketch=t}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initDrawTools())}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i}),D.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initDrawTools(){this._sketchWidget=new this.Sketch({layer:this._sketchGraphicsLayer,view:this.mapView,container:this._sketchElement,creationMode:"single",defaultCreateOptions:{mode:"hybrid"}}),this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol,this._sketchWidget.viewModel.pointSymbol=this.pointSymbol,this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol,this._sketchWidget.visibleElements={selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1},this._sketchWidget.on("update",(i=>{"active"===i.state&&(clearTimeout(this._selectionTimer),this._selectionTimer=setTimeout((()=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)}),500))})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("undo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("redo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("create",(i=>{"complete"===i.state&&(this.graphics=[i.graphic],this.sketchGraphicsChange.emit(this.graphics))}))}_clearSketch(){var i;this.graphics=[],null===(i=this._sketchGraphicsLayer)||void 0===i||i.removeAll()}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};R.style=":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}";const X=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.refineSelectionGraphicsChange=t(this,"refineSelectionGraphicsChange",7),this.refineSelectionIdsChange=t(this,"refineSelectionIdsChange",7),this._featuresCollection={},this.active=!1,this.border=!1,this.enabledLayerIds=[],this.graphics=void 0,this.ids=[],this.layerView=void 0,this.layerViews=[],this.mapView=void 0,this.mode=void 0,this.refineMode=void 0,this.refineSelectionSet=void 0,this.useLayerPicker=!0,this._selectEnabled=!1,this._selectionMode=void 0,this._translations=void 0}idsWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&this._highlightFeatures(i)}async reset(){this.ids=[]}async clearHighlight(){this._clearHighlight()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this.active=!1}connectedCallback(){this.active=!0,this.ids.length>0&&(this._selectEnabled=!0,this._highlightFeatures(this.ids))}render(){var i,t;const s=this.border?" border":"",n=this.refineMode===$.ALL?"div-visible":"div-not-visible";return e(a,null,e("div",null,e("map-layer-picker",{class:this.useLayerPicker?"div-visible":"div-not-visible",enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedLayerIds:this.layerViews.map((i=>i.layer.id)),selectionMode:"single"}),e("div",{class:"margin-top-1"+s},e("div",{class:"esri-sketch esri-widget"},e("div",{class:"esri-sketch__panel"},e("div",{class:"esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:!this._selectEnabled,icon:"pin",onClick:()=>this._setSelectionMode(M.POINT),scale:"s",text:this._translations.select}),e("calcite-action",{disabled:!this._selectEnabled,icon:"line",onClick:()=>this._setSelectionMode(M.LINE),scale:"s",text:this._translations.selectLine}),e("calcite-action",{disabled:!this._selectEnabled,icon:"polygon",onClick:()=>this._setSelectionMode(M.POLY),scale:"s",text:this._translations.selectPolygon}),e("calcite-action",{disabled:!this._selectEnabled,icon:"rectangle",onClick:()=>this._setSelectionMode(M.RECT),scale:"s",text:this._translations.selectRectangle})),e("div",{class:n+" esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:!(null===(i=this.refineSelectionSet)||void 0===i?void 0:i.undoStack)||0===this.refineSelectionSet.undoStack.length,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),e("calcite-action",{disabled:!(null===(t=this.refineSelectionSet)||void 0===t?void 0:t.redoStack)||0===this.refineSelectionSet.redoStack.length,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo})))))))}_init(){this._initGraphicsLayer(),this._initSketchViewModel()}async _initModules(){const[i,t]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=i,this.SketchViewModel=t}_initSketchViewModel(){this._sketchViewModel=new this.SketchViewModel({layer:this._sketchGraphicsLayer,defaultUpdateOptions:{tool:"reshape",toggleToolOnClick:!1},view:this.mapView}),this._sketchViewModel.on("create",(i=>{"complete"===i.state&&this.active&&(this._featuresCollection={},this._sketchGeometry=i.graphic.geometry,this._selectFeatures(this._sketchGeometry))}))}_clear(){this._sketchGeometry=null,this._sketchViewModel.cancel(),this._sketchGraphicsLayer.removeAll()}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i}),D.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initHitTest(){this._hitTestHandle&&this._hitTestHandle.remove(),this._hitTestHandle=this.mapView.on("click",(i=>{i.stopPropagation();const t={include:this.layerViews.map((i=>i.layer))};this.mapView.hitTest(i,t).then((i=>{let t=[];i.results.length>0&&(t=i.results.reduce(((i,t)=>{const e=null==t?void 0:t.graphic;return e&&i.push(e),i}),[])),this.refineSelectionGraphicsChange.emit({graphics:t,useOIDs:!1}),this._clear()}))}))}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){this._selectEnabled=!0;const t=i.detail.map((i=>I(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i}))}this._selectEnabled=!1}_setSelectionMode(i){switch(this._selectionMode=i,this._hitTestHandle&&this._hitTestHandle.remove(),this._selectionMode){case M.POINT:this._sketchViewModel.create("point");break;case M.LINE:this._sketchViewModel.create("polyline");break;case M.POLY:this._sketchViewModel.create("polygon");break;case M.RECT:this._sketchViewModel.create("rectangle")}}async _selectFeatures(i){this.selectionLoadingChange.emit(!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.selectionLoadingChange.emit(!1);let t=[];if(i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))})),this.refineMode===$.SUBSET)this.refineSelectionGraphicsChange.emit({graphics:t,useOIDs:this.layerViews[0].layer.title===this.layerView.layer.title});else{const i=Array.isArray(t)?t.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(i,this.mode,this.refineSelectionSet.undoStack,this.mode)}this._clear()}))}async _highlightFeatures(i,t=!1){this._clearHighlight(),i.length>0&&(D.highlightHandle=await L(i,this.layerViews[0],this.mapView,t))}_clearHighlight(){var i;null===(i=D.highlightHandle)||void 0===i||i.remove()}async _updateIds(i,t,e,a){const s={addIds:[],removeIds:[]};t===C.ADD?(s.addIds=i.filter((i=>this.ids.indexOf(i)<0)),this.ids=[...this.ids,...s.addIds],s.addIds.length>0&&e.push({mode:a,ids:s.addIds})):(s.removeIds=i.filter((i=>this.ids.indexOf(i)>-1)),this.ids=this.ids.filter((i=>s.removeIds.indexOf(i)<0)),s.removeIds.length>0&&e.push({mode:a,ids:s.removeIds})),await this._highlightFeatures(this.ids).then((()=>{this.refineSelectionIdsChange.emit(s)}))}_undo(){const i=this.refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===C.ADD?C.REMOVE:C.ADD,this.refineSelectionSet.redoStack,i.mode)}_redo(){const i=this.refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode,this.refineSelectionSet.undoStack,i.mode)}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{ids:["idsWatchHandler"]}}};X.style=':host{display:block}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.border{outline:1px solid var(--calcite-ui-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:var(--calcite-ui-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110,110,110,.3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110,110,110,.3)}';export{S as buffer_tools,A as calcite_radio_group,T as calcite_radio_group_item,P as calcite_slider,R as map_draw_tools,X as refine_selection_tools}