@esri/solutions-components 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. package/dist/assets/t9n/crowdsource-reporter/resources.json +3 -1
  2. package/dist/assets/t9n/crowdsource-reporter/resources_en.json +3 -1
  3. package/dist/cjs/{calcite-action-menu_2.cjs.entry.js → calcite-action-menu_3.cjs.entry.js} +114 -7
  4. package/dist/cjs/calcite-alert_4.cjs.entry.js +46 -5
  5. package/dist/cjs/{calcite-input-date-picker_3.cjs.entry.js → calcite-block_5.cjs.entry.js} +691 -13
  6. package/dist/cjs/{calcite-combobox_5.cjs.entry.js → calcite-combobox_3.cjs.entry.js} +876 -844
  7. package/dist/cjs/calcite-dropdown_4.cjs.entry.js +1023 -0
  8. package/dist/cjs/{calcite-flow_5.cjs.entry.js → calcite-flow_6.cjs.entry.js} +327 -2
  9. package/dist/cjs/card-manager_3.cjs.entry.js +5 -5
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  11. package/dist/cjs/crowdsource-reporter.cjs.entry.js +122 -21
  12. package/dist/cjs/{downloadUtils-8b05d7cc.js → downloadUtils-dc349b1a.js} +2 -2
  13. package/dist/cjs/{index.es-e7587227.js → index.es-1830a1e6.js} +2 -2
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +8 -8
  16. package/dist/cjs/{mapViewUtils-3e0fa457.js → mapViewUtils-9dc05308.js} +11 -5
  17. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  18. package/dist/cjs/solutions-components.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/create-feature/create-feature.js +18 -0
  21. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +16 -0
  22. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +155 -35
  23. package/dist/collection/components/feature-details/feature-details.css +18 -0
  24. package/dist/collection/components/feature-details/feature-details.js +500 -0
  25. package/dist/collection/components/feature-details/test/feature-details.e2e.js +14 -0
  26. package/dist/collection/components/feature-details/test/feature-details.spec.js +22 -0
  27. package/dist/collection/components/feature-list/feature-list.js +14 -1
  28. package/dist/collection/components/info-card/info-card.css +15 -5
  29. package/dist/collection/components/info-card/info-card.js +178 -5
  30. package/dist/collection/components/layer-table/layer-table.js +2 -2
  31. package/dist/collection/components/map-card/map-card.js +1 -1
  32. package/dist/collection/components/map-select-tools/map-select-tools.js +5 -5
  33. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  34. package/dist/collection/demos/crowdsource-reporter.html +115 -1
  35. package/dist/collection/utils/mapViewUtils.js +11 -5
  36. package/dist/collection/utils/mapViewUtils.ts +13 -5
  37. package/dist/components/create-feature2.js +4 -0
  38. package/dist/components/crowdsource-reporter.js +270 -81
  39. package/dist/components/feature-details.d.ts +11 -0
  40. package/dist/components/feature-details.js +11 -0
  41. package/dist/components/feature-details2.js +449 -0
  42. package/dist/components/feature-list2.js +14 -1
  43. package/dist/components/info-card2.js +53 -5
  44. package/dist/components/layer-table2.js +2 -2
  45. package/dist/components/map-card2.js +1 -1
  46. package/dist/components/map-select-tools2.js +5 -5
  47. package/dist/components/mapViewUtils.js +11 -5
  48. package/dist/components/refine-selection2.js +1 -1
  49. package/dist/esm/{calcite-action-menu_2.entry.js → calcite-action-menu_3.entry.js} +118 -12
  50. package/dist/esm/calcite-alert_4.entry.js +46 -5
  51. package/dist/esm/{calcite-input-date-picker_3.entry.js → calcite-block_5.entry.js} +688 -12
  52. package/dist/esm/{calcite-combobox_5.entry.js → calcite-combobox_3.entry.js} +878 -844
  53. package/dist/esm/calcite-date-picker-day_3.entry.js +1 -1
  54. package/dist/esm/calcite-dropdown_4.entry.js +1016 -0
  55. package/dist/esm/{calcite-flow_5.entry.js → calcite-flow_6.entry.js} +327 -3
  56. package/dist/esm/card-manager_3.entry.js +5 -5
  57. package/dist/esm/crowdsource-manager.entry.js +1 -1
  58. package/dist/esm/crowdsource-reporter.entry.js +122 -21
  59. package/dist/esm/{date-5630530d.js → date-0c026a8b.js} +1 -1
  60. package/dist/esm/{downloadUtils-0c1e4d7b.js → downloadUtils-df4f21f6.js} +2 -2
  61. package/dist/esm/{index.es-286e3cfa.js → index.es-904fb846.js} +2 -2
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/map-select-tools_3.entry.js +8 -8
  64. package/dist/esm/{mapViewUtils-253178f1.js → mapViewUtils-2ec19fb0.js} +11 -5
  65. package/dist/esm/public-notification.entry.js +2 -2
  66. package/dist/esm/solutions-components.js +1 -1
  67. package/dist/solutions-components/demos/crowdsource-reporter.html +115 -1
  68. package/dist/solutions-components/{p-813fd8a4.entry.js → p-29f518fd.entry.js} +2 -2
  69. package/dist/solutions-components/{p-13ca3b00.entry.js → p-452fd697.entry.js} +1 -1
  70. package/dist/solutions-components/p-511b1c91.entry.js +23 -0
  71. package/dist/solutions-components/p-577efb16.js +36 -0
  72. package/dist/solutions-components/{p-94de9279.js → p-5817d78c.js} +1 -1
  73. package/dist/solutions-components/p-602cd811.entry.js +17 -0
  74. package/dist/solutions-components/{p-15f9624a.entry.js → p-6557b703.entry.js} +1 -1
  75. package/dist/solutions-components/p-7269c49b.entry.js +6 -0
  76. package/dist/solutions-components/p-760bd17e.entry.js +6 -0
  77. package/dist/solutions-components/p-95fea07a.entry.js +17 -0
  78. package/dist/solutions-components/{p-212b02e7.js → p-ae4d86e8.js} +1 -1
  79. package/dist/solutions-components/{p-038fcd93.entry.js → p-c273ab7a.entry.js} +1 -1
  80. package/dist/solutions-components/p-d742b915.entry.js +29 -0
  81. package/dist/solutions-components/p-dfad61a8.entry.js +24 -0
  82. package/dist/solutions-components/{p-331b5d1e.js → p-fca434c8.js} +2 -2
  83. package/dist/solutions-components/p-fd82a00f.entry.js +6 -0
  84. package/dist/solutions-components/solutions-components.esm.js +1 -1
  85. package/dist/solutions-components/utils/mapViewUtils.ts +13 -5
  86. package/dist/types/components/create-feature/create-feature.d.ts +4 -4
  87. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +91 -10
  88. package/dist/types/components/feature-details/feature-details.d.ts +151 -0
  89. package/dist/types/components/feature-list/feature-list.d.ts +6 -0
  90. package/dist/types/components/info-card/info-card.d.ts +33 -1
  91. package/dist/types/components.d.ts +129 -12
  92. package/dist/types/preact.d.ts +6 -1
  93. package/dist/types/utils/mapViewUtils.d.ts +5 -3
  94. package/package.json +1 -1
  95. package/dist/cjs/calcite-block_2.cjs.entry.js +0 -652
  96. package/dist/cjs/calcite-graph_2.cjs.entry.js +0 -1055
  97. package/dist/cjs/calcite-scrim.cjs.entry.js +0 -125
  98. package/dist/cjs/utils-7bc7f595.js +0 -64
  99. package/dist/esm/calcite-block_2.entry.js +0 -647
  100. package/dist/esm/calcite-graph_2.entry.js +0 -1050
  101. package/dist/esm/calcite-scrim.entry.js +0 -121
  102. package/dist/esm/utils-9fb4104a.js +0 -61
  103. package/dist/solutions-components/p-04c37d69.entry.js +0 -17
  104. package/dist/solutions-components/p-0b92e4b1.entry.js +0 -11
  105. package/dist/solutions-components/p-238d3b5f.entry.js +0 -6
  106. package/dist/solutions-components/p-3af79063.js +0 -36
  107. package/dist/solutions-components/p-80b11ec1.entry.js +0 -17
  108. package/dist/solutions-components/p-a3a11749.entry.js +0 -6
  109. package/dist/solutions-components/p-aec06ce4.entry.js +0 -18
  110. package/dist/solutions-components/p-bfdf89c2.js +0 -11
  111. package/dist/solutions-components/p-c4ff3b52.entry.js +0 -17
  112. package/dist/solutions-components/p-ced067bd.entry.js +0 -17
  113. package/dist/solutions-components/p-d136eab0.entry.js +0 -23
  114. package/dist/solutions-components/p-e0446d5b.entry.js +0 -6
