@esri/solutions-components 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/dist/cjs/buffer-tools_6.cjs.entry.js +18 -3
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/public-notification.cjs.entry.js +33 -5
  4. package/dist/cjs/solutions-components.cjs.js +1 -1
  5. package/dist/collection/components/buffer-tools/buffer-tools.js +48 -0
  6. package/dist/collection/components/map-draw-tools/map-draw-tools.js +8 -3
  7. package/dist/collection/components/public-notification/public-notification.css +12 -12
  8. package/dist/collection/components/public-notification/public-notification.js +44 -4
  9. package/dist/collection/demos/new-public-notification.html +5 -5
  10. package/dist/collection/utils/interfaces.ts +5 -0
  11. package/dist/components/buffer-tools2.js +10 -0
  12. package/dist/components/map-draw-tools2.js +8 -3
  13. package/dist/components/public-notification.js +34 -6
  14. package/dist/esm/buffer-tools_6.entry.js +18 -3
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/public-notification.entry.js +33 -5
  17. package/dist/esm/solutions-components.js +1 -1
  18. package/dist/solutions-components/demos/new-public-notification.html +5 -5
  19. package/dist/solutions-components/{p-877dd0dc.entry.js → p-3649acb3.entry.js} +3 -3
  20. package/dist/solutions-components/p-851e04ae.entry.js +6 -0
  21. package/dist/solutions-components/solutions-components.esm.js +1 -1
  22. package/dist/solutions-components/utils/interfaces.ts +5 -0
  23. package/dist/types/components/buffer-tools/buffer-tools.d.ts +9 -1
  24. package/dist/types/components/public-notification/public-notification.d.ts +18 -0
  25. package/dist/types/components.d.ts +9 -1
  26. package/dist/types/preact.d.ts +3 -1
  27. package/dist/types/utils/interfaces.d.ts +4 -0
  28. package/package.json +1 -1
  29. package/dist/solutions-components/p-bd4d0773.entry.js +0 -6
@@ -3,16 +3,16 @@
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-c023e6a1.js";import{l as n}from"./p-1c567f3a.js";import{g as l}from"./p-44da2507.js";import{b as r,g as o,t as h,i as c,h as d}from"./p-83166522.js";import{c as m,d as u}from"./p-bd67334c.js";import{a as b,c as p,d as g,H as f}from"./p-316f56db.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 _}from"./p-73e23995.js";import{n as w,c as z,d as V}from"./p-9eba5c66.js";import{s as D}from"./p-9c1ebc90.js";import{h as M,g as $,f as C}from"./p-be41429f.js";import{a as S,f as H,h as I}from"./p-3fa9b3c8.js";import"./p-3b010ce1.js";import"./p-729708a3.js";import"./p-9a9955db.js";import"./p-4307dacd.js";const L=class{constructor(e){i(this,e),this.bufferComplete=t(this,"bufferComplete",7),this.appearance="text",this.distance=0,this.geometries=[],this.sliderMax=100,this.sliderMin=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this._translations=void 0}geometriesWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&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){this.distance=i.detail.value,this.distance>0?this._buffer():this.bufferComplete.emit(void 0)}_setUnit(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","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.sliderMax,min:this.sliderMin,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"]}}};L.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(){m(this),p(this)}disconnectedCallback(){u(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-c023e6a1.js";import{l as n}from"./p-1c567f3a.js";import{g as l}from"./p-44da2507.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-316f56db.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 _}from"./p-73e23995.js";import{n as w,c as z,d as V}from"./p-9eba5c66.js";import{s as D}from"./p-9c1ebc90.js";import{h as M,g as $,f as C}from"./p-be41429f.js";import{a as S,f as H,h as I}from"./p-3fa9b3c8.js";import"./p-3b010ce1.js";import"./p-729708a3.js";import"./p-9a9955db.js";import"./p-4307dacd.js";const L=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.sliderMax=100,this.sliderMin=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this._translations=void 0}geometriesWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&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){this.distanceChanged.emit({oldValue:this.distance,newValue:i.detail.value}),this.distance=i.detail.value,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","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.sliderMax,min:this.sliderMin,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"]}}};L.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.
10
10
  * v1.0.0-beta.97
