@esri/solutions-components 0.10.7 → 0.10.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +24 -8
  2. package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
  3. package/dist/cjs/calcite-combobox_3.cjs.entry.js +354 -967
  4. package/dist/cjs/calcite-graph_2.cjs.entry.js +1082 -0
  5. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +6 -6
  6. package/dist/cjs/calcite-tree_3.cjs.entry.js +1 -1
  7. package/dist/cjs/card-manager_3.cjs.entry.js +246 -18
  8. package/dist/cjs/crowdsource-manager.cjs.entry.js +171 -50
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  11. package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
  12. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  13. package/dist/cjs/refine-results-flow-item.cjs.entry.js +1 -1
  14. package/dist/cjs/share-item.cjs.entry.js +1 -1
  15. package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
  16. package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
  17. package/dist/cjs/solutions-components.cjs.js +1 -1
  18. package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
  19. package/dist/collection/assets/t9n/crowdsource-manager/resources.json +5 -1
  20. package/dist/collection/assets/t9n/crowdsource-manager/resources_en.json +5 -1
  21. package/dist/collection/assets/t9n/layer-table/resources.json +1 -0
  22. package/dist/collection/assets/t9n/layer-table/resources_en.json +1 -0
  23. package/dist/collection/assets/t9n/map-card/resources.json +6 -1
  24. package/dist/collection/assets/t9n/map-card/resources_en.json +6 -1
  25. package/dist/collection/components/card-manager/card-manager.js +34 -8
  26. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +176 -84
  27. package/dist/collection/components/layer-table/layer-table.js +175 -8
  28. package/dist/collection/components/map-card/map-card.css +4 -0
  29. package/dist/collection/components/map-card/map-card.js +368 -3
  30. package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
  31. package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
  32. package/dist/collection/components/map-layer-picker/map-layer-picker.js +9 -3
  33. package/dist/collection/components/map-legend/map-legend.js +1 -1
  34. package/dist/collection/components/map-picker/map-picker.css +8 -0
  35. package/dist/collection/components/map-picker/map-picker.js +74 -3
  36. package/dist/collection/components/map-search/map-search.js +1 -1
  37. package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
  38. package/dist/collection/components/map-tools/map-tools.js +1 -1
  39. package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
  40. package/dist/collection/components/pdf-download/pdf-download.js +1 -1
  41. package/dist/collection/components/public-notification/public-notification.js +1 -1
  42. package/dist/collection/components/refine-results-flow-item/refine-results-flow-item.js +1 -1
  43. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  44. package/dist/collection/components/share-item/share-item.js +1 -1
  45. package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
  46. package/dist/collection/components/solution-contents/solution-contents.js +1 -1
  47. package/dist/collection/components/solution-item/solution-item.js +1 -1
  48. package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
  49. package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
  50. package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
  51. package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
  52. package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
  53. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
  54. package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
  55. package/dist/collection/components/solution-variables/solution-variables.js +1 -1
  56. package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
  57. package/dist/collection/demos/crowdsource-manager.html +1 -0
  58. package/dist/components/card-manager2.js +20 -8
  59. package/dist/components/crowdsource-manager.js +175 -55
  60. package/dist/components/layer-table2.js +72 -10
  61. package/dist/components/map-card2.js +288 -47
  62. package/dist/components/map-draw-tools2.js +1 -1
  63. package/dist/components/map-fullscreen2.js +1 -1
  64. package/dist/components/map-layer-picker2.js +9 -3
  65. package/dist/components/map-legend2.js +1 -1
  66. package/dist/components/map-picker2.js +24 -5
  67. package/dist/components/map-search2.js +1 -1
  68. package/dist/components/map-select-tools2.js +1 -1
  69. package/dist/components/map-tools2.js +1 -1
  70. package/dist/components/pci-calculator.js +1 -1
  71. package/dist/components/pdf-download2.js +1 -1
  72. package/dist/components/public-notification.js +1 -1
  73. package/dist/components/refine-results-flow-item.js +1 -1
  74. package/dist/components/refine-selection2.js +1 -1
  75. package/dist/components/share-item.js +1 -1
  76. package/dist/components/solution-configuration.js +3 -3
  77. package/dist/components/solution-contents2.js +1 -1
  78. package/dist/components/solution-item-details2.js +1 -1
  79. package/dist/components/solution-item-icon2.js +1 -1
  80. package/dist/components/solution-item-sharing2.js +1 -1
  81. package/dist/components/solution-item2.js +1 -1
  82. package/dist/components/solution-organization-variables2.js +1 -1
  83. package/dist/components/solution-resource-item2.js +1 -1
  84. package/dist/components/solution-spatial-ref2.js +1 -1
  85. package/dist/components/solution-template-data2.js +1 -1
  86. package/dist/components/solution-variables2.js +1 -1
  87. package/dist/components/spatial-ref.js +1 -1
  88. package/dist/esm/basemap-gallery_7.entry.js +24 -8
  89. package/dist/esm/buffer-tools_3.entry.js +1 -1
  90. package/dist/esm/calcite-combobox_3.entry.js +369 -982
  91. package/dist/esm/calcite-graph_2.entry.js +1077 -0
  92. package/dist/esm/calcite-shell-panel_14.entry.js +6 -6
  93. package/dist/esm/calcite-tree_3.entry.js +1 -1
  94. package/dist/esm/card-manager_3.entry.js +248 -20
  95. package/dist/esm/crowdsource-manager.entry.js +172 -51
  96. package/dist/esm/loader.js +1 -1
  97. package/dist/esm/map-select-tools_3.entry.js +3 -3
  98. package/dist/esm/pci-calculator.entry.js +1 -1
  99. package/dist/esm/public-notification.entry.js +1 -1
  100. package/dist/esm/refine-results-flow-item.entry.js +1 -1
  101. package/dist/esm/share-item.entry.js +1 -1
  102. package/dist/esm/solution-configuration.entry.js +3 -3
  103. package/dist/esm/solution-contents_3.entry.js +3 -3
  104. package/dist/esm/solutions-components.js +1 -1
  105. package/dist/esm/spatial-ref.entry.js +1 -1
  106. package/dist/solutions-components/assets/t9n/crowdsource-manager/resources.json +5 -1
  107. package/dist/solutions-components/assets/t9n/crowdsource-manager/resources_en.json +5 -1
  108. package/dist/solutions-components/assets/t9n/layer-table/resources.json +1 -0
  109. package/dist/solutions-components/assets/t9n/layer-table/resources_en.json +1 -0
  110. package/dist/solutions-components/assets/t9n/map-card/resources.json +6 -1
  111. package/dist/solutions-components/assets/t9n/map-card/resources_en.json +6 -1
  112. package/dist/solutions-components/demos/crowdsource-manager.html +1 -0
  113. package/dist/solutions-components/p-0abc1354.entry.js +6 -0
  114. package/dist/solutions-components/p-0f7b5d36.entry.js +6 -0
  115. package/dist/solutions-components/{p-a9818be2.entry.js → p-20c465e9.entry.js} +1 -1
  116. package/dist/solutions-components/{p-db18bce8.entry.js → p-36b50b5b.entry.js} +1 -1
  117. package/dist/solutions-components/{p-85512ae3.entry.js → p-445213cf.entry.js} +1 -1
  118. package/dist/solutions-components/{p-d49f895d.entry.js → p-4a5f0a97.entry.js} +1 -1
  119. package/dist/solutions-components/{p-002c97df.entry.js → p-5d201016.entry.js} +1 -1
  120. package/dist/solutions-components/{p-b7cec3bd.entry.js → p-618bafec.entry.js} +1 -1
  121. package/dist/solutions-components/p-6a66d5a9.entry.js +6 -0
  122. package/dist/solutions-components/p-71a2d5b8.entry.js +6 -0
  123. package/dist/solutions-components/p-7a64b026.entry.js +17 -0
  124. package/dist/solutions-components/p-7d514d7f.entry.js +6 -0
  125. package/dist/solutions-components/p-85c25564.entry.js +6 -0
  126. package/dist/solutions-components/{p-235bf02e.entry.js → p-913413c3.entry.js} +1 -1
  127. package/dist/solutions-components/{p-49aa2929.entry.js → p-bebd4646.entry.js} +1 -1
  128. package/dist/solutions-components/p-ce454f5a.entry.js +11 -0
  129. package/dist/solutions-components/solutions-components.esm.js +1 -1
  130. package/dist/types/components/card-manager/card-manager.d.ts +11 -0
  131. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +88 -22
  132. package/dist/types/components/layer-table/layer-table.d.ts +30 -0
  133. package/dist/types/components/map-card/map-card.d.ts +124 -0
  134. package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +4 -0
  135. package/dist/types/components/map-picker/map-picker.d.ts +12 -0
  136. package/dist/types/components.d.ts +130 -8
  137. package/dist/types/preact.d.ts +4 -2
  138. package/package.json +5 -5
  139. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +0 -453
  140. package/dist/esm/calcite-dropdown-group_2.entry.js +0 -448
  141. package/dist/solutions-components/p-129fd80e.entry.js +0 -6
  142. package/dist/solutions-components/p-3b426576.entry.js +0 -6
  143. package/dist/solutions-components/p-72b217f2.entry.js +0 -6
  144. package/dist/solutions-components/p-8b999a2b.entry.js +0 -6
  145. package/dist/solutions-components/p-973ff7b2.entry.js +0 -23
  146. package/dist/solutions-components/p-a001f9c9.entry.js +0 -6
  147. package/dist/solutions-components/p-c683b3fe.entry.js +0 -6
  148. package/dist/solutions-components/p-e9d049bd.entry.js +0 -6
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as e,g as a,h as i,H as t}from"./p-f4c4a2b7.js";import{c as l}from"./p-747d4b59.js";const s=class{constructor(a){e(this,a),this.showAddDeduct=!1}get el(){return a(this)}_deductValuesElement;render(){const e=this.showAddDeduct?"position-relative":"display-none";return i(t,{key:"9bc609be932ec1285dcdc2dc3b6336a36494c9f9"},i("div",{key:"9b64b3fdc3bf3e0265eb544e540c8c32eed8ec9e",class:this.showAddDeduct?"display-none":"display-grid"},i("div",{key:"de7e6a9b213cfb28fcea5c609e664635abf8b782",class:"label-display"},i("calcite-label",{key:"e9af278421644f6d23b8b07e3e116affaa576c07",class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),i("div",{key:"0703cf731b5497a09cc6bb54c5e18a63ea2ba244"},this._getCalculateButton())),i("div",{key:"bd32e040f6d3789987c53a94484e7aeebc6b82b1",class:e},i("div",{key:"8f977910db0578ebfc8ea79a19b664e109aba266",class:"position-right"},i("calcite-action",{key:"a624606534ff220a97a05aa7cb4f22d4c8bb6ddc",appearance:"transparent",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),i("deduct-calculator",{key:"0b327b89377b88ec2b11065c6f3ecb4b582ef7e4",class:"display-grid padding-top-1",onDeductValueComplete:e=>this._addDeductValue(e)})))}_getDeductValuesInput(){return i("div",{class:"display-flex"},i("calcite-input",{class:"main-input",ref:e=>{this._deductValuesElement=e}}),i("calcite-action",{appearance:"transparent",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return i("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(e){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${e.detail}`:e.detail}_calculatePCI(e){const a=l(e,!0),i=a<=10?"Failed":a<=25?"Serious":a<=40?"Very Poor":a<=55?"Poor":a<=70?"Fair":a<=85?"Satisfactory":"Good";console.log(`PCI: ${a}`),console.log(`Rating: ${i}`),alert("See debug console for results")}};s.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{s as pci_calculator}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as s,g as e,h as a,H as r}from"./p-f4c4a2b7.js";const t=class{constructor(e){s(this,e)}get el(){return e(this)}render(){return a(r,{key:"fb0d98cfbbb4becfc168d715f6198a3923f58e03"},a("slot",{key:"7d8d7644cd59654a081c22b696790aaf8c493ade"}))}};t.style=":host{display:block}";export{t as share_item}
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as t,f as i,h as e,g as a,c as s,H as l}from"./p-f4c4a2b7.js";import{g as h}from"./p-0ae5f8fe.js";import{c as n}from"./p-2327029a.js";import{i as r,v as o}from"./p-8448b98b.js";import{c,d,a as m,H as u}from"./p-7c585a72.js";import{c as b,d as p,u as f,I as g}from"./p-ec561560.js";import{i as v}from"./p-4250bde1.js";import{c as x,d as k,g as _}from"./p-d7ee860a.js";import{s as $,a as y,c as w}from"./p-f83c0ef6.js";import{n as M,c as z,d as V}from"./p-16d69510.js";import{d as L,c as H}from"./p-33447b6f.js";import"./p-73ae4b9b.js";import"./p-a8e556aa.js";import"./p-bb3ce613.js";
7
+ /*!
8
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
+ * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
10
+ * v2.11.1
11
+ */function j(t,i,e){const a=i[0]-t[0];return a?(3*(i[1]-t[1])/a-e)/2:e}function X(t,i,e,a,s){const[l,h]=t,[n,r]=i,o=(n-l)/3;return`C ${s([l+o,h+o*e]).join(",")} ${s([n-o,r-o*a]).join(",")} ${s([n,r]).join(",")}`}const T=class{constructor(e){t(this,e),this.graphId=`calcite-graph-${h()}`,this.resizeObserver=n("resize",(()=>i(this))),this.data=[],this.colorStops=void 0,this.highlightMin=void 0,this.highlightMax=void 0,this.min=void 0,this.max=void 0}connectedCallback(){this.resizeObserver?.observe(this.el)}disconnectedCallback(){this.resizeObserver?.disconnect()}render(){const{data:t,colorStops:i,el:a,highlightMax:s,highlightMin:l,min:h,max:n}=this,r=this.graphId,{clientHeight:o,clientWidth:c}=a;if(!t||0===t.length)return e("svg",{"aria-hidden":"true",class:"svg",height:o,preserveAspectRatio:"none",viewBox:`0 0 ${c} ${o}`,width:c});const{min:d,max:m}=function(t){const[i,e]=t[0];return t.reduce((({min:t,max:i},[e,a])=>({min:[Math.min(t[0],e),Math.min(t[1],a)],max:[Math.max(i[0],e),Math.max(i[1],a)]})),{min:[i,e],max:[i,e]})}(t);let u=d,b=m;(h<d[0]||h>d[0])&&(u=[h,0]),(n>m[0]||n<m[0])&&(b=[n,m[1]]);const p=function({width:t,height:i,min:e,max:a}){const s=a[0]-e[0],l=a[1]-e[1];return a=>[(a[0]-e[0])/s*t,i-a[1]/l*i]}({min:u,max:b,width:c,height:o}),[f]=p([l,b[1]]),[g]=p([s,b[1]]),v=function({data:t,min:i,max:e,t:a}){if(0===t.length)return"";const[s,l]=a(t[0]),[h,n]=a(i),[r]=a(e);let o,c,d;const m=t.reduce(((i,e,s)=>{if(c=t[s-2],d=t[s-1],s>1){const t=function(t,i,e){const a=i[0]-t[0],s=e[0]-i[0],l=(i[1]-t[1])/(a||s<0&&0),h=(e[1]-i[1])/(s||a<0&&0),n=(l*s+h*a)/(a+s);return(Math.sign(l)+Math.sign(h))*Math.min(Math.abs(l),Math.abs(h),.5*Math.abs(n))||0}(c,d,e),s=void 0===o?j(c,d,t):o,l=X(c,d,s,t,a);return o=t,`${i} ${l}`}return i}),`M ${h},${n} L ${h},${l} L ${s},${l}`),u=t[t.length-1];return`${m} ${X(d,u,o,j(d,u,o),a)} L ${r},${n} Z`}({data:t,min:d,max:m,t:p}),x=i?`url(#linear-gradient-${r})`:void 0;return e("svg",{"aria-hidden":"true",class:"svg",height:o,preserveAspectRatio:"none",viewBox:`0 0 ${c} ${o}`,width:c},i?e("defs",null,e("linearGradient",{id:`linear-gradient-${r}`,x1:"0",x2:"1",y1:"0",y2:"0"},i.map((({offset:t,color:i,opacity:a})=>e("stop",{offset:100*t+"%","stop-color":i,"stop-opacity":a}))))):null,void 0!==l?[e("mask",{height:"100%",id:`${r}1`,width:"100%",x:"0%",y:"0%"},e("path",{d:`\n M 0,0\n L ${f-1},0\n L ${f-1},${o}\n L 0,${o}\n Z\n `,fill:"white"})),e("mask",{height:"100%",id:`${r}2`,width:"100%",x:"0%",y:"0%"},e("path",{d:`\n M ${f+1},0\n L ${g-1},0\n L ${g-1},${o}\n L ${f+1}, ${o}\n Z\n `,fill:"white"})),e("mask",{height:"100%",id:`${r}3`,width:"100%",x:"0%",y:"0%"},e("path",{d:`\n M ${g+1},0\n L ${c},0\n L ${c},${o}\n L ${g+1}, ${o}\n Z\n `,fill:"white"})),e("path",{class:"graph-path",d:v,fill:x,mask:`url(#${r}1)`}),e("path",{class:"graph-path--highlight",d:v,fill:x,mask:`url(#${r}2)`}),e("path",{class:"graph-path",d:v,fill:x,mask:`url(#${r}3)`})]:e("path",{class:"graph-path",d:v,fill:x}))}get el(){return a(this)}};T.style=":host{display:block;block-size:100%}.svg{fill:currentColor;stroke:transparent;margin:0px;display:block;block-size:100%;inline-size:100%;padding:0px}.svg .graph-path--highlight{fill:var(--calcite-color-brand);opacity:0.5}: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/dev/LICENSE.md for details.
15
+ * v2.11.1
16
+ */
17
+ const D="container",C="container--range",S="hyphen",I="hyphen--wrap",A="thumb",F="thumb--active",P="thumb--minValue",R="thumb--precise",O="thumb--value",W="tick",N="tick--active",U="tick__label",B="tick__label--max",Z="tick__label--min";function G(t){return Array.isArray(t)}const E=class{constructor(i){t(this,i),this.calciteSliderInput=s(this,"calciteSliderInput",6),this.calciteSliderChange=s(this,"calciteSliderChange",6),this.handleKeyDown=t=>{const i=this.shouldMirror(),{activeProp:e,max:a,min:s,pageStep:l,step:h}=this,n=this[e],{key:r}=t;if(v(r))return void t.preventDefault();let o;if("ArrowUp"===r||"ArrowRight"===r?o=n+h*(i&&"ArrowRight"===r?-1:1):"ArrowDown"===r||"ArrowLeft"===r?o=n-h*(i&&"ArrowLeft"===r?-1:1):"PageUp"===r?l&&(o=n+l):"PageDown"===r?l&&(o=n-l):"Home"===r?o=s:"End"===r&&(o=a),isNaN(o))return;t.preventDefault();const c=Number(o.toFixed(L(h)));this.setValue({[e]:this.clamp(c,e)})},this.activeProp="value",this.guid=`calcite-slider-${h()}`,this.onThumbBlur=()=>{this.activeProp=null},this.onThumbFocus=t=>{this.activeProp=t.currentTarget.getAttribute("data-value-prop")},this.onThumbPointerDown=t=>{this.pointerDownDragStart(t,t.currentTarget.getAttribute("data-value-prop"))},this.onTrackPointerDown=t=>{this.pointerDownDragStart(t,"minMaxValue")},this.dragUpdate=t=>{if(!this.disabled&&(t.preventDefault(),this.dragProp)){const i=this.translate(t.clientX||t.pageX);if(G(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const t=i-this.minValueDragRange,e=i+this.maxValueDragRange;e<=this.max&&t>=this.min&&e-t===this.minMaxValueRange&&this.setValue({minValue:this.clamp(t,"minValue"),maxValue:this.clamp(e,"maxValue")})}else this.minValueDragRange=i-this.minValue,this.maxValueDragRange=this.maxValue-i,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(i,this.dragProp)})}},this.pointerUpDragEnd=t=>{!this.disabled&&r(t)&&this.dragEnd(t)},this.dragEnd=t=>{this.disabled||(this.removeDragListeners(),this.focusActiveHandle(t.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null)},this.storeTrackRef=t=>{this.trackEl=t},this.storeThumbRef=t=>{t&&("minValue"===t.getAttribute("data-value-prop")?this.minHandle=t:this.maxHandle=t)},this.formatValue=t=>(M.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},M.localize(t.toString())),this.disabled=!1,this.fillPlacement="start",this.form=void 0,this.groupSeparator=!1,this.hasHistogram=!1,this.histogram=void 0,this.histogramStops=void 0,this.labelHandles=!1,this.labelFormatter=void 0,this.labelTicks=!1,this.max=100,this.maxLabel=void 0,this.maxValue=void 0,this.min=0,this.minLabel=void 0,this.minValue=void 0,this.mirrored=!1,this.name=void 0,this.numberingSystem=void 0,this.pageStep=void 0,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.ticks=void 0,this.value=0,this.scale="m",this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[]}histogramWatcher(t){this.hasHistogram=!!t}ticksWatcher(){this.tickValues=this.generateTickValues()}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){b(this),z(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),x(this),c(this)}disconnectedCallback(){p(this),k(this),d(this),V(this),this.removeDragListeners()}componentWillLoad(){$(this),G(this.value)||(this.value=this.snap?this.getClosestStep(this.value):this.clamp(this.value)),this.ticksWatcher(),this.histogramWatcher(this.histogram),m(this,this.value)}componentDidLoad(){y(this)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),G(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),f(this)}render(){const t=this.el.id||this.guid,i=G(this.value)?this.maxValue:this.value,a=this.minValue||this.min,s=this.shouldUseMinValue(),h=100*this.getUnitInterval(s?this.minValue:a),n=100*this.getUnitInterval(i),r=this.shouldMirror(),o=G(this.value),c=this.buildThumbType("max"),d=this.renderThumb({type:c,thumbPlacement:c.includes("histogram")?"below":"above",maxInterval:n,minInterval:h,mirror:r}),m=this.buildThumbType("min"),b=o&&this.renderThumb({type:m,thumbPlacement:m.includes("histogram")||m.includes("precise")?"below":"above",maxInterval:n,minInterval:h,mirror:r}),p=o?"start":this.fillPlacement,f="none"===p?{left:"unset",right:"unset"}:"end"===p?{left:`${r?h:n}%`,right:`${r?n:h}%`}:{left:`${r?100-n:h}%`,right:`${r?h:100-n}%`};return e(l,{key:"345553b84f2336fe5a98bb2b3050d137130c41ef",id:t,onKeyDown:this.handleKeyDown,onTouchStart:this.handleTouchStart},e(g,{key:"0d9db31db94152095071d9ff40dbf3cf8ba685d6",disabled:this.disabled},e("div",{key:"767ab1401000b02717013231c935fe1747def1b3","aria-label":_(this),class:{[D]:!0,[C]:o,[`scale--${this.scale}`]:!0}},this.renderGraph(),e("div",{key:"1a104ad97079f71d37efea9d933f364520d49397",class:"track",ref:this.storeTrackRef},e("div",{key:"84f8033505dc0f373a0d19a641886e49ca4fe732",class:"track__range",onPointerDown:this.onTrackPointerDown,style:f}),e("div",{key:"79f89b93a6acbb05ffce09bd2aa34ef134b3e219",class:"ticks"},this.tickValues.map((t=>{const l=100*this.getUnitInterval(t)+"%";let h=!1;return"start"!==p&&"end"!==p||(h=s?t>=this.minValue&&t<=this.maxValue:t>=("start"===p?a:i)&&t<=("start"===p?i:this.max)),e("span",{class:{[W]:!0,[N]:h},style:{left:r?"":l,right:r?l:""}},this.renderTickLabel(t))})))),e("div",{key:"9bc6ea406e2036adb87da4a6053533283434864d",class:"thumb-container"},b,d,e(u,{key:"c13236898b527a1ffc058914fe87e6004b93aaf5",component:this})))))}renderThumb({type:t,mirror:i,thumbPlacement:a,minInterval:s,maxInterval:l}){const h=t.includes("labeled"),n=t.includes("precise"),r=t.includes("min"),o=G(this.value),c=r?this.minValue:o?this.maxValue:this.value,d=r?"minValue":o?"maxValue":"value",m=r?this.minLabel:o?this.maxLabel:this.minLabel,u=r?this.minValue:c,b="minValue"===d?this.internalLabelFormatter(this.minValue,"min"):"maxValue"===d?this.internalLabelFormatter(this.maxValue,"max"):this.internalLabelFormatter(c,"value"),p=r?{left:`${i?100-s:s}%`}:{right:`${i?l:100-l}%`},f="handle__label "+(r?"handle__label--minValue":"handle__label--value"),g=[...h?[e("span",{"aria-hidden":"true",class:f},b),e("span",{"aria-hidden":"true",class:`${f} static`},b),e("span",{"aria-hidden":"true",class:`${f} transformed`},b)]:[],e("div",{class:"handle"}),n&&e("div",{class:"handle-extension"})];return"below"===a&&g.reverse(),e("div",{"aria-disabled":this.disabled,"aria-label":m,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":u,class:{[A]:!0,[O]:!r,[F]:"minMaxValue"!==this.lastDragProp&&this.dragProp===d,[R]:n,[P]:r},"data-value-prop":d,key:t,onBlur:this.onThumbBlur,onFocus:this.onThumbFocus,onPointerDown:this.onThumbPointerDown,ref:this.storeThumbRef,role:"slider",style:p,tabIndex:0},g)}renderGraph(){return this.histogram?e("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:G(this.value)?this.maxValue:this.value,highlightMin:G(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(t){const{hasHistogram:i,labelHandles:a,labelTicks:s,max:l,min:h,precise:n,value:r}=this,o=G(r),c=t===h,d=t===l,m=c||d;return!s||(i||!m&&n&&o)&&(!i||!m&&(n||a))?null:e("span",{class:{[U]:!0,[Z]:c,[B]:d}},this.internalLabelFormatter(t,"tick"))}pointerDownHandler(t){if(this.disabled||!r(t))return;const i=t.clientX||t.pageX,e=this.translate(i);let a="value";G(this.value)&&(a=e>=this.minValue&&e<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-e)<Math.abs(this.minValue-e)||e>=this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(`.${A}:active`)||this.setValue({[a]:this.clamp(e,a)}),this.focusActiveHandle(i)}handleTouchStart(t){t.preventDefault()}async setFocus(){await w(this);const t=this.minHandle?this.minHandle:this.maxHandle;t?.focus()}buildThumbType(t){const i=[t];return this.labelHandles&&i.push("labeled"),this.precise&&i.push("precise"),this.hasHistogram&&i.push("histogram"),i.join("-")}setValueFromMinMax(){const{minValue:t,maxValue:i}=this;"number"==typeof t&&"number"==typeof i&&(this.value=[t,i])}setMinMaxFromValue(){const{value:t}=this;G(t)&&(this.minValue=t[0],this.maxValue=t[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!G(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}getTickDensity(){const t=(this.max-this.min)/this.ticks/250;return t<1?1:t}generateTickValues(){const t=this.ticks??0;if(t<=0)return[];const i=[this.min],e=t*this.getTickDensity();let a=this.min;for(;a<this.max;)a+=e,i.push(Math.min(a,this.max));return i.includes(this.max)||i.push(this.max),i}pointerDownDragStart(t,i){r(t)&&this.dragStart(i)}dragStart(t){this.dragProp=t,this.lastDragProp=this.dragProp,this.activeProp=t,window.addEventListener("pointermove",this.dragUpdate),window.addEventListener("pointerup",this.pointerUpDragEnd),window.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(t){"minValue"===this.dragProp?this.minHandle.focus():"maxValue"===this.dragProp||"value"===this.dragProp?this.maxHandle.focus():"minMaxValue"===this.dragProp&&this.getClosestHandle(t).focus()}emitInput(){this.calciteSliderInput.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){window.removeEventListener("pointermove",this.dragUpdate),window.removeEventListener("pointerup",this.pointerUpDragEnd),window.removeEventListener("pointercancel",this.dragEnd)}setValue(t){let i;Object.keys(t).forEach((e=>{const a=t[e];i||(i=this[e]!==a),this[e]=a})),i&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(t,i){return t=H(t,this.min,this.max),"maxValue"===i&&(t=Math.max(t,this.minValue)),"minValue"===i&&(t=Math.min(t,this.maxValue)),t}translate(t){const i=this.max-this.min,{left:e,width:a}=this.trackEl.getBoundingClientRect(),s=(t-e)/a,l=this.shouldMirror(),h=this.clamp(this.min+i*(l?1-s:s)),n=Number(h.toFixed(L(this.step)));return this.snap&&this.step?this.getClosestStep(n):n}getClosestStep(t){const{max:i,min:e,step:a}=this;let s=Math.floor((t-e)/a)*a+e;return s=Math.min(Math.max(s,e),i),s>i&&(s-=a),s}getClosestHandle(t){return this.getDistanceX(this.maxHandle,t)>this.getDistanceX(this.minHandle,t)?this.minHandle:this.maxHandle}getDistanceX(t,i){return Math.abs(t.getBoundingClientRect().left-i)}getFontSizeForElement(t){return Number(window.getComputedStyle(t).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(t){return((t=this.clamp(t))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(t){const i=this.el.shadowRoot.querySelector(`.handle__label--${t}`),e=this.el.shadowRoot.querySelector(`.handle__label--${t}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${t}.transformed`),s=e.getBoundingClientRect(),l=this.getHostOffset(s.left,s.right);i.style.transform=`translateX(${l}px)`,a.style.transform=`translateX(${l}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:t}=this.el,i=this.shouldMirror(),e=i?"value":"minValue",a=i?"minValue":"value",s=t.querySelector(`.handle__label--${e}`),l=t.querySelector(`.handle__label--${e}.static`),h=t.querySelector(`.handle__label--${e}.transformed`),n=this.getHostOffset(l.getBoundingClientRect().left,l.getBoundingClientRect().right),r=t.querySelector(`.handle__label--${a}`),o=t.querySelector(`.handle__label--${a}.static`),c=t.querySelector(`.handle__label--${a}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),m=this.getFontSizeForElement(s),u=this.getRangeLabelOverlap(h,c),b=s,p=m/2;if(u>0){if(b.classList.add(S,I),0===d&&0===n){let t=u/2-p;t=-1===Math.sign(t)?Math.abs(t):-t;const i=this.getHostOffset(h.getBoundingClientRect().left+t-p,h.getBoundingClientRect().right+t-p);let e=u/2;const a=this.getHostOffset(c.getBoundingClientRect().left+e,c.getBoundingClientRect().right+e);0!==i&&(t+=i,e+=i),0!==a&&(t+=a,e+=a),s.style.transform=`translateX(${t}px)`,h.style.transform=`translateX(${t-p}px)`,r.style.transform=`translateX(${e}px)`,c.style.transform=`translateX(${e}px)`}else if(n>0||d>0)s.style.transform=`translateX(${n+p}px)`,r.style.transform=`translateX(${u+d}px)`,c.style.transform=`translateX(${u+d}px)`;else if(n<0||d<0){let t=Math.abs(n)+u-p;t=-1===Math.sign(t)?Math.abs(t):-t,s.style.transform=`translateX(${t}px)`,h.style.transform=`translateX(${t-p}px)`}}else b.classList.remove(S,I),s.style.transform=`translateX(${n}px)`,h.style.transform=`translateX(${n}px)`,r.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const t=G(this.value);if(!(this.hasHistogram||t||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!t&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!t&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!t&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&t&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const i=this.el.shadowRoot.querySelector(`.${P}`),e=this.el.shadowRoot.querySelector(`.${O}`),a=this.el.shadowRoot.querySelector(`.${Z}`),s=this.el.shadowRoot.querySelector(`.${B}`);!i&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,e)?"0":"1"),i&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,i)||this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,i)||this.isMaxTickLabelObscured(s,e)&&this.hasHistogram?"0":"1")}getHostOffset(t,i){const e=this.el.getBoundingClientRect();return t+7<e.left?e.left-t-7:i-7>e.right?7-(i-e.right):0}getRangeLabelOverlap(t,i){const e=t.getBoundingClientRect(),a=i.getBoundingClientRect(),s=this.getFontSizeForElement(t);return Math.max(e.right+s-a.left,0)}isMinTickLabelObscured(t,i){const e=t.getBoundingClientRect(),a=i.getBoundingClientRect();return o(e,a)}isMaxTickLabelObscured(t,i){const e=t.getBoundingClientRect(),a=i.getBoundingClientRect();return o(e,a)}internalLabelFormatter(t,i){const e=this.labelFormatter;if(!e)return this.formatValue(t);const a=e(t,i,this.formatValue);return null==a?this.formatValue(t):a}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{histogram:["histogramWatcher"],ticks:["ticksWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};E.style='@charset "UTF-8";: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}.scale--s{--calcite-slider-handle-size:0.625rem;--calcite-slider-handle-extension-height:0.4rem;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:0.875rem;--calcite-slider-handle-extension-height:0.5rem;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:1rem;--calcite-slider-handle-extension-height:0.65rem;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n );touch-action:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-color-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.375rem}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.5rem}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.55rem}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-color-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-color-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-color-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-color-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-color-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-focus-color, 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 )}.thumb:focus .handle-extension{background-color:var(--calcite-color-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-0.125rem}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.4375rem}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.875rem}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-2rem}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-2.075rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-2.75rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-3.0625rem}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-color-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise::after,.thumb:focus.thumb--precise::after,.thumb--active.thumb--precise::after{background-color:var(--calcite-color-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-color-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-color-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range::after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-color-border-input);border-color:var(--calcite-color-foreground-1);inset-block-start:-2px;pointer-events:none;margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-color-brand)}.tick__label{pointer-events:none;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-3)}.graph{color:var(--calcite-color-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}';export{T as calcite_graph,E as calcite_slider}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as t,c as i,g as e,h as s,H as o,F as h}from"./p-f4c4a2b7.js";import{g as l}from"./p-d7868dd4.js";import{E as a}from"./p-80cb7c73.js";import{g as n}from"./p-eb483242.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const d=class{constructor(e){t(this,e),this.showIntroductionWindow=i(this,"showIntroductionWindow",7),this.showCoverPage=i(this,"showCoverPage",7),this.appLayout="splitView",this.appProxies=void 0,this.basemapConfig=void 0,this.coverPageEnabled=void 0,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.introductionWindowEnabled=!1,this.enableAutoRefresh=!1,this.enableBasemap=!0,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableHome=!0,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableZoom=!0,this.hideMapOnLoad=!1,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.popupHeaderColor=void 0,this.popupHeaderHoverColor=void 0,this.popupHeaderHoverTextColor=void 0,this.popupHeaderTextColor=void 0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=!0,this.theme="light",this.zoomAndScrollToSelected=!1,this.zoomToScale=void 0,this._enableCreateFeatures=!0,this._hideFooter=!1,this._hideTable=!1,this._isMobile=!1,this._translations=void 0,this._layer=void 0,this._layoutMode=a.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._filterOpen=!1}get el(){return e(this)}_defaultCenterHonored=!1;_defaultLevelHonored=!1;_hideMapOnLoadHonored=!1;_layerTable;_mapChange;_resizeObserver;_shouldSetMapView=!1;_layerExpressions;_filterList;_isMapViewOnLoad=!1;enableZoomWatchHandler(){this._initMapZoom()}hideMapOnLoadWatchHandler(){this.showHideMapPopupAndTable(this.hideMapOnLoad&&!this._isMobile)}showIntroductionWindow;showCoverPage;async featureSelectionChange(t){this._numSelected=t.detail?.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async layerSelectionChange(t){const i=t.detail[0],e=await n(this._mapView,i);await e.when((()=>{this._layer=e,this._initLayerExpressions()}))}async mapInfoChange(){this._hideMapOnLoadHonored=!1}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return s(o,{key:"44041e4854d9d1da0f894c090e4b5455930b7a48"},s("calcite-shell",{key:"f11ed09226e43740677eefe01d42b70329b2485b",class:"position-relative"},s("calcite-panel",{key:"6911478eaf00887e7b1578baba16989395dca190",class:"width-full height-full "+(this.popupHeaderColor&&"#FFFFFF"!==this.popupHeaderColor?"border-width-0":"")},this._getBody(this._layoutMode,this._panelOpen,this._hideTable)),this._getFooter()),this._filterModal())}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,this._mapChange&&await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el),this.hideMapOnLoad&&(this.appLayout="tableView"),this._isMapViewOnLoad="mapView"===this.appLayout,this._setActiveLayout(this.appLayout)}_getFooter(){const t=this._numSelected>0,i=this._layer?.editingEnabled&&this._layer?.capabilities?.operations?.supportsDelete;return this._isMobile&&t&&!this._hideFooter?s("div",{class:"width-100",slot:"footer"},s("div",{class:"display-flex padding-1-2"},s("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),i?s("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer}):void 0)):void 0}_setActiveLayout(t){"splitView"!==t||this._panelOpen||this._toggleLayout(),"mapView"===t?this._showMapInFullView():this._showMapInCardView()}_getDividerIcon(t,i){let e="";switch(t){case a.HORIZONTAL:e=i?"chevrons-up":"chevrons-down";break;case a.VERTICAL:case a.GRID:e=i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i,e){let s="";switch(t){case a.HORIZONTAL:s=(i&&!e?"height-1-2 display-grid":i&&e?"height-full":"height-0")+" width-full position-relative";break;case a.GRID:s="height-full position-relative "+(i?"width-1-3":"width-0");break;case a.VERTICAL:s="height-full position-relative "+(i?"width-1-2":"width-0")}return s}_getTableSizeClass(t,i){let e="";switch(t){case a.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case a.GRID:e=(i?"width-2-3":"width-full")+" height-full display-flex";break;case a.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,i,e){const o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return s("calcite-panel",{class:"width-full height-full"},s("div",{class:"width-full height-full overflow-hidden "+(t===a.HORIZONTAL?"":"display-flex")},this._getMapAndCard(t,i,e),this._getTable(t,i,e)),this.coverPageEnabled&&s("div",{class:"floating-container",onClick:this.coverPageButtonClick.bind(this)},s("calcite-button",{appearance:"solid",class:`floating-button ${o}`,"icon-start":"content-minimal",kind:"neutral",label:"",round:!0,scale:"l","split-child":"primary",width:"auto"})),this.introductionWindowEnabled&&s("div",{class:"floating-container",onClick:this.infoButtonClick.bind(this)},s("calcite-button",{appearance:"solid",class:`floating-button ${o}`,"icon-start":"information-letter",kind:"neutral",label:"",round:!0,scale:"l","split-child":"primary",width:"auto"})))}infoButtonClick(){this.showIntroductionWindow.emit()}coverPageButtonClick(){this.showCoverPage.emit()}_getMapAndCard(t,i,e){const o=this._getMapSizeClass(t,i,e);return s("div",{class:`${o} overflow-hidden`},this._getMapNode(i),this._getPopupExpandNode())}_getMapNode(t){const i="mapView"===this.appLayout,e="tableView"===this.appLayout;return s("div",{class:(i||e?"position-absolute-0":this._layoutMode!==a.HORIZONTAL||this._isMobile&&!t?"adjusted-height-50":"")+" overflow-hidden",id:"card-mapView"},s("map-card",{appProxies:this.appProxies,basemapConfig:this.basemapConfig,class:"width-full",defaultLayerId:this.defaultWebmap&&this.defaultLayer?this.defaultLayer:"",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:!0,hidden:!this._isMobile&&e,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",isMapLayout:i,isMobile:this._isMobile,mapInfo:this._mapInfo,mapInfos:this.mapInfos?.filter((t=>!1!==t.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",onToggleFilter:this._toggleFilter.bind(this),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,selectedFeaturesIds:this._layerTable?.selectedIds,selectedLayer:this._layer,stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"],zoomToScale:this.zoomToScale}))}_getPopupExpandNode(){return s("div",{class:`${this.popupHeaderColor?"":this._isMobile?"calcite-mode-light":"calcite-mode-dark"} height-full ${this._isMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isMobile?"display-none height-0":""}`,style:{"--calcite-color-foreground-1":this.popupHeaderColor,"--calcite-color-foreground-2":this.popupHeaderHoverColor,"--calcite-color-text-3":this.popupHeaderTextColor,"--calcite-color-text-2":this.popupHeaderTextColor}},s("calcite-panel",null,this._isMobile?void 0:s("div",{class:"display-flex align-items-center "+(this._isMobile?"display-none height-0":""),slot:"header-content"},s("calcite-icon",{icon:"information",scale:"s"}),s("div",{class:"padding-inline-start-75"},this._translations.information)),this._getCardNode()))}_getCardNode(){return s("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},s("card-manager",{class:("mapView"===this.appLayout||"tableView"===this.appLayout||this._isMobile?"height-full":"height-50")+" width-full",enableEditGeometry:this?._mapInfo?.enableEditGeometry,isMobile:this._isMobile,layer:this._layer,mapView:this?._mapView,selectedFeaturesIds:this._layerTable?.selectedIds,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,i,e){const o="mapView"===this.appLayout,h="tableView"===this.appLayout,l=e&&this._isMobile?"visibility-hidden":o?"display-none":"",n=o?"height-full width-full":"display-none",d=this._getTableSizeClass(t,i),r=t===a.HORIZONTAL?"horizontal":"vertical",c=t===a.HORIZONTAL?"header":"panel-start",p=this.defaultWebmap&&this.defaultLayer,g=this.defaultGlobalId?this.defaultGlobalId?.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0,u=this.defaultOid?this.defaultOid?.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0;return s("calcite-shell",{class:`${d} border-bottom`},this._isMobile?void 0:s("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:r,slot:c},this.getActions(t,i)),s("div",{class:`width-full height-full position-relative ${l}`},s("layer-table",{createFilterModal:!1,defaultGlobalId:p?g:void 0,defaultLayerId:p?this.defaultLayer:"",defaultOid:p&&!g?u:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this?._mapInfo?.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isMobile,mapHidden:h,mapInfo:this._mapInfo,mapView:this?._mapView,onToggleFilter:this._toggleFilter.bind(this),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:t=>this._layerTable=t,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected,zoomToScale:this.zoomToScale})),s("div",{class:n,id:"full-map-view"}))}getActions(t,i){const e=this._getDividerIcon(t,i),o=i?this._translations.close:this._translations.open,l="toggle-layout";return s(h,null,s("calcite-action",{active:"splitView"===this.appLayout,class:"toggle-node",icon:"browser",id:"browser-action",onClick:()=>{this._changeLayout("splitView")},text:""}),s("calcite-tooltip",{placement:"right","reference-element":"browser-action"},s("span",null,this._translations.splitView)),s("calcite-action",{active:"tableView"===this.appLayout,class:"toggle-node",icon:"dock-left",id:"dock-left-action",onClick:()=>{this._changeLayout("tableView")},text:""}),s("calcite-tooltip",{placement:"right","reference-element":"dock-left-action"},s("span",null,this._translations.tableView)),s("calcite-action",{active:"mapView"===this.appLayout,class:"toggle-node",icon:"browser-map",id:"browser-map-action",onClick:()=>{this._changeLayout("mapView")},text:""}),s("calcite-tooltip",{placement:"right","reference-element":"browser-map-action"},s("span",null,this._translations.mapView)),s("calcite-action",{class:"toggle-node",icon:e,id:l,onClick:()=>this._toggleLayout(),slot:"actions-end",text:""}),s("calcite-tooltip",{placement:"bottom","reference-element":l},s("span",null,o)))}_filterModal(){return s("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},s("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations?.filter?.replace("{{title}}",this._layer?.title)),s("div",{slot:"content"},s("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>this._handleFilterListReset(),onFilterUpdate:()=>{this._layerTable?.filterUpdate()},ref:t=>this._filterList=t,view:this._mapView,zoomBtn:!1})))}_initLayerExpressions(){const t=this._mapInfo?.filterConfig?.layerExpressions;this._layerExpressions=t?t.filter((t=>t.id===this._layer?.id)):[],this._filterList.layerExpressions=this._layerExpressions,this._layerExpressions.filter((t=>t.expressions.filter((t=>t.active)).length>0))}_toggleFilter(){this._filterOpen=!this._filterOpen}_handleFilterListReset(){this._layerTable.filterReset()}async _closeFilter(){this._filterOpen&&(this._filterOpen=!1,this._layerTable.closeFilter())}_onResize(){const t=this.el.offsetWidth<1024,i=!this._isMobile&&t;this._isMobile=t,this._layoutMode=this._isMobile?a.HORIZONTAL:a.GRID,i&&(this._panelOpen=!0),(this.hideMapOnLoad&&!this._hideMapOnLoadHonored||this._isMobile)&&this.hideMapOnLoadWatchHandler()}_toggleLayout(){this._panelOpen=!this._panelOpen}_changeLayout(t){this.appLayout!==t&&(this._setActiveLayout(t),this.appLayout=t,this._isMapViewOnLoad&&(this._layerTable.refresh(),this._isMapViewOnLoad=!1))}_showMapInCardView(){if("mapView"===this.appLayout){const t=document.getElementById("full-map-view").childNodes[0],i=document.getElementById("card-mapView");t&&i.appendChild(t)}}_showMapInFullView(){const t=document.getElementById("card-mapView").childNodes[0],i=document.getElementById("full-map-view");t&&i.appendChild(t)}showHideMapPopupAndTable(t){this._hideTable=t,this._hideFooter=t}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),{...i}}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._enableCreateFeatures=this._mapInfo.enableCreateFeatures,this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1;const t=!this.defaultCenter||this._defaultCenterHonored?void 0:this.defaultCenter?.split(";").map((t=>parseFloat(t))),i=!this.defaultLevel||this._defaultLevelHonored?void 0:parseInt(this.defaultLevel,10);t&&i&&(await this._mapView.goTo({center:t,zoom:i}),this._defaultCenterHonored=!0,this._defaultLevelHonored=!0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}static get watchers(){return{enableZoom:["enableZoomWatchHandler"],hideMapOnLoad:["hideMapOnLoadWatchHandler"]}}};d.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}";export{d as crowdsource_manager}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as e,g as s,h as r,H as t}from"./p-f4c4a2b7.js";const a=class{constructor(s){e(this,s)}get el(){return s(this)}render(){return r(t,{key:"301d721cbe276288d621e0cd3a54ee5558dea76a"},r("slot",{key:"d8d933a33826d99e7455b6fb4d55e93320f09c96"}))}};a.style=":host{display:block}";export{a as refine_results_flow_item}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as i,g as s,a as e,h as a,H as l}from"./p-f4c4a2b7.js";import{b as o,c as n,a as h}from"./p-80cb7c73.js";import{l as c,g as r}from"./p-d7868dd4.js";import{e as d,h as p}from"./p-eb483242.js";import{s as g}from"./p-122a81b5.js";import{c as b,r as m}from"./p-4b3cc01f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dcc35070.js";import"./p-9fe07c30.js";import"./p-badcaf04.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.enableLayerFeatures=!0,this.enableSearchDistance=!0,this.enableSketchTools=!0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.locale=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}get el(){return s(this)}_activeSelection;_downloadTools;_geometryEngine;Graphic;_jsonUtils;_onboardingImageUrl="";_popupsEnabled;_removeDuplicates;_searchConfiguration;_selectTools;_mediaQuery;_titleElement;_titleValue=void 0;_numSelected=0;async mapViewWatchHandler(t){t?.popup&&(this._popupsEnabled=t?.popup.autoOpenEnabled),this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);this.mapView&&(s!==JSON.stringify(i)||s&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){if(this._checkPopups(),this.mapView?.popup&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),i===n.EXPORT&&this._removeExportGraphics(),t!==n.SELECT)return this._highlightFeatures()}searchConfigurationChange;selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=e("../solutions-components/assets/data/images/onboarding.png")}render(){return a(l,{key:"706cac9f6c3456220ffaa13cbe74a0b6eb60710b"},a("calcite-shell",{key:"2d7169374eb285efc1b0dc20f005173aa7e33f61"},a("calcite-action-bar",{key:"66ee03cbf7ad909af37f49ed7d89146235f6a1d6",class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async componentDidLoad(){this._initSearchConfiguration(this.searchConfiguration)}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i,s]=await c(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils","esri/Graphic"]);this._geometryEngine=t,this._jsonUtils=i,this.Graphic=s}_initSearchConfiguration(t){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=t,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return a("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},a("div",{class:"background-override"},a("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),a("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},a("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return a("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),a("div",{class:"display-flex padding-1"},a("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},a("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return a("div",{class:"display-flex padding-sides-1"},a("img",{class:"img-container",role:"presentation",src:this._onboardingImageUrl}))}_getSelectionSetList(){return a("div",{class:"padding-top-1-2 padding-bottom-1-2"},a("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{const e=this._getSelectionSetIds(i);let l=!0;return i.workflowType===h.REFINE&&(l=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),l&&t.push(a("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",e.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==h.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===h.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==h.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return a("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),a("div",null,a("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enableLayerFeatures:this.enableLayerFeatures,enableSearchDistance:this.enableSearchDistance,enableSketchTools:this.enableSketchTools,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,locale:this.locale,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return a("calcite-panel",null,a("div",null,this._getLabel(this._translations.export,!1),t?a("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),a("div",{class:"padding-sides-1 "+i},a("div",{class:"display-flex"},a("calcite-label",{layout:"inline"},a("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),a("div",{class:"display-flex"},this._translations.removeDuplicate,a("div",{class:"info-message padding-start-1-2"},a("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"remove-duplicates-icon",scale:"s"})),a("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},a("span",{class:"tooltip-message"},this._translations.duplicatesTip))),a("div",{class:"border-bottom"}),a("div",{class:"padding-top-sides-1"},a("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},a("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},a("span",{class:"font-weight-500"},this._translations.pdf)),a("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},a("span",{class:"font-weight-500"},this._translations.csv)))),a("div",{class:"padding-bottom-1"},this._getExportOptions()),a("div",{class:"padding-1 display-flex"},a("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},a("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",e=this._addResults?"":"display-none";return a("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),a("div",{class:`padding-top-sides-1 ${e}`},a("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),a("div",{class:`padding-sides-1 ${e}`},a("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),a("div",{class:t},this._getLabel(this._translations.title,!0,""),a("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),a("div",{class:`padding-top-sides-1 ${i}`},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"list-graphics-icon",scale:"s"}),a("calcite-popover",{closable:!0,label:"",referenceElement:"list-graphics-icon"},a("span",{class:"tooltip-message"},this._translations.listGraphicsTip))))}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(t){let i;return Object.keys(g.managedLayers).some((s=>{const e=this.mapView.map.layers.findIndex((t=>t.title===s));if(g.managedLayers[s]===t)return i=this.mapView.map.layers.getItemAt(e),!0})),i}_updateExportGraphics(t=!1){!t&&this._exportGraphics&&this._addMap||this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");t&&t.graphics.removeAll(),i&&i.graphics.removeAll()}_addExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");this._selectionSets.forEach((s=>{if(s.download&&(t&&t.graphics.add(s.sketchGraphic),i)){const t=new this.Graphic({geometry:s.buffer,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});i.graphics.add(t)}}))}_getRefinePage(){const t=this._hasSelections();return a("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?a("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),a("refine-selection",{enabledLayerIds:this.selectionLayerIds,locale:this.locale,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,e,l,o){return a("div",{class:"padding-bottom-1"},a("div",{class:"display-flex padding-top-sides-1"},a("calcite-button",{disabled:i,onClick:s,width:"full"},a("span",{class:"font-weight-500"},t))),a("div",{class:"display-flex padding-top-1-2 padding-sides-1"},a("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},a("span",{class:"font-weight-500"},e))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return a("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},a("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{const s=this._getSelectionSetIds(i),e=i.workflowType!==h.REFINE||s.length>0;return!this._downloadActive&&i.download&&e&&(this._downloadActive=!0),e&&t.push(a("div",{class:"display-flex padding-sides-1 padding-bottom-1"},a("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),a("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},a("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",s.length.toString()))))))),t}),[])||a("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._updateExportGraphics(!0),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=t?.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{if(i.workflowType===h.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const s=i?.layerView?.layer.id;t=this._updateExportInfos(t,s,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,e,l=!1,o=""){return a("calcite-action",{disabled:!t,icon:i,iconFlipRtl:!0,indicator:l,onClick:e,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){const t=await(this._selectTools?.getSelection()),i=this._selectTools?.isUpdate;return this._selectionSets=i?this._selectionSets.map((i=>i.id===t.id?t:i)):[...this._selectionSets,t],this._home()}async _clearSelection(){await(this._selectTools?.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){d(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===h.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(e.ids,e.layerView,this.mapView))}}_checkPopups(){"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=this.mapView?.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await r(this.el);this._translations=t[0]}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
6
+ import{r as t,c as i,g as s,a as e,h as a,H as l}from"./p-f4c4a2b7.js";import{b as o,c as n,a as h}from"./p-80cb7c73.js";import{l as c,g as r}from"./p-d7868dd4.js";import{e as d,h as p}from"./p-eb483242.js";import{s as g}from"./p-122a81b5.js";import{c as b,r as m}from"./p-4b3cc01f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dcc35070.js";import"./p-9fe07c30.js";import"./p-badcaf04.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.enableLayerFeatures=!0,this.enableSearchDistance=!0,this.enableSketchTools=!0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.locale=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}get el(){return s(this)}_activeSelection;_downloadTools;_geometryEngine;Graphic;_jsonUtils;_onboardingImageUrl="";_popupsEnabled;_removeDuplicates;_searchConfiguration;_selectTools;_mediaQuery;_titleElement;_titleValue=void 0;_numSelected=0;async mapViewWatchHandler(t){t?.popup&&(this._popupsEnabled=t?.popup.autoOpenEnabled),this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);this.mapView&&(s!==JSON.stringify(i)||s&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){if(this._checkPopups(),this.mapView?.popup&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),i===n.EXPORT&&this._removeExportGraphics(),t!==n.SELECT)return this._highlightFeatures()}searchConfigurationChange;selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=e("../solutions-components/assets/data/images/onboarding.png")}render(){return a(l,{key:"de2d5102a42be0ef268b269402a027f9ea91d9b5"},a("calcite-shell",{key:"9ce77bf23a9d6479e7e65742e7caac2b83033975"},a("calcite-action-bar",{key:"c82214eda0751577ca6c40474d418286f3954ce5",class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async componentDidLoad(){this._initSearchConfiguration(this.searchConfiguration)}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i,s]=await c(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils","esri/Graphic"]);this._geometryEngine=t,this._jsonUtils=i,this.Graphic=s}_initSearchConfiguration(t){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=t,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return a("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},a("div",{class:"background-override"},a("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),a("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},a("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return a("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),a("div",{class:"display-flex padding-1"},a("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},a("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return a("div",{class:"display-flex padding-sides-1"},a("img",{class:"img-container",role:"presentation",src:this._onboardingImageUrl}))}_getSelectionSetList(){return a("div",{class:"padding-top-1-2 padding-bottom-1-2"},a("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{const e=this._getSelectionSetIds(i);let l=!0;return i.workflowType===h.REFINE&&(l=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),l&&t.push(a("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",e.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==h.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===h.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==h.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return a("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),a("div",null,a("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enableLayerFeatures:this.enableLayerFeatures,enableSearchDistance:this.enableSearchDistance,enableSketchTools:this.enableSketchTools,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,locale:this.locale,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return a("calcite-panel",null,a("div",null,this._getLabel(this._translations.export,!1),t?a("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),a("div",{class:"padding-sides-1 "+i},a("div",{class:"display-flex"},a("calcite-label",{layout:"inline"},a("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),a("div",{class:"display-flex"},this._translations.removeDuplicate,a("div",{class:"info-message padding-start-1-2"},a("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"remove-duplicates-icon",scale:"s"})),a("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},a("span",{class:"tooltip-message"},this._translations.duplicatesTip))),a("div",{class:"border-bottom"}),a("div",{class:"padding-top-sides-1"},a("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},a("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},a("span",{class:"font-weight-500"},this._translations.pdf)),a("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},a("span",{class:"font-weight-500"},this._translations.csv)))),a("div",{class:"padding-bottom-1"},this._getExportOptions()),a("div",{class:"padding-1 display-flex"},a("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},a("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",e=this._addResults?"":"display-none";return a("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),a("div",{class:`padding-top-sides-1 ${e}`},a("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),a("div",{class:`padding-sides-1 ${e}`},a("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),a("div",{class:t},this._getLabel(this._translations.title,!0,""),a("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),a("div",{class:`padding-top-sides-1 ${i}`},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"list-graphics-icon",scale:"s"}),a("calcite-popover",{closable:!0,label:"",referenceElement:"list-graphics-icon"},a("span",{class:"tooltip-message"},this._translations.listGraphicsTip))))}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(t){let i;return Object.keys(g.managedLayers).some((s=>{const e=this.mapView.map.layers.findIndex((t=>t.title===s));if(g.managedLayers[s]===t)return i=this.mapView.map.layers.getItemAt(e),!0})),i}_updateExportGraphics(t=!1){!t&&this._exportGraphics&&this._addMap||this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");t&&t.graphics.removeAll(),i&&i.graphics.removeAll()}_addExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");this._selectionSets.forEach((s=>{if(s.download&&(t&&t.graphics.add(s.sketchGraphic),i)){const t=new this.Graphic({geometry:s.buffer,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});i.graphics.add(t)}}))}_getRefinePage(){const t=this._hasSelections();return a("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?a("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),a("refine-selection",{enabledLayerIds:this.selectionLayerIds,locale:this.locale,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,e,l,o){return a("div",{class:"padding-bottom-1"},a("div",{class:"display-flex padding-top-sides-1"},a("calcite-button",{disabled:i,onClick:s,width:"full"},a("span",{class:"font-weight-500"},t))),a("div",{class:"display-flex padding-top-1-2 padding-sides-1"},a("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},a("span",{class:"font-weight-500"},e))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return a("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},a("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{const s=this._getSelectionSetIds(i),e=i.workflowType!==h.REFINE||s.length>0;return!this._downloadActive&&i.download&&e&&(this._downloadActive=!0),e&&t.push(a("div",{class:"display-flex padding-sides-1 padding-bottom-1"},a("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),a("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},a("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",s.length.toString()))))))),t}),[])||a("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._updateExportGraphics(!0),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=t?.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{if(i.workflowType===h.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const s=i?.layerView?.layer.id;t=this._updateExportInfos(t,s,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,e,l=!1,o=""){return a("calcite-action",{disabled:!t,icon:i,iconFlipRtl:!0,indicator:l,onClick:e,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){const t=await(this._selectTools?.getSelection()),i=this._selectTools?.isUpdate;return this._selectionSets=i?this._selectionSets.map((i=>i.id===t.id?t:i)):[...this._selectionSets,t],this._home()}async _clearSelection(){await(this._selectTools?.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){d(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===h.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(e.ids,e.layerView,this.mapView))}}_checkPopups(){"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=this.mapView?.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await r(this.el);this._translations=t[0]}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as i,c as t,g as e,h as s,H as a}from"./p-f4c4a2b7.js";import{a as h,l,g as n}from"./p-d7868dd4.js";import{e as o,h as r,k as c,l as d,c as p,m as b,n as g,o as f}from"./p-eb483242.js";import{a as y,e as m,f as u}from"./p-80cb7c73.js";import{s as w}from"./p-122a81b5.js";import{d as v,a as _}from"./p-4b3cc01f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dcc35070.js";import"./p-9fe07c30.js";import"./p-badcaf04.js";const S=class{constructor(e){i(this,e),this.selectionSetChange=t(this,"selectionSetChange",7),this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.enableLayerFeatures=!0,this.enableSearchDistance=!0,this.enableSketchTools=!0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.locale=void 0,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}get el(){return e(this)}FeatureLayer;Graphic;GraphicsLayer;Search;_geometryEngine;_bufferGeometry;_bufferGraphicsLayer;_bufferTools;_distance;_drawTools;_labelName;_selectLayers;_searchElement;_searchResult;_searchWidget;_selectedIds=[];_selectionLabel="";_skipGeomOIDs;_sketchGraphic;_graphics=[];_unit;_workflowType;_featuresCollection={};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}}selectionSetChange;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(){const i=this.enableSketchTools?"":"display-none",t=this.enableSketchTools?"padding-top-1":"";return s(a,{key:"e6ac512fe773d0257844fcdd41afda5cd227b359"},this._getMapLayerPicker(),s("div",{key:"3be4ed76db0d6899d984b0a2be85ebac6b7c29ae",class:"border-bottom"}),s("div",{key:"b2a835c9096718742a54be522e1dc174d6f4da8f",class:"padding-top-sides-1"},s("div",{key:"6133e6b951cde4504f8d19f747b4d7be5fe1d587",class:"search-widget",ref:i=>{this._searchElement=i}}),s("div",{key:"71636d8d7f9073315daae47d55746986c54f7596",class:t},s("map-draw-tools",{key:"4f8d3bc3953c4bd22837536c700eff959550f1e3",active:!0,class:i,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.enableSearchDistance?this._getBufferOptions():void 0,this.enableLayerFeatures?this._getUseLayerFeaturesOptions():void 0,this._getNumSelected()),s("div",{key:"4dbd38b3b88d776e8b30561841e0a288f23fc38b",class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){const i=this._searchDistanceEnabled?"search-distance":"div-not-visible",t="number"==typeof this.selectionSet?.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",flipRtl:!("he"===this.locale?.toLowerCase()),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:i},s("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:t,geometries:this.geometries,onBufferComplete:i=>{this._bufferComplete(i)},ref:i=>this._bufferTools=i,unit:this.selectionSet?.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",flipRtl:!("he"===this.locale?.toLowerCase()),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=h(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,e,s,a]=await l(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=e,this._geometryEngine=s,this.FeatureLayer=a}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){this.selectionSet&&(this._searchTerm=this.selectionSet.searchResult?.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=[...this.selectionSet?.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=this.selectionSet?.label,this._useLayerFeaturesEnabled||await(this._drawTools?.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={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=>{if(i.result){this._searchResult=i.result;const t=i.result.feature,e=t?.layer,s=this.selectLayerView.layer,a=t?.getObjectId(),h=e?.url&&s?.url&&e.url===s.url&&!isNaN(a),l=h?[a]:void 0;this._workflowType=y.SEARCH,this._updateLabel();const n=[i.result.feature];this._updateSelection(n,h,l),this._drawTools.graphics=n,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}})),await this._searchWidget.when((()=>{this._searchWidget.allPlaceholder=this.searchConfiguration?.allPlaceholder&&"find address or place"!==this.searchConfiguration.allPlaceholder.toLowerCase()?this.searchConfiguration.allPlaceholder:this._translations.placeholder}))}}_searchClearLabel(){return this._searchResult?.name&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const e=i?.sources;return e?.length>0?(i={...i,includeDefaultSources:!1},e.forEach((i=>{if(i.hasOwnProperty("layer")){const e=i,s=e.layer?.id,a=s?t.map.findLayerById(s):null,h=e?.layer?.url;a?e.layer=a:h&&(e.layer=new this.FeatureLayer(h))}})),e?.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===t?.name&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i={...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 e=i.detail.graphics;if(e.length>0&&e[0])if(t||(this._sketchGraphic=e[0]),this._workflowType=this._useLayerFeaturesEnabled?y.SELECT:y.SKETCH,this._workflowType===y.SKETCH&&await this._drawTools.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(e)?e.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=e.reduce(((i,t)=>(t?.layer?.objectIdField?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i)),[]),s=i.detail.useOIDs&&t.length>0;this._updateSelection(e,s,t),s&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){return this._skipGeomOIDs?.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 c(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,e=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),e=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:e})}_geomQuery(i){const t=d(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName&&(this._labelName.value="")),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),w.removeHandles(),this._drawTools?.clear&&(this._graphics=[],await this._drawTools.clear()),this.selectionSetChange.emit(this._selectedIds.length)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,e){this._selectedIds=t&&e?e:this._selectedIds,this._skipGeomOIDs=t?e:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}async _updateLabel(){if(this.enableSearchDistance){const i=this._selectionLabel.indexOf(this._translations.sketch)>-1,t=this._selectionLabel.indexOf(this._translations.select)>-1,e=this._selectionLabel.indexOf(this._searchResult?.name)>-1,s=this._workflowType===y.SEARCH?this._searchResult?.name:this._workflowType===y.SELECT?this._translations.select:this._translations.sketch,a=this._unit?this._unit:this._bufferTools.unit,h=await this._bufferTools.getTranslatedUnit(a),l=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=i||t||e||!this._selectionLabel?`${s} ${l} ${h}`: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){const t=i?.detail?.length>0?i.detail[0]:"";this.selectLayerView&&t===this.selectLayerView.layer.id||(this.selectLayerView=await p(this.mapView,t),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]=[],b(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))}));let e=!1;t.forEach((i=>{const t=i.geometry;i.symbol="point"===t.type?this.sketchPointSymbol:"polyline"===t.type?this.sketchLineSymbol:"polygon"===t.type?this.sketchPolygonSymbol:void 0,e=i?.layer?.hasOwnProperty("objectIdField")||i.hasOwnProperty("getObjectId")}));const s=this.layerViews[0].layer.url===this.selectLayerView.layer.url&&e;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:s}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}static get watchers(){return{geometries:["watchGeometriesHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};S.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}}]}),k=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}get el(){return e(this)}_labelInfoElement;_intl;async downloadCSV(i,t,e,s=!0){return v(i,t,!0,e,s)}async downloadPDF(i,t,e=!1,s="",a=""){return _(i,t,this._labelInfoElement.selectedOption?.value,e,s,a)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return s(a,{key:"7474ef13bc67b7c69b0605239748ec9f1816b3be"},s("calcite-select",{key:"2a6d379cb08aef1cafd5f568438f9981cef26962",disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidLoad(){this._renderOptions()}async _initModules(){const[i]=await l(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="&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 e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),s=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<s?-1:e>s?1:0})).forEach(((i,t)=>{const e=document.createElement("calcite-option");e.value=i,e.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(e),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(e.selected=!0,this._labelInfoElement.selectedOption=e)}))}};k.style=":host{display:block}";const P=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this.addresseeLayer=void 0,this.enabledLayerIds=[],this.locale=void 0,this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=m.ADD,this._refineLayer=void 0}get el(){return e(this)}_addEnabled=!0;_drawTools;_refineSets=[];_enabledLayerIds=[];_layerPicker;_featuresCollection={};_refineSelectionSet;selectionLoadingChange;selectionSetsChanged;async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){return s(a,{key:"5bd1d6b85fc43ca4bfdffefd6a19bbbbd37cc13e"},s("div",{key:"48312843133e3ece11ac8882aad91a570d809472",class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},s("div",{key:"dea13cbbe64fff8dc6dff1ea4816229ba04c6b51",class:"display-flex"},s("calcite-label",{key:"8184e95f8777e72e826d773aa212a32383983a51",class:"font-bold width-full label-margin-0"},s("div",{key:"b59989cfe2676fa520e7d2e23dd178425802536e",class:"display-flex"},this._translations.inputLayer,s("calcite-icon",{key:"0cdbf4745da0953434024c49a8fbc52a686e876a",class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"refine-input-layer",scale:"s"})),s("map-layer-picker",{key:"1d62e84b9fa0fa6ac0416ecf22a52a8b72eb7529",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",{key:"ed39858d71e1b4f128eed508e1a7fc71c5112b75",closable:!0,label:"",referenceElement:"refine-input-layer"},s("span",{key:"1c0a8e1b9a9e77b097a9e676c06c8cbc1ce4b235",class:"tooltip-message"},this._translations.inputLayerTip)))),s("div",{key:"eceb792f9deb9cbe346173337ec254faacd3036d",class:"padding-1"},s("div",{key:"d172826cc5e6a206bde83fa0fed5c46fbf0422ec",class:"padding-bottom-1"},s("calcite-segmented-control",{key:"096245916589f8486ed5f78f035a090c43749feb",class:"w-100",width:"full"},s("calcite-segmented-control-item",{key:"d0e5f7c7256e14421167cc9af90707d6d0457c01",checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(m.ADD),value:m.ADD},s("span",{key:"c5764bbb451659757c9f8fb84263255c50114e9c",class:"font-weight-500"},this._translations.add)),s("calcite-segmented-control-item",{key:"6d1ffc481926f70176e5db3debb71daf6d782e97",checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(m.REMOVE),value:m.REMOVE},s("span",{key:"aa3a9d97ebcf7553729858628164a5cdbb4ab5a6",class:"font-weight-500"},this._translations.remove)))),s("div",{key:"7d366f2bb9d91696915e6bb5aa7872c8e13c0f4b"},s("map-draw-tools",{key:"973fc2dfe9a3bb941e1257862ee6bf478dab6963",active:!0,drawMode:u.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:this._refineSelectionSet?.redoStack.length>0,ref:i=>{this._drawTools=i},undoEnabled:this._refineSelectionSet?.undoStack.length>0})),s("br",{key:"fb6fb3c198ad97e157a3f08df1283e20928f17fd"}),s("calcite-list",{key:"fb32a7abec8c89d2d2073fbe741e18daba37eb6f",class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){const t=i.detail?.graphics[0].geometry;this._selectFeatures(t)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{const e=t?.layerView?.layer.id;return e&&i.indexOf(e)<0?i.push(e):t.workflowType===y.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===y.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const e={};e[i]={addIds:[],removeIds:[],layerView:await p(this.mapView,i)},t?t.refineInfos={...t.refineInfos,...e}:(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:y.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:e,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===m.ADD?m.REMOVE:m.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===m.ADD?m.REMOVE:m.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===y.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=g(i);return Object.keys(t).reduce(((i,e)=>i+t[e].ids.length),0)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}async _selectFeatures(i){this.selectionLoadingChange.emit(!0),this._featuresCollection[this._refineLayer?.layer.id]=[];const t=await b(0,this._refineLayer?.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let e=[];Object.keys(t).forEach((i=>{i===this._refineLayer?.layer.id&&(e=e.concat(t[i]))}));const s=Array.isArray(e)?e.map((i=>i.attributes[i?.layer?.objectIdField])):[];await this._updateIds(s,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),w.highlightHandles=await f(this.selectionSets)}_clearHighlight(){w.removeHandles()}async _updateIds(i,t,e,s){let a=!1;const h=this._refineSelectionSet.refineInfos,l=s.layer.id,n={};n[l]={addIds:[],removeIds:[],layerView:s};const o=Object.keys(h).indexOf(l)>-1?h[l]:n[l];if(t===m.ADD)o.addIds=[...new Set([...i,...o.addIds])],o.addIds.length>0&&e.push({ids:i,mode:t,layerView:s}),o.removeIds.length>0&&(o.removeIds=o.removeIds.filter((t=>i.indexOf(t)<0)));else{const h=this.selectionSets.reduce(((t,e)=>(i.forEach((i=>{e.workflowType!==y.REFINE?e.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(e.refineInfos).some((a=>{const h=e.refineInfos[a];if(h.layerView.layer.id===s.layer.id&&h.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);o.removeIds=[...new Set([...h,...o.removeIds])],o.addIds=o.addIds.filter((i=>h.indexOf(i)<0)),o.removeIds.length>0&&e.push({ids:h,mode:t,layerView:s}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==y.REFINE&&t.layerView.layer.id===s.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[l]=o,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}};P.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{S as map_select_tools,k as pdf_download,P as refine_selection}
6
+ import{r as i,c as t,g as e,h as s,H as a}from"./p-f4c4a2b7.js";import{a as h,l,g as n}from"./p-d7868dd4.js";import{e as o,h as r,k as c,l as d,c as p,m as b,n as g,o as f}from"./p-eb483242.js";import{a as y,e as m,f as u}from"./p-80cb7c73.js";import{s as w}from"./p-122a81b5.js";import{d as v,a as _}from"./p-4b3cc01f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dcc35070.js";import"./p-9fe07c30.js";import"./p-badcaf04.js";const S=class{constructor(e){i(this,e),this.selectionSetChange=t(this,"selectionSetChange",7),this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.enableLayerFeatures=!0,this.enableSearchDistance=!0,this.enableSketchTools=!0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.locale=void 0,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}get el(){return e(this)}FeatureLayer;Graphic;GraphicsLayer;Search;_geometryEngine;_bufferGeometry;_bufferGraphicsLayer;_bufferTools;_distance;_drawTools;_labelName;_selectLayers;_searchElement;_searchResult;_searchWidget;_selectedIds=[];_selectionLabel="";_skipGeomOIDs;_sketchGraphic;_graphics=[];_unit;_workflowType;_featuresCollection={};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}}selectionSetChange;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(){const i=this.enableSketchTools?"":"display-none",t=this.enableSketchTools?"padding-top-1":"";return s(a,{key:"5a04e72d23e06c463d7dc3b453ca91ce046359bd"},this._getMapLayerPicker(),s("div",{key:"e821ee7452a1a784b485b487cedeff6425e2b063",class:"border-bottom"}),s("div",{key:"53e9a7d16279c9287af730452492d56ace65cdaf",class:"padding-top-sides-1"},s("div",{key:"a56f9637ab82b938e8ee2668fceeec2631f270cf",class:"search-widget",ref:i=>{this._searchElement=i}}),s("div",{key:"c06517880c5e2fca23e45a7392a9d72c159a482c",class:t},s("map-draw-tools",{key:"54df55d7f39cf68e6bf07ca8ae1c3ac952f8c2ff",active:!0,class:i,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.enableSearchDistance?this._getBufferOptions():void 0,this.enableLayerFeatures?this._getUseLayerFeaturesOptions():void 0,this._getNumSelected()),s("div",{key:"1d6ec53f2a270407c62972fb6e5775940821ca18",class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){const i=this._searchDistanceEnabled?"search-distance":"div-not-visible",t="number"==typeof this.selectionSet?.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",flipRtl:!("he"===this.locale?.toLowerCase()),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:i},s("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:t,geometries:this.geometries,onBufferComplete:i=>{this._bufferComplete(i)},ref:i=>this._bufferTools=i,unit:this.selectionSet?.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",flipRtl:!("he"===this.locale?.toLowerCase()),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=h(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,e,s,a]=await l(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=e,this._geometryEngine=s,this.FeatureLayer=a}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){this.selectionSet&&(this._searchTerm=this.selectionSet.searchResult?.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=[...this.selectionSet?.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=this.selectionSet?.label,this._useLayerFeaturesEnabled||await(this._drawTools?.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={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=>{if(i.result){this._searchResult=i.result;const t=i.result.feature,e=t?.layer,s=this.selectLayerView.layer,a=t?.getObjectId(),h=e?.url&&s?.url&&e.url===s.url&&!isNaN(a),l=h?[a]:void 0;this._workflowType=y.SEARCH,this._updateLabel();const n=[i.result.feature];this._updateSelection(n,h,l),this._drawTools.graphics=n,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}})),await this._searchWidget.when((()=>{this._searchWidget.allPlaceholder=this.searchConfiguration?.allPlaceholder&&"find address or place"!==this.searchConfiguration.allPlaceholder.toLowerCase()?this.searchConfiguration.allPlaceholder:this._translations.placeholder}))}}_searchClearLabel(){return this._searchResult?.name&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const e=i?.sources;return e?.length>0?(i={...i,includeDefaultSources:!1},e.forEach((i=>{if(i.hasOwnProperty("layer")){const e=i,s=e.layer?.id,a=s?t.map.findLayerById(s):null,h=e?.layer?.url;a?e.layer=a:h&&(e.layer=new this.FeatureLayer(h))}})),e?.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===t?.name&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i={...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 e=i.detail.graphics;if(e.length>0&&e[0])if(t||(this._sketchGraphic=e[0]),this._workflowType=this._useLayerFeaturesEnabled?y.SELECT:y.SKETCH,this._workflowType===y.SKETCH&&await this._drawTools.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(e)?e.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=e.reduce(((i,t)=>(t?.layer?.objectIdField?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i)),[]),s=i.detail.useOIDs&&t.length>0;this._updateSelection(e,s,t),s&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){return this._skipGeomOIDs?.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 c(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,e=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),e=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:e})}_geomQuery(i){const t=d(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName&&(this._labelName.value="")),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),w.removeHandles(),this._drawTools?.clear&&(this._graphics=[],await this._drawTools.clear()),this.selectionSetChange.emit(this._selectedIds.length)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,e){this._selectedIds=t&&e?e:this._selectedIds,this._skipGeomOIDs=t?e:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}async _updateLabel(){if(this.enableSearchDistance){const i=this._selectionLabel.indexOf(this._translations.sketch)>-1,t=this._selectionLabel.indexOf(this._translations.select)>-1,e=this._selectionLabel.indexOf(this._searchResult?.name)>-1,s=this._workflowType===y.SEARCH?this._searchResult?.name:this._workflowType===y.SELECT?this._translations.select:this._translations.sketch,a=this._unit?this._unit:this._bufferTools.unit,h=await this._bufferTools.getTranslatedUnit(a),l=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=i||t||e||!this._selectionLabel?`${s} ${l} ${h}`: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){const t=i?.detail?.length>0?i.detail[0]:"";this.selectLayerView&&t===this.selectLayerView.layer.id||(this.selectLayerView=await p(this.mapView,t),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]=[],b(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))}));let e=!1;t.forEach((i=>{const t=i.geometry;i.symbol="point"===t.type?this.sketchPointSymbol:"polyline"===t.type?this.sketchLineSymbol:"polygon"===t.type?this.sketchPolygonSymbol:void 0,e=i?.layer?.hasOwnProperty("objectIdField")||i.hasOwnProperty("getObjectId")}));const s=this.layerViews[0].layer.url===this.selectLayerView.layer.url&&e;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:s}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}static get watchers(){return{geometries:["watchGeometriesHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};S.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}}]}),k=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}get el(){return e(this)}_labelInfoElement;_intl;async downloadCSV(i,t,e,s=!0){return v(i,t,!0,e,s)}async downloadPDF(i,t,e=!1,s="",a=""){return _(i,t,this._labelInfoElement.selectedOption?.value,e,s,a)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return s(a,{key:"a33458caa21a1cbe1545b30eeba3d0d9ce868148"},s("calcite-select",{key:"75623fdf7467da7e45d917a0149b48a9f5c24394",disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidLoad(){this._renderOptions()}async _initModules(){const[i]=await l(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="&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 e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),s=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<s?-1:e>s?1:0})).forEach(((i,t)=>{const e=document.createElement("calcite-option");e.value=i,e.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(e),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(e.selected=!0,this._labelInfoElement.selectedOption=e)}))}};k.style=":host{display:block}";const P=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this.addresseeLayer=void 0,this.enabledLayerIds=[],this.locale=void 0,this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=m.ADD,this._refineLayer=void 0}get el(){return e(this)}_addEnabled=!0;_drawTools;_refineSets=[];_enabledLayerIds=[];_layerPicker;_featuresCollection={};_refineSelectionSet;selectionLoadingChange;selectionSetsChanged;async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){return s(a,{key:"48fd9fbbe8560ca4d165e5a3e9399ce5c3c7ba8e"},s("div",{key:"4b314e3941366d8251238a13171d21ce28a7b87e",class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},s("div",{key:"f7007f8333e1a8c160bcbd5659f6410776c54e2a",class:"display-flex"},s("calcite-label",{key:"c24380176e9c4791ef1fcda1a3f955265f51b0d7",class:"font-bold width-full label-margin-0"},s("div",{key:"403542a6105b28368cd364070abfe6d8cf160d7e",class:"display-flex"},this._translations.inputLayer,s("calcite-icon",{key:"745e828c6bbb8c7c89259142ca5301561d441128",class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"refine-input-layer",scale:"s"})),s("map-layer-picker",{key:"15aa897e1cc858b2bda6a9cefca1d87347592bb0",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",{key:"334ab4b1918e6905b4ab90a683ffa5129e6b449f",closable:!0,label:"",referenceElement:"refine-input-layer"},s("span",{key:"2770007f82ff6dc157e5ffae8c9f61c55cb47a48",class:"tooltip-message"},this._translations.inputLayerTip)))),s("div",{key:"f29a52a9ac924bf4cd81b5311df6a2a8ca28f0ae",class:"padding-1"},s("div",{key:"c0c5815ef8e74971e26517a12c95ca19b2294dc8",class:"padding-bottom-1"},s("calcite-segmented-control",{key:"b6338cabb01ba8453df5e00a46ab51e4da924c3d",class:"w-100",width:"full"},s("calcite-segmented-control-item",{key:"61ecda9667fdf6e3acc7931531ee9a49fdd40295",checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(m.ADD),value:m.ADD},s("span",{key:"3b48631b4b75716680f15ac0e4790043926bf857",class:"font-weight-500"},this._translations.add)),s("calcite-segmented-control-item",{key:"1e26bced9c292ffdca78a589f3b78961cb5fceb6",checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(m.REMOVE),value:m.REMOVE},s("span",{key:"b7abd723a8f440d03d35256812229bf2e84e87c6",class:"font-weight-500"},this._translations.remove)))),s("div",{key:"368a335da540fb7c747d6f2abffc3e7f98545833"},s("map-draw-tools",{key:"a3cc7f67104512ab108157bd3f7ebd57b1a5f202",active:!0,drawMode:u.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:this._refineSelectionSet?.redoStack.length>0,ref:i=>{this._drawTools=i},undoEnabled:this._refineSelectionSet?.undoStack.length>0})),s("br",{key:"038fb2b359eb59730de50778d809841ef33471d9"}),s("calcite-list",{key:"02fdc3e4096a8f88e727118f9ae27a9b823edb3a",class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){const t=i.detail?.graphics[0].geometry;this._selectFeatures(t)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{const e=t?.layerView?.layer.id;return e&&i.indexOf(e)<0?i.push(e):t.workflowType===y.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===y.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const e={};e[i]={addIds:[],removeIds:[],layerView:await p(this.mapView,i)},t?t.refineInfos={...t.refineInfos,...e}:(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:y.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:e,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===m.ADD?m.REMOVE:m.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===m.ADD?m.REMOVE:m.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===y.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=g(i);return Object.keys(t).reduce(((i,e)=>i+t[e].ids.length),0)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}async _selectFeatures(i){this.selectionLoadingChange.emit(!0),this._featuresCollection[this._refineLayer?.layer.id]=[];const t=await b(0,this._refineLayer?.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let e=[];Object.keys(t).forEach((i=>{i===this._refineLayer?.layer.id&&(e=e.concat(t[i]))}));const s=Array.isArray(e)?e.map((i=>i.attributes[i?.layer?.objectIdField])):[];await this._updateIds(s,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),w.highlightHandles=await f(this.selectionSets)}_clearHighlight(){w.removeHandles()}async _updateIds(i,t,e,s){let a=!1;const h=this._refineSelectionSet.refineInfos,l=s.layer.id,n={};n[l]={addIds:[],removeIds:[],layerView:s};const o=Object.keys(h).indexOf(l)>-1?h[l]:n[l];if(t===m.ADD)o.addIds=[...new Set([...i,...o.addIds])],o.addIds.length>0&&e.push({ids:i,mode:t,layerView:s}),o.removeIds.length>0&&(o.removeIds=o.removeIds.filter((t=>i.indexOf(t)<0)));else{const h=this.selectionSets.reduce(((t,e)=>(i.forEach((i=>{e.workflowType!==y.REFINE?e.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(e.refineInfos).some((a=>{const h=e.refineInfos[a];if(h.layerView.layer.id===s.layer.id&&h.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);o.removeIds=[...new Set([...h,...o.removeIds])],o.addIds=o.addIds.filter((i=>h.indexOf(i)<0)),o.removeIds.length>0&&e.push({ids:h,mode:t,layerView:s}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==y.REFINE&&t.layerView.layer.id===s.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[l]=o,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}};P.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{S as map_select_tools,k as pdf_download,P as refine_selection}
@@ -0,0 +1,11 @@
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 a}from"./p-f4c4a2b7.js";import{d as o}from"./p-e3196917.js";import{f as n,e as c}from"./p-262e91ea.js";import{D as l,E as h,t as r}from"./p-8448b98b.js";import{d,f as p,c as b,r as m,a as u,F as g}from"./p-583ecbf6.js";import{s as f,c as v,a as x,d as y,H as w}from"./p-7c585a72.js";import{g as C}from"./p-0ae5f8fe.js";import{c as k,u as I,d as z,I as j}from"./p-ec561560.js";import{c as S,d as $,g as H}from"./p-d7ee860a.js";import{b as D,c as E,s as A,a as L}from"./p-f83c0ef6.js";import{c as O,d as _}from"./p-16d69510.js";import{c as P}from"./p-2327029a.js";import{o as F}from"./p-cd4d69c1.js";import{D as M}from"./p-a8e556aa.js";import{c as W,s as T,d as V,u as B}from"./p-d4e3e979.js";import{g as G,c as R}from"./p-bb3ce613.js";import{V as N}from"./p-cfca5772.js";import{i as U,h as q,C as J,b as X,c as Y,d as K,e as Q,f as Z,j as tt}from"./p-ee056d26.js";import{d as it}from"./p-c8d3207e.js";import{C as et}from"./p-c5897e36.js";import{g as st}from"./p-d7868dd4.js";import{g as at,d as ot,p as nt}from"./p-eb483242.js";import{s as ct}from"./p-122a81b5.js";import"./p-73ae4b9b.js";import"./p-4250bde1.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-dcc35070.js";
7
+ /*!
8
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
+ * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
10
+ * v2.11.1
11
+ */const lt="x-button";function ht({disabled:i,key:e,label:s,onClick:a,ref:o,scale:n}){return t("button",{"aria-label":s,class:lt,disabled:i,key:e,onClick:a,ref:o,tabIndex:-1,type:"button"},t("calcite-icon",{icon:"x",scale:G(n)}))}const rt="combobox-item-",dt="combobox-chip-",pt="combobox-label-",bt="combobox-listbox-",mt="combobox-input-",ut=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=d,this.internalValueChangeFlag=!1,this.textInput=null,this.mutationObserver=P("mutation",(()=>this.updateItems())),this.resizeObserver=P("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?p(i,t):null},this.getValue=()=>{const t=this.selectedItems.map((t=>t?.value?.toString()));return t?.length?t.length>1?t:t[0]:""},this.onLabelClick=()=>{this.setFocus()},this.keyDownHandler=t=>{if(this.readOnly)return;const{key:i}=t;switch(i){case"Tab":this.activeChipIndex=-1,this.activeItemIndex=-1,this.allowCustomValues&&this.filterText?(this.addCustomChip(this.filterText,!0),t.preventDefault()):this.open?(this.open=!1,t.preventDefault()):!this.allowCustomValues&&this.filterText&&(this.clearInputValue(),this.filterItems(""),this.updateActiveItemIndex(-1));break;case"ArrowLeft":-1===this.activeChipIndex&&0!==this.textInput.selectionStart||(this.previousChip(),t.preventDefault());break;case"ArrowRight":-1!==this.activeChipIndex&&(this.nextChip(),t.preventDefault());break;case"ArrowUp":this.filteredItems.length&&(t.preventDefault(),this.open&&this.shiftActiveItemIndex(-1),this.comboboxInViewport()||this.el.scrollIntoView());break;case"ArrowDown":this.filteredItems.length&&(t.preventDefault(),this.open?this.shiftActiveItemIndex(1):(this.open=!0,this.ensureRecentSelectedItemIsActive()),this.comboboxInViewport()||this.el.scrollIntoView());break;case" ":this.textInput.value||t.defaultPrevented||(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.open&&this.activeItemIndex>-1?(this.toggleSelection(this.filteredItems[this.activeItemIndex]),t.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(),t.preventDefault()):this.allowCustomValues&&this.filterText?(this.addCustomChip(this.filterText,!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.filterText&&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=>{if(this.readOnly)return;const i=t.composedPath();return i.some((t=>"CALCITE-CHIP"===t.tagName))?(this.open=!1,void t.preventDefault()):i.some((t=>t.classList?.contains(lt)))?(this.clearValue(),void t.preventDefault()):(this.open=!this.open,void this.ensureRecentSelectedItemIsActive())},this.refreshSelectionDisplay=async()=>{if(await D(this),U(this.selectionMode))return;if(!this.textInput)return;const{allSelectedIndicatorChipEl:t,chipContainerEl:i,selectionDisplay:e,placeholder:s,selectedIndicatorChipEl:a,textInput:n}=this,c=parseInt(getComputedStyle(i).gap.replace("px","")),r=l(i),{fontSize:d,fontFamily:p}=getComputedStyle(n),b=(h(s,`${d} ${p}`)||parseInt(o))+c,m=l(t),u=l(a),g=Math.max(m,u);if(this.setCompactSelectionDisplay({chipContainerElGap:c,chipContainerElWidth:r,inputWidth:b,largestSelectedIndicatorChipWidth:g}),"fit"===e){const t=Array.from(this.el.shadowRoot.querySelectorAll("calcite-chip")).filter((t=>t.closable)),i=Math.round(r-((this.selectedHiddenChipsCount>0?u:0)+c+b+c));this.refreshChipDisplay({availableHorizontalChipElSpace:i,chipContainerElGap:c,chipEls:t}),this.setVisibleAndHiddenChips(t)}},this.setFloatingEl=t=>{this.floatingEl=t,b(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,b(this,this.referenceEl,this.floatingEl)},this.setAllSelectedIndicatorChipEl=t=>{this.allSelectedIndicatorChipEl=t},this.setSelectedIndicatorChipEl=t=>{this.selectedIndicatorChipEl=t},this.inputHandler=t=>{this.filterText=t.target.value},this.filterItems=(()=>{const t=(t,i)=>t&&i.some((({label:i,value:e})=>t.tagName===tt?i===t.label:e===t.value&&i===t.textLabel));return it(((i,e=!1,s=!0)=>{const a=n(this.data,i),o=this.getItemsAndGroups(),l=""===i;o.forEach((i=>{if(l)return void(i.hidden=!1);const e=!t(i,a);i.hidden=e;const[s,o]=i.ancestors;(t(s,a)||t(o,a))&&(i.hidden=!1),e||i.ancestors.forEach((t=>t.hidden=!1))})),this.filterTextMatchPattern=this.filterText&&new RegExp(`(${c(this.filterText)})`,"i"),this.filteredItems=this.getFilteredItems(),this.filteredItems.forEach((t=>{t.filterTextMatchPattern=this.filterTextMatchPattern})),e&&(this.open=this.filterText.trim().length>0&&this.filteredItems.length>0),s&&this.calciteComboboxFilterChange.emit()}),M.filter)})(),this.internalComboboxChangeEvent=()=>{this.calciteComboboxChange.emit()},this.emitComboboxChange=it(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||!q(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.calculateScrollerHeight(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=()=>{this.disabled||this.textInput?.focus()},this.clearDisabled=!1,this.filterText="",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.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},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.readOnly=!1,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.effectiveLocale=void 0,this.defaultMessages=void 0}filterTextChange(t){this.updateActiveItemIndex(-1),this.filterItems(t,!0)}openHandler(){F(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}async documentClickHandler(t){this.disabled||t.composedPath().includes(this.el)||(await R(this.el),!this.allowCustomValues&&this.filterText&&(this.clearInputValue(),this.filterItems(""),this.updateActiveItemIndex(-1)),this.allowCustomValues&&this.filterText.trim().length&&this.addCustomChip(this.filterText),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:a,filteredFlipPlacements:o}=this;return m(this,{floatingEl:i,referenceEl:e,overlayPositioning:a,placement:s,flipPlacements:o,type:"menu"},t)}async setFocus(){await E(this),this.textInput?.focus(),this.activeChipIndex=-1,this.activeItemIndex=-1}connectedCallback(){k(this),O(this),W(this),S(this),v(this),this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1,this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateItems(),this.setFilteredPlacements(),this.open&&(this.openHandler(),F(this)),b(this,this.referenceEl,this.floatingEl)}async componentWillLoad(){A(this),this.updateItems(),await T(this),this.filterItems(this.filterText,!1,!1)}componentDidLoad(){x(this,this.getValue()),b(this,this.referenceEl,this.floatingEl),L(this)}componentDidRender(){this.el.offsetHeight!==this.inputHeight&&(this.reposition(!0),this.inputHeight=this.el.offsetHeight),I(this)}componentDidUpdate(){this.refreshSelectionDisplay()}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),z(this),$(this),y(this),u(this,this.referenceEl,this.floatingEl),_(this),V(this)}effectiveLocaleChange(){B(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.filterText=""}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(J.chipInvisible)}showChip(t){t.classList.remove(J.chipInvisible)}refreshChipDisplay({chipEls:t,availableHorizontalChipElSpace:i,chipContainerElGap:e}){t.forEach((t=>{if(t.selected){const s=l(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 a=Math.round(s+t+e);(!this.maxCompactBreakpoint||this.maxCompactBreakpoint<a)&&(this.maxCompactBreakpoint=a),this.compactSelectionDisplay=i<this.maxCompactBreakpoint}setVisibleAndHiddenChips(t){let i=0;t.forEach((t=>{t.selected&&!t.classList.contains(J.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){const i=this.calculateScrollerHeight(t);i>0&&(s+=i,e++)}})),s}calculateScrollerHeight(t){if(t)return t.getBoundingClientRect().height-Array.from(t.querySelectorAll(X)).reduce(((t,i)=>t+i.getBoundingClientRect().height),0)}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=Y(t)),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems("")))}updateAncestors(t){if("ancestors"!==this.selectionMode)return;const i=K(t),e=Q(t);t.selected?i.forEach((t=>{t.selected=!0})):(e.forEach((t=>t.selected=!1)),[...i].forEach((t=>{q(t)||(t.selected=!1)})))}getFilteredItems(){return""===this.filterText?this.items:this.items.filter((t=>!t.hidden))}getData(){return this.items.map((t=>({description:t.description,filterDisabled:t.filterDisabled,label:t.textLabel,metadata:t.metadata,shortHeading:t.shortHeading,value:t.value})))}getNeedsIcon(){return U(this.selectionMode)&&this.items.some((t=>t.icon))}resetText(){this.textInput&&(this.textInput.value=""),this.filterText=""}getItems(){return Array.from(this.el.querySelectorAll(Z)).filter((t=>!t.disabled))}getGroupItems(){return Array.from(this.el.querySelectorAll(tt))}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.prepend(e),this.resetText(),i&&this.setFocus(),this.updateItems(),this.filterItems(""),this.open=!0,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(){const t=this.activeChipIndex;this.activeChipIndex=-1===t?this.selectedItems.length-1:Math.max(t-1,0),this.updateActiveItemIndex(-1),this.focusChip()}nextChip(){const t=this.activeChipIndex+1;t>this.selectedItems.length-1?(this.activeChipIndex=-1,this.setFocus()):(this.activeChipIndex=t,this.focusChip()),this.updateActiveItemIndex(-1)}focusChip(){const t=this.selectedItems[this.activeChipIndex]?.guid,i=t?this.referenceEl.querySelector(`#${dt}${t}`):null;i?.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=`${rt}${e.guid}`):e.active=!1})),this.activeDescendant=i,this.activeItemIndex>-1&&(this.activeChipIndex=-1)}isAllSelected(){return this.getItems().length===this.getSelectedItems().length}isMulti(){return!U(this.selectionMode)}renderChips(){const{activeChipIndex:i,readOnly:e,scale:s,selectionMode:a,messages:o}=this;return this.selectedItems.map(((n,c)=>{const l={chip:!0,"chip--active":i===c},h=[...K(n)].reverse(),r=Y(n),d=[...h,n].map((t=>Y(t))),p="ancestors"!==a?r:d.join(" / ");return t("calcite-chip",{appearance:e?"outline":"solid",class:l,closable:!e,"data-test-id":`chip-${c}`,icon:n.icon,iconFlipRtl:n.iconFlipRtl,id:n.guid?`${dt}${n.guid}`:null,key:r,messageOverrides:{dismissLabel:o.removeTag},onCalciteChipClose:()=>this.calciteChipCloseHandler(n),onFocusin:()=>this.activeChipIndex=c,scale:s,selected:n.selected,tabindex:i===c?0:-1,title:p,value:n.value},p)}))}renderAllSelectedIndicatorChip(){const{compactSelectionDisplay:i,scale:e,selectedVisibleChipsCount:s,setAllSelectedIndicatorChipEl:a}=this,o=this.messages.allSelected;return t("calcite-chip",{class:{chip:!0,[J.chipInvisible]:!(this.isAllSelected()&&!s&&!i)},ref:a,scale:e,title:o,value:""},o)}renderAllSelectedIndicatorChipCompact(){const{compactSelectionDisplay:i,scale:e,selectedVisibleChipsCount:s}=this,a=this.messages.all||"All";return t("calcite-chip",{class:{chip:!0,[J.chipInvisible]:!(this.isAllSelected()&&!s&&i)},scale:e,title:a,value:""},a)}renderSelectedIndicatorChip(){const{compactSelectionDisplay:i,selectionDisplay:e,getSelectedItems:s,scale:a,selectedHiddenChipsCount:o,selectedVisibleChipsCount:n,setSelectedIndicatorChipEl:c}=this;let l,h;if(i)l=!0;else if("single"===e){const t=s().length;l=!(!this.isAllSelected()&&t>0),h=`${t} ${this.messages.selected}`}else"fit"===e&&(l=!!(this.isAllSelected()&&0===n||0===o),h=n>0?`+${o}`:`${o} ${this.messages.selected}`);return t("calcite-chip",{class:{chip:!0,[J.chipInvisible]:l},ref:c,scale:a,title:h,value:""},h)}renderSelectedIndicatorChipCompact(){const{compactSelectionDisplay:i,selectionDisplay:e,getSelectedItems:s,scale:a,selectedHiddenChipsCount:o}=this;let n,c;if(i){const t=s().length;this.isAllSelected()?n=!0:"fit"===e?(n=!(o>0),c=`${o||0}`):"single"===e&&(n=!(t>0),c=`${t}`)}else n=!0;return t("calcite-chip",{class:{chip:!0,[J.chipInvisible]:n},scale:a,title:c,value:""},c)}get showingInlineIcon(){const{placeholderIcon:t,selectionMode:i,selectedItems:e,open:s}=this,a=e[0],o=a?.icon,n=U(i);return!s&&a?!!o&&n:!!t&&(!a||n)}renderInput(){const{guid:i,disabled:e,placeholder:s,selectionMode:a,selectedItems:o,open:n}=this,c=U(a),l=o[0],h=!n&&c&&!!l;return t("span",{class:{"input-wrap":!0,"input-wrap--single":c}},h&&t("span",{class:{label:!0,"label--icon":!!l?.icon},key:"label"},Y(l)),t("input",{"aria-activedescendant":this.activeDescendant,"aria-autocomplete":"list","aria-controls":`${bt}${i}`,"aria-expanded":r(n),"aria-haspopup":"listbox","aria-label":H(this),"aria-owns":`${bt}${i}`,class:{[J.input]:!0,"input--single":!0,"input--hidden":h,"input--icon":this.showingInlineIcon&&!!this.placeholderIcon},"data-test-id":"input",disabled:e,id:`${mt}${i}`,key:"input",onFocus:this.comboboxFocusHandler,onInput:this.inputHandler,placeholder:s,readOnly:this.readOnly,ref:t=>this.textInput=t,role:"combobox",tabindex:-1===this.activeChipIndex?0:-1,type:"text",value:this.filterText}))}renderListBoxOptions(){return this.filteredItems.map((i=>t("li",{"aria-selected":r(i.selected),id:i.guid?`${rt}${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:{[J.listContainer]:!0,[g.animation]:!0,[g.animationActive]:s},ref:e},t("ul",{class:{list:!0,"list--hide":!s}},t("slot",null))))}renderSelectedOrPlaceholderIcon(){const{selectedItems:i,placeholderIcon:e,placeholderIconFlipRtl:s}=this,a=i[0],o=a?.icon;return this.showingInlineIcon&&t("span",{class:"icon-start",key:"selected-placeholder-icon"},t("calcite-icon",{class:"selected-icon",flipRtl:this.open&&a?a.iconFlipRtl:s,icon:!this.open&&a?o:e,scale:G(this.scale)}))}renderChevronIcon(){const{open:i}=this;return t("span",{class:"icon-end",key:"chevron"},t("calcite-icon",{class:J.icon,icon:i?"chevron-up":"chevron-down",scale:G(this.scale)}))}render(){const{selectionDisplay:i,guid:e,label:a,open:o,readOnly:n}=this,c=U(this.selectionMode),l="all"===i,h="single"===i,r=!c&&"fit"===i,d=!this.clearDisabled&&this.value?.length>0;return t(s,{key:"c51466b3ff7d6aaf29578ba9a017cab02b49d704",onClick:this.comboboxFocusHandler},t(j,{key:"5c1e3383be919a3348677607b46f79a8baefeee7",disabled:this.disabled},t("div",{key:"ffb0ee17748ed4827cfca2c8aea8f39fc82a05cc","aria-live":"polite",class:{wrapper:!0,"wrapper--single":c||!this.selectedItems.length,"wrapper--active":o},onClick:this.clickHandler,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},this.renderSelectedOrPlaceholderIcon(),t("div",{class:{"grid-input":!0,[J.selectionDisplayFit]:r,[J.selectionDisplaySingle]:h},key:"grid",ref:this.setChipContainerEl},!c&&!h&&this.renderChips(),!c&&!l&&[this.renderSelectedIndicatorChip(),this.renderSelectedIndicatorChipCompact(),this.renderAllSelectedIndicatorChip(),this.renderAllSelectedIndicatorChipCompact()],t("label",{key:"d60ddc1697b80245c56fd7b553408beb21296b3d",class:"screen-readers-only",htmlFor:`${mt}${e}`,id:`${pt}${e}`},a),this.renderInput()),!n&&d?t(ht,{disabled:this.disabled,key:"close-button",label:this.messages.clear,scale:this.scale}):null,!n&&this.renderChevronIcon()),t("ul",{key:"856e6f4bd4fcf6db32fb6e8d984fcdb7c4776448","aria-labelledby":`${pt}${e}`,"aria-multiselectable":"true",class:"screen-readers-only",id:`${bt}${e}`,role:"listbox",tabIndex:-1},this.renderListBoxOptions()),this.renderFloatingUIContainer(),t(w,{key:"eca6c0108b0fbb8e6851c6cc86d15dc70318a4a3",component:this}),this.validationMessage&&"invalid"===this.status?t(N,{icon:this.validationIcon,message:this.validationMessage,scale:this.scale,status:this.status}):null))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{filterText:["filterTextChange"],open:["openHandler"],disabled:["handleDisabledChange"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],selectionMode:["handlePropsChange"],scale:["handlePropsChange"],value:["valueHandler"],messageOverrides:["onMessagesChange"],flipPlacements:["flipPlacementsHandler"],selectedItems:["selectedItemsHandler"],effectiveLocale:["effectiveLocaleChange"]}}};ut.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:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform 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)}.wrapper:hover .icon{color:var(--calcite-color-text-1)}:host(:focus-within) .wrapper,.wrapper--active{outline:2px solid var(--calcite-ui-focus-color, 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([read-only]) .wrapper{background-color:var(--calcite-color-background)}:host([read-only]) .label{font-weight:var(--calcite-font-weight-medium)}: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);margin-inline-end: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;overflow:hidden;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--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-l)}.input-wrap{display:flex;flex-grow:1;align-items:center}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;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}.icon-end .icon{color:var(--calcite-color-text-3)}.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)}";const gt=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=P("mutation",(()=>this.updateItems())),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){this.updateItems(),this.mutationObserver?.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){this.mutationObserver?.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,{key:"1c189e8ff87a118d296781b729c889307c2b4a5b","aria-label":this.groupTitle,role:"group"},t("div",{key:"2afc3aee9c68b26af882168ce24cb2937a17c9e8",class:{[et.container]:!0}},e,i,t("slot",{key:"3fdcfab750b0541a4a24764f1a1875c867db06e8"})))}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 a(this)}static get watchers(){return{selectionMode:["handlePropsChange"]}}};gt.style=":host{position:relative;display:block}.container{text-align:start}.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([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-title{padding:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-title{padding:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-title{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}";const ft=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.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}get el(){return a(this)}defaultLayerHonored=!1;_layerElement;_layerNameHash;_tableNameHash;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())}idsFound;noLayersFound;layerSelectionChange;async componentWillLoad(){await this._getTranslations(),await this._setLayers()}async componentWillRender(){if(this.ids.length>0||1===this.selectedIds.length){const t=await at(this.mapView,this.selectedIds[0]);this.selectedName=t?.title}}render(){const i="map-layer-picker";let e=this.height>0?{height:`${this.height.toString()}px`}:{};return e={...e,display:this.display},t(s,{key:"47a42a4855654930ebaf59b1567ab4bd5ccf3133"},t("div",{key:"acc05150c663d68ae633a7d293984ae282cfbdfa",class:"map-layer-picker-container",style:e},t("div",{key:"811bde9a5118862f58b6a9ed99abec0f46fb4a1f",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],a=!!this.onlyShowUpdatableLayers&&!s.supportsUpdate,o=s.name,n=this.selectedIds.indexOf(i)>-1;return"combobox"===this.type?t("calcite-combobox-item",{disabled:a,selected:n,textLabel:o,value:i}):"select"===this.type?t("calcite-option",{disabled:a,label:o,selected:n,value:i}):t("calcite-dropdown-group",{class:a?"disabled":"",selectionMode:a?"none":"single"},t("calcite-dropdown-item",{onClick:a?void 0:()=>{this._setSelectedLayer(i)},selected:n},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=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=>!(this.enabledLayerIds?.length>0)||this.enabledLayerIds.reverse().indexOf(t)>-1)),...i.reverse().filter((t=>!(this.enabledTableIds?.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 ot(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await nt(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){const i=this._layerNameHash[t]?.name;return i&&Object.keys(ct.managedLayers).indexOf(i)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){const i=this._tableNameHash[t]?.name,e=i&&this.showTables;return e?ct.managedTables.indexOf(i)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):e}_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 st(this.el);this._translations=t[0]}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};ft.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{ut as calcite_combobox,gt as calcite_dropdown_group,ft as map_layer_picker}