@@ -1,17 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,h as s,H as e,g as n}from"./p-7d280d8a.js";import{d as a,a as o,b as l,i as r,c as h,e as c,f as d}from"./p-94de9279.js";import{t as p}from"./p-3dd92f0d.js";import{f as u,c as v,d as m,r as f,a as g,F as b}from"./p-db53bde3.js";import{s as _,c as x,d as w,H as y}from"./p-1f33a29d.js";import{c as $,d as k,u as C,I as z}from"./p-6d520a58.js";import{n as D}from"./p-e7afc0a8.js";import{c as E,d as I}from"./p-9d53e0f2.js";import{c as L,s as P,a as F}from"./p-a4149333.js";import{n as R,c as S,d as j,b as N}from"./p-13f2d901.js";import{o as O}from"./p-2b0454a0.js";import{g as T,a as A}from"./p-bfdf89c2.js";import{c as M,s as U,d as B}from"./p-05cb50f9.js";import{c as W,d as H,a as V}from"./p-d7b02d3a.js";import{g as J}from"./p-5a9a971a.js";import{g as Z}from"./p-495e7b9d.js";import{V as K}from"./p-c94d2cec.js";import{l as q}from"./p-89218b6e.js";import{g as Y}from"./p-fc2fb61b.js";import{g as G}from"./p-c96eb2db.js";import"./p-7c2be8cc.js";import"./p-a82f35c9.js";import"./p-ba7d55ea.js";import"./p-1f65ab1e.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-e85ba21c.js";
7
- /*!
8
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
10
- * v2.4.0
11
- */const X="input-wrapper",Q="input",tt="toggle-icon",it=class{constructor(s){t(this,s),this.calciteInputDatePickerChange=i(this,"calciteInputDatePickerChange",6),this.calciteInputDatePickerBeforeClose=i(this,"calciteInputDatePickerBeforeClose",6),this.calciteInputDatePickerClose=i(this,"calciteInputDatePickerClose",6),this.calciteInputDatePickerBeforeOpen=i(this,"calciteInputDatePickerBeforeOpen",6),this.calciteInputDatePickerOpen=i(this,"calciteInputDatePickerOpen",6),this.calciteInternalInputInputHandler=t=>{const i=t.target,s=i.value,e=this.parseNumerals(s),n=this.formatNumerals(e);i.value=n;const{year:a}=o(s,this.localeData);if(a&&a.length<4)return;const h=l(s,this.localeData);r(h,this.min,this.max)&&(this.datePickerActiveDate=h)},this.calciteInternalInputBlurHandler=()=>{this.commitValue()},this.dialogId=`date-picker-dialog--${J()}`,this.focusOnOpen=!1,this.userChangedValue=!1,this.openTransitionProp="opacity",this.valueAsDateChangedExternally=!1,this.placeholderTextId=`calcite-input-date-picker-placeholder-${J()}`,this.onInputWrapperPointerDown=()=>{this.currentOpenInput=this.focusedInput},this.onInputWrapperClick=t=>{const{range:i,endInput:s,startInput:e,currentOpenInput:n}=this,a=t.currentTarget.getAttribute("data-position");t.composedPath().find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains(tt)}))&&("start"===a?e:s).setFocus(),i&&this.open&&n!==a||(this.open=!this.open)},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:i}=this;this.filteredFlipPlacements=i?u(i,t):null},this.setTransitionEl=t=>{this.transitionEl=t},this.setStartInput=t=>{this.startInput=t},this.setEndInput=t=>{this.endInput=t},this.blurHandler=()=>{this.open=!1},this.keyDownHandler=t=>{var i,s;const{defaultPrevented:e,key:n}=t;e||("Enter"===n?(this.commitValue(),this.shouldFocusRangeEnd()?null===(i=this.endInput)||void 0===i||i.setFocus():this.shouldFocusRangeStart()&&(null===(s=this.startInput)||void 0===s||s.setFocus()),_(this)&&(t.preventDefault(),this.restoreInputFocus())):"ArrowDown"===n?(this.open=!0,this.focusOnOpen=!0,t.preventDefault()):"Escape"===n&&(this.open=!1,t.preventDefault(),this.restoreInputFocus()))},this.startInputFocus=()=>{this.focusedInput="start"},this.endInputFocus=()=>{this.focusedInput="end"},this.setFloatingEl=t=>{this.floatingEl=t,v(this,this.referenceEl,this.floatingEl)},this.setStartWrapper=t=>{this.startWrapper=t,this.setReferenceEl()},this.setEndWrapper=t=>{this.endWrapper=t,this.setReferenceEl()},this.setDatePickerRef=t=>{this.datePickerEl=t,W(this,{focusTrapEl:t,focusTrapOptions:{initialFocus:!1,setReturnFocus:!1}})},this.handleDateChange=t=>{this.range||(t.stopPropagation(),this.setValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.handleDateRangeChange=t=>{this.range&&(t.stopPropagation(),this.setRangeValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.setInputValue=(t,i="start")=>{const s=this[`${i}Input`];s&&(s.value=t)},this.setRangeValue=t=>{if(!this.range)return;const{value:i}=this,s=Array.isArray(i),e=Array.isArray(t);let n=e?h(e?t[0]:null):"";n&&(n=this.getNormalizedDate(n));let a=e?h(e?t[1]:null):"";a&&(a=this.getNormalizedDate(a));const o=n||a?[n,a]:"";if(o===i)return;this.userChangedValue=!0,this.value=o,this.valueAsDate=o?T(o):void 0;const l=this.calciteInputDatePickerChange.emit();l&&l.defaultPrevented&&(this.value=i,s?(this.setInputValue(i[0],"start"),this.setInputValue(i[1],"end")):(this.value=i,this.setInputValue(i)))},this.setValue=t=>{if(this.range)return;const i=this.value;let s=h(t);s=this.getNormalizedDate(s),s!==i&&(this.userChangedValue=!0,this.valueAsDate=s?c(s):void 0,this.value=s||"",this.calciteInputDatePickerChange.emit().defaultPrevented&&(this.value=i,this.setInputValue(i)))},this.commonDateSeparators=[".","-","/"],this.formatNumerals=t=>t?t.split("").map((t=>{var i,s,e;return(null===(i=this.commonDateSeparators)||void 0===i?void 0:i.includes(t))?null===(s=this.localeData)||void 0===s?void 0:s.separator:(null==D?void 0:D.includes(t))?null===(e=null==R?void 0:R.numberFormatter)||void 0===e?void 0:e.format(Number(t)):t})).join(""):"",this.parseNumerals=t=>t?t.split("").map((t=>D.includes(t)?R.delocalize(t):t)).join(""):"",this.disabled=!1,this.focusTrapDisabled=!1,this.form=void 0,this.readOnly=!1,this.value="",this.flipPlacements=void 0,this.headingLevel=void 0,this.valueAsDate=void 0,this.messageOverrides=void 0,this.messages=void 0,this.minAsDate=void 0,this.maxAsDate=void 0,this.min=void 0,this.max=void 0,this.open=!1,this.validationMessage=void 0,this.validationIcon=void 0,this.name=void 0,this.numberingSystem=void 0,this.scale="m",this.status="idle",this.placement=m,this.range=!1,this.required=!1,this.overlayPositioning="absolute",this.proximitySelectionDisabled=!1,this.layout="horizontal",this.datePickerActiveDate=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.focusedInput="start",this.localeData=void 0}handleFocusTrapDisabled(t){this.open&&(t?H(this):V(this))}handleDisabledAndReadOnlyChange(t){t||(this.open=!1)}valueWatcher(t){if(!this.userChangedValue){let i;i=Array.isArray(t)?T(t):t?c(t):void 0,this.valueAsDateChangedExternally||i===this.valueAsDate||(this.valueAsDate=i),this.localizeInputValues()}this.userChangedValue=!1}valueAsDateWatcher(t){this.datePickerActiveDate=t;const i=this.range&&Array.isArray(t)?[h(t[0]),h(t[1])]:h(t);this.value!==i&&(this.valueAsDateChangedExternally=!0,this.value=i,this.valueAsDateChangedExternally=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}onMinChanged(t){t&&(this.minAsDate=c(t))}onMaxChanged(t){t&&(this.maxAsDate=c(t))}openHandler(){O(this),this.disabled||this.readOnly?this.open=!1:this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}calciteDaySelectHandler(){this.shouldFocusRangeStart()||this.shouldFocusRangeEnd()||(this.open=!1)}async setFocus(){await L(this),this.el.focus()}async reposition(t=!1){const{floatingEl:i,referenceEl:s,placement:e,overlayPositioning:n,filteredFlipPlacements:a}=this;return f(this,{floatingEl:i,referenceEl:s,overlayPositioning:n,placement:e,flipPlacements:a,type:"menu"},t)}connectedCallback(){$(this),S(this);const{open:t}=this;if(t&&this.openHandler(),Array.isArray(this.value))this.valueAsDate=T(this.value);else if(this.value)try{this.valueAsDate=c(this.value)}catch(t){this.warnAboutInvalidValue(this.value),this.value=""}else this.valueAsDate&&(this.range?this.setRangeValue(this.valueAsDate):Array.isArray(this.valueAsDate)||(this.value=h(this.valueAsDate)));this.min&&(this.minAsDate=c(this.min)),this.max&&(this.maxAsDate=c(this.max)),E(this),x(this),M(this),this.setFilteredPlacements(),this.reposition(!0),R.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.open&&O(this),v(this,this.referenceEl,this.floatingEl)}async componentWillLoad(){P(this),await Promise.all([this.loadLocaleData(),U(this)]),this.onMinChanged(this.min),this.onMaxChanged(this.max)}componentDidLoad(){F(this),this.localizeInputValues(),this.reposition(!0)}disconnectedCallback(){H(this),k(this),I(this),w(this),g(this,this.referenceEl,this.floatingEl),j(this),B(this)}componentDidRender(){C(this)}render(){var t,i,n;const{disabled:a,effectiveLocale:o,messages:l,numberingSystem:r,readOnly:h}=this;return R.numberFormatOptions={numberingSystem:r,locale:o,useGrouping:!1},s(e,{onBlur:this.blurHandler,onKeyDown:this.keyDownHandler},s(z,{disabled:this.disabled},this.localeData&&s("div",{class:"input-container"},s("div",{class:X,"data-position":"start",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setStartWrapper},s("calcite-input-text",{"aria-autocomplete":"none","aria-controls":this.dialogId,"aria-describedby":this.placeholderTextId,"aria-expanded":p(this.open),"aria-haspopup":"dialog",class:{[Q]:!0,"no-bottom-border":"vertical"===this.layout&&this.range},disabled:a,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.startInputFocus,placeholder:null===(t=this.localeData)||void 0===t?void 0:t.placeholder,readOnly:h,role:"combobox",scale:this.scale,status:this.status,ref:this.setStartInput}),!this.readOnly&&this.renderToggleIcon(this.open&&"start"===this.focusedInput),s("span",{"aria-hidden":"true",class:"assistive-text",id:this.placeholderTextId},"Date Format: ",null===(i=this.localeData)||void 0===i?void 0:i.placeholder)),s("div",{"aria-hidden":p(!this.open),"aria-label":l.chooseDate,"aria-live":"polite","aria-modal":"true",class:{"menu-container":!0,"menu-container--active":this.open},id:this.dialogId,role:"dialog",ref:this.setFloatingEl},s("div",{class:{"calendar-wrapper":!0,"calendar-wrapper--end":"end"===this.focusedInput,[b.animation]:!0,[b.animationActive]:this.open},ref:this.setTransitionEl},s("calcite-date-picker",{activeDate:this.datePickerActiveDate,activeRange:this.focusedInput,headingLevel:this.headingLevel,max:this.max,maxAsDate:this.maxAsDate,messageOverrides:this.messageOverrides,min:this.min,minAsDate:this.minAsDate,numberingSystem:r,onCalciteDatePickerChange:this.handleDateChange,onCalciteDatePickerRangeChange:this.handleDateRangeChange,proximitySelectionDisabled:this.proximitySelectionDisabled,range:this.range,scale:this.scale,tabIndex:this.open?void 0:-1,valueAsDate:this.valueAsDate,ref:this.setDatePickerRef}))),this.range&&"horizontal"===this.layout&&s("div",{class:"horizontal-arrow-container"},s("calcite-icon",{flipRtl:!0,icon:"arrow-right",scale:Z(this.scale)})),this.range&&"vertical"===this.layout&&"s"!==this.scale&&s("div",{class:"vertical-arrow-container"},s("calcite-icon",{icon:"arrow-down",scale:Z(this.scale)})),this.range&&s("div",{class:X,"data-position":"end",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setEndWrapper},s("calcite-input-text",{"aria-autocomplete":"none","aria-controls":this.dialogId,"aria-expanded":p(this.open),"aria-haspopup":"dialog",class:{[Q]:!0,"border-top-color-one":"vertical"===this.layout&&this.range},disabled:a,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.endInputFocus,placeholder:null===(n=this.localeData)||void 0===n?void 0:n.placeholder,readOnly:h,role:"combobox",scale:this.scale,status:this.status,ref:this.setEndInput}),!this.readOnly&&this.renderToggleIcon(this.open&&"end"===this.focusedInput))),s(y,{component:this}),this.validationMessage?s(K,{icon:this.validationIcon,message:this.validationMessage,scale:this.scale,status:this.status}):null))}renderToggleIcon(t){return s("span",{class:tt,tabIndex:-1},s("calcite-icon",{icon:t?"chevron-up":"chevron-down",scale:Z(this.scale)}))}setReferenceEl(){const{focusedInput:t,layout:i,endWrapper:s,startWrapper:e}=this;this.referenceEl="end"===t||"vertical"===i?s||e:e||s,requestAnimationFrame((()=>v(this,this.referenceEl,this.floatingEl)))}onLabelClick(){this.setFocus()}onBeforeOpen(){this.calciteInputDatePickerBeforeOpen.emit()}onOpen(){V(this,{onActivate:()=>{this.focusOnOpen&&(this.datePickerEl.setFocus(),this.focusOnOpen=!1)}}),this.calciteInputDatePickerOpen.emit()}onBeforeClose(){this.calciteInputDatePickerBeforeClose.emit()}onClose(){this.calciteInputDatePickerClose.emit(),H(this),this.restoreInputFocus(),this.focusOnOpen=!1,this.datePickerEl.reset()}commitValue(){const{focusedInput:t,value:i}=this,s=l(this[`${t}Input`].value,this.localeData),e=h(s),n=Array.isArray(i);if(this.range)if(n){if(e===i["start"===t?0:1])return;s?(this.setRangeValue(["start"===t?s:c(i[0]),"end"===t?s:c(i[1])]),this.localizeInputValues()):this.setRangeValue(["end"===t&&c(i[0]),"start"===t&&c(i[1])])}else s&&(this.setRangeValue(["start"===t?s:c(i[0]),"end"===t?s:c(i[1])]),this.localizeInputValues());else{if(e===i)return;this.setValue(s),this.localizeInputValues()}}async loadLocaleData(){R.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.localeData=await A(this.effectiveLocale),this.localizeInputValues()}shouldFocusRangeStart(){return!(!this.value[1]||this.value[0]||"end"!==this.focusedInput||!this.startInput)}shouldFocusRangeEnd(){return!(!this.value[0]||this.value[1]||"start"!==this.focusedInput||!this.endInput)}restoreInputFocus(){this.range?("start"===this.focusedInput?this.startInput:this.endInput).setFocus():this.startInput.setFocus()}localizeInputValues(){var t;const i=d(this.range?Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0:this.valueAsDate,this.minAsDate,this.maxAsDate),s=this.range?d(Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0,this.minAsDate,this.maxAsDate):null,e={numberingSystem:N(this.numberingSystem)},n=i&&i.toLocaleDateString(this.effectiveLocale,e),a=s&&s.toLocaleDateString(this.effectiveLocale,e);this.setInputValue(null!=n?n:"","start"),this.setInputValue(null!==(t=this.range&&a)&&void 0!==t?t:"","end")}warnAboutInvalidValue(t){console.warn(`The specified value "${t}" does not conform to the required format, "YYYY-MM-DD".`)}getNormalizedDate(t){if(!t)return"";if(!
12
- /*!
13
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
15
- * v2.4.0
16
- */
17
- function(t){if(!t)return!1;const{year:i}=a(t);return Number(i)<100}(t))return t;const{day:i,month:s,year:e}=a(t);return`${function(t){const i=(new Date).getFullYear();return 100*Math.floor(i/100)+t}(Number(e))}-${s}-${i}`}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return n(this)}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],disabled:["handleDisabledAndReadOnlyChange"],readOnly:["handleDisabledAndReadOnlyChange"],value:["valueWatcher"],valueAsDate:["valueAsDateWatcher"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],min:["onMinChanged"],max:["onMaxChanged"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],layout:["setReferenceEl"],focusedInput:["setReferenceEl"],effectiveLocale:["loadLocaleData"]}}};it.style=":host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:inline-block;inline-size:100%;overflow:visible;vertical-align:top;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host .menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host .menu-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}:host .menu-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}:host .menu-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}:host .menu-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([scale=s]){--calcite-toggle-spacing:0.5rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1rem)}:host([scale=m]){--calcite-toggle-spacing:0.75rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1.5rem)}:host([scale=l]){--calcite-toggle-spacing:1rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 2rem)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.calendar-wrapper{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:translate3d(0, 0, 0)}.input-wrapper{position:relative}.toggle-icon{position:absolute;display:flex;cursor:pointer;align-items:center;inset-inline-end:0;inset-block:0;padding-inline:var(--calcite-toggle-spacing)}:host([range]) .input-container{display:flex}:host([range]) .input-wrapper{flex:1 1 auto}:host([range]) .horizontal-arrow-container{display:flex;align-items:center;border-width:1px;border-inline-start-width:0px;border-inline-end-width:0px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);padding-block:0px;padding-inline:0.25rem}:host([range][layout=vertical]) .input-wrapper{inline-size:100%}:host([range][layout=vertical]) .input-container{flex-direction:column;align-items:flex-start}:host([range][layout=vertical]) .calendar-wrapper--end{transform:translate3d(0, 0, 0)}:host([range][layout=vertical]) .vertical-arrow-container{inset-block-start:1.5rem;position:absolute;z-index:var(--calcite-z-index);margin-inline:1px;background-color:var(--calcite-color-foreground-1);padding-inline:0.625rem;inset-inline-start:0}.menu-container{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.menu-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.menu-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.menu-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.menu-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .menu-container{visibility:visible}.menu-container--active{visibility:visible}.input .calcite-input__wrapper{margin-block-start:0px}:host([range][layout=vertical][scale=m]) .vertical-arrow-container{inset-block-start:1.5rem;padding-inline-start:0.75rem}:host([range][layout=vertical][scale=m]) .vertical-arrow-container calcite-icon{block-size:0.75rem;inline-size:0.75rem;min-inline-size:0px}:host([range][layout=vertical][scale=l]) .vertical-arrow-container{inset-block-start:2.25rem;padding-inline:0.875rem}:host([range][layout=vertical][open]) .vertical-arrow-container{display:none}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::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}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}";const st="instant-apps-filter-list calcite-mode-light",et=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function nt(t){return t.replaceAll("'","''")}function at(t,i=!1){if(t){const s=new Date(t),e=`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`;return i?`${e} ${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}`:e}}function ot(t){var i;if(null!=t){t.value=["",""];const s=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll("calcite-input");if(null!=s)for(const t of s)t.value=""}}const lt="instant-apps-filter-list__footer",rt="instant-apps-filter-list__item-container--user-input",ht=class{constructor(s){t(this,s),this.filterListReset=i(this,"filterListReset",7),this.filterUpdate=i(this,"filterUpdate",7),this.layerExpressions=void 0,this.autoUpdateUrl=!1,this.closeBtn=!1,this.closeBtnOnClick=void 0,this.comboboxOverlayPositioning="absolute",this.closeBtnText=void 0,this.openFilters=!1,this.extentSelector=!1,this.extentSelectorConfig=void 0,this.urlParams=void 0,this.filterCount=0,this.view=void 0,this.zoomBtn=!0,this.loading=void 0,this.filterLayerExpressions=void 0,this.messages=void 0,this.baseClass=st,this.disabled=!0,this.hasLayerExpression=!1,this.initDefExpressions=void 0,this.initMapImageExpressions=void 0,this.initPointCloudFilters=void 0}watchViewHandler(){this.handleWhenView()}watchLayerExpressions(){this.hasLayerExpression||(this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}async componentWillLoad(){var t;this.baseClass="dark"===G(this.el)?"instant-apps-filter-list calcite-mode-dark":st,await this.initializeModules(),Y(this),this.hasLayerExpression=null!=this.layerExpressions,this.filterLayerExpressions=null!=this.layerExpressions?JSON.parse(JSON.stringify(this.layerExpressions)):void 0,this.disabled=!(null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)||void 0,this.reactiveUtils.whenOnce((()=>this.view)).then((()=>this.handleLayerExpressionsUpdate()))}componentShouldUpdate(t,i,s){"view"===s&&null!=t?this.handleWhenView():"layerExpressions"===s&&(this.hasLayerExpression&&this.resetAllFilters(),this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}componentWillRender(){var t;this.disabled=!((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0)||void 0}disconnectedCallback(){this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.resetAllFilters()}async initializeModules(){const[t,i,s]=await q(["esri/intl","esri/geometry/support/jsonUtils","esri/core/reactiveUtils"]);return this.geometryJsonUtils=i,this.reactiveUtils=s,this.locale=t.getLocale(),this.intl=t,Promise.resolve()}render(){const t=this.loading?this.renderLoading():this.initFilterConfig(),i=this.closeBtn?this.renderFullFooter():this.renderFooter();return s(e,null,s("calcite-panel",{class:this.baseClass,ref:t=>this.panelEl=t},s("slot",{slot:"header-content",name:"filter-header-content"}),s("slot",{slot:"header-actions-end",name:"filter-header-actions-end"}),s("div",{key:"filter-container",class:"instant-apps-filter-list__container"},t,i)))}renderLoading(){return s("calcite-loader",{label:"Loading filters..."})}renderFilter(t){const{id:i}=t;return t.expressions.map(((e,n)=>"checkbox"==e.type||null==e.type?s("div",{key:`${i}-${n}`,class:"instant-apps-filter-list__item-container"},s("div",{class:"instant-apps-filter-list__title"},s("p",null,e.name)),s("div",{class:"instant-apps-filter-list__checkbox-container"},s("calcite-checkbox",{id:e.id.toString(),scale:"l",checked:null==e?void 0:e.active,onCalciteCheckboxChange:this.handleCheckboxChange.bind(this,t,e)}))):this.initInput(t,e)))}renderLayerBlock(){return this.filterLayerExpressions.map((t=>this.renderFilterBlocks(t)))}renderFilterBlocks(t){var i;const e=this.renderFilter(t),{operator:n}=t,a="OR"===(null==n?void 0:n.trim())?"orOperator":"andOperator",o=this.renderZoomTo(t);return s("calcite-block",{key:t.id,heading:t.title,description:null===(i=this.messages)||void 0===i?void 0:i[a],open:!!this.openFilters||void 0,collapsible:!0},o,e)}renderCombobox(t,i){var e;return s("label",{key:"combo-select",class:rt},s("span",null,i.name),s("calcite-combobox",{id:i.id.toString(),onCalciteComboboxChange:this.handleComboSelect.bind(this,i,t),label:i.name,placeholder:i.placeholder,selectionMode:"multiple","max-items":"6",scale:"s",overlayPositioning:this.comboboxOverlayPositioning},null===(e=i.fields)||void 0===e?void 0:e.map(((t,s)=>this.renderComboboxItem(i,t,s)))))}renderComboboxItem(t,i,e){var n;const a=this.createLabel(t,i),o=null==t?void 0:t.selectedFields,l=null!==(n=null==o?void 0:o.includes(i))&&void 0!==n&&n;return s("calcite-combobox-item",{key:`${a}-${e}`,value:i,textLabel:`${a}`,selected:l})}initFilterConfig(){var t,i;if((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0){if(1===this.filterLayerExpressions.length){const{operator:t}=this.filterLayerExpressions[0],e="OR"===(null==t?void 0:t.trim())?"orOperator":"andOperator",n=this.renderZoomTo(this.filterLayerExpressions[0]);return s("calcite-block",{class:"instant-apps-filter-list__operator-description",heading:null===(i=this.messages)||void 0===i?void 0:i[e],open:!0},n,this.renderFilter(this.filterLayerExpressions[0]))}if(this.filterLayerExpressions.length>1)return this.renderLayerBlock()}}renderNumberSlider(t,i){var e,n,a,o,l,r,h,c;const d=null==i?void 0:i.min,p=null==i?void 0:i.max,u=(null==i?void 0:i.step)?i.step:1,v=null!==(e=null==i?void 0:i.field)&&void 0!==e?e:"",m=[null!=(null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.min)?i.range.min:d,null!=(null===(a=null==i?void 0:i.range)||void 0===a?void 0:a.max)?i.range.max:p];return null!=d&&null!=p?s("label",{key:null==i?void 0:i.id.toString(),class:rt},s("span",null,null==i?void 0:i.name),s("div",{class:"instant-apps-filter-list__number-input-container"},s("calcite-slider",{id:null==i?void 0:i.id.toString(),onCalciteSliderChange:this.handleSliderChange.bind(this,i,t),min:d,max:p,minValue:d,maxValue:p,"min-label":null===(l=null===(o=this.messages)||void 0===o?void 0:o.minSlider)||void 0===l?void 0:l.replace("{field}",v),"max-label":null===(h=null===(r=this.messages)||void 0===r?void 0:r.maxSlider)||void 0===h?void 0:h.replace("{field}",v),step:u,labelHandles:!0,snap:!0,value:m,"group-separator":null===(c=null==i?void 0:i.format)||void 0===c?void 0:c.digitSeparator}))):void 0}renderDatePicker(t,i){var e,n,a,o;const{min:l,max:r}=i,h=[null===(e=null==i?void 0:i.range)||void 0===e?void 0:e.min,null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.max];return null!=l&&null!=r?s("label",{class:rt},s("span",null,null==i?void 0:i.name),s("div",{class:"instant-apps-filter-list__date-picker-input-container"},s("calcite-input-date-picker",{id:null==i?void 0:i.id.toString(),onCalciteInputDatePickerChange:this.handleDatePickerRangeChange.bind(this,i,t),min:l,max:r,"overlay-positioning":"fixed",lang:null!==(a=this.locale)&&void 0!==a?a:"en",layout:"vertical",value:h,range:!0}),s("calcite-action",{onClick:this.handleResetDatePicker.bind(this,i,t),icon:"reset",text:null===(o=this.messages)||void 0===o?void 0:o.resetDatePicker,scale:"s"}))):null}renderFooter(){var t;return s("div",{class:lt,slot:"footer"},s("calcite-button",{appearance:"outline",width:"full",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(t=this.messages)||void 0===t?void 0:t.resetFilter))}renderFullFooter(){var t,i,e;const n=null!=this.closeBtnText?this.closeBtnText:null===(t=this.messages)||void 0===t?void 0:t.close;return s("div",{class:lt,slot:"footer"},s("calcite-button",{appearance:"outline",width:"half",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(i=this.messages)||void 0===i?void 0:i.resetFilter),s("calcite-button",{appearance:"solid",width:"half",kind:"brand",onClick:null===(e=this.closeBtnOnClick)||void 0===e?void 0:e.bind(this)},n))}renderZoomTo(t){var i;return this.zoomBtn?s("div",{class:"instant-apps-filter-list__zoom-to"},s("calcite-button",{id:(null==t?void 0:t.sublayerId)?`zoom-to-${t.id}-${t.sublayerId}`:`zoom-to-${t.id}`,appearance:"transparent",kind:"neutral",scale:"s",iconStart:"magnifying-glass-plus",onClick:this.handleZoomTo.bind(this,t)},null===(i=this.messages)||void 0===i?void 0:i.zoomTo)):void 0}handleResetDatePicker(t,i){ot(this.panelEl.querySelector(`[id='${t.id}']`)),t.active=!1,t.definitionExpression=void 0,t.range=void 0,this.generateOutput(i)}initInput(t,i){const{type:s}=i;return"string"===s||"coded-value"==s?this.renderCombobox(t,i):"number"===s||"range"==s?"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?this.renderCombobox(t,i):this.renderNumberSlider(t,i):"date"===s?"drop-down"===(null==i?void 0:i.displayOption)?this.renderCombobox(t,i):this.renderDatePicker(t,i):void 0}async initExpressions(){if(this.loading=!0,null==this.filterLayerExpressions)return;const t=this.filterLayerExpressions;for(let i=0;i<(null==t?void 0:t.length);i++){const s=t[i].expressions;for(let e=0;e<(null==s?void 0:s.length);e++)null==s[e].active&&null!=s[e].definitionExpression&&(s[e].active=!1),await this.setInitExpression(t[i],s[e])}this.loading=!1,this.filterLayerExpressions=[...t]}handleResetFilter(){var t;null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=t.expressions)||void 0===i||i.forEach((t=>{const{type:i}=t;"string"===i||"coded-value"===i?this.resetCombobox(t):"date"===i?"drop-down"===(null==t?void 0:t.numDisplayOption)||"drop-down"===(null==t?void 0:t.displayOption)?this.resetCombobox(t):this.resetDatePicker(t):"number"===i||"range"===i?"drop-down"===(null==t?void 0:t.numDisplayOption)||"drop-down"===(null==t?void 0:t.displayOption)?this.resetCombobox(t):this.resetNumberRange(t):this.resetCheckbox(t),t.active=!1}))})),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetCombobox(t){const{id:i}=t;t.selectedFields=void 0;const s=this.panelEl.querySelector(`[id='${i}']`);if(null!=s)for(let t=0;t<s.children.length;t++)s.children[t].selected=!1}resetDatePicker(t){const{id:i}=t;t.range=void 0,ot(this.panelEl.querySelector(`[id='${i}']`))}resetNumberRange(t){t.range=void 0;const{id:i,max:s,min:e}=t,n=this.panelEl.querySelector(`[id='${i}']`);null!=n&&(n.minValue=e,n.maxValue=s)}resetCheckbox(t){const{id:i}=t,s=this.panelEl.querySelector(`[id='${i}']`);null!=s&&(s.checked=!1)}resetAllFilters(){var t,i,s,e,n;const a=null===(s=null===(i=null===(t=this.view)||void 0===t?void 0:t.map)||void 0===i?void 0:i.allLayers)||void 0===s?void 0:s.concat(null===(n=null===(e=this.view)||void 0===e?void 0:e.map)||void 0===n?void 0:n.allTables);null==a||a.forEach((t=>{var i,s;if(et.includes(t.type)){const e=t;"point-cloud"===e.type?e.filters=null===(i=this.initPointCloudFilters)||void 0===i?void 0:i[e.id]:"map-image"===e.type?e.allSublayers.forEach((t=>{var i,s;t.definitionExpression=null===(s=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[e.id])||void 0===s?void 0:s[t.id]})):e.definitionExpression=null===(s=this.initDefExpressions)||void 0===s?void 0:s[e.id]}}))}async updateStringExpression(t,i){const{field:s,type:e}=i,n=this.findFilterLayer(t);if(i.fields=await this.getFeatureAttributes(n,s),"date"===e){const t=n.fields.find((({name:t})=>t===s));"date-only"===(null==t?void 0:t.type)&&(i.dateOnly=!0)}if(null==i?void 0:i.selectedFields){const t=i.selectedFields.map((t=>"number"==typeof t?t:`'${nt(t)}'`));return i.definitionExpression=`${s} IN (${t.join(",")})`,Promise.resolve(!0)}return Promise.resolve(!1)}async updateNumberExpression(t,i){var s,e;if(!(null==i?void 0:i.min)&&0!==(null==i?void 0:i.min)||!(null==i?void 0:i.max)&&0!==(null==i?void 0:i.max)){const n=this.findFilterLayer(t),{field:a}=i;if(null!=a)if(this.setExpressionFormat(n,i,a),"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)){const t=await this.getFeatureAttributes(n,a);t.sort(((t,i)=>t-i)),i.fields=t}else{const t=await this.calculateMinMaxStatistics(n,a),o=null===(s=null==t?void 0:t[0])||void 0===s?void 0:s.attributes;if(null!=(null===(e=i.format)||void 0===e?void 0:e.places)?(i.min=this.roundMinNumberDown(o[`min${a}`],i.format.places),i.max=this.roundMaxNumberUp(o[`max${a}`],i.format.places)):(i.min=o[`min${a}`],i.max=o[`max${a}`]),(null==i?void 0:i.range)&&Object.keys(i.range).length){const{min:t,max:s}=i.range;return i.definitionExpression=`${i.field} BETWEEN ${t} AND ${s}`,!0}}}return!1}async updateDateExpression(t,i){var s;const{field:e,range:n}=i,a=this.findFilterLayer(t),o=await this.calculateMinMaxStatistics(a,e),l=null===(s=null==o?void 0:o[0])||void 0===s?void 0:s.attributes;if(i.min=at(l[`min${e}`]),i.max=at(l[`max${e}`]),null!=n&&(null!=(null==n?void 0:n.max)||null!=(null==n?void 0:n.min))){let{min:t,max:s}=n;if(t=null==t?void 0:t.replace("+"," "),s=null==s?void 0:s.replace("+"," "),t||s){const n=s&&!t?"<":!s&&t?">":null;return i.definitionExpression=n?`${e} ${n} '${null!=t?t:s}'`:`${e} BETWEEN '${t}' AND '${s}'`,!0}}return!1}updateCodedValueExpression(t,i){var s;const{field:e}=t,n=[];t.codedValues={};const a=null==i?void 0:i.domain;if(null===(s=null==a?void 0:a.codedValues)||void 0===s||s.forEach((i=>{const{code:s,name:e}=i;n.push(s),null!=t.codedValues&&(t.codedValues[s]=e)})),t.fields=n,null==t?void 0:t.selectedFields){const i=t.selectedFields.map((t=>"number"==typeof t?t:`'${nt(t)}'`)),s=`${e} IN (${i.join(",")})`;return t.definitionExpression=s,!0}return!1}updateRangeExpression(t,i){const{field:s,range:e}=t,n=null==i?void 0:i.domain;if(t.min=null==n?void 0:n.minValue,t.max=null==n?void 0:n.maxValue,e&&Object.keys(e).length){const{min:i,max:n}=e;return t.definitionExpression=`${s} BETWEEN ${i} AND ${n}`,!0}return!1}async getFeatureAttributes(t,i){var s,e,n;if(t&&et.includes(t.type)){const a=t.createQuery();if((null===(e=null===(s=null==t?void 0:t.capabilities)||void 0===s?void 0:s.query)||void 0===e?void 0:e.supportsCacheHint)&&(a.cacheHint=!0),i){const s=this.getInitDefExprFromLayer(t);if(a.where=s||"1=1",a.outFields=[i],a.orderByFields=[`${i} DESC`],a.returnDistinctValues=!0,a.returnGeometry=!1,a.maxRecordCountFactor=3,this.extentSelector&&this.extentSelectorConfig){const t=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=t&&(a.geometry=t),a.spatialRelationship="intersects"}return null===(n=await this.queryForFeatures(t,a,i))||void 0===n?void 0:n.sort()}}return[]}async queryForFeatures(t,i,s){const e=await t.queryFeatures(i),n=null==e?void 0:e.features.filter((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[s]}));return null==n?void 0:n.map((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[s]}))}async calculateMinMaxStatistics(t,i){var s,e;if(t&&et.includes(t.type)){const n=t.createQuery();let a=this.getInitDefExprFromLayer(t);if(n.where=a||"1=1",(null===(e=null===(s=null==t?void 0:t.capabilities)||void 0===s?void 0:s.query)||void 0===e?void 0:e.supportsCacheHint)&&(n.cacheHint=!0),i){if(n.outStatistics=[{onStatisticField:i,outStatisticFieldName:`max${i}`,statisticType:"max"},{onStatisticField:i,outStatisticFieldName:`min${i}`,statisticType:"min"}],this.extentSelector&&this.extentSelectorConfig){const t=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=t&&(n.geometry=t),n.spatialRelationship="intersects"}const s=await t.queryFeatures(n);return null==s?void 0:s.features}}return[]}getExtent(t,i){if(t&&i){const{constraints:t}=i;let s=Object.assign({},t);const e=null==s?void 0:s.geometry;if(e){const t="extent"in e?e:this.geometryJsonUtils.fromJSON(e);if("extent"===(null==t?void 0:t.type)||"polygon"===(null==t?void 0:t.type))return t}}}setInitExpression(t,i){if(i.field&&i.type){const s=this.findFilterLayer(t);return null==s?Promise.resolve():("not-loaded"!==s.loadStatus&&"failed"!==s.loadStatus||s.load(),s.when((async()=>{var e,n;const a=null===(e=s.fields)||void 0===e?void 0:e.find((({name:t})=>t===i.field)),o=null===(n=null==a?void 0:a.domain)||void 0===n?void 0:n.type;i.type="coded-value"===o||"range"===o?o:i.type,await this.updateExpression(t,i,a)})))}return this.updateExpression(t,i,void 0),Promise.resolve()}async updateExpression(t,i,s){let e=!1;const{type:n}=i;"string"===n?e=await this.updateStringExpression(t,i):"number"===n?e=await this.updateNumberExpression(t,i):"date"===n?e="drop-down"===i.displayOption?await this.updateStringExpression(t,i):await this.updateDateExpression(t,i):"coded-value"===n?e=this.updateCodedValueExpression(i,s):"range"===n?e=this.updateRangeExpression(i,s):!i.active||"checkbox"!==n&&null!=n||(e=!0),e&&this.generateOutput(t)}updateRangeExpressions(t,i,s,e){const n=this.getInitDefExprFromLayerExpression(i);!e&&0!==e||!s&&0!==s||(e===(null==t?void 0:t.min)&&s===(null==t?void 0:t.max)?(t.definitionExpression=void 0,t.active=!1):(t.definitionExpression=n?`(${n}) AND ${null==t?void 0:t.field} BETWEEN ${e} AND ${s}`:`${null==t?void 0:t.field} BETWEEN ${e} AND ${s}`,t.active=!0)),t.range={min:e,max:s}}handleCheckboxChange(t,i,s){i.active=s.target.checked,this.generateOutput(t)}handleSliderChange(t,i,s){const{maxValue:e,minValue:n}=s.target;this.updateRangeExpressions(t,i,e,n),this.generateOutput(i)}handleComboSelect(t,i,s){const e=s.target.selectedItems,{field:n,type:a}=t;if(e&&e.length){const i=e.map((({value:t})=>"number"==typeof t?t:`'${nt(t)}'`));if("date"===a)t.selectedFields=e.map((({value:t})=>t)),t.definitionExpression=i.map((t=>this.buildDateExpression(t,n))).join(" OR ");else{t.selectedFields=e.map((({value:t})=>t));const s=`${n} IN (${i.join(",")})`;t.definitionExpression=s}t.active=!0}else t.definitionExpression=void 0,t.active=!1;this.generateOutput(i)}handleDatePickerRangeChange(t,i,s){const e=s.target,[n,a]=e.valueAsDate,o=null!=n?at(Math.floor(n.getTime()),!0):void 0,l=null!=a?at(Math.floor(a.getTime()),!0):void 0;if(null!=o||null!=l){const s=l&&null==o?"<":null==l&&o?">":null;t.definitionExpression=s?`${t.field} ${s} '${null!=o?o:l}'`:`${t.field} BETWEEN '${o}' AND '${l}'`,t.range={min:o,max:l},t.active=!0,this.generateOutput(i)}}handleURLParams(){var t;if("URLSearchParams"in window){const i=null===(t=new URLSearchParams(document.location.search).get("filter"))||void 0===t?void 0:t.split(";");let s=0;null==i||i.forEach((t=>{var i;const e=JSON.parse(t);null===(i=this.filterLayerExpressions)||void 0===i||i.forEach((t=>{var i;(null==e?void 0:e.layerId)===t.id&&(null===(i=t.expressions)||void 0===i||i.forEach((t=>{var i,n;(null===(i=t.id)||void 0===i?void 0:i.toString())===(null===(n=null==e?void 0:e.expressionId)||void 0===n?void 0:n.toString())&&(t.active=!0,s++,"range"===e.type?t.range=e.range:"select"===e.type&&(t.selectedFields=e.selectedFields))})))}))})),this.filterCount=s}}createURLParamExpression(t,i){const{id:s,range:e,selectedFields:n,type:a}=i;return"string"===a||"coded-value"===a||"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?{type:"select",layerId:t.id,expressionId:s.toString(),selectedFields:n}:"number"===a||"range"===a||"date"===a?{type:"range",layerId:t.id,expressionId:s.toString(),range:e}:{layerId:t.id,expressionId:s.toString()}}autoUpdateURLCheck(t){this.autoUpdateUrl&&(t.toString()?window.history.replaceState({},"",`${window.location.pathname}?${t} `):window.history.replaceState({},"",window.location.pathname))}generateURLParams(){var t;if("URLSearchParams"in window){const i=new URLSearchParams(window.location.search),s=[];let e=0;null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=null==t?void 0:t.expressions)||void 0===i||i.forEach((i=>{if(i.active){e++;const n=this.createURLParamExpression(t,i);s.push(JSON.stringify(n))}}))})),this.filterCount=e,s.length>0?i.set("filter",s.join(";")):i.delete("filter"),this.autoUpdateURLCheck(i),this.urlParams=i}}updateFilter(t,i,s){const{id:e}=t,n=this.view.map.findLayerById(e)||this.view.map.findTableById(e);if(null!=n)if("point-cloud"===n.type)this.updateFilterLayerPCLFilter(n,s);else if("map-image"===n.type){const s=n.findSublayerById(null==t?void 0:t.sublayerId);null!=s&&this.updateFilterLayerDefExpression(s,i,t)}else this.updateFilterLayerDefExpression(n,i,t)}updateFilterLayerDefExpression(t,i,s){const{operator:e}=s;let n=this.getInitDefExprFromLayer(t);const a=(null==i?void 0:i.length)>0&&null!=n?`(${i.join(e)}) AND (${n})`:i.length>0?i.join(e):n;t.definitionExpression=a}updateFilterLayerPCLFilter(t,i){t.filters=i}async handleWhenView(){if(null==this.view)return;const t=this.view.map;await t.loadAll(),this.handleLayerExpressionsUpdate()}async handleLayerExpressionsUpdate(){if(null==this.view)return;const t=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={};const i=t.allLayers.concat(t.allTables);for(let t=0;t<i.length;t++){const s=i.getItemAt(t);if(et.includes(s.type)){const t=s;"point-cloud"===t.type?this.initPointCloudFilters[t.id]=t.filters:"map-image"===t.type?(this.initMapImageExpressions[t.id]={},t.allSublayers.forEach((i=>{this.initMapImageExpressions[t.id][i.id]=i.definitionExpression}))):this.initDefExpressions[t.id]=t.definitionExpression}}this.initExpressions(),this.handleURLParams()}async handleZoomTo(t){const i=this.panelEl.querySelector((null==t?void 0:t.sublayerId)?`#zoom-to-${t.id}-${t.sublayerId}`:`#zoom-to-${t.id}`);null!=i&&(i.loading=!0,i.disabled=!0),this.zoomToGraphics=[];let s=0,e=!1;const n=setInterval((()=>{s>=1e3&&e&&(this.view.goTo(this.zoomToGraphics),null!=i&&(i.loading=!1,i.disabled=!1),clearInterval(n)),s+=500}),500);await this.getZoomToGraphics(t),e=!0}async getZoomToGraphics(t){var i,s,e,n,a;const o=this.view.allLayerViews.find((({layer:i})=>i.id===t.id)),l=o.layer,r="map-image"===l.type?l.findSublayerById(t.sublayerId):l;if("point-cloud"!==r.type&&et.includes(null==r?void 0:r.type)){const t=r.createQuery();if((null===(s=null===(i=null==l?void 0:l.capabilities)||void 0===i?void 0:i.query)||void 0===s?void 0:s.supportsCacheHint)&&(t.cacheHint=!0),t.where=null!==(e=r.definitionExpression)&&void 0!==e?e:"1=1",t.returnGeometry=!0,t.returnDistinctValues=!0,t.maxRecordCountFactor=3,t.returnExceededLimitFeatures=!0,t.outFields=[],this.extentSelector&&this.extentSelectorConfig){const i=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=i&&(t.geometry=i),t.spatialRelationship="intersects"}const h=null!=(null===(n=null==o?void 0:o.featureEffect)||void 0===n?void 0:n.filter)?o.featureEffect.filter:o.filter;null!=h&&(null!=h.objectIds&&(t.objectIds=h.objectIds),null!=h.distance&&(t.distance=h.distance),null!=h.geometry&&(t.geometry=h.geometry),null!=h.distance&&(t.distance=h.distance),null!=h.spatialRelationship&&(t.spatialRelationship=h.spatialRelationship),null!=h.units&&(t.units=h.units),null!=h.where&&(t.where=h.where),null!=h.timeExtent&&(t.timeExtent=h.timeExtent));try{const i=await r.queryFeatures(t);this.zoomToGraphics.push(...i.features)}catch(i){if(null===(a=null==i?void 0:i.message)||void 0===a?void 0:a.toLowerCase().includes("distinct"))try{t.returnDistinctValues=!1;const i=await r.queryFeatures(t);this.zoomToGraphics.push(...i.features)}catch(t){}}}return Promise.resolve()}generateOutput(t){if(null==this.view)return;const i=[];let s=[];if(t){for(const e of t.expressions){const{active:t,definitionExpression:n,pointCloudFilters:a}=e;t&&n&&i.push(`(${n})`),t&&null!=a&&a.length>0&&(s=s.concat(a))}this.updateFilter(t,i,s),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(t){return t.toLocaleString("en-US",{maximumFractionDigits:20})}roundMinNumberDown(t,i){if(null!=t){if((""+t).includes("e")){var s=(""+t).split("e"),e="";return+s[1]+i>0&&(e="+"),+(Math.floor(+s[0]+"e"+e+(+s[1]+i))+"e-"+i)}return+(Math.floor(t+"e+"+i)+"e-"+i)}}roundMaxNumberUp(t,i){if(null!=t){if((""+t).includes("e")){var s=(""+t).split("e"),e="";return+s[1]+i>0&&(e="+"),+(Math.ceil(+s[0]+"e"+e+(+s[1]+i))+"e-"+i)}return+(Math.ceil(t+"e+"+i)+"e-"+i)}}roundNumber(t,i){if(null!=t){if((""+t).includes("e")){var s=(""+t).split("e"),e="";return+s[1]+i>0&&(e="+"),+(Math.round(+s[0]+"e"+e+(+s[1]+i))+"e-"+i)}return+(Math.round(t+"e+"+i)+"e-"+i)}}setExpressionFormat(t,i,s){if(null!=(null==t?void 0:t.popupTemplate)){const e=t.popupTemplate.fieldInfos.find((({fieldName:t})=>t===s));i.format=null==e?void 0:e.format}}getInitDefExprFromLayer(t){var i,s,e;return"sublayer"===t.type?null===(s=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.layer.id])||void 0===s?void 0:s[t.id]:null===(e=this.initDefExpressions)||void 0===e?void 0:e[t.id]}getInitDefExprFromLayerExpression(t){var i,s,e;return null!=(null==t?void 0:t.sublayerId)?null===(s=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.id])||void 0===s?void 0:s[t.sublayerId]:null===(e=this.initDefExpressions)||void 0===e?void 0:e[t.id]}findFilterLayer(t){const i=this.view.map.allLayers.concat(this.view.map.allTables).find((({id:i})=>i===t.id));return"map-image"===i.type?null==i?void 0:i.findSublayerById(t.sublayerId):i}createLabel(t,i){var s;let e=i;if("coded-value"===t.type)e=null===(s=t.codedValues)||void 0===s?void 0:s[i];else if("number"===t.type&&"number"==typeof i&&null!=t.format)null!=t.format.places&&(e=this.roundNumber(i,t.format.places)),t.format.digitSeparator&&(e=this.numberWithCommas(e));else if("date"===t.type&&!t.dateOnly){const s=t.dateOnly?this.intl.convertDateFormatToIntlOptions("short-date-long-time"):void 0;e=this.intl.formatDate(i,s)}return e}buildDateExpression(t,i){if(t){const s=new Date(t),e=new Date(t),n=new Date(e.setDate(s.getDate()+1)),a=`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`,o=`${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}`,l=`${n.getHours()}:${n.getMinutes()}:${n.getSeconds()}`;return`${i} BETWEEN '${a} ${o}' AND '${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()} ${l}'`}}get el(){return n(this)}static get watchers(){return{view:["watchViewHandler"],layerExpressions:["watchLayerExpressions"]}}};ht.style=":host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:normal}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;font-size:16px;--calcite-combobox-input-height:24px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:64px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:normal;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1:12px}.instant-apps-filter-list__zoom-to{display:flex;justify-content:flex-end;margin:8px 0 20px}.instant-apps-filter-list__zoom-to calcite-action{width:-moz-min-content;width:min-content}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1:16px}@media (prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor:2;--calcite-internal-animation-timing-slow:calc(300ms * 2)}}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}";const ct="instant-apps-social-share",dt={base:ct,dialog:`${ct}__dialog`,dialogEmbed:`${ct}__dialog-embed`,dialogContent:`${ct}__dialog-content`,options:`${ct}__options`,tipContainer:`${ct}__tip`,tipHeader:`${ct}__tip-header`,tipContent:`${ct}__tip-content`,icon:`${ct}__icon`,iconContainer:`${ct}__icon-container`,optionText:`${ct}__option-text`,popoverButton:`${ct}__popover-button`,layout:{vertical:`${ct}__layout--vertical`,horizontal:`${ct}__layout--horizontal`},xLogo:{light:`${ct}__x-logo--light`,dark:`${ct}__x-logo--dark`},success:{container:`${ct}__success`,header:`${ct}__success-header`,message:`${ct}__success-message`,icon:`${ct}__success-icon`},embed:{container:`${ct}__embed`,header:`${ct}__embed-header`,embedCode:{container:`${ct}__embed-code`,textArea:`${ct}__embed-code-text-area`,copyButton:`${ct}__embed-code-copy-button`},textAreaText:`${ct}__embed-text-area-text`,dimensions:{container:`${ct}__embed-dimensions`,input:`${ct}__embed-dimensions-input`}},rtl:{optionText:`${ct}__option-text--rtl`,textArea:`${ct}__text-area--rtl`}},pt={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",x:"https://x.com/intent/post?url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}"},ut=class{constructor(i){t(this,i),this.mode="popover",this.shareUrl=window.location.href,this.autoUpdateShareUrl=!0,this.shareText="",this.embed=!1,this.shareButtonColor="neutral",this.shareButtonType="button",this.shareButtonScale=void 0,this.iframeInnerText="",this.popoverButtonIconScale="m",this.view=void 0,this.displayTipText=!0,this.shortenShareUrl=!0,this.socialMedia=!0,this.shareIconsLayout="vertical",this.scale="m",this.successMessage="",this.defaultUrlParams=null,this.inlineSuccessPopoverPlacement="trailing",this.messages=void 0,this.opened=!1,this.copied=!1,this.inlineCopyLinkOpened=!1,this.inlineCopyEmbedOpened=!1,this.embedWidth=400,this.embedHeight=600}componentDidLoad(){var t,i;Y(this),this.setupAutoCloseListeners(),"popover"===this.mode&&(this.opened&&(this.popoverRef.open=!0),this.popoverRef.addEventListener("calcitePopoverOpen",(()=>{this.shareListRef&&this.shareListRef.children[0].focus()})),this.popoverRef.addEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))),this.embed&&(null===(t=this.embedWidthRef)||void 0===t||t.addEventListener("change",this.updateDimensions.bind(this,"width")),null===(i=this.embedHeightRef)||void 0===i||i.addEventListener("change",this.updateDimensions.bind(this,"height")))}disconnectedCallback(){var t,i,s;document.documentElement.removeEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?null!=this.popoverRef&&(this.popoverRef.removeEventListener("click",this.stopPropagationCallback.bind(this)),this.popoverRef.removeEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this)),this.popoverRef.removeEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))):(null===(t=this.embedWidthRef)||void 0===t||t.removeEventListener("change",this.updateDimensions.bind(this)),null===(i=this.embedHeightRef)||void 0===i||i.removeEventListener("change",this.updateDimensions.bind(this)),null===(s=this.dialogContentRef)||void 0===s||s.removeEventListener("click",this.stopPropagationCallback.bind(this)))}setupAutoCloseListeners(){var t,i,s;document.documentElement.addEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?(null===(t=this.popoverRef)||void 0===t||t.addEventListener("click",this.stopPropagationCallback.bind(this)),null===(i=this.popoverRef)||void 0===i||i.addEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this))):null===(s=this.dialogContentRef)||void 0===s||s.addEventListener("click",this.stopPropagationCallback.bind(this))}handlePopoverRefKeyDown(t){var i,s;if("Tab"===t.code){if(!this.shareListRef)return;const s=t.target,e=this.shareListRef.children[0],n=this.shareListRef.children[(null===(i=this.shareListRef)||void 0===i?void 0:i.children.length)-1];t.shiftKey&&s===e?(t.preventDefault(),n.focus()):t.shiftKey||s!==n||(t.preventDefault(),e.focus())}else"Escape"===t.code&&(this.closePopover(),null===(s=this.popoverButtonRef)||void 0===s||s.setFocus())}autoCloseCallback(){"popover"===this.mode?(this.opened=!1,this.popoverRef.open=this.opened):(this.copyLinkPopoverRef&&(this.copyLinkPopoverRef.open=!1),this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef&&(this.copyEmbedPopoverRef.open=!1),this.inlineCopyEmbedOpened=!1)}stopPropagationCallback(t){t.stopPropagation()}resetPopoverCopyState(){var t;null===(t=this.popoverButtonRef)||void 0===t||t.setFocus(),setTimeout((()=>{this.copied=!1}),200)}updateDimensions(t){var i,s;if("width"===t){const t=null===(i=this.embedWidthRef)||void 0===i?void 0:i.value;this.embedWidth=parseInt(t)}else{const t=null===(s=this.embedHeightRef)||void 0===s?void 0:s.value;this.embedHeight=parseInt(t)}}render(){var t,i,n,a,o,l;const r=this.copied&&"popover"===this.mode?this.renderSuccess():s("div",{class:dt.dialogContent},this.renderOptions(),this.displayTipText?this.renderTip():null,this.embed?this.renderEmbed():null),h=s("div",{ref:t=>this.dialogContentRef=t,class:`${dt.dialog}${"vertical"===this.shareIconsLayout?` ${dt.layout.vertical}`:` ${dt.layout.horizontal}`}`},r);return s(e,null,"popover"===this.mode?[s("calcite-popover",{ref:t=>this.popoverRef=t,label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,referenceElement:"shareButton",placement:"bottom-start",scale:this.scale},h),this.renderButton()]:[h,s("calcite-popover",{ref:t=>this.copyLinkPopoverRef=t,label:null===(a=null===(n=this.messages)||void 0===n?void 0:n.share)||void 0===a?void 0:a.label,referenceElement:"copyToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderSuccess()),s("calcite-popover",{ref:t=>this.copyEmbedPopoverRef=t,label:null===(l=null===(o=this.messages)||void 0===o?void 0:o.share)||void 0===l?void 0:l.label,referenceElement:"copyEmbedToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderEmbedSuccess())])}renderButton(){var t,i,e,n,a,o,l,r;const h=null!=this.shareButtonScale?this.shareButtonScale:this.scale;return"button"===this.shareButtonType?s("calcite-button",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:dt.popoverButton,kind:this.shareButtonColor,appearance:"transparent",label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,title:null===(n=null===(e=this.messages)||void 0===e?void 0:e.share)||void 0===n?void 0:n.label,scale:h},s("div",{class:dt.iconContainer},s("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale}))):s("calcite-action",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:dt.popoverButton,appearance:"transparent",label:null===(o=null===(a=this.messages)||void 0===a?void 0:a.share)||void 0===o?void 0:o.label,title:null===(r=null===(l=this.messages)||void 0===l?void 0:l.share)||void 0===r?void 0:r.label,scale:h,text:"",alignment:"center"},s("div",{class:dt.iconContainer},s("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale})))}renderSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return s("div",{class:dt.success.container},s("span",{class:dt.success.header},s("span",{class:dt.success.icon},s("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),s("span",{class:dt.success.message},this.successMessage||(null==i?void 0:i.url)))}renderEmbedSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return s("div",{class:dt.success.container},s("span",{class:dt.success.header},s("span",{class:dt.success.icon},s("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),s("span",{class:dt.success.message},null==i?void 0:i.embed))}renderOptions(){var t,i,e,n;const a=null===(t=this.messages)||void 0===t?void 0:t.options,o="rtl"===document.dir?` ${dt.rtl.optionText}`:"";return s("ul",{ref:t=>this.shareListRef=t,class:dt.options,role:"menu"},s("li",{id:"copyToClipboard",onClick:this.handleShareItem.bind(this,"link"),onKeyDown:this.handleOptionKeyDown("link"),role:"menuitem",tabindex:"0"},s("span",{class:dt.icon},s("calcite-icon",{icon:"link",scale:this.scale})),s("span",{class:`${dt.optionText}${o}`},null===(i=null==a?void 0:a.link)||void 0===i?void 0:i.label)),this.socialMedia?[s("li",{onClick:this.handleShareItem.bind(this,"facebook"),onKeyDown:this.handleOptionKeyDown("facebook"),role:"menuitem",tabindex:"0"},s("span",{class:dt.icon},this.renderFacebookIcon()),s("span",{class:`${dt.optionText}${o}`},null===(e=null==a?void 0:a.facebook)||void 0===e?void 0:e.label)),s("li",{onClick:this.handleShareItem.bind(this,"x"),onKeyDown:this.handleOptionKeyDown("x"),role:"menuitem",tabindex:"0"},s("span",{class:dt.icon},this.renderXIcon()),s("span",{class:`${dt.optionText}${o}`},"X")),s("li",{onClick:this.handleShareItem.bind(this,"linkedIn"),onKeyDown:this.handleOptionKeyDown("linkedIn"),role:"menuitem",tabindex:"0"},s("span",{class:dt.icon},this.renderLinkedInIcon()),s("span",{class:`${dt.optionText}${o}`},null===(n=null==a?void 0:a.linkedIn)||void 0===n?void 0:n.label))]:null)}handleOptionKeyDown(t){return i=>{const s=i.code;("Space"===s||"Enter"===s)&&this.handleShareItem(t)}}renderFacebookIcon(){return s("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},s("g",null,s("path",{d:"M512,256c0,-141.385 -114.615,-256 -256,-256c-141.385,0 -256,114.615 -256,256c0,127.777 93.616,233.685 216,252.89l0,-178.89l-65,0l0,-74l65,0l0,-56.4c0,-64.16 38.219,-99.6 96.695,-99.6c28.009,0 57.305,5 57.305,5l0,63l-32.281,0c-31.801,0 -41.719,19.733 -41.719,39.978l0,48.022l71,0l-11.35,74l-59.65,0l0,178.89c122.385,-19.205 216,-125.113 216,-252.89Z",style:{fill:"#1877f2",fillRule:"nonzero"}}),s("path",{d:"M355.65,330l11.35,-74l-71,0l0,-48.022c0,-20.245 9.917,-39.978 41.719,-39.978l32.281,0l0,-63c0,0 -29.297,-5 -57.305,-5c-58.476,0 -96.695,35.44 -96.695,99.6l0,56.4l-65,0l0,74l65,0l0,178.89c13.033,2.045 26.392,3.11 40,3.11c13.608,0 26.966,-1.065 40,-3.11l0,-178.89l59.65,0Z",style:{fill:"#fff",fillRule:"nonzero"}})))}renderXIcon(){const t=!!this.el.closest(".calcite-mode-dark");return s("svg",{class:t?dt.xLogo.dark:dt.xLogo.light,width:"1200",height:"1227",viewBox:"0 0 1200 1227",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s("rect",{height:"400",style:{fill:"none"},width:"400",x:"56",y:"56"}),s("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",fill:t?"white":"black"}))}renderLinkedInIcon(){return s("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},s("g",{id:"g5891"},s("path",{d:"M512,64c0,-35.323 -28.677,-64 -64,-64l-384,0c-35.323,0 -64,28.677 -64,64l0,384c0,35.323 28.677,64 64,64l384,0c35.323,0 64,-28.677 64,-64l0,-384Z",id:"background",style:{fill:"#2867b2"}}),s("g",{id:"shapes"},s("rect",{height:"257.962",id:"rect11",style:{fill:"#fff"},width:"85.76",x:"61.053",y:"178.667"}),s("path",{d:"M104.512,54.28c-29.341,0 -48.512,19.29 -48.512,44.573c0,24.752 18.588,44.574 47.377,44.574l0.554,0c29.903,0 48.516,-19.822 48.516,-44.574c-0.555,-25.283 -18.611,-44.573 -47.935,-44.573Z",id:"path13-0",style:{fill:"#fff",fillRule:"nonzero"}}),s("path",{d:"M357.278,172.601c-45.49,0 -65.866,25.017 -77.276,42.589l0,-36.523l-85.738,0c1.137,24.197 0,257.961 0,257.961l85.737,0l0,-144.064c0,-7.711 0.554,-15.42 2.827,-20.931c6.188,-15.4 20.305,-31.352 43.993,-31.352c31.012,0 43.436,23.664 43.436,58.327l0,138.02l85.741,0l0,-147.93c0,-79.237 -42.305,-116.097 -98.72,-116.097Z",id:"path15",style:{fill:"#fff",fillRule:"nonzero"}}))))}renderTip(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.info;return s("div",{class:dt.tipContainer},s("span",{class:dt.tipHeader},s("calcite-icon",{icon:"lightbulb",scale:this.scale}),s("span",null,null==i?void 0:i.label)),s("p",{class:dt.tipContent},null==i?void 0:i.tooltip))}renderEmbed(){var t,i,e;const n=null===(t=this.messages)||void 0===t?void 0:t.embed,a="rtl"===document.dir?` ${dt.rtl.textArea}`:"";return s("div",{class:dt.embed.container},s("span",{class:dt.embed.header},s("calcite-icon",{icon:"code",scale:this.scale}),s("span",null,null===(e=null===(i=this.messages)||void 0===i?void 0:i.embed)||void 0===e?void 0:e.label)),s("div",{class:dt.embed.embedCode.container},s("div",{class:dt.embed.embedCode.textArea},s("textarea",{ref:t=>this.embedCodeRef=t,cols:30,rows:5,readonly:!0,class:a,value:this.getEmbedCode()}),s("button",{id:"copyEmbedToClipboard",onClick:this.copyEmbedCode.bind(this),class:dt.embed.embedCode.copyButton},s("calcite-icon",{icon:"copy",scale:this.scale}),s("span",null,null==n?void 0:n.copy))),s("span",{class:dt.embed.textAreaText},s("slot",{name:"text-area-text"})),s("div",{class:dt.embed.dimensions.container},s("label",{class:dt.embed.dimensions.input},s("span",null,null==n?void 0:n.width),s("input",{ref:t=>this.embedWidthRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("width"),value:this.embedWidth,min:"1"})),s("label",{class:dt.embed.dimensions.input},s("span",null,null==n?void 0:n.height),s("input",{ref:t=>this.embedHeightRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("height"),value:this.embedHeight,min:"1"})))))}handleNumberInputOnChange(t){const i="width"===t?this.embedWidthRef:this.embedHeightRef,s="width"===t?"embedWidth":"embedHeight";return()=>{i&&parseFloat(i.value)<=0&&(this[s]=parseInt("1"),i.value="1")}}togglePopover(t){t.stopPropagation(),this.opened=!this.opened,this.popoverRef.open=this.opened}closePopover(){this.opened=!1,this.popoverRef.open=this.opened}async handleShareItem(t){var i,s,e,n;this.shareUrl=await this.generateShareUrl();let a=null;const o=null!==(s=null===(i=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===i?void 0:i.includes("Chrome"))&&void 0!==s&&s,l=null!==(n=null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===e?void 0:e.includes("Safari"))&&void 0!==n&&n&&!o;!l&&this.shortenShareUrl&&(a=await this.shortenUrl(this.shareUrl));let r=a||this.shareUrl;switch(t){case"link":return navigator.clipboard.writeText(r),this.embed&&(this.copyEmbedPopoverRef.open=!1,this.inlineCopyEmbedOpened=!1),"inline"===this.mode&&(this.copyLinkPopoverRef.open=!0,setTimeout((()=>this.copyLinkPopoverRef.open=!1),3e3)),this.inlineCopyLinkOpened=!0,this.copied=!0,void("popover"===this.mode&&setTimeout((()=>this.closePopover()),2e3));case"facebook":case"x":case"linkedIn":let i;l&&(i=window.open("","_blank"),this.shortenShareUrl&&(r=await this.shortenUrl(this.shareUrl)||r));const s={url:encodeURI(r)},e="x"===t?Object.assign(Object.assign({},s),{text:this.shareText}):s,[n]=await q(["esri/intl"]),a=n.substitute(pt[t],e);return"popover"===this.mode&&this.closePopover(),void(l&&i?(i.location=a,i.focus()):window.open(encodeURI(a),"_blank"))}}async shortenUrl(t){var i,s;const[e]=await q(["esri/request"]),n=await e("https://arcg.is/prod/shorten",{query:{longUrl:t,f:"json"}}),a=null===(s=null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data)||void 0===s?void 0:s.url;if(a)return a.replace("http://","https://")}getEmbedCode(){return`<iframe src="${this.shareUrl}" width="${this.embedWidth}" height="${this.embedHeight}" frameborder="0" style="border:0" allowfullscreen>${this.iframeInnerText}</iframe>`}copyEmbedCode(){navigator.clipboard.writeText(this.getEmbedCode()),this.copyLinkPopoverRef.open=!1,this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef.open=!0,setTimeout((()=>this.copyEmbedPopoverRef.open=!1),3e3),this.inlineCopyEmbedOpened=!0}async generateShareUrl(){var t;if(this.autoUpdateShareUrl&&(this.shareUrl=window.location.href),!this.view||!(null===(t=this.view)||void 0===t?void 0:t.ready))return this.shareUrl;const{x:i,y:s}=this.view.center,{spatialReference:e}=this.view,[n,a]=await q(["esri/geometry/Point","esri/geometry/SpatialReference"]),o=new n({x:i,y:s,spatialReference:new a(Object.assign({},e.toJSON()))}),l=await this.processPoint(o),{isWGS84:r,isWebMercator:h}=l.spatialReference;return this.generateShareUrlParams(l,r||h)}async processPoint(t){const{isWGS84:i,isWebMercator:s}=t.spatialReference;if(i||s)return t;const[e,n]=await q(["esri/geometry/SpatialReference","esri/geometry/projection"]),a=new e({wkid:4326});try{await n.load();const i=n.project(t,a);return Promise.resolve(i)}catch(t){return console.error("Failed to project point",t),Promise.reject(null)}}generateShareUrlParams(t,i){var s,e,n,a;const{longitude:o,latitude:l,x:r,y:h}=t;if(void 0===o||void 0===l)return this.shareUrl;const c=this.roundValue(i?o:r),d=this.roundValue(i?l:h),{zoom:p}=this.view,u=this.roundValue(p),v=null===(e=null===(s=this.view)||void 0===s?void 0:s.popup)||void 0===e?void 0:e.selectedFeature,m=null===(a=null===(n=this.view)||void 0===n?void 0:n.popup)||void 0===a?void 0:a.visible;let f,g;if(v&&m){const t=null==v?void 0:v.layer;f=t.id,g=v.attributes[t.objectIdField]}const b=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";"),{type:_}=this.view,{defaultUrlParams:x}=this,w=new URL(this.shareUrl),{searchParams:y}=w;if(y.get("center")&&y.delete("center"),y.get("level")&&y.delete("level"),y.get("selectedFeature")&&y.delete("selectedFeature"),y.get("hiddenLayers")&&y.delete("hiddenLayers"),y.get("viewpoint")&&y.delete("viewpoint"),"3d"===_){const{camera:t}=this.view,{heading:i,position:s,tilt:e}=t,{longitude:n,latitude:a,z:o}=s,l={longitude:this.roundValue(n,8),latitude:this.roundValue(a,8),z:this.roundValue(o,3),heading:this.roundValue(i,3),tilt:this.roundValue(e,3)};return!1!==(null==x?void 0:x.viewpoint)&&w.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),f&&g&&!1!==(null==x?void 0:x.selectedFeature)&&w.searchParams.set("selectedFeature",`${f};${g}`),b&&!1!==(null==x?void 0:x.hiddenLayers)&&w.searchParams.set("hiddenLayers",b),w.search=decodeURIComponent(w.search),w.href}return!1!==(null==x?void 0:x.center)&&w.searchParams.set("center",`${c};${d}`),!1!==(null==x?void 0:x.level)&&w.searchParams.set("level",`${u}`),f&&g&&!1!==(null==x?void 0:x.selectedFeature)&&w.searchParams.set("selectedFeature",`${f};${g}`),b&&!1!==(null==x?void 0:x.hiddenLayers)&&w.searchParams.set("hiddenLayers",b),w.search=decodeURIComponent(w.search),w.href}roundValue(t,i=4){return parseFloat(t.toFixed(i))}get el(){return n(this)}};ut.style=":host{display:block;--instant-apps-social-share-action-width:initial;--instant-apps-social-share-width--s:200px;--instant-apps-social-share-width--m:280px;--instant-apps-social-share-width--l:320px;--instant-apps-social-share-width-horizontal--s:300px;--instant-apps-social-share-width-horizontal--m:380px;--instant-apps-social-share-width-horizontal--l:420px;--instant-apps-social-share-background-color:var(--calcite-color-foreground-1);--instant-apps-social-share-popover-button-background-color:transparent;--instant-apps-social-share-popover-button-icon-color:var(--calcite-ui-icon-color);--instant-apps-social-share-embed-border:1px solid $border;--instant-apps-social-share-embed-text-area-text:#468540}:host .instant-apps-social-share__popover-button{background-color:var(--instant-apps-social-share-popover-button-background-color)}:host .instant-apps-social-share__popover-button calcite-icon{color:var(--instant-apps-social-share-popover-button-icon-color)}:host .instant-apps-social-share__dialog,:host .instant-apps-social-share__dialog-embed{background-color:var(--instant-apps-social-share-background-color);border:var(--instant-apps-social-share-embed-border)}:host .instant-apps-social-share__dialog{box-sizing:border-box;height:auto;padding:10px 0;border-radius:5px}:host .instant-apps-social-share__options{margin:0;padding:1% 0 0 0;list-style-type:none}:host .instant-apps-social-share__options li{box-sizing:border-box;display:flex;align-items:center;width:100%;padding:5%;transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__options li .instant-apps-social-share__icon,:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{display:inline-block}:host .instant-apps-social-share__options li .instant-apps-social-share__icon{display:flex;align-items:center}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{width:85%;margin-left:10px;word-break:break-word}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text--rtl{margin-left:0;margin-right:10px}:host .instant-apps-social-share__options li:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}:host .instant-apps-social-share__options__x-logo--light path{fill:#000000}:host .instant-apps-social-share__options__x-logo--dark path{fill:#ffffff}:host .instant-apps-social-share__tip{box-sizing:border-box;padding:0 5% 1% 5%}:host .instant-apps-social-share__tip-header{display:flex;align-items:center;color:#007ac2;margin:8px 0 5px 0}:host .instant-apps-social-share__tip-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__tip-content{line-height:17px;margin:0;padding-top:2%}:host .instant-apps-social-share__success{display:flex;flex-direction:column;padding:15px}:host .instant-apps-social-share__success-header{display:flex;align-items:center;font-weight:bold;margin-bottom:10px}:host .instant-apps-social-share__success-icon{display:flex;align-items:center;margin-right:5px}:host .instant-apps-social-share__success-icon calcite-icon{color:var(--calcite-color-status-success)}:host .instant-apps-social-share__success-message{line-height:16px}:host .instant-apps-social-share__embed{box-sizing:border-box;width:100%;padding:5%;margin-bottom:10px;border-top:1px solid #d3d3d3}:host .instant-apps-social-share__embed-header{display:flex;align-items:center;margin-bottom:5px}:host .instant-apps-social-share__embed-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__embed-code-text-area{border:1px solid #d3d3d3}:host .instant-apps-social-share__embed-code-text-area textarea{box-sizing:border-box;padding:4%;border:none;resize:none;background:transparent;width:100%;font-family:var(--calcite-sans-family);color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button{display:flex;align-items:center;text-align:start;width:100%;border:none;border-top:1px solid #d3d3d3;background-color:transparent;line-height:16px;font-weight:400;padding:3%;color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button calcite-icon{color:#007ac2;margin-right:3px}:host .instant-apps-social-share__embed-code-text-area button:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2);transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__embed-text-area-text{font-weight:600;color:var(--instant-apps-social-share-embed-text-area-text)}:host .instant-apps-social-share__embed .instant-apps-social-share__text-area--rtl{text-align:left;direction:ltr}:host .instant-apps-social-share__embed-dimensions{display:flex;justify-content:space-between;margin-top:10px}:host .instant-apps-social-share__embed-dimensions-input{width:47%;box-sizing:border-box}:host .instant-apps-social-share__embed-dimensions-input input{border:1px solid #d3d3d3;width:100%;height:25px;font-family:var(--calcite-sans-family)}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options{display:flex;justify-content:space-around;margin-bottom:8%}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li{flex-direction:column;padding:0}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li .instant-apps-social-share__option-text{word-break:break-word;margin-left:0;margin-top:10px;text-align:center}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li:hover{background-color:unset}:host .instant-apps-social-share__icon-container{display:flex;align-items:center}:host calcite-action{width:var(--instant-apps-social-share-action-width)}:host([scale=s]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--s)}:host([scale=s]) .instant-apps-social-share__icon{width:16px;height:16px}:host([scale=s]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size--1)}:host([scale=s]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--s)}:host([scale=s]) .instant-apps-social-share__tip-header,:host([scale=s]) .instant-apps-social-share__tip-content,:host([scale=s]) .instant-apps-social-share__embed-header,:host([scale=s]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--2)}:host([scale=m]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--m)}:host([scale=m]) .instant-apps-social-share__icon{width:24px;height:24px}:host([scale=m]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-0)}:host([scale=m]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--m)}:host([scale=m]) .instant-apps-social-share__tip-header,:host([scale=m]) .instant-apps-social-share__tip-content,:host([scale=m]) .instant-apps-social-share__embed-header,:host([scale=m]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--1)}:host([scale=l]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--l)}:host([scale=l]) .instant-apps-social-share__icon{width:32px;height:32px}:host([scale=l]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-1)}:host([scale=l]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--l)}:host([scale=l]) .instant-apps-social-share__tip-header,:host([scale=l]) .instant-apps-social-share__tip-content,:host([scale=l]) .instant-apps-social-share__embed-header,:host([scale=l]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size-0)}";export{it as calcite_input_date_picker,ht as instant_apps_filter_list,ut as instant_apps_social_share}
@@ -1,17 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,h as e,H as s,g as a}from"./p-7d280d8a.js";import{c as n,d as o}from"./p-de9522e9.js";import{f as r,g as c,t as l}from"./p-3dd92f0d.js";import{c as h,d,u as g,I as p}from"./p-6d520a58.js";import{c as m,d as u,n as v,a as f}from"./p-13f2d901.js";import{u as b,c as x,d as y,s as k}from"./p-05cb50f9.js";import{H as D}from"./p-76bd5032.js";import{c as w,s as z,a as C}from"./p-a4149333.js";import{o as j}from"./p-2b0454a0.js";import{g as A,c as L,e as B,f as M,s as P}from"./p-94de9279.js";import{g as S,a as H}from"./p-bfdf89c2.js";import"./p-1f65ab1e.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-ba7d55ea.js";import"./p-e7afc0a8.js";
7
- /*!
8
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
10
- * v2.4.0
11
- */const I="content",O="toggle",W="header",E="icon",F="icon",q="control",R="header-menu-actions",T={opened:"chevron-up",closed:"chevron-down",valid:"check-circle",invalid:"exclamation-mark-triangle"},_=class{constructor(e){t(this,e),this.calciteBlockBeforeClose=i(this,"calciteBlockBeforeClose",6),this.calciteBlockBeforeOpen=i(this,"calciteBlockBeforeOpen",6),this.calciteBlockClose=i(this,"calciteBlockClose",6),this.calciteBlockOpen=i(this,"calciteBlockOpen",6),this.calciteBlockToggle=i(this,"calciteBlockToggle",6),this.openTransitionProp="opacity",this.onHeaderClick=()=>{this.open=!this.open,this.calciteBlockToggle.emit()},this.setTransitionEl=t=>{this.transitionEl=t},this.collapsible=!1,this.disabled=!1,this.dragHandle=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.open=!1,this.status=void 0,this.description=void 0,this.messages=void 0,this.messageOverrides=void 0,this.overlayPositioning="absolute",this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){j(this)}onMessagesChange(){}async setFocus(){await w(this),r(this.el)}onBeforeOpen(){this.calciteBlockBeforeOpen.emit()}onOpen(){this.calciteBlockOpen.emit()}onBeforeClose(){this.calciteBlockBeforeClose.emit()}onClose(){this.calciteBlockClose.emit()}effectiveLocaleChange(){b(this,this.effectiveLocale)}connectedCallback(){n(this),h(this),m(this),x(this)}disconnectedCallback(){d(this),u(this),y(this),o(this)}async componentWillLoad(){await k(this),z(this),this.open&&j(this)}componentDidLoad(){C(this)}componentDidRender(){g(this)}renderScrim(){const{loading:t}=this,i=e("slot",null);return[t?e("calcite-scrim",{loading:t}):null,i]}renderIcon(){const{loading:t,messages:i,status:s}=this,a=!!c(this.el,F);return t?e("div",{class:E,key:"loader"},e("calcite-loader",{inline:!0,label:i.loading})):s?e("div",{class:E,key:"status-icon"},e("calcite-icon",{class:{"status-icon":!0,valid:"valid"==s,invalid:"invalid"==s},icon:T[s],scale:"s"})):a?e("div",{class:E,key:"icon-slot"},e("slot",{key:"icon-slot",name:F})):null}renderTitle(){const{heading:t,headingLevel:i,description:s}=this;return t||s?e("div",{class:"title"},e(D,{class:"heading",level:i},t),s?e("div",{class:"description"},s):null):null}render(){const{collapsible:t,el:i,loading:a,open:n,heading:o,messages:r}=this,h=n?r.collapse:r.expand,d=e("header",{class:"header",id:W},this.renderIcon(),this.renderTitle()),g=!!c(i,q),m=!!c(i,R),u=n?T.opened:T.closed,v=e("div",{class:"header-container"},this.dragHandle?e("calcite-handle",{label:o}):null,t?e("button",{"aria-controls":I,"aria-describedby":W,"aria-expanded":t?l(n):null,class:"toggle",id:O,onClick:this.onHeaderClick,title:h},d,e("calcite-icon",{"aria-hidden":"true",class:"toggle-icon",icon:u,scale:"s"})):d,g?e("div",{class:"control-container"},e("slot",{name:q})):null,m?e("calcite-action-menu",{label:r.options,overlayPositioning:this.overlayPositioning},e("slot",{name:R})):null);return e(s,null,e(p,{disabled:this.disabled},e("article",{"aria-busy":l(a),class:{container:!0}},v,e("section",{"aria-labelledby":O,class:"content",hidden:!n,id:I,ref:this.setTransitionEl},this.renderScrim()))))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};_.style=':host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-shrink:0;flex-grow:0;flex-direction:column;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);padding:0px;transition-property:margin;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-timing-function:cubic-bezier(0.215, 0.440, 0.420, 0.880);flex-basis:auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-color-text-2);color:var(--calcite-color-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.header{justify-content:flex-start;padding:0px}.header,.toggle{grid-area:header}.header-container{display:grid;align-items:stretch;grid-template:auto/auto 1fr auto auto;grid-template-areas:"handle header control menu";grid-column:header-start/menu-end;grid-row:1/2}.toggle{margin:0px;display:flex;cursor:pointer;flex-wrap:nowrap;align-items:center;justify-content:space-between;border-style:none;padding:0px;font-family:inherit;outline-color:transparent;text-align:initial;background-color:transparent}.toggle:hover{background-color:var(--calcite-color-foreground-2)}.toggle:focus{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}calcite-loader[inline]{grid-area:control;align-self:center}calcite-handle{grid-area:handle}.title{margin:0px;padding:0.75rem}.header .title .heading{padding:0px;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);line-height:1.25;color:var(--calcite-color-text-2);transition-property:color;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);word-wrap:break-word;word-break:break-word}.description{margin-block-start:0.125rem;padding:0px;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text-3);word-wrap:break-word;word-break:break-word}.icon{display:flex;margin-inline-start:0.75rem;margin-inline-end:0px}.status-icon.valid{color:var(--calcite-color-status-success)}.status-icon.invalid{color:var(--calcite-color-status-danger)}@keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}.toggle-icon{margin-block:0.75rem;align-self:center;justify-self:end;color:var(--calcite-color-text-3);transition-property:color;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);margin-inline-end:0.75rem;margin-inline-start:auto}.toggle:hover .toggle-icon{color:var(--calcite-color-text-1)}.container{position:relative;display:flex;block-size:100%;flex-direction:column}.content{position:relative;min-block-size:0px;flex:1 1 0%}@keyframes in{0%{opacity:0}100%{opacity:1}}.content{animation:in var(--calcite-internal-animation-timing-slow) ease-in-out;padding-block:var(--calcite-block-padding, 0.5rem);padding-inline:var(--calcite-block-padding, 0.625rem)}.control-container{margin:0px;display:flex;grid-area:control}calcite-action-menu{grid-area:menu}:host([open]){margin-block:0.5rem}:host([open]) .header .title .heading{color:var(--calcite-color-text-1)}:host([hidden]){display:none}[hidden]{display:none}';
12
- /*!
13
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
15
- * v2.4.0
16
- */
17
- const G={dateStyle:"full"},K=class{constructor(e){t(this,e),this.calciteDatePickerChange=i(this,"calciteDatePickerChange",6),this.calciteDatePickerRangeChange=i(this,"calciteDatePickerRangeChange",6),this.keyDownHandler=t=>{"Escape"===t.key&&this.resetActiveDates()},this.monthHeaderSelectChange=t=>{const i=new Date(t.detail);this.range?("end"===this.activeRange?this.activeEndDate=i:this.activeStartDate=i,this.mostRecentRangeValue=i):this.activeDate=i},this.monthActiveDateChange=t=>{const i=new Date(t.detail);this.range?("end"===this.activeRange?this.activeEndDate=i:this.activeStartDate=i,this.mostRecentRangeValue=i):this.activeDate=i},this.monthHoverChange=t=>{if(!this.range)return void(this.hoverRange=void 0);const{valueAsDate:i}=this,e=Array.isArray(i)&&i[0],s=Array.isArray(i)&&i[1],a=new Date(t.detail);if(this.hoverRange={focused:this.activeRange||"start",start:e,end:s},this.proximitySelectionDisabled)s?this.hoverRange=void 0:a<e?this.hoverRange={focused:"start",start:a,end:e}:(this.hoverRange.end=a,this.hoverRange.focused="end");else if(e&&s){const t=A(a,e),i=A(a,s);i>0?(this.hoverRange.end=a,this.hoverRange.focused="end"):t<0||t>i?(this.hoverRange.start=a,this.hoverRange.focused="start"):(this.hoverRange.end=a,this.hoverRange.focused="end")}else e&&(a<e?this.hoverRange={focused:"start",start:a,end:e}:(this.hoverRange.end=a,this.hoverRange.focused="end"));t.stopPropagation()},this.monthMouseOutChange=()=>{this.hoverRange&&(this.hoverRange=void 0)},this.resetActiveDates=()=>{const{valueAsDate:t}=this;!Array.isArray(t)&&t&&t!==this.activeDate&&(this.activeDate=new Date(t)),Array.isArray(t)&&(t[0]&&t[0]!==this.activeStartDate&&(this.activeStartDate=new Date(t[0])),t[1]&&t[1]!==this.activeEndDate&&(this.activeEndDate=new Date(t[1])))},this.monthDateChange=t=>{const i=new Date(t.detail),e=L(i);if(!this.range&&e===L(this.valueAsDate))return;if(!this.range)return this.value=e||"",this.valueAsDate=i||null,this.activeDate=i||null,void this.calciteDatePickerChange.emit();const s=this.getStartDate(),a=this.getEndDate();if(!s||!a&&i<s)s&&this.setEndDate(new Date(s)),"end"==this.activeRange?this.setEndDate(i):this.setStartDate(i);else if(a)if(this.proximitySelectionDisabled)this.setStartDate(i);else if(this.activeRange)"end"==this.activeRange?this.setEndDate(i):this.setStartDate(i);else{const t=A(i,s),e=A(i,a);0===e||t<0?this.setStartDate(i):0===t||e<0?this.setEndDate(i):t<e?this.setStartDate(i):this.setEndDate(i)}else this.setEndDate(i);this.calciteDatePickerChange.emit()},this.activeDate=void 0,this.activeRange=void 0,this.value=void 0,this.headingLevel=void 0,this.valueAsDate=void 0,this.minAsDate=void 0,this.maxAsDate=void 0,this.min=void 0,this.max=void 0,this.numberingSystem=void 0,this.scale="m",this.range=!1,this.proximitySelectionDisabled=!1,this.messageOverrides=void 0,this.messages=void 0,this.activeEndDate=void 0,this.activeStartDate=void 0,this.dateTimeFormat=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.endAsDate=void 0,this.hoverRange=void 0,this.localeData=void 0,this.mostRecentRangeValue=void 0,this.startAsDate=void 0}activeDateWatcher(t){"end"===this.activeRange&&(this.activeEndDate=t)}valueAsDateWatcher(t){if(this.range&&Array.isArray(t)){const{activeStartDate:i,activeEndDate:e}=this,s=t[0],a=t[1];this.activeStartDate=i!==s&&s,this.activeEndDate=e!==a&&a}else t&&t!==this.activeDate&&(this.activeDate=t)}onMinChanged(t){t&&(this.minAsDate=B(t))}onMaxChanged(t){t&&(this.maxAsDate=B(t))}onMessagesChange(){}async setFocus(){await w(this),this.el.focus()}async reset(){this.resetActiveDates(),this.mostRecentRangeValue=void 0}connectedCallback(){m(this),x(this),Array.isArray(this.value)?this.valueAsDate=S(this.value):this.value&&(this.valueAsDate=B(this.value)),this.min&&(this.minAsDate=B(this.min)),this.max&&(this.maxAsDate=B(this.max))}disconnectedCallback(){u(this),y(this)}async componentWillLoad(){z(this),await this.loadLocaleData(),this.onMinChanged(this.min),this.onMaxChanged(this.max),await k(this)}componentDidLoad(){C(this)}render(){var t;const i=M(this.range&&Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate);let a=this.getActiveDate(i,this.minAsDate,this.maxAsDate);const n=this.range&&Array.isArray(this.valueAsDate)?M(this.valueAsDate[1],this.minAsDate,this.maxAsDate):null,o=this.getActiveEndDate(n,this.minAsDate,this.maxAsDate);return"end"!==this.activeRange&&("end"!==(null===(t=this.hoverRange)||void 0===t?void 0:t.focused)||this.proximitySelectionDisabled&&!n)||!o||(a=o),this.range&&this.mostRecentRangeValue&&(a=this.mostRecentRangeValue),e(s,{onBlur:this.resetActiveDates,onKeyDown:this.keyDownHandler},this.renderCalendar(a,this.range&&this.activeRange&&"start"===this.activeRange&&n||this.maxAsDate,this.range&&this.activeRange?"start"===this.activeRange?this.minAsDate:i||this.minAsDate:this.minAsDate,i,n))}effectiveLocaleChange(){b(this,this.effectiveLocale)}valueHandler(t){Array.isArray(t)?this.valueAsDate=S(t):t&&(this.valueAsDate=B(t))}async loadLocaleData(){v.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.localeData=await H(this.effectiveLocale),this.dateTimeFormat=f(this.effectiveLocale,G)}renderCalendar(t,i,s,a,n){return this.localeData&&[e("calcite-date-picker-month-header",{activeDate:t,headingLevel:this.headingLevel||2,localeData:this.localeData,max:i,messages:this.messages,min:s,onCalciteInternalDatePickerSelect:this.monthHeaderSelectChange,scale:this.scale,selectedDate:"end"===this.activeRange?n:a||new Date}),e("calcite-date-picker-month",{activeDate:t,dateTimeFormat:this.dateTimeFormat,endDate:this.range?n:void 0,hoverRange:this.hoverRange,localeData:this.localeData,max:i,min:s,onCalciteInternalDatePickerActiveDateChange:this.monthActiveDateChange,onCalciteInternalDatePickerHover:this.monthHoverChange,onCalciteInternalDatePickerMouseOut:this.monthMouseOutChange,onCalciteInternalDatePickerSelect:this.monthDateChange,scale:this.scale,selectedDate:"end"===this.activeRange?n:a,startDate:this.range?a:void 0})]}getEndDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0}setEndDate(t){const i=this.getStartDate(),e=t?P(t):t;this.value=[L(i),L(t)],this.valueAsDate=[i,t],this.mostRecentRangeValue=e,this.calciteDatePickerRangeChange.emit(),this.activeEndDate=t||null}getStartDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[0]}setStartDate(t){const i=this.getEndDate();this.value=[L(t),L(i)],this.valueAsDate=[t,i],this.mostRecentRangeValue=t,this.calciteDatePickerRangeChange.emit(),this.activeStartDate=t||null}getActiveDate(t,i,e){return M(this.activeDate,i,e)||t||M(new Date,i,e)}getActiveEndDate(t,i,e){return M(this.activeEndDate,i,e)||t||M(new Date,i,e)}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{activeDate:["activeDateWatcher"],valueAsDate:["valueAsDateWatcher"],min:["onMinChanged"],max:["onMaxChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange","loadLocaleData"],value:["valueHandler"]}}};K.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:inline-block;inline-size:auto;overflow:visible;border-radius:0px;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-1);vertical-align:top}:host([scale=s]){inline-size:234px;min-inline-size:216px;max-inline-size:380px}:host([scale=m]){inline-size:304px;min-inline-size:272px;max-inline-size:480px}:host([scale=l]){inline-size:370px;min-inline-size:320px;max-inline-size:600px}:host([hidden]){display:none}[hidden]{display:none}";export{_ as calcite_block,K as calcite_date_picker}
@@ -1,23 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{h as t,r as i,c as e,H as s,g as n}from"./p-7d280d8a.js";import{f as o}from"./p-bdea5320.js";import{z as a,A as l,i as r,t as c,d as h,e as d}from"./p-3dd92f0d.js";import{d as p,f as m,c as u,r as b,a as g,F as v}from"./p-db53bde3.js";import{s as f,c as w,a as x,d as y,H as k}from"./p-1f33a29d.js";import{g as C}from"./p-5a9a971a.js";import{c as I,u as z,d as D,I as E}from"./p-6d520a58.js";import{c as H,d as $,g as S}from"./p-9d53e0f2.js";import{b as j,c as A,s as O,a as P}from"./p-a4149333.js";import{c as L,d as _}from"./p-13f2d901.js";import{c as F}from"./p-1f65ab1e.js";import{o as M}from"./p-2b0454a0.js";import{c as B,s as T,d as R,u as W}from"./p-05cb50f9.js";import{i as V,h as G,C as q,b as N,c as U,d as K,e as X,f as Y}from"./p-b3eb3302.js";import{g as J}from"./p-495e7b9d.js";import{V as Q}from"./p-c94d2cec.js";import{d as Z}from"./p-a82f35c9.js";import{i as tt}from"./p-e7afc0a8.js";import{g as it}from"./p-be8ef276.js";import{c as et,o as st}from"./p-3af79063.js";import{s as nt}from"./p-322868ec.js";import"./p-7c2be8cc.js";import"./p-ba7d55ea.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";import"./p-18f1e8b5.js";
7
- /*!
8
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
10
- * v2.4.0
11
- */const ot="x-button";function at({disabled:i,key:e,label:s,onClick:n,ref:o,scale:a}){return t("button",{"aria-label":s,class:ot,disabled:i,key:e,onClick:n,tabIndex:-1,type:"button",ref:o},t("calcite-icon",{icon:"x",scale:J(a)}))}const lt="combobox-item-",rt="combobox-chip-",ct="combobox-label-",ht="combobox-listbox-",dt="combobox-input-",pt=class{constructor(t){i(this,t),this.calciteComboboxChange=e(this,"calciteComboboxChange",6),this.calciteComboboxFilterChange=e(this,"calciteComboboxFilterChange",6),this.calciteComboboxChipClose=e(this,"calciteComboboxChipClose",6),this.calciteComboboxBeforeClose=e(this,"calciteComboboxBeforeClose",6),this.calciteComboboxClose=e(this,"calciteComboboxClose",6),this.calciteComboboxBeforeOpen=e(this,"calciteComboboxBeforeOpen",6),this.calciteComboboxOpen=e(this,"calciteComboboxOpen",6),this.placement=p,this.internalValueChangeFlag=!1,this.textInput=null,this.mutationObserver=F("mutation",(()=>this.updateItems())),this.resizeObserver=F("resize",(()=>{this.setMaxScrollerHeight(),this.refreshSelectionDisplay()})),this.guid=C(),this.inputHeight=0,this.ignoreSelectedEventsFlag=!1,this.openTransitionProp="opacity",this.setFilteredPlacements=()=>{const{el:t,flipPlacements:i}=this;this.filteredFlipPlacements=i?m(i,t):null},this.getValue=()=>{const t=this.selectedItems.map((t=>{var i;return null===(i=null==t?void 0:t.value)||void 0===i?void 0:i.toString()}));return(null==t?void 0:t.length)?t.length>1?t:t[0]:""},this.onLabelClick=()=>{this.setFocus()},this.keyDownHandler=t=>{const{key:i}=t;switch(i){case"Tab":this.activeChipIndex=-1,this.activeItemIndex=-1,this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),t.preventDefault()):this.open?(this.open=!1,t.preventDefault()):!this.allowCustomValues&&this.text&&(this.clearInputValue(),this.filterItems(""),this.updateActiveItemIndex(-1));break;case"ArrowLeft":this.previousChip(),t.preventDefault();break;case"ArrowRight":this.nextChip(),t.preventDefault();break;case"ArrowUp":t.preventDefault(),this.open&&this.shiftActiveItemIndex(-1),this.comboboxInViewport()||this.el.scrollIntoView();break;case"ArrowDown":t.preventDefault(),this.open?this.shiftActiveItemIndex(1):(this.open=!0,this.ensureRecentSelectedItemIsActive()),this.comboboxInViewport()||this.el.scrollIntoView();break;case" ":this.textInput.value||(this.open||(this.open=!0,this.shiftActiveItemIndex(1)),t.preventDefault());break;case"Home":if(!this.open)return;t.preventDefault(),this.updateActiveItemIndex(0),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"End":if(!this.open)return;t.preventDefault(),this.updateActiveItemIndex(this.filteredItems.length-1),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"Escape":this.clearDisabled||this.open||this.clearValue(),this.open=!1,t.preventDefault();break;case"Enter":this.activeItemIndex>-1?(this.toggleSelection(this.filteredItems[this.activeItemIndex]),t.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(),t.preventDefault()):this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),t.preventDefault()):t.defaultPrevented||f(this)&&t.preventDefault();break;case"Delete":case"Backspace":if("single"===this.selectionDisplay||"fit"===this.selectionDisplay&&this.selectedHiddenChipsCount>0)return;this.activeChipIndex>-1?(t.preventDefault(),this.removeActiveChip()):!this.text&&this.isMulti()&&(t.preventDefault(),this.removeLastChip())}},this.toggleCloseEnd=()=>{this.open=!1,this.el.removeEventListener("calciteComboboxClose",this.toggleCloseEnd)},this.toggleOpenEnd=()=>{this.open=!1,this.el.removeEventListener("calciteComboboxOpen",this.toggleOpenEnd)},this.setMaxScrollerHeight=async()=>{const{listContainerEl:t,open:i,referenceEl:e}=this;if(!t||!i)return;await this.reposition(!0);const s=this.getMaxScrollerHeight();t.style.maxHeight=s>0?`${s}px`:"",t.style.minWidth=`${e.clientWidth}px`,await this.reposition(!0)},this.calciteChipCloseHandler=t=>{this.open=!1;const i=this.items.find((i=>i===t));i&&this.toggleSelection(i,!1),this.calciteComboboxChipClose.emit()},this.clickHandler=t=>{const i=t.composedPath();return i.some((t=>"CALCITE-CHIP"===t.tagName))?(this.open=!1,void t.preventDefault()):i.some((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains(ot)}))?(this.clearValue(),void t.preventDefault()):(this.open=!this.open,void this.ensureRecentSelectedItemIsActive())},this.refreshSelectionDisplay=async()=>{if(await j(this),V(this.selectionMode))return;if(!this.textInput)return;const{allSelectedIndicatorChipEl:t,chipContainerEl:i,selectionDisplay:e,placeholder:s,selectedIndicatorChipEl:n,textInput:o}=this,r=parseInt(getComputedStyle(i).gap.replace("px","")),c=a(i),{fontSize:h,fontFamily:d}=getComputedStyle(o),p=(l(s,`${h} ${d}`)||parseInt("48px"))+r,m=a(t),u=a(n),b=Math.max(m,u);if(this.setCompactSelectionDisplay({chipContainerElGap:r,chipContainerElWidth:c,inputWidth:p,largestSelectedIndicatorChipWidth:b}),"fit"===e){const t=Array.from(this.el.shadowRoot.querySelectorAll("calcite-chip")).filter((t=>t.closable)),i=Math.round(c-((this.selectedHiddenChipsCount>0?u:0)+r+p+r));this.refreshChipDisplay({availableHorizontalChipElSpace:i,chipContainerElGap:r,chipEls:t}),this.setVisibleAndHiddenChips(t)}},this.setFloatingEl=t=>{this.floatingEl=t,u(this,this.referenceEl,this.floatingEl)},this.setContainerEl=t=>{this.resizeObserver.observe(t),this.listContainerEl=t,this.transitionEl=t},this.setChipContainerEl=t=>{this.resizeObserver.observe(t),this.chipContainerEl=t},this.setReferenceEl=t=>{this.referenceEl=t,u(this,this.referenceEl,this.floatingEl)},this.setAllSelectedIndicatorChipEl=t=>{this.allSelectedIndicatorChipEl=t},this.setSelectedIndicatorChipEl=t=>{this.selectedIndicatorChipEl=t},this.inputHandler=t=>{const i=t.target.value;this.text=i,this.filterItems(i),i&&(this.activeChipIndex=-1)},this.filterItems=(()=>{const t=(t,i)=>t&&i.some((({label:i,value:e})=>t.tagName===Y?i===t.label:e===t.value&&i===t.textLabel));return Z((i=>{const e=o(this.data,i);this.getItemsAndGroups().forEach((i=>{const s=!t(i,e);i.hidden=s;const[n,o]=i.ancestors;(t(n,e)||t(o,e))&&(i.hidden=!1),s||i.ancestors.forEach((t=>t.hidden=!1))})),this.filteredItems=this.getFilteredItems(),this.calciteComboboxFilterChange.emit()}),100)})(),this.internalComboboxChangeEvent=()=>{this.calciteComboboxChange.emit()},this.emitComboboxChange=Z(this.internalComboboxChangeEvent,0),this.getSelectedItems=()=>{if(!this.isMulti()){const t=this.items.find((({selected:t})=>t));return t?[t]:[]}return this.items.filter((t=>t.selected&&("ancestors"!==this.selectionMode||!G(t)))).sort(((t,i)=>{const e=this.selectedItems.indexOf(t),s=this.selectedItems.indexOf(i);return e>-1&&s>-1?e-s:s-e}))},this.updateItems=()=>{this.items=this.getItems(),this.groupItems=this.getGroupItems(),this.data=this.getData(),this.selectedItems=this.getSelectedItems(),this.filteredItems=this.getFilteredItems(),this.needsIcon=this.getNeedsIcon(),this.items.forEach((t=>{t.selectionMode=this.selectionMode,t.scale=this.scale})),this.allowCustomValues||this.setMaxScrollerHeight(),this.groupItems.forEach(((t,i,e)=>{0===i&&(t.afterEmptyGroup=!1);const s=e[i+1];s&&(s.afterEmptyGroup=0===t.children.length)}))},this.scrollToActiveItem=()=>{const t=this.filteredItems[this.activeItemIndex];if(!t)return;const i=this.calculateSingleItemHeight(t),{offsetHeight:e,scrollTop:s}=this.listContainerEl;e+s<t.offsetTop+i?this.listContainerEl.scrollTop=t.offsetTop-e+i:t.offsetTop<s&&(this.listContainerEl.scrollTop=t.offsetTop)},this.comboboxFocusHandler=()=>{var t;this.disabled||null===(t=this.textInput)||void 0===t||t.focus()},this.clearDisabled=!1,this.selectionDisplay="all",this.open=!1,this.disabled=!1,this.form=void 0,this.label=void 0,this.placeholder=void 0,this.placeholderIcon=void 0,this.placeholderIconFlipRtl=!1,this.maxItems=0,this.validationMessage=void 0,this.validationIcon=void 0,this.name=void 0,this.allowCustomValues=void 0,this.overlayPositioning="absolute",this.required=!1,this.selectionMode="multiple",this.scale="m",this.status="idle",this.value=null,this.flipPlacements=void 0,this.messages=void 0,this.messageOverrides=void 0,this.selectedItems=[],this.filteredItems=[],this.items=[],this.groupItems=[],this.needsIcon=void 0,this.activeItemIndex=-1,this.activeChipIndex=-1,this.activeDescendant="",this.compactSelectionDisplay=!1,this.selectedHiddenChipsCount=0,this.selectedVisibleChipsCount=0,this.text="",this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){M(this),this.disabled?this.open=!1:this.setMaxScrollerHeight()}handleDisabledChange(t){t||(this.open=!1)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems()}valueHandler(t){if(!this.internalValueChangeFlag){const i=this.getItems();Array.isArray(t)?i.forEach((i=>i.selected=t.includes(i.value))):i.forEach(t?i=>i.selected=t===i.value:t=>t.selected=!1),this.updateItems()}}onMessagesChange(){}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}selectedItemsHandler(){this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1}documentClickHandler(t){if(this.disabled||!r(t))return;const i=t.composedPath();i.includes(this.el)||i.includes(this.referenceEl)||(!this.allowCustomValues&&this.textInput.value&&(this.clearInputValue(),this.filterItems(""),this.updateActiveItemIndex(-1)),this.allowCustomValues&&this.text.trim().length&&this.addCustomChip(this.text),this.open=!1)}calciteComboboxItemChangeHandler(t){if(this.ignoreSelectedEventsFlag)return;const i=t.target,e=this.filteredItems.indexOf(i);this.updateActiveItemIndex(e),this.toggleSelection(i,i.selected)}async reposition(t=!1){const{floatingEl:i,referenceEl:e,placement:s,overlayPositioning:n,filteredFlipPlacements:o}=this;return b(this,{floatingEl:i,referenceEl:e,overlayPositioning:n,placement:s,flipPlacements:o,type:"menu"},t)}async setFocus(){var t;await A(this),null===(t=this.textInput)||void 0===t||t.focus(),this.activeChipIndex=-1,this.activeItemIndex=-1}connectedCallback(){var t;I(this),L(this),B(this),H(this),w(this),this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1,null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0,subtree:!0}),this.updateItems(),this.setFilteredPlacements(),this.reposition(!0),this.open&&(this.openHandler(),M(this)),u(this,this.referenceEl,this.floatingEl)}async componentWillLoad(){O(this),this.updateItems(),await T(this)}componentDidLoad(){x(this,this.getValue()),this.reposition(!0),P(this)}componentDidRender(){this.el.offsetHeight!==this.inputHeight&&(this.reposition(!0),this.inputHeight=this.el.offsetHeight),z(this)}componentDidUpdate(){this.refreshSelectionDisplay()}disconnectedCallback(){var t,i;null===(t=this.mutationObserver)||void 0===t||t.disconnect(),null===(i=this.resizeObserver)||void 0===i||i.disconnect(),D(this),$(this),y(this),g(this,this.referenceEl,this.floatingEl),_(this),R(this)}textHandler(){this.updateActiveItemIndex(-1)}effectiveLocaleChange(){W(this,this.effectiveLocale)}clearValue(){this.ignoreSelectedEventsFlag=!0,this.items.forEach((t=>t.selected=!1)),this.ignoreSelectedEventsFlag=!1,this.selectedItems=[],this.emitComboboxChange(),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems(""),this.setFocus()}clearInputValue(){this.textInput.value="",this.text=""}comboboxInViewport(){const t=this.el.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.right<=(window.innerWidth||document.documentElement.clientWidth)&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)}onBeforeOpen(){this.scrollToActiveItem(),this.calciteComboboxBeforeOpen.emit()}onOpen(){this.calciteComboboxOpen.emit()}onBeforeClose(){this.calciteComboboxBeforeClose.emit()}onClose(){this.calciteComboboxClose.emit()}ensureRecentSelectedItemIsActive(){const{selectedItems:t}=this,i=0===t.length?0:this.items.indexOf(t[t.length-1]);this.updateActiveItemIndex(i)}hideChip(t){t.classList.add(q.chipInvisible)}showChip(t){t.classList.remove(q.chipInvisible)}refreshChipDisplay({chipEls:t,availableHorizontalChipElSpace:i,chipContainerElGap:e}){t.forEach((t=>{if(t.selected){const s=a(t);if(s&&s<i)return i-=s+e,void this.showChip(t)}else this.hideChip(t);this.hideChip(t)}))}setCompactSelectionDisplay({chipContainerElGap:t,chipContainerElWidth:i,inputWidth:e,largestSelectedIndicatorChipWidth:s}){const n=Math.round(s+t+e);(!this.maxCompactBreakpoint||this.maxCompactBreakpoint<n)&&(this.maxCompactBreakpoint=n),this.compactSelectionDisplay=i<this.maxCompactBreakpoint}setVisibleAndHiddenChips(t){let i=0;t.forEach((t=>{t.selected&&!t.classList.contains(q.chipInvisible)&&i++})),i!==this.selectedVisibleChipsCount&&(this.selectedVisibleChipsCount=i);const e=this.getSelectedItems().length-i;e!==this.selectedHiddenChipsCount&&(this.selectedHiddenChipsCount=e)}getMaxScrollerHeight(){const t=this.getItemsAndGroups().filter((t=>!t.hidden)),{maxItems:i}=this;let e=0,s=0;return t.length>i&&t.forEach((t=>{if(e<i&&i>0){const i=this.calculateSingleItemHeight(t);i>0&&(s+=i,e++)}})),s}calculateSingleItemHeight(t){if(!t)return;let i=t.offsetHeight;return Array.from(t.querySelectorAll(N)).map((t=>null==t?void 0:t.offsetHeight)).forEach((t=>{i-=t})),i}getItemsAndGroups(){return[...this.groupItems,...this.items]}toggleSelection(t,i=!t.selected){!t||"single-persist"===this.selectionMode&&t.selected&&t.value===this.value||(this.isMulti()?(t.selected=i,this.updateAncestors(t),this.selectedItems=this.getSelectedItems(),this.emitComboboxChange(),this.resetText(),this.filterItems("")):(this.ignoreSelectedEventsFlag=!0,this.items.forEach((e=>e.selected=e===t&&i)),this.ignoreSelectedEventsFlag=!1,this.selectedItems=this.getSelectedItems(),this.emitComboboxChange(),this.textInput&&(this.textInput.value=t.textLabel),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems("")))}updateAncestors(t){if("ancestors"!==this.selectionMode)return;const i=U(t),e=K(t);t.selected?i.forEach((t=>{t.selected=!0})):(e.forEach((t=>t.selected=!1)),[...i].forEach((t=>{G(t)||(t.selected=!1)})))}getFilteredItems(){return this.items.filter((t=>!t.hidden))}getData(){return this.items.map((t=>({filterDisabled:t.filterDisabled,value:t.value,label:t.textLabel})))}getNeedsIcon(){return V(this.selectionMode)&&this.items.some((t=>t.icon))}resetText(){this.textInput&&(this.textInput.value=""),this.text=""}getItems(){return Array.from(this.el.querySelectorAll(X)).filter((t=>!t.disabled))}getGroupItems(){return Array.from(this.el.querySelectorAll(Y))}addCustomChip(t,i){const e=this.items.find((i=>i.textLabel===t));if(e)this.toggleSelection(e,!0);else{this.isMulti()||this.toggleSelection(this.selectedItems[this.selectedItems.length-1],!1);const e=document.createElement("calcite-combobox-item");e.value=t,e.textLabel=t,e.selected=!0,this.el.appendChild(e),this.resetText(),i&&this.setFocus(),this.updateItems(),this.filterItems(""),this.emitComboboxChange()}}removeActiveChip(){this.toggleSelection(this.selectedItems[this.activeChipIndex],!1),this.setFocus()}removeLastChip(){this.toggleSelection(this.selectedItems[this.selectedItems.length-1],!1),this.setFocus()}previousChip(){if(this.text)return;const t=this.activeChipIndex;this.activeChipIndex=-1===t?this.selectedItems.length-1:Math.max(t-1,0),this.updateActiveItemIndex(-1),this.focusChip()}nextChip(){if(this.text||-1===this.activeChipIndex)return;const t=this.activeChipIndex+1;t>this.selectedItems.length-1?(this.activeChipIndex=-1,this.setFocus()):(this.activeChipIndex=t,this.focusChip()),this.updateActiveItemIndex(-1)}focusChip(){var t;const i=null===(t=this.selectedItems[this.activeChipIndex])||void 0===t?void 0:t.guid,e=i?this.referenceEl.querySelector(`#${rt}${i}`):null;null==e||e.setFocus()}shiftActiveItemIndex(t){const{length:i}=this.filteredItems;this.updateActiveItemIndex((this.activeItemIndex+i+t)%i),this.scrollToActiveItem()}updateActiveItemIndex(t){this.activeItemIndex=t;let i=null;this.filteredItems.forEach(((e,s)=>{s===t?(e.active=!0,i=`${lt}${e.guid}`):e.active=!1})),this.activeDescendant=i,this.activeItemIndex>-1&&(this.activeChipIndex=-1)}isAllSelected(){return this.getItems().length===this.getSelectedItems().length}isMulti(){return!V(this.selectionMode)}renderChips(){const{activeChipIndex:i,scale:e,selectionMode:s,messages:n}=this;return this.selectedItems.map(((o,a)=>{const l={chip:!0,"chip--active":i===a},r=[...[...U(o)].reverse(),o].map((t=>t.textLabel)),c="ancestors"!==s?o.textLabel:r.join(" / ");return t("calcite-chip",{class:l,closable:!0,icon:o.icon,iconFlipRtl:o.iconFlipRtl,id:o.guid?`${rt}${o.guid}`:null,key:o.textLabel,messageOverrides:{dismissLabel:n.removeTag},onCalciteChipClose:()=>this.calciteChipCloseHandler(o),scale:e,selected:o.selected,title:c,value:o.value},c)}))}renderAllSelectedIndicatorChip(){const{compactSelectionDisplay:i,scale:e,selectedVisibleChipsCount:s,setAllSelectedIndicatorChipEl:n}=this,o=this.messages.allSelected;return t("calcite-chip",{class:{chip:!0,[q.chipInvisible]:!(this.isAllSelected()&&!s&&!i)},scale:e,title:o,value:"",ref:n},o)}renderAllSelectedIndicatorChipCompact(){const{compactSelectionDisplay:i,scale:e,selectedVisibleChipsCount:s}=this,n=this.messages.all||"All";return t("calcite-chip",{class:{chip:!0,[q.chipInvisible]:!(this.isAllSelected()&&!s&&i)},scale:e,title:n,value:""},n)}renderSelectedIndicatorChip(){const{compactSelectionDisplay:i,selectionDisplay:e,getSelectedItems:s,scale:n,selectedHiddenChipsCount:o,selectedVisibleChipsCount:a,setSelectedIndicatorChipEl:l}=this;let r,c;if(i)r=!0;else if("single"===e){const t=s().length;r=!(!this.isAllSelected()&&t>0),c=`${t} ${this.messages.selected}`}else"fit"===e&&(r=!!(this.isAllSelected()&&0===a||0===o),c=a>0?`+${o}`:`${o} ${this.messages.selected}`);return t("calcite-chip",{class:{chip:!0,[q.chipInvisible]:r},scale:n,title:c,value:"",ref:l},c)}renderSelectedIndicatorChipCompact(){const{compactSelectionDisplay:i,selectionDisplay:e,getSelectedItems:s,scale:n,selectedHiddenChipsCount:o}=this;let a,l;if(i){const t=s().length;this.isAllSelected()?a=!0:"fit"===e?(a=!(o>0),l=`${o||0}`):"single"===e&&(a=!(t>0),l=`${t}`)}else a=!0;return t("calcite-chip",{class:{chip:!0,[q.chipInvisible]:a},scale:n,title:l,value:""},l)}renderInput(){const{guid:i,disabled:e,placeholder:s,selectionMode:n,selectedItems:o,open:a}=this,l=V(n),r=o[0],c=!a&&l&&!!r;return t("span",{class:{"input-wrap":!0,"input-wrap--single":l}},c&&t("span",{class:{label:!0,"label--icon":!!(null==r?void 0:r.icon)},key:"label"},r.textLabel),t("input",{"aria-activedescendant":this.activeDescendant,"aria-autocomplete":"list","aria-controls":`${ht}${i}`,"aria-label":S(this),class:{input:!0,"input--single":!0,"input--transparent":this.activeChipIndex>-1,"input--hidden":c,"input--icon":!!this.placeholderIcon},disabled:e,id:`${dt}${i}`,key:"input",onFocus:this.comboboxFocusHandler,onInput:this.inputHandler,placeholder:s,type:"text",ref:t=>this.textInput=t}))}renderListBoxOptions(){return this.filteredItems.map((i=>t("li",{"aria-selected":c(i.selected),id:i.guid?`${lt}${i.guid}`:null,role:"option",tabindex:"-1"},i.textLabel)))}renderFloatingUIContainer(){const{setFloatingEl:i,setContainerEl:e,open:s}=this;return t("div",{"aria-hidden":"true",class:{"floating-ui-container":!0,"floating-ui-container--active":s},ref:i},t("div",{class:{[q.listContainer]:!0,[v.animation]:!0,[v.animationActive]:s},ref:e},t("ul",{class:{list:!0,"list--hide":!s}},t("slot",null))))}renderIconStart(){const{selectedItems:i,placeholderIcon:e,selectionMode:s,placeholderIconFlipRtl:n}=this,o=i[0],a=null==o?void 0:o.icon,l=V(s);return(!this.open&&o?!!a&&l:!!this.placeholderIcon&&(!o||l))&&t("span",{class:"icon-start"},t("calcite-icon",{class:"selected-icon",flipRtl:this.open&&o?o.iconFlipRtl:n,icon:!this.open&&o?a:e,scale:J(this.scale)}))}renderIconEnd(){const{open:i}=this;return t("span",{class:"icon-end"},t("calcite-icon",{icon:i?"chevron-up":"chevron-down",scale:J(this.scale)}))}render(){var i;const{selectionDisplay:e,guid:n,label:o,open:a}=this,l=V(this.selectionMode),r="all"===e,h="single"===e,d=!l&&"fit"===e,p=!this.clearDisabled&&(null===(i=this.value)||void 0===i?void 0:i.length)>0;return t(s,{onClick:this.comboboxFocusHandler},t(E,{disabled:this.disabled},t("div",{"aria-autocomplete":"list","aria-controls":`${ht}${n}`,"aria-expanded":c(a),"aria-haspopup":"listbox","aria-label":S(this),"aria-live":"polite","aria-owns":`${ht}${n}`,class:{wrapper:!0,"wrapper--single":l||!this.selectedItems.length,"wrapper--active":a},onClick:this.clickHandler,onKeyDown:this.keyDownHandler,role:"combobox",ref:this.setReferenceEl},t("div",{class:{"grid-input":!0,[q.selectionDisplayFit]:d,[q.selectionDisplaySingle]:h},ref:this.setChipContainerEl},this.renderIconStart(),!l&&!h&&this.renderChips(),!l&&!r&&[this.renderSelectedIndicatorChip(),this.renderSelectedIndicatorChipCompact(),this.renderAllSelectedIndicatorChip(),this.renderAllSelectedIndicatorChipCompact()],t("label",{class:"screen-readers-only",htmlFor:`${dt}${n}`,id:`${ct}${n}`},o),this.renderInput()),p?t(at,{disabled:this.disabled,key:"close-button",label:this.messages.clear,scale:this.scale}):null,this.renderIconEnd()),t("ul",{"aria-labelledby":`${ct}${n}`,"aria-multiselectable":"true",class:"screen-readers-only",id:`${ht}${n}`,role:"listbox",tabIndex:-1},this.renderListBoxOptions()),this.renderFloatingUIContainer(),t(k,{component:this}),this.validationMessage?t(Q,{icon:this.validationIcon,message:this.validationMessage,scale:this.scale,status:this.status}):null))}static get assetsDirs(){return["assets"]}get el(){return n(this)}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],selectionMode:["handlePropsChange"],scale:["handlePropsChange"],value:["valueHandler"],messageOverrides:["onMessagesChange"],flipPlacements:["flipPlacementsHandler"],selectedItems:["selectedItemsHandler"],text:["textHandler"],effectiveLocale:["effectiveLocaleChange"]}}};pt.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([scale=s]) .x-button{inline-size:1rem;block-size:1rem}:host([scale=m]) .x-button{inline-size:1.5rem;block-size:1.5rem}:host([scale=l]) .x-button{inline-size:2rem;block-size:2rem}.x-button{margin:0px;display:flex;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-content:center;align-items:center;justify-content:center;align-self:center;border-width:2px;background-color:transparent;color:var(--calcite-color-text-3);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-radius:50%;border-color:transparent;background-color:var(--calcite-color-foreground-2)}.x-button:active,.x-button:hover{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-3)}.x-button:active{border-style:solid;border-color:var(--calcite-color-brand)}.x-button calcite-icon{color:inherit}:host([scale=s]){font-size:var(--calcite-font-size--2);--calcite-combobox-item-spacing-unit-l:0.5rem;--calcite-combobox-item-spacing-unit-s:0.25rem;--calcite-combobox-input-height:1rem;--calcite-internal-combobox-input-margin-block:calc(0.25rem - 1px)}:host([scale=s]) .x-button{margin-inline:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);--calcite-combobox-item-spacing-unit-l:0.75rem;--calcite-combobox-item-spacing-unit-s:0.5rem;--calcite-combobox-input-height:1rem;--calcite-internal-combobox-input-margin-block:calc(0.5rem - 1px)}:host([scale=m]) .x-button{margin-inline-end:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);--calcite-combobox-item-spacing-unit-l:1rem;--calcite-combobox-item-spacing-unit-s:0.75rem;--calcite-combobox-input-height:1.5rem;--calcite-internal-combobox-input-margin-block:calc(0.625rem - 1px)}:host([scale=l]) .x-button{margin-inline-end:1rem}.wrapper{display:flex;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);outline-color:transparent;padding-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);padding-inline:var(--calcite-combobox-item-spacing-unit-l)}:host(:focus-within) .wrapper,.wrapper--active{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}:host([status=invalid]) .wrapper{border-color:var(--calcite-color-status-danger)}:host([status=invalid]:focus-within) .wrapper{outline:2px solid var(--calcite-color-status-danger);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.wrapper--single{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l);cursor:pointer;flex-wrap:nowrap}.grid-input{position:relative;display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px;gap:var(--calcite-combobox-item-spacing-unit-s)}.grid-input.selection-display-fit,.grid-input.selection-display-single{flex-wrap:nowrap;overflow:hidden}.input{flex-grow:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;border-style:none;background-color:transparent;padding:0px;font-family:inherit;color:var(--calcite-color-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);inline-size:100%;margin-block-end:var(--calcite-combobox-item-spacing-unit-s);min-inline-size:4.8125rem}.input:focus{outline:2px solid transparent;outline-offset:2px}.input:-moz-placeholder-shown{text-overflow:ellipsis}.input:placeholder-shown{text-overflow:ellipsis}.input--transparent{opacity:0}.input--single{padding:0px;margin-block:var(--calcite-internal-combobox-input-margin-block)}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;inline-size:0px;min-inline-size:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-s)}:host([scale=m]) .input--icon,:host([scale=l]) .input--icon{padding-inline:0.25rem}.input-wrap{display:flex;flex-grow:1;align-items:center}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;display:flex;max-inline-size:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.icon-end,.icon-start{display:flex;cursor:pointer;align-items:center}.icon-end{flex:none}.floating-ui-container{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}.floating-ui-container--active{visibility:visible}@media (forced-colors: active){.wrapper,.floating-ui-container--active{border:1px solid canvasText}}.screen-readers-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.list-container{max-block-size:45vh;overflow-y:auto;background-color:var(--calcite-color-foreground-1);inline-size:var(--calcite-dropdown-width)}.list{margin:0px;display:block;padding:0px}.list--hide{block-size:0px;overflow:hidden}calcite-chip{--calcite-animation-timing:0}.chip{margin-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);max-inline-size:100%}.chip--active{background-color:var(--calcite-color-foreground-3)}.chip--invisible{visibility:hidden;position:absolute}.item{display:block}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::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}:host([hidden]){display:none}[hidden]{display:none}::slotted(calcite-combobox-item-group:not(:first-child)){padding-block-start:var(--calcite-combobox-item-spacing-unit-l)}";
12
- /*!
13
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
15
- * v2.4.0
16
- */
17
- const mt=class{constructor(t){i(this,t),this.calciteDropdownSelect=e(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=e(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=e(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=e(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=e(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=F("mutation",(()=>this.updateItems())),this.resizeObserver=F("resize",(t=>this.resizeObserverCallback(t))),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${C()}`,this.defaultAssignedElements=[],this.slotChangeHandler=t=>{this.defaultAssignedElements=t.target.assignedElements({flatten:!0}),this.updateItems()},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:i}=this;this.filteredFlipPlacements=i?m(i,t):null},this.updateTriggers=t=>{this.triggers=t.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map((t=>Array.from(null==t?void 0:t.querySelectorAll("calcite-dropdown-item")))).reduce(((t,i)=>[...t,...i]),[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach((t=>t.scale=this.scale))},this.updateGroups=t=>{const i=t.target.assignedElements({flatten:!0}).filter((t=>null==t?void 0:t.matches("calcite-dropdown-group")));this.groups=i,this.updateItems()},this.resizeObserverCallback=t=>{t.forEach((t=>{const{target:i}=t;i===this.referenceEl?this.setDropdownWidth():i===this.scrollerEl&&this.setMaxScrollerHeight()}))},this.setDropdownWidth=()=>{const{referenceEl:t,scrollerEl:i}=this,e=null==t?void 0:t.clientWidth;e&&i&&(i.style.minWidth=`${e}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:t}=this;if(!t)return;this.reposition(!0);const i=this.getMaxScrollerHeight();t.style.maxHeight=i>0?`${i}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=t=>{this.resizeObserver.observe(t),this.scrollerEl=t,this.transitionEl=t},this.setReferenceEl=t=>{this.referenceEl=t,u(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(t)},this.setFloatingEl=t=>{this.floatingEl=t,u(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=t=>{if(!t.composedPath().includes(this.referenceEl))return;const{defaultPrevented:i,key:e}=t;if(!i){if(this.open){if("Escape"===e)return this.closeCalciteDropdown(),void t.preventDefault();if(t.shiftKey&&"Tab"===e)return this.closeCalciteDropdown(),void t.preventDefault()}tt(e)?(this.openCalciteDropdown(),t.preventDefault()):"Escape"===e&&(this.closeCalciteDropdown(),t.preventDefault())}},this.focusOnFirstActiveOrFirstItem=()=>{this.getFocusableElement(this.getTraversableItems().find((t=>t.selected))||this.items[0])},this.toggleOpenEnd=()=>{this.focusOnFirstActiveOrFirstItem(),this.el.removeEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.openCalciteDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=p,this.selectedItems=[],this.type="click",this.widthScale=void 0,this.scale="m"}openHandler(){M(this),this.disabled?this.open=!1:this.reposition(!0)}handleDisabledChange(t){t||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems()}async setFocus(){await A(this),this.el.focus()}connectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.reposition(!0),this.open&&(this.openHandler(),M(this)),I(this),this.updateItems(),u(this,this.referenceEl,this.floatingEl)}componentWillLoad(){O(this)}componentDidLoad(){P(this),this.reposition(!0)}componentDidRender(){z(this)}disconnectedCallback(){var t,i;null===(t=this.mutationObserver)||void 0===t||t.disconnect(),null===(i=this.resizeObserver)||void 0===i||i.disconnect(),D(this),g(this,this.referenceEl,this.floatingEl)}render(){const{open:i,guid:e}=this;return t(s,null,t(E,{disabled:this.disabled},t("div",{class:"calcite-trigger-container",id:`${e}-menubutton`,onClick:this.openCalciteDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},t("slot",{"aria-controls":`${e}-menu`,"aria-expanded":c(i),"aria-haspopup":"menu",name:"trigger",onSlotchange:this.updateTriggers})),t("div",{"aria-hidden":c(!i),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},t("div",{"aria-labelledby":`${e}-menubutton`,class:{"calcite-dropdown-content":!0,[v.animation]:!0,[v.animationActive]:i},id:`${e}-menu`,role:"menu",ref:this.setScrollerAndTransitionEl},t("slot",{onSlotchange:this.updateGroups})))))}async reposition(t=!1){const{floatingEl:i,referenceEl:e,placement:s,overlayPositioning:n,filteredFlipPlacements:o}=this;return b(this,{floatingEl:i,referenceEl:e,overlayPositioning:n,placement:s,flipPlacements:o,type:"menu"},t)}closeCalciteDropdownOnClick(t){!this.disabled&&r(t)&&this.open&&!t.composedPath().includes(this.el)&&this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(t){this.closeCalciteDropdown(),t.stopPropagation()}closeCalciteDropdownOnOpenEvent(t){t.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||"hover"!==this.type||this.openCalciteDropdown()}pointerLeaveHandler(){this.disabled||"hover"!==this.type||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter((t=>!t.disabled&&!t.hidden))}calciteInternalDropdownItemKeyEvent(t){const{keyboardEvent:i}=t.detail,e=i.target,s=this.getTraversableItems();switch(i.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(e);break;case"ArrowDown":h(s,e,"next");break;case"ArrowUp":h(s,e,"previous");break;case"Home":h(s,e,"first");break;case"End":h(s,e,"last")}t.stopPropagation()}handleItemSelect(t){this.updateSelectedItems(),t.stopPropagation(),this.calciteDropdownSelect.emit(),this.closeOnSelectDisabled&&"none"!==t.detail.requestedDropdownGroup.selectionMode||this.closeCalciteDropdown(),t.stopPropagation()}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter((t=>t.selected))}getMaxScrollerHeight(){const{maxItems:t,items:i}=this;let e,s=0,n=0;return this.groups.forEach((i=>{t>0&&s<t&&Array.from(i.children).forEach(((i,o)=>{0===o&&(isNaN(e)&&(e=i.offsetTop),n+=e),s<t&&(n+=i.offsetHeight,s+=1)}))})),i.length>t?n:0}closeCalciteDropdown(t=!0){this.open=!1,t&&d(this.triggers[0])}getFocusableElement(t){t&&d(t)}updateTabIndexOfItems(t){this.items.forEach((i=>{i.tabIndex=t!==i?-1:0}))}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}};mt.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;block-size:100%;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width-scale=s]){--calcite-dropdown-width:12rem}:host([width-scale=m]){--calcite-dropdown-width:14rem}:host([width-scale=l]){--calcite-dropdown-width:16rem}:host([hidden]){display:none}[hidden]{display:none}";
18
- /*!
19
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
20
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
21
- * v2.4.0
22
- */
23
- const ut="container",bt=class{constructor(t){i(this,t),this.calciteInternalDropdownItemChange=e(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((t=>t.selectionMode=this.selectionMode))},this.mutationObserver=F("mutation",(()=>this.updateItems())),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){var t;this.updateItems(),null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect()}render(){const i=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,e=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(s,{"aria-label":this.groupTitle,role:"group"},t("div",{class:{[ut]:!0,[`${ut}--${this.scale}`]:!0}},e,i,t("slot",null)))}updateActiveItemOnChange(t){this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{selectionMode:["handlePropsChange"]}}};bt.style=":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}";const gt=class{constructor(t){i(this,t),this.calciteDropdownItemSelect=e(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=e(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=e(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=e(this,"calciteInternalDropdownCloseRequest",6),this.disabled=!1,this.href=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.label=void 0,this.rel=void 0,this.selected=!1,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){var t;await A(this),null===(t=this.el)||void 0===t||t.focus()}componentWillLoad(){O(this),this.initialize()}componentDidLoad(){P(this)}connectedCallback(){this.initialize()}componentDidRender(){z(this)}render(){const{href:i,selectionMode:e,label:n,iconFlipRtl:o,scale:a}=this,l=t("calcite-icon",{class:"dropdown-item-icon-start",flipRtl:"start"===o||"both"===o,icon:this.iconStart,scale:J(this.scale)}),r=t("span",{class:"dropdown-item-content"},t("slot",null)),h=t("calcite-icon",{class:"dropdown-item-icon-end",flipRtl:"end"===o||"both"===o,icon:this.iconEnd,scale:J(this.scale)}),d=this.iconStart&&this.iconEnd?[l,r,h]:this.iconStart?[l,r]:this.iconEnd?[r,h]:r,p=i?t("a",{"aria-label":n,class:"dropdown-link",href:i,rel:this.rel,tabIndex:-1,target:this.target,ref:t=>this.childLink=t},d):d,m=i?null:"single"===e?"menuitemradio":"multiple"===e?"menuitemcheckbox":"menuitem",u="none"!==e?c(this.selected):null,{disabled:b}=this;return t(s,{"aria-checked":u,"aria-label":i?"":n,role:m,tabIndex:b?-1:0},t(E,{disabled:b},t("div",{class:{[ut]:!0,"container--link":!!i,[`${ut}--${a}`]:!0,"container--multi-selection":"multiple"===e,"container--single-selection":"single"===e,"container--none-selection":"none"===e}},"none"!==e?t("calcite-icon",{class:"dropdown-item-icon",icon:"multiple"===e?"check":"bullet-point",scale:J(this.scale)}):null,p)))}onClick(){this.emitRequestedItem()}keyDownHandler(t){switch(t.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),t.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),t.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:t});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":t.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:t})}}updateActiveItemOnChange(t){t.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.determineActiveItem()),t.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),"none"===this.selectionMode&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return n(this)}};gt.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.container--s{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}.container--s.container--none-selection{padding-inline-start:0.25rem}.container--s.container--none-selection .dropdown-link{padding-inline-start:0px}.container--m.container--none-selection{padding-inline-start:0.5rem}.container--m.container--none-selection .dropdown-link{padding-inline-start:0px}.container--l.container--none-selection{padding-inline-start:0.75rem}.container--l.container--none-selection .dropdown-link{padding-inline-start:0px}:host{position:relative;display:flex;flex-grow:1;align-items:center}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem;padding-inline-end:auto;padding-inline-start:0.25rem}:host,.container--link a{outline-color:transparent}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.container--link{padding:0px}.container--link a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.container--s .dropdown-link{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m .dropdown-link{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l .dropdown-link{padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}:host(:hover:not([disabled])) .container,:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:hover:not([disabled])) .container--link .dropdown-link,:host(:active:not([disabled])) .container--link .dropdown-link{color:var(--calcite-color-text-1)}:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-3)}:host(:focus) .container{color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host([selected]) .container:not(.container--none-selection),:host([selected]) .container--link .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .container--link .dropdown-link calcite-icon{color:var(--calcite-color-brand)}.dropdown-item-icon{position:absolute;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}.container--s .dropdown-item-icon{inset-inline-start:0.25rem}.container--m .dropdown-item-icon{inset-inline-start:0.5rem}.container--l .dropdown-item-icon{inset-inline-start:0.75rem}:host(:hover:not([disabled])) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}.container--s .dropdown-item-icon-start{margin-inline-end:0.5rem;margin-inline-start:0.25rem}.container--s .dropdown-item-icon-end{margin-inline-start:0.5rem}.container--m .dropdown-item-icon-start{margin-inline-end:0.75rem;margin-inline-start:0.25rem}.container--m .dropdown-item-icon-end{margin-inline-start:0.75rem}.container--l .dropdown-item-icon-start{margin-inline-end:1rem;margin-inline-start:0.25rem}.container--l .dropdown-item-icon-end{margin-inline-start:1rem}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}";const vt=class{constructor(t){i(this,t),this.idsFound=e(this,"idsFound",7),this.noLayersFound=e(this,"noLayersFound",7),this.layerSelectionChange=e(this,"layerSelectionChange",7),this.defaultLayerHonored=!1,this.appearance="transparent",this.defaultLayerId="",this.display="inline-block",this.enabledLayerIds=[],this.enabledTableIds=[],this.height=void 0,this.isMobile=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.placeholderIcon="",this.selectedIds=[],this.scale="m",this.showTables=void 0,this.showSingleLayerAsLabel=!1,this.type="select",this._hasMultipleLayers=!0,this._hasValidLayers=!0,this._isDropdownOpen=void 0,this.ids=[],this.selectedName="",this._translations=void 0}async mapViewWatchHandler(){await this._setLayers(),this.ids.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this._setSelectedLayer(this.ids[0])):(this._hasValidLayers=!1,this.noLayersFound.emit())}async componentWillLoad(){await this._getTranslations(),await this._setLayers(),(this.ids.length>0||1===this.selectedIds.length)&&this.layerSelectionChange.emit(1===this.selectedIds.length?[this.selectedIds[0]]:[this.ids[0]])}render(){const i="map-layer-picker";let e=this.height>0?{height:`${this.height.toString()}px`}:{};return e=Object.assign(Object.assign({},e),{display:this.display}),t(s,null,t("div",{class:"map-layer-picker-container",style:e},t("div",{class:"map-layer-picker",style:e},this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():"combobox"===this.type?this._getCombobox(i):"select"===this.type?this._getSelect(i):this._getDropdown(i):this._getInvalidPlaceholder())))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=t:"dropdown"===this.type&&(this.selectedName=Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t].name:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t].name:"")}}_getInvalidPlaceholder(){return t("div",null,t("calcite-notice",{class:"height-100",icon:"exclamation-mark-triangle",id:"no-valid-layers",kind:"danger",open:!0},t("div",{slot:"message"},this._translations.noLayersFound)),t("calcite-tooltip",{label:this._translations.enableEditUpdate,placement:"bottom","reference-element":"no-valid-layers"},t("span",null,this._translations.enableEditUpdate)))}_getSingleLayerPlaceholder(){return t("div",{class:"layer-picker-label-container cursor-default"},t("calcite-icon",{icon:"layers",scale:"s"}),t("calcite-label",{class:"no-bottom-margin padding-start-1"},this.selectedName))}_getSelect(i){return t("calcite-select",{id:i,label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:t=>{this._layerElement=t},scale:this.scale},this._getMapLayerOptions())}_getCombobox(i){return t("calcite-combobox",{clearDisabled:!0,id:i,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:t=>{this._layerElement=t},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(i){return t("calcite-dropdown",{class:"layer-picker-dropdown",onCalciteDropdownBeforeClose:()=>this._isDropdownOpen=!1,onCalciteDropdownBeforeOpen:()=>this._isDropdownOpen=!0},this.isMobile?this._getDropdownButton():this._getActionDropdownButton(i),t("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getActionDropdownButton(i){return t("calcite-action",{id:i,slot:"trigger",text:""},this._getDropdownButton())}_getDropdownButton(){return t("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:this.isMobile?"":"max-width-350",iconEnd:this._isDropdownOpen?"chevron-up":"chevron-down",iconStart:"layers",kind:"neutral",slot:this.isMobile?"trigger":"",width:"full"},t("div",null,this.selectedName))}_getMapLayerOptions(){return this.ids.reduce(((t,i)=>(this._validLayer(i)?t.push(this._getItem(i,"layer")):this._validTable(i)&&t.push(this._getItem(i,"table")),t)),[])}_getItem(i,e){const s="layer"===e?this._layerNameHash[i]:this._tableNameHash[i],n=!!this.onlyShowUpdatableLayers&&!s.supportsUpdate,o=s.name,a=this.selectedIds.indexOf(i)>-1;return"combobox"===this.type?t("calcite-combobox-item",{disabled:n,selected:a,textLabel:o,value:i}):"select"===this.type?t("calcite-option",{disabled:n,label:o,selected:a,value:i}):t("calcite-dropdown-group",{class:n?"disabled":"",selectionMode:n?"none":"single"},t("calcite-dropdown-item",{onClick:n?void 0:()=>{this._setSelectedLayer(i)},selected:a},o))}_setSelectedLayer(t){let i;this.defaultLayerId&&!this.defaultLayerHonored&&(i=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=void 0!==i,t=this.defaultLayerHonored?this.defaultLayerId:t),i=i||this._getLayerFromHash(t),this.selectedName=null==i?void 0:i.name,this.selectedIds=[t],this.layerSelectionChange.emit(this.selectedIds)}_getLayerFromHash(t){return Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t]:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();const t=this.onlyShowUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash),i=this.showTables?this.onlyShowUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[];this.ids=[...t.reverse().filter((t=>{var i;return!((null===(i=this.enabledLayerIds)||void 0===i?void 0:i.length)>0)||this.enabledLayerIds.reverse().indexOf(t)>-1})),...i.reverse().filter((t=>{var i;return!((null===(i=this.enabledTableIds)||void 0===i?void 0:i.length)>0)||this.enabledTableIds.reverse().indexOf(t)>-1}))],this.idsFound.emit({layerIds:t,tableIds:i})}}_getEditableIds(t){return Object.keys(t).reduce(((i,e)=>(t[e].supportsUpdate&&i.push(e),i)),[])}async _initLayerTableHash(){this._layerNameHash=await et(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await st(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){var i;const e=null===(i=this._layerNameHash[t])||void 0===i?void 0:i.name;return e&&Object.keys(nt.managedLayers).indexOf(e)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){var i;const e=null===(i=this._tableNameHash[t])||void 0===i?void 0:i.name,s=e&&this.showTables;return s?nt.managedTables.indexOf(e)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):s}_layerSelectionChange(){const t=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(t)!==JSON.stringify([""])&&(this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds))}async _getTranslations(){const t=await it(this.el);this._translations=t[0]}get el(){return n(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};vt.style=":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";export{pt as calcite_combobox,mt as calcite_dropdown,bt as calcite_dropdown_group,gt as calcite_dropdown_item,vt as map_layer_picker}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as i,c as t,h as s,H as e,g as a}from"./p-7d280d8a.js";import{a as l,l as h,g as n}from"./p-be8ef276.js";import{d as o,h as r,j as d,k as c,b as p,l as g,m as b,n as u}from"./p-3af79063.js";import{a as v,e as y,f as m}from"./p-c1cf3ebc.js";import{s as w}from"./p-322868ec.js";import{d as f,a as S}from"./p-331b5d1e.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-18f1e8b5.js";import"./p-b503d01d.js";import"./p-a230b270.js";import"./p-94c634ba.js";const _=class{constructor(s){i(this,s),this.selectionSetChange=t(this,"selectionSetChange",7),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectionLayerIds=[],this.selectLayerView=void 0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._numSelected=0,this._searchDistanceEnabled=!1,this._searchTerm=void 0,this._selectionLoading=!1,this._translations=void 0,this._useLayerFeaturesEnabled=!1}async watchGeometriesHandler(i,t){if(i!==t){const t=0===i.length;if(await this._clearResults(t,t),i.length>0)return this._highlightWithOIDsOrGeoms()}}async mapViewWatchHandler(i,t){i&&i!==t&&await this._init()}async watchSearchConfigurationHandler(i,t){JSON.stringify(i)!==JSON.stringify(t)&&await this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this._searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this._useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(i){this.searchConfiguration=i.detail}async distanceChanged(i){await this._distanceChanged(i.detail)}async unitChanged(i){i.detail.newValue!==i.detail.oldValue&&(this._unit=i.detail.newValue,await this._updateLabel())}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){await this._init()}render(){return s(e,null,this._getMapLayerPicker(),s("div",{class:"border-bottom"}),s("div",{class:"padding-top-sides-1"},s("div",{class:"search-widget",ref:i=>{this._searchElement=i}}),s("div",{class:"padding-top-1"},s("map-draw-tools",{active:!0,editGraphicsEnabled:!this._useLayerFeaturesEnabled,graphics:this._graphics,mapView:this.mapView,onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,ref:i=>{this._drawTools=i}})),this._getBufferOptions(),this._getUseLayerFeaturesOptions(),this._getNumSelected()),s("div",{class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){var i,t;const e=this._searchDistanceEnabled?"search-distance":"div-not-visible",a="number"==typeof(null===(i=this.selectionSet)||void 0===i?void 0:i.distance)?this.selectionSet.distance:this.defaultBufferDistance;return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.searchDistance,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"search-distance-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"search-distance-icon"},s("span",{class:"tooltip-message"},this._translations.useSearchDistanceTootip)),s("calcite-switch",{checked:this._searchDistanceEnabled,onCalciteSwitchChange:()=>this._searchDistanceEnabled=!this._searchDistanceEnabled})),s("div",{class:e},s("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:a,geometries:this.geometries,onBufferComplete:i=>this._bufferComplete(i),ref:i=>this._bufferTools=i,unit:(null===(t=this.selectionSet)||void 0===t?void 0:t.unit)||this.defaultBufferUnit})))}_getUseLayerFeaturesOptions(){const i=this._useLayerFeaturesEnabled?"div-visible":"div-not-visible";return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.useLayerFeatures,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"use-layer-features-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"use-layer-features-icon"},s("span",{class:"tooltip-message"},this._translations.useLayerFeaturesTooltip)),s("calcite-switch",{checked:this._useLayerFeaturesEnabled,onCalciteSwitchChange:()=>{this._useLayerFeaturesEnabledChanged()}})),s("div",{class:i+" padding-top-1"},s("map-layer-picker",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedIds:this.layerViews.map((i=>i.layer.id)),showTables:!1})))}_getNumSelected(){const i=l(this.el),t=i&&"en"===i?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return s("div",{class:"padding-top-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?s("div",null,s("calcite-loader",{class:"info-blue",inline:!0,label:t,scale:"m",type:"indeterminate"})):s("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),s("calcite-input-message",{class:"info-blue",scale:"m"},this._selectionLoading?t:this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())))}_getNameInput(){return s("div",{class:"padding-sides-1 padding-top-1 "+(this.customLabelEnabled?"":"display-none")},s("calcite-label",{class:"font-bold"},this._translations.listName,s("calcite-input",{onInput:()=>{this._selectionLabel=this._labelName.value},placeholder:this._translations.listNamePlaceholder,ref:i=>{this._labelName=i},value:this._selectionLabel||""})))}_getMapLayerPicker(){return s("div",{class:"display-flex padding-sides-1 padding-bottom-1"},s("calcite-label",{class:"font-bold width-full label-margin-0"},this._translations.inputLayer,s("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>this._inputLayerSelectionChange(i),selectedIds:this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet?[this.selectionSet.layerView.layer.id]:[],showTables:!1})))}async _initModules(){const[i,t,s,e,a]=await h(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=s,this._geometryEngine=e,this.FeatureLayer=a}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){var i,t,s,e;this.selectionSet&&(this._searchTerm=null===(i=this.selectionSet.searchResult)||void 0===i?void 0:i.name,this._searchResult=this.selectionSet.searchResult,this._selectLayers=this.selectionSet.selectLayers,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs,this._searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this._useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...(null===(t=this.selectionSet)||void 0===t?void 0:t.geometries)||[]],this._graphics=this.geometries.map((i=>new this.Graphic({geometry:i,symbol:"point"===i.type?this.sketchPointSymbol:"polyline"===i.type?this.sketchLineSymbol:this.sketchPolygonSymbol}))),this._selectionLabel=null===(s=this.selectionSet)||void 0===s?void 0:s.label,this._useLayerFeaturesEnabled||null===(e=this._drawTools)||void 0===e||e.updateGraphics(),await o(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}async _initSearchWidget(){if(this.mapView&&this._searchElement){const i=this._getSearchConfig(this.searchConfiguration,this.mapView),t=Object.assign({view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm},i);this._searchWidget=new this.Search(t),this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.on("search-clear",(()=>{const i=this._searchClearLabel();this._clearResults(!1,i)})),this._searchWidget.on("select-result",(i=>{var t,s;if(i.result){this._searchResult=i.result;const e=(null===(s=null===(t=i.source)||void 0===t?void 0:t.layer)||void 0===s?void 0:s.id)&&i.source.layer.id===this.selectLayerView.layer.id,a=e?[i.result.feature.getObjectId()]:void 0;this._workflowType=v.SEARCH,this._updateLabel();const l=[i.result.feature];this._updateSelection(l,e,a),this._drawTools.graphics=l,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}})),await this._searchWidget.when((()=>{var i;this._searchWidget.allPlaceholder=(null===(i=this.searchConfiguration)||void 0===i?void 0:i.allPlaceholder)&&"find address or place"!==this.searchConfiguration.allPlaceholder.toLowerCase()?this.searchConfiguration.allPlaceholder:this._translations.placeholder}))}}_searchClearLabel(){var i;return(null===(i=this._searchResult)||void 0===i?void 0:i.name)&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const s=null==i?void 0:i.sources;return(null==s?void 0:s.length)>0?(i.includeDefaultSources=!1,s.forEach((i=>{var s,e;if(i.hasOwnProperty("layer")){const a=i,l=null===(s=a.layer)||void 0===s?void 0:s.id,h=l?t.map.findLayerById(l):null,n=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;h?a.layer=h:n&&(a.layer=new this.FeatureLayer(n))}})),null==s||s.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===(null==t?void 0:t.name)&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i=Object.assign(Object.assign({},i),{includeDefaultSources:!0}),i}_initGraphicsLayer(){const i=this._translations.bufferLayer;if(this.mapView){const t=this.mapView.map.layers.findIndex((t=>t.title===i));if(t>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(t);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),w.managedLayers[i]="buffer";const t=this.mapView.map.layers.findIndex((i=>i.title===this._translations.sketchLayer));t>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,t):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}}async _sketchGraphicsChanged(i,t=!1){const s=i.detail.graphics;if(s.length>0&&s[0])if(t||(this._sketchGraphic=s[0]),this._workflowType=this._useLayerFeaturesEnabled?v.SELECT:v.SKETCH,this._workflowType===v.SKETCH&&this._drawTools.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(s)?s.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=s.reduce(((i,t)=>{var s;return(null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.objectIdField)?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i}),[]),e=i.detail.useOIDs&&t.length>0;this._updateSelection(s,e,t),e&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){var i;return(null===(i=this._skipGeomOIDs)||void 0===i?void 0:i.length)>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(i){w.removeHandles(),i.length>0&&w.highlightHandles.push(await r(i,this.selectLayerView,this.mapView)),this._numSelected=i.length,this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectionLoading=!0,this._selectedIds=await d(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,s=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),s=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:s})}_geomQuery(i){const t=c(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){var s;this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),w.removeHandles(),(null===(s=this._drawTools)||void 0===s?void 0:s.clear)&&(this._graphics=[],await this._drawTools.clear()),this.selectionSetChange.emit(this._selectedIds.length)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,s){this._selectedIds=t&&s?s:this._selectedIds,this._skipGeomOIDs=t?s:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}async _updateLabel(){var i,t;const s=this._selectionLabel.indexOf(this._translations.sketch)>-1,e=this._selectionLabel.indexOf(this._translations.select)>-1,a=this._selectionLabel.indexOf(null===(i=this._searchResult)||void 0===i?void 0:i.name)>-1,l=this._workflowType===v.SEARCH?null===(t=this._searchResult)||void 0===t?void 0:t.name:this._workflowType===v.SELECT?this._translations.select:this._translations.sketch,h=this._unit?this._unit:this._bufferTools.unit,n=await this._bufferTools.getTranslatedUnit(h),o=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=s||e||a||!this._selectionLabel?`${l} ${o} ${n}`:this._selectionLabel,this._labelName.value=this._selectionLabel}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){const t=i.detail.map((i=>p(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i,this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}))}}async _inputLayerSelectionChange(i){var t;const s=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";this.selectLayerView&&s===this.selectLayerView.layer.id||(this.selectLayerView=await p(this.mapView,s),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(i){i.newValue!==i.oldValue&&(this._distance=i.newValue,await this._updateLabel())}async _selectLayerFeatures(i){this._selectionLoading=!0;const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],g(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((s=>{t=t.concat(i[s])}))}));let s=!1;t.forEach((i=>{var t;const e=i.geometry;i.symbol="point"===e.type?this.sketchPointSymbol:"polyline"===e.type?this.sketchLineSymbol:"polygon"===e.type?this.sketchPolygonSymbol:void 0,s=(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.hasOwnProperty("objectIdField"))||i.hasOwnProperty("getObjectId")}));const e=this.layerViews[0].layer.title===this.selectLayerView.layer.title&&s;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:e}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};_.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{border-inline-end:1px solid var(--calcite-color-border-2)}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:0.5rem}.icon{--calcite-color-icon-color:var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}';const L=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]}),P=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}async downloadCSV(i,t,s,e=!0){return f(i,t,!0,s,e)}async downloadPDF(i,t,s=!1,e="",a=""){var l;return S(i,t,null===(l=this._labelInfoElement.selectedOption)||void 0===l?void 0:l.value,s,e,a)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return s(e,null,s("calcite-select",{disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidLoad(){this._renderOptions()}async _initModules(){const[i]=await h(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="&lrm;"+i.descriptionPDF.labelWidthDisplay+" x "+i.descriptionPDF.labelHeightDisplay+"&rlm;";return this._translations.pdfLabel.replace("{{n}}",i.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",t)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}_renderOptions(){(L.default||L).sort(((i,t)=>{const s=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),e=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return s<e?-1:s>e?1:0})).forEach(((i,t)=>{const s=document.createElement("calcite-option");s.value=i,s.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(s),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(s.selected=!0,this._labelInfoElement.selectedOption=s)}))}get el(){return a(this)}};P.style=":host{display:block}";const x=class{constructor(s){i(this,s),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this._addEnabled=!0,this._refineSets=[],this._enabledLayerIds=[],this._featuresCollection={},this.addresseeLayer=void 0,this.enabledLayerIds=[],this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=y.ADD,this._refineLayer=void 0}async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){var i,t;return s(e,null,s("div",{class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},s("div",{class:"display-flex"},s("calcite-label",{class:"font-bold width-full label-margin-0"},s("div",{class:"display-flex"},this._translations.inputLayer,s("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"refine-input-layer",scale:"s"})),s("map-layer-picker",{enabledLayerIds:this._enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},ref:i=>{this._layerPicker=i},selectedIds:[this._refineLayer.layer.id],showTables:!1})),s("calcite-popover",{closable:!0,label:"",referenceElement:"refine-input-layer"},s("span",{class:"tooltip-message"},this._translations.inputLayerTip)))),s("div",{class:"padding-1"},s("div",{class:"padding-bottom-1"},s("calcite-segmented-control",{class:"w-100",width:"full"},s("calcite-segmented-control-item",{checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(y.ADD),value:y.ADD},s("span",{class:"font-weight-500"},this._translations.add)),s("calcite-segmented-control-item",{checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(y.REMOVE),value:y.REMOVE},s("span",{class:"font-weight-500"},this._translations.remove)))),s("div",null,s("map-draw-tools",{active:!0,drawMode:m.REFINE,mapView:this.mapView,onDrawRedo:()=>this._redo(),onDrawUndo:()=>this._undo(),onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,redoEnabled:(null===(i=this._refineSelectionSet)||void 0===i?void 0:i.redoStack.length)>0,ref:i=>{this._drawTools=i},undoEnabled:(null===(t=this._refineSelectionSet)||void 0===t?void 0:t.undoStack.length)>0})),s("br",null),s("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){var t;const s=null===(t=i.detail)||void 0===t?void 0:t.graphics[0].geometry;this._selectFeatures(s)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{var s;const e=null===(s=null==t?void 0:t.layerView)||void 0===s?void 0:s.layer.id;return e&&i.indexOf(e)<0?i.push(e):t.workflowType===v.REFINE&&Object.keys(t.refineInfos).forEach((t=>{i.indexOf(t)<0&&i.push(t)})),i}),[])}async _setRefineSet(i){this.selectionSets.some((t=>{if(t.workflowType===v.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const s={};s[i]={addIds:[],removeIds:[],layerView:await p(this.mapView,i)},t?t.refineInfos=Object.assign(Object.assign({},t.refineInfos),s):(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:v.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:s,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===y.ADD?y.REMOVE:y.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===y.ADD?y.REMOVE:y.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===v.REFINE)return t=i,!0}));let e=0,a=0;return Object.keys(t.refineInfos).forEach((i=>{e+=t.refineInfos[i].addIds.length,a+=t.refineInfos[i].removeIds.length})),[s("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",e.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getTotal(i){const t=b(i);return Object.keys(t).reduce(((i,s)=>i+t[s].ids.length),0)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}async _selectFeatures(i){var t,s;this.selectionLoadingChange.emit(!0),this._featuresCollection[null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id]=[];const e=await g(0,null===(s=this._refineLayer)||void 0===s?void 0:s.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let a=[];Object.keys(e).forEach((i=>{var t;i===(null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id)&&(a=a.concat(e[i]))}));const l=Array.isArray(a)?a.map((i=>{var t;return i.attributes[null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.objectIdField]})):[];await this._updateIds(l,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),w.highlightHandles=await u(this.selectionSets)}_clearHighlight(){w.removeHandles()}async _updateIds(i,t,s,e){let a=!1;const l=this._refineSelectionSet.refineInfos,h=e.layer.id,n={};n[h]={addIds:[],removeIds:[],layerView:e};const o=Object.keys(l).indexOf(h)>-1?l[h]:n[h];if(t===y.ADD)o.addIds=[...new Set([...i,...o.addIds])],o.addIds.length>0&&s.push({ids:i,mode:t,layerView:e}),o.removeIds.length>0&&(o.removeIds=o.removeIds.filter((t=>i.indexOf(t)<0)));else{const l=this.selectionSets.reduce(((t,s)=>(i.forEach((i=>{s.workflowType!==v.REFINE?s.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(s.refineInfos).some((a=>{const l=s.refineInfos[a];if(l.layerView.layer.id===e.layer.id&&l.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);o.removeIds=[...new Set([...l,...o.removeIds])],o.addIds=o.addIds.filter((i=>l.indexOf(i)<0)),o.removeIds.length>0&&s.push({ids:l,mode:t,layerView:e}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==v.REFINE&&t.layerView.layer.id===e.layer.id?(t.selectedIds=t.selectedIds.filter((i=>o.removeIds.indexOf(i)<0)),t.selectedIds.length>0?i.push(t):a=!0):i.push(t),i)),[])}this._refineSelectionSet.refineInfos[h]=o,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}get el(){return a(this)}};x.style=':host{display:block}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.border{outline:1px solid var(--calcite-color-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:var(--calcite-color-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110,110,110,.3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110,110,110,.3)}.display-flex{display:flex}.font-bold{font-weight:bold}.width-full{width:100%}.label-margin-0{--calcite-label-margin-bottom:0}.padding-start-1-2{padding-inline-start:0.5rem}.font-weight-500{font-weight:500}.word-wrap-anywhere{word-wrap:anywhere}';export{_ as map_select_tools,P as pdf_download,x as refine_selection}