11
11
  */
12
- const j="radio-group-item-icon",T=class{constructor(e){i(this,e),this.calciteInternalRadioGroupItemChange=t(this,"calciteInternalRadioGroupItemChange",6),this.checked=!1,this.iconFlipRtl=!1,this.iconPosition="start"}handleCheckedChange(){this.calciteInternalRadioGroupItemChange.emit()}render(){const{checked:i,value:t}=this,s=o(this.el,"scale","m"),n=o(this.el,"appearance","solid"),l=o(this.el,"layout","horizontal"),r=this.iconStart?e("calcite-icon",{class:j,flipRtl:this.iconFlipRtl,icon:this.iconStart,key:"icon-start",scale:"s"}):null,c=this.iconEnd?e("calcite-icon",{class:j,flipRtl:this.iconFlipRtl,icon:this.iconEnd,key:"icon-end",scale:"s"}):null,d=e("calcite-icon",{class:j,flipRtl:this.iconFlipRtl,icon:this.icon,key:"icon",scale:"s"}),m=this.icon&&"start"===this.iconPosition&&!this.iconStart?d:null,u=this.icon&&"end"===this.iconPosition&&!this.iconEnd?d:null;return e(a,{"aria-checked":h(i),"aria-label":t,role:"radio"},e("label",{class:{"label--scale-s":"s"===s,"label--scale-m":"m"===s,"label--scale-l":"l"===s,"label--horizontal":"horizontal"===l,"label--outline":"outline"===n}},m,this.iconStart?r:null,e("slot",null,t),e("slot",{name:"input"}),u,this.iconEnd?c:null))}get el(){return s(this)}static get watchers(){return{checked:["handleCheckedChange"]}}};T.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{display:flex;cursor:pointer;align-self:stretch;font-weight:var(--calcite-font-weight-normal);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out, border-color var(--calcite-animation-timing) ease-in-out}:host label{pointer-events:none;margin:0.125rem;box-sizing:border-box;display:flex;flex:1 1 0%;align-items:center;color:var(--calcite-ui-text-3);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out, border-color var(--calcite-internal-animation-timing-fast) ease-in-out, color var(--calcite-internal-animation-timing-fast) ease-in-out}.label--horizontal{justify-content:center}:host{outline-color:transparent}:host(:focus){outline:2px solid var(--calcite-ui-brand);outline-offset:-1px}.label--scale-s{padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-block:0.125rem}.label--scale-m{padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-block:0.375rem}.label--scale-l{padding-inline:1rem;padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host(:hover) label{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host(:active) label{background-color:var(--calcite-ui-foreground-3)}:host([checked]) label{cursor:default;border-color:var(--calcite-ui-brand);background-color:var(--calcite-ui-brand);color:var(--calcite-ui-background)}:host([checked]) .label--outline{border-color:var(--calcite-ui-brand);background-color:var(--calcite-ui-foreground-1);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand);color:var(--calcite-ui-brand)}::slotted(input){display:none}@media (forced-colors: active){:host([checked]) label{background-color:highlight}:host([checked]) .label--outline{outline:2px solid transparent;outline-offset:2px}:host([checked]) label:not([class~=label--outline]) .radio-group-item-icon{color:highlightText}}.radio-group-item-icon{position:relative;margin:0px;display:inline-flex;line-height:inherit}:host([icon-position=start]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([icon-position=end]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}:host([icon-position=start]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([icon-position=end]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:0.75rem;margin-inline-start:0.75rem}:host([icon-position=start]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:1rem;margin-inline-end:1rem}:host([icon-position=end]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:1rem;margin-inline-start:1rem}:host([icon-start]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([icon-end]) .label--scale-s .radio-group-item-icon{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}:host([icon-start]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([icon-end]) .label--scale-m .radio-group-item-icon{-webkit-margin-start:0.75rem;margin-inline-start:0.75rem}:host([icon-start]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:1rem;margin-inline-end:1rem}:host([icon-end]) .label--scale-l .radio-group-item-icon{-webkit-margin-start:1rem;margin-inline-start:1rem}";
12
+ const j="radio-group-item-icon",T=class{constructor(e){i(this,e),this.calciteInternalRadioGroupItemChange=t(this,"calciteInternalRadioGroupItemChange",6),this.checked=!1,this.iconFlipRtl=!1,this.iconPosition="start"}handleCheckedChange(){this.calciteInternalRadioGroupItemChange.emit()}render(){const{checked:i,value:t}=this,s=h(this.el,"scale","m"),n=h(this.el,"appearance","solid"),l=h(this.el,"layout","horizontal"),r=this.iconStart?e("calcite-icon",{class:j,flipRtl:this.iconFlipRtl,icon:this.iconStart,key:"icon-start",scale:"s"}):null,c=this.iconEnd?e("calcite-icon",{class:j,flipRtl:this.iconFlipRtl,icon:this.iconEnd,key:"icon-end",scale:"s"}):null,d=e("calcite-icon",{class:j,flipRtl:this.iconFlipRtl,icon:this.icon,key:"icon",scale:"s"}),u=this.icon&&"start"===this.iconPosition&&!this.iconStart?d:null,m=this.icon&&"end"===this.iconPosition&&!this.iconEnd?d:null;return e(a,{"aria-checked":o(i),"aria-label":t,role:"radio"},e("label",{class:{"label--scale-s":"s"===s,"label--scale-m":"m"===s,"label--scale-l":"l"===s,"label--horizontal":"horizontal"===l,"label--outline":"outline"===n}},u,this.iconStart?r:null,e("slot",null,t),e("slot",{name:"input"}),m,this.iconEnd?c:null))}get el(){return s(this)}static get watchers(){return{checked:["handleCheckedChange"]}}};T.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{display:flex;cursor:pointer;align-self:stretch;font-weight:var(--calcite-font-weight-normal);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out, border-color var(--calcite-animation-timing) ease-in-out}:host label{pointer-events:none;margin:0.125rem;box-sizing:border-box;display:flex;flex:1 1 0%;align-items:center;color:var(--calcite-ui-text-3);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out, border-color var(--calcite-internal-animation-timing-fast) ease-in-out, color var(--calcite-internal-animation-timing-fast) ease-in-out}.label--horizontal{justify-content:center}:host{outline-color:transparent}:host(:focus){outline:2px solid var(--calcite-ui-brand);outline-offset:-1px}.label--scale-s{padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-block:0.125rem}.label--scale-m{padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-block:0.375rem}.label--scale-l{padding-inline:1rem;padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host(:hover) label{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host(:active) label{background-color:var(--calcite-ui-foreground-3)}:host([checked]) label{cursor:default;border-color:var(--calcite-ui-brand);background-color:var(--calcite-ui-brand);color:var(--calcite-ui-background)}:host([checked]) .label--outline{border-color:var(--calcite-ui-brand);background-color:var(--calcite-ui-foreground-1);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand);color:var(--calcite-ui-brand)}::slotted(input){display:none}@media (forced-colors: active){:host([checked]) label{background-color:highlight}:host([checked]) .label--outline{outline:2px solid transparent;outline-offset:2px}:host([checked]) label:not([class~=label--outline]) .radio-group-item-icon{color:highlightText}}.radio-group-item-icon{position:relative;margin:0px;display:inline-flex;line-height:inherit}:host([icon-position=start]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([icon-position=end]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}:host([icon-position=start]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([icon-position=end]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:0.75rem;margin-inline-start:0.75rem}:host([icon-position=start]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:1rem;margin-inline-end:1rem}:host([icon-position=end]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:unset;margin-inline-end:unset;-webkit-margin-start:1rem;margin-inline-start:1rem}:host([icon-start]) .label--scale-s .radio-group-item-icon{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([icon-end]) .label--scale-s .radio-group-item-icon{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}:host([icon-start]) .label--scale-m .radio-group-item-icon{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([icon-end]) .label--scale-m .radio-group-item-icon{-webkit-margin-start:0.75rem;margin-inline-start:0.75rem}:host([icon-start]) .label--scale-l .radio-group-item-icon{-webkit-margin-end:1rem;margin-inline-end:1rem}:host([icon-end]) .label--scale-l .radio-group-item-icon{-webkit-margin-start:1rem;margin-inline-start:1rem}";
13
13
  /*!
14
14
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
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 w.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},w.localize(i.toString())}}histogramWatcher(i){this.hasHistogram=!!i}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){z(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),m(this),p(this)}disconnectedCallback(){u(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,o=this.shouldUseMinValue(),h=100*this.getUnitInterval(o?this.minValue:r),c=100*this.getUnitInterval(s),d=this.shouldMirror(),m=`${d?100-h:h}%`,u=`${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:u},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:u},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:u},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:u},tabIndex:0},e("div",{class:"handle"}),e("div",{class:"handle-extension"})),_=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:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),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:u},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:u},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:m},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:m},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:m},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:m},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:m},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:h}%`,right:`${d?h:100-c}%`}}),e("div",{class:"ticks"},this.tickValues.map((i=>{const t=100*this.getUnitInterval(i)+"%";let a=i>=r&&i<=s;return o&&(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&&_,!this.hasHistogram&&this.precise&&this.labelHandles&&w,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:o}=i;if(_(o))return void i.preventDefault();let h;if("ArrowUp"===o||"ArrowRight"===o?h=r+l*(t&&"ArrowRight"===o?-1:1):"ArrowDown"===o||"ArrowLeft"===o?h=r-l*(t&&"ArrowLeft"===o?-1:1):"PageUp"===o?n&&(h=r+n):"PageDown"===o?n&&(h=r-n):"Home"===o?h=s:"End"===o&&(h=a),isNaN(h))return;i.preventDefault();const c=Number(h.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),o=i.querySelector(`.handle__label--${a}`),h=i.querySelector(`.handle__label--${a}.static`),c=i.querySelector(`.handle__label--${a}.transformed`),d=this.getHostOffset(h.getBoundingClientRect().left,h.getBoundingClientRect().right),m=this.getFontSizeForElement(s),u=this.getRangeLabelOverlap(l,c),b=s,p=m/2;if(u>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===r){let i=u/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=u/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)`,o.style.transform=`translateX(${e}px)`,c.style.transform=`translateX(${e}px)`}else if(r>0||d>0)s.style.transform=`translateX(${r+p}px)`,o.style.transform=`translateX(${u+d}px)`,c.style.transform=`translateX(${u+d}px)`;else if(r<0||d<0){let i=Math.abs(r)+u-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)`,o.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:"update",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,point:!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)}))}_clearSketch(){this.graphics=[],this._sketchGraphicsLayer.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.refineSelectionGraphicsChange=t(this,"refineSelectionGraphicsChange",7),this.refineSelectionIdsChange=t(this,"refineSelectionIdsChange",7),this._featuresCollection={},this._redoStack=[],this._undoStack=[],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.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(){const i=this.border?" border":"";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"+i},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:"select",onClick:()=>this._setSelectionMode(M.POINT),scale:"s",text:this._translations.select})),e("div",{class:"esri-sketch__tool-section esri-sketch__section"},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:"esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:0===this._undoStack.length,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),e("calcite-action",{disabled:0===this._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(t),this._clear()}))}))}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){this._selectEnabled=!0;const t=i.detail.map((i=>S(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){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=>{let t=[];if(i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))})),this.refineMode===$.SUBSET)this.refineSelectionGraphicsChange.emit(t);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._undoStack,this.mode)}this._clear()}))}async _highlightFeatures(i,t=!1){this._clearHighlight(),i.length>0&&(D.highlightHandle=await I(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],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)),e.push({mode:a,ids:s.removeIds})),await this._highlightFeatures(this.ids).then((()=>{this.refineSelectionIdsChange.emit(s)}))}_undo(){const i=this._undoStack.pop();this._updateIds(i.ids,i.mode===C.ADD?C.REMOVE:C.ADD,this._redoStack,i.mode)}_redo(){const i=this._redoStack.pop();this._updateIds(i.ids,i.mode,this._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}.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{L 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 w.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},w.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"})),_=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"})),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("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&&_,!this.hasHistogram&&this.precise&&this.labelHandles&&w,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(_(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}},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(){this.graphics=[],this._sketchGraphicsLayer.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.refineSelectionGraphicsChange=t(this,"refineSelectionGraphicsChange",7),this.refineSelectionIdsChange=t(this,"refineSelectionIdsChange",7),this._featuresCollection={},this._redoStack=[],this._undoStack=[],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.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(){const i=this.border?" border":"";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"+i},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:"select",onClick:()=>this._setSelectionMode(M.POINT),scale:"s",text:this._translations.select})),e("div",{class:"esri-sketch__tool-section esri-sketch__section"},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:"esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:0===this._undoStack.length,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),e("calcite-action",{disabled:0===this._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(t),this._clear()}))}))}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){this._selectEnabled=!0;const t=i.detail.map((i=>S(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){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=>{let t=[];if(i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))})),this.refineMode===$.SUBSET)this.refineSelectionGraphicsChange.emit(t);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._undoStack,this.mode)}this._clear()}))}async _highlightFeatures(i,t=!1){this._clearHighlight(),i.length>0&&(D.highlightHandle=await I(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],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)),e.push({mode:a,ids:s.removeIds})),await this._highlightFeatures(this.ids).then((()=>{this.refineSelectionIdsChange.emit(s)}))}_undo(){const i=this._undoStack.pop();this._updateIds(i.ids,i.mode===C.ADD?C.REMOVE:C.ADD,this._redoStack,i.mode)}_redo(){const i=this._redoStack.pop();this._updateIds(i.ids,i.mode,this._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}.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{L 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}
@@ -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-c023e6a1.js";import{b as l,c as n,E as d,d as o}from"./p-be41429f.js";import{l as h}from"./p-1c567f3a.js";import{a as c,c as r,g as p,h as g}from"./p-3fa9b3c8.js";import{s as b}from"./p-9c1ebc90.js";import{g as u}from"./p-44da2507.js";import{g as m,a as v}from"./p-fc884dd6.js";import"./p-4307dacd.js";import"./p-3b010ce1.js";const f=class{constructor(s){i(this,s),this.labelChange=t(this,"labelChange",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.exportOptions=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.addresseeLayer=void 0,this._downloadActive=!0,this._numSelected=0,this._pageType=l.LIST,this._saveEnabled=!1,this._selectionSets=[],this._sketchType=n.INTERACTIVE,this._selectionWorkflowType=d.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 selectionSetsWatchHandler(i,t){i&&i!==t&&i.length>0&&0===i.filter((i=>i.workflowType!==d.REFINE)).length&&(this._selectionSets=[])}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)}selectionSetsChanged(i){this._selectionSets=[...i.detail]}sketchTypeChange(i){this._sketchType=i.detail}unitChanged(i){this._updateLabel(i)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){var i,t,a,n,d,o;const h=this._selectionSets.length>0,c="boolean"!=typeof(null===(t=null===(i=this.exportOptions)||void 0===i?void 0:i.csvOptions)||void 0===t?void 0:t.enabled)||(null===(a=this.exportOptions)||void 0===a?void 0:a.csvOptions.enabled),r="boolean"!=typeof(null===(d=null===(n=this.exportOptions)||void 0===n?void 0:n.pdfOptions)||void 0===d?void 0:d.enabled)||(null===(o=this.exportOptions)||void 0===o?void 0:o.pdfOptions.enabled);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",!1,l.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",!h,l.REFINE,this._translations.refineSelection):void 0,r?this._getActionGroup("file-pdf",!h,l.PDF,this._translations.downloadPDF):void 0,c?this._getActionGroup("file-csv",!h,l.CSV,this._translations.downloadCSV):void 0),this._getPage(this._pageType)))}async _initModules(){const[i]=await h(["esri/geometry/geometryEngine"]);this._geometryEngine=i}_getActionGroup(i,t,e,a){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===e,alignment:"center",class:"width-full height-full",compact:!1,disabled:t,icon:i,id:i,onClick:()=>{this._setPageType(e)},text:""}),s("calcite-tooltip",{label:"",placement:"bottom","reference-element":i},s("span",null,a)))}_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!==d.REFINE)).length>0,t=m(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!==d.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)}_getSelectPage(){var i,t;const e=this._selectionWorkflowType===d.SELECT?this._translations.selectLayerTip:this._selectionWorkflowType===d.SKETCH?this._sketchType===n.INTERACTIVE?this._translations.selectSketchTip:this._translations.selectLayerTip:this._translations.selectSearchTip,a=this.customLabelEnabled?"":"display-none";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})),s("div",{class:"padding-sides-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},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.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"},"Name label",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(){return s("calcite-panel",null,this._getLabel(this._translations.refineSelection),this._getNotice(this._translations.refineTip,"padding-sides-1"),s("refine-selection",{addresseeLayer:this.addresseeLayer,enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets}))}_getPDFPage(){return this._getDownloadPage(o.PDF)}_getCSVPage(){return this._getDownloadPage(o.CSV)}_getDownloadPage(i){var t,e;const a=i===o.PDF,l=(null===(t=this.exportOptions)||void 0===t?void 0:t.pdfOptions.enabledSizeValues.length)>1;return s("calcite-panel",null,s("div",null,s("div",{class:"padding-top-sides-1"},s("calcite-label",{class:"font-bold"},a?this._translations.pdfDownloads:this._translations.csvDownloads),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",{layout:"inline"},s("calcite-checkbox",{disabled:!this._downloadActive,ref:i=>{this._removeDuplicates=i}}),this._translations.removeDuplicate)),s("div",{class:a&&l?"":"display-none"},this._getLabel(this._translations.selectPDFLabelOption,!1),s("div",{class:"padding-sides-1"},s("pdf-download",{disabled:!this._downloadActive,enabledSizeValues:null===(e=this.exportOptions)||void 0===e?void 0:e.pdfOptions.enabledSizeValues,layerView:this.addresseeLayer,ref:i=>{this._downloadTools=i}}))),s("div",{class:"padding-1 display-flex"},s("calcite-button",{disabled:!this._downloadActive,onClick:a?()=>this._downloadPDF():()=>this._downloadCSV(),width:"full"},a?this._translations.downloadPDF:this._translations.downloadCSV))))}_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!==d.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=v(this._getDownloadSelectionSets());this._downloadTools.downloadPDF(i,this._removeDuplicates.checked)}_downloadCSV(){var i;const t=v(this._getDownloadSelectionSets());this._downloadTools.downloadCSV(t,this._removeDuplicates.checked,null===(i=this.exportOptions)||void 0===i?void 0:i.csvOptions.addColumnTitle)}_getDownloadSelectionSets(){return this._selectionSets.filter((i=>i.download||i.workflowType===d.REFINE))}_updateLabel(i){this.customLabelEnabled&&this._customLabel&&this._labelName.value.indexOf(i.detail.oldValue)>-1&&(this._customLabel=this._customLabel.replace(i.detail.oldValue,i.detail.newValue),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!==d.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}_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.customLabelEnabled&&(this._customLabel=this._activeSelection.label),this._pageType=l.SELECT}async _highlightFeatures(){this._clearHighlight();const i=v(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"],_selectionSets:["selectionSetsWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};f.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{f as public_notification}