@esri/solutions-components 0.8.23 → 0.8.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/dist/cjs/arcgis-login.cjs.entry.js +1 -1
  2. package/dist/cjs/basemap-gallery_7.cjs.entry.js +1 -1
  3. package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
  4. package/dist/cjs/{calcite-avatar.cjs.entry.js → calcite-avatar_2.cjs.entry.js} +62 -0
  5. package/dist/cjs/calcite-block_5.cjs.entry.js +12 -3
  6. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +419 -0
  7. package/dist/cjs/{calcite-dropdown_4.cjs.entry.js → calcite-dropdown_2.cjs.entry.js} +12 -435
  8. package/dist/cjs/calcite-flow_6.cjs.entry.js +23 -27
  9. package/dist/cjs/card-manager_3.cjs.entry.js +1 -1
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  11. package/dist/cjs/crowdsource-reporter.cjs.entry.js +56 -36
  12. package/dist/cjs/feature-list.cjs.entry.js +4 -3
  13. package/dist/cjs/{helpers-9347ad83.js → helpers-618a3f7d.js} +2 -1
  14. package/dist/cjs/instant-apps-create.cjs.entry.js +266 -0
  15. package/dist/cjs/instant-apps-export.cjs.entry.js +31 -16
  16. package/dist/cjs/instant-apps-header.cjs.entry.js +3 -2
  17. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +11 -4
  18. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +1 -1
  19. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +1 -1
  20. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +2 -2
  21. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +1 -1
  22. package/dist/cjs/instant-apps-landing-page.cjs.entry.js +45 -9
  23. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +1 -1
  24. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +1 -1
  25. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +168 -0
  26. package/dist/cjs/{languageSwitcher-395021d6.js → languageSwitcher-b9a1485c.js} +3 -1
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  29. package/dist/cjs/resources-fa37e40f.js +26 -0
  30. package/dist/cjs/solutions-components.cjs.js +1 -1
  31. package/dist/collection/collection-manifest.json +3 -1
  32. package/dist/collection/components/arcgis-login/arcgis-login.js +1 -1
  33. package/dist/collection/components/basemap-gallery/basemap-gallery.js +1 -1
  34. package/dist/collection/components/buffer-tools/buffer-tools.js +1 -1
  35. package/dist/collection/components/card-manager/card-manager.js +1 -1
  36. package/dist/collection/components/create-feature/create-feature.js +1 -1
  37. package/dist/collection/components/create-related-feature/create-related-feature.js +1 -1
  38. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -1
  39. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +56 -45
  40. package/dist/collection/components/feature-details/feature-details.js +56 -13
  41. package/dist/collection/components/feature-list/feature-list.js +22 -3
  42. package/dist/collection/components/layer-list/layer-list.js +6 -13
  43. package/dist/collection/components/public-notification/public-notification.js +3 -3
  44. package/dist/collection/demos/crowdsource-reporter.html +22 -15
  45. package/dist/collection/utils/interfaces.ts +1 -0
  46. package/dist/components/arcgis-login.js +1 -1
  47. package/dist/components/basemap-gallery2.js +1 -1
  48. package/dist/components/buffer-tools2.js +1 -1
  49. package/dist/components/calcite-navigation-user.js +1 -99
  50. package/dist/components/card-manager2.js +1 -1
  51. package/dist/components/create-feature2.js +1 -1
  52. package/dist/components/create-related-feature2.js +1 -1
  53. package/dist/components/crowdsource-manager.js +1 -1
  54. package/dist/components/crowdsource-reporter.js +57 -37
  55. package/dist/components/feature-details2.js +16 -12
  56. package/dist/components/feature-list2.js +5 -3
  57. package/dist/components/helpers.js +3 -2
  58. package/dist/components/instant-apps-ckeditor-wrapper2.js +1 -1
  59. package/dist/components/instant-apps-create.js +317 -0
  60. package/dist/components/instant-apps-export.js +32 -16
  61. package/dist/components/instant-apps-filter-list2.js +6 -1
  62. package/dist/components/instant-apps-header2.js +3 -2
  63. package/dist/components/instant-apps-interactive-legend-classic2.js +12 -5
  64. package/dist/components/instant-apps-interactive-legend-legend-element-caption2.js +2 -2
  65. package/dist/components/instant-apps-landing-page.js +91 -16
  66. package/dist/components/instant-apps-language-translator2.js +3 -1
  67. package/dist/components/instant-apps-sign-in.js +11 -0
  68. package/dist/components/instant-apps-sign-in2.js +243 -0
  69. package/dist/components/instant-apps-social-share2.js +8 -2
  70. package/dist/components/layer-list2.js +6 -13
  71. package/dist/{esm/calcite-navigation-user.entry.js → components/navigation-user.js} +46 -9
  72. package/dist/components/public-notification.js +3 -3
  73. package/dist/esm/arcgis-login.entry.js +1 -1
  74. package/dist/esm/basemap-gallery_7.entry.js +1 -1
  75. package/dist/esm/buffer-tools_3.entry.js +1 -1
  76. package/dist/esm/{calcite-avatar.entry.js → calcite-avatar_2.entry.js} +64 -3
  77. package/dist/esm/calcite-block_5.entry.js +12 -3
  78. package/dist/esm/calcite-color-picker-hex-input_2.entry.js +1 -1
  79. package/dist/esm/calcite-color-picker.entry.js +1 -1
  80. package/dist/esm/calcite-dropdown-group_2.entry.js +414 -0
  81. package/dist/esm/{calcite-dropdown_4.entry.js → calcite-dropdown_2.entry.js} +2 -423
  82. package/dist/esm/calcite-flow_6.entry.js +23 -27
  83. package/dist/esm/card-manager_3.entry.js +1 -1
  84. package/dist/esm/crowdsource-manager.entry.js +1 -1
  85. package/dist/esm/crowdsource-reporter.entry.js +56 -36
  86. package/dist/esm/feature-list.entry.js +4 -3
  87. package/dist/esm/{helpers-a5a81b9d.js → helpers-61b05164.js} +3 -2
  88. package/dist/esm/instant-apps-create.entry.js +262 -0
  89. package/dist/esm/instant-apps-export.entry.js +31 -16
  90. package/dist/esm/instant-apps-header.entry.js +3 -2
  91. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +11 -4
  92. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +1 -1
  93. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +1 -1
  94. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +2 -2
  95. package/dist/esm/instant-apps-interactive-legend.entry.js +1 -1
  96. package/dist/esm/instant-apps-landing-page.entry.js +46 -10
  97. package/dist/esm/instant-apps-language-switcher.entry.js +1 -1
  98. package/dist/esm/instant-apps-language-translator.entry.js +1 -1
  99. package/dist/esm/instant-apps-sign-in.entry.js +164 -0
  100. package/dist/esm/{languageSwitcher-a4a615e4.js → languageSwitcher-d60f03b2.js} +3 -1
  101. package/dist/esm/loader.js +1 -1
  102. package/dist/esm/public-notification.entry.js +3 -3
  103. package/dist/esm/resources-16800cce.js +24 -0
  104. package/dist/esm/solutions-components.js +1 -1
  105. package/dist/esm/{utils-6419e941.js → utils-251cb6de.js} +1 -1
  106. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-create/instant-apps-create.css +150 -0
  107. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-header/instant-apps-header.css +16 -9
  108. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-landing-page/instant-apps-landing-page.css +19 -0
  109. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-sign-in/instant-apps-sign-in.css +98 -0
  110. package/dist/solutions-components/demos/crowdsource-reporter.html +22 -15
  111. package/dist/solutions-components/p-1251dcc6.entry.js +6 -0
  112. package/dist/solutions-components/{p-88495699.entry.js → p-16730f05.entry.js} +1 -1
  113. package/dist/solutions-components/p-1ae3b886.entry.js +17 -0
  114. package/dist/solutions-components/{p-63460d51.entry.js → p-1ff9eb95.entry.js} +1 -1
  115. package/dist/solutions-components/{p-8f6e0ae5.entry.js → p-26eb1225.entry.js} +1 -1
  116. package/dist/solutions-components/{p-3a2e0188.entry.js → p-2c044250.entry.js} +2 -2
  117. package/dist/solutions-components/p-314dc933.entry.js +6 -0
  118. package/dist/solutions-components/p-50741707.entry.js +6 -0
  119. package/dist/solutions-components/p-614ebce7.js +6 -0
  120. package/dist/solutions-components/{p-df73649e.entry.js → p-77cd573b.entry.js} +1 -1
  121. package/dist/solutions-components/{p-c95dcdf7.entry.js → p-7883b885.entry.js} +3 -3
  122. package/dist/solutions-components/p-79e2e203.entry.js +6 -0
  123. package/dist/solutions-components/{p-968a6fd8.entry.js → p-7b17e929.entry.js} +1 -1
  124. package/dist/solutions-components/p-80b3eb6b.entry.js +6 -0
  125. package/dist/solutions-components/p-84913712.js +6 -0
  126. package/dist/solutions-components/p-8c500fd7.entry.js +6 -0
  127. package/dist/solutions-components/{p-fe9d6d06.js → p-9f56c02c.js} +1 -1
  128. package/dist/solutions-components/{p-667c022f.entry.js → p-af4be4ce.entry.js} +1 -1
  129. package/dist/solutions-components/p-bb2e669d.entry.js +6 -0
  130. package/dist/solutions-components/p-c41997d5.js +11 -0
  131. package/dist/solutions-components/p-c512fcfb.entry.js +6 -0
  132. package/dist/solutions-components/{p-21d6360a.entry.js → p-c7f0e7a8.entry.js} +1 -1
  133. package/dist/solutions-components/{p-64da5bb8.entry.js → p-cbf0dada.entry.js} +3 -3
  134. package/dist/solutions-components/{p-9c7d4343.entry.js → p-cd91c3e7.entry.js} +1 -1
  135. package/dist/solutions-components/p-ceba37d3.entry.js +11 -0
  136. package/dist/solutions-components/{p-09b769b7.entry.js → p-d8a15e32.entry.js} +1 -1
  137. package/dist/solutions-components/p-d8da6406.entry.js +6 -0
  138. package/dist/solutions-components/p-da6b3c8a.entry.js +6 -0
  139. package/dist/solutions-components/{p-60f1055e.entry.js → p-e2400b0d.entry.js} +1 -1
  140. package/dist/solutions-components/p-e78be59a.entry.js +6 -0
  141. package/dist/solutions-components/p-f35cc7ae.entry.js +6 -0
  142. package/dist/solutions-components/solutions-components.esm.js +1 -1
  143. package/dist/solutions-components/utils/interfaces.ts +1 -0
  144. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +18 -7
  145. package/dist/types/components/feature-details/feature-details.d.ts +13 -1
  146. package/dist/types/components/feature-list/feature-list.d.ts +4 -0
  147. package/dist/types/components/layer-list/layer-list.d.ts +1 -1
  148. package/dist/types/components.d.ts +25 -2
  149. package/dist/types/preact.d.ts +7 -2
  150. package/dist/types/utils/interfaces.d.ts +1 -0
  151. package/package.json +2 -2
  152. package/dist/cjs/calcite-navigation-user.cjs.entry.js +0 -73
  153. package/dist/solutions-components/p-08a1e120.js +0 -6
  154. package/dist/solutions-components/p-3283660c.entry.js +0 -6
  155. package/dist/solutions-components/p-33647277.entry.js +0 -6
  156. package/dist/solutions-components/p-3af0764f.entry.js +0 -6
  157. package/dist/solutions-components/p-41d288c0.entry.js +0 -6
  158. package/dist/solutions-components/p-599dcc29.js +0 -6
  159. package/dist/solutions-components/p-64b4b579.entry.js +0 -11
  160. package/dist/solutions-components/p-ab96dd27.entry.js +0 -6
  161. package/dist/solutions-components/p-bb0c7be3.entry.js +0 -17
  162. package/dist/solutions-components/p-bb8e3add.entry.js +0 -11
  163. package/dist/solutions-components/p-c36bb8ca.entry.js +0 -6
  164. package/dist/solutions-components/p-cbe166fc.entry.js +0 -6
  165. package/dist/solutions-components/p-eab95aa4.entry.js +0 -6
  166. package/dist/solutions-components/p-f6a1673c.entry.js +0 -6
@@ -26,4 +26,4 @@ const Dt="calendar-wrapper",zt="calendar-wrapper--end",Et="border-top-color-one"
26
26
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
27
27
  * v2.8.2
28
28
  */
29
- function(t){if(!t)return!1;const{year:i}=R(t);return Number(i)<100}(t))return t;const{day:i,month:e,year:s}=R(t);return`${function(t){const i=(new Date).getFullYear();return 100*Math.floor(i/100)+t}(Number(s))}-${e}-${i}`}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],disabled:["handleDisabledAndReadOnlyChange"],readOnly:["handleDisabledAndReadOnlyChange"],value:["valueWatcher"],valueAsDate:["valueAsDateWatcher"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],min:["onMinChanged"],max:["onMaxChanged"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],layout:["setReferenceEl"],focusedInput:["setReferenceEl"],effectiveLocale:["loadLocaleData"]}}};Rt.style=":host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:inline-block;inline-size:100%;overflow:visible;vertical-align:top;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host .menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host .menu-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}:host .menu-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}:host .menu-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}:host .menu-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([scale=s]){--calcite-toggle-spacing:0.5rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1rem)}:host([scale=m]){--calcite-toggle-spacing:0.75rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1.5rem)}:host([scale=l]){--calcite-toggle-spacing:1rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 2rem)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.calendar-wrapper{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:translate3d(0, 0, 0)}.input-wrapper{position:relative}.input-wrapper .chevron-icon{color:var(--calcite-color-text-3)}.input-wrapper:focus-within .chevron-icon,.input-wrapper:active .chevron-icon,.input-wrapper:hover .chevron-icon{color:var(--calcite-color-text-1)}.toggle-icon{position:absolute;display:flex;cursor:pointer;align-items:center;inset-inline-end:0;inset-block:0;padding-inline:var(--calcite-toggle-spacing)}:host([range]) .input-container{display:flex}:host([range]) .input-wrapper{flex:1 1 auto}:host([range]) .horizontal-arrow-container{display:flex;align-items:center;border-width:1px;border-inline-start-width:0px;border-inline-end-width:0px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);padding-block:0px;padding-inline:0.25rem}:host([range][layout=vertical]) .input-wrapper{inline-size:100%}:host([range][layout=vertical]) .input-container{flex-direction:column;align-items:flex-start}:host([range][layout=vertical]) .calendar-wrapper--end{transform:translate3d(0, 0, 0)}:host([range][layout=vertical]) .vertical-arrow-container{inset-block-start:1.5rem;position:absolute;z-index:var(--calcite-z-index);margin-inline:1px;background-color:var(--calcite-color-foreground-1);padding-inline:0.625rem;inset-inline-start:0}.menu-container{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.menu-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.menu-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.menu-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.menu-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .menu-container{visibility:visible}.menu-container--active{visibility:visible}.input .calcite-input__wrapper{margin-block-start:0px}:host([range][layout=vertical][scale=m]) .vertical-arrow-container{inset-block-start:1.5rem;padding-inline-start:0.75rem}:host([range][layout=vertical][scale=m]) .vertical-arrow-container calcite-icon{block-size:0.75rem;inline-size:0.75rem;min-inline-size:0px}:host([range][layout=vertical][scale=l]) .vertical-arrow-container{inset-block-start:2.25rem;padding-inline:0.875rem}:host([range][layout=vertical][open]) .vertical-arrow-container{display:none}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}";const Ot="instant-apps-filter-list calcite-mode-light",jt=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function Mt(t){return t.replaceAll("'","''")}function Nt(t,i=!1){if(t){const e=new Date(t),s=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;return i?`${s} ${e.getHours()}:${e.getMinutes()}:${e.getSeconds()}`:s}}function Tt(t){var i;if(null!=t){t.value=["",""];const e=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll("calcite-input");if(null!=e)for(const t of e)t.value=""}}const Bt="instant-apps-filter-list__footer",Wt="instant-apps-filter-list__item-container--user-input",Ht=class{constructor(e){t(this,e),this.filterListReset=i(this,"filterListReset",7),this.filterUpdate=i(this,"filterUpdate",7),this.layerExpressions=void 0,this.autoUpdateUrl=!1,this.closeBtn=!1,this.closeBtnOnClick=void 0,this.comboboxOverlayPositioning="absolute",this.closeBtnText=void 0,this.openFilters=!1,this.extentSelector=!1,this.extentSelectorConfig=void 0,this.urlParams=void 0,this.filterCount=0,this.view=void 0,this.zoomBtn=!0,this.loading=void 0,this.filterLayerExpressions=void 0,this.messages=void 0,this.baseClass=Ot,this.disabled=!0,this.hasLayerExpression=!1,this.initDefExpressions=void 0,this.initMapImageExpressions=void 0,this.initPointCloudFilters=void 0}watchViewHandler(){this.handleWhenView()}watchLayerExpressions(){this.hasLayerExpression||(this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}async componentWillLoad(){var t;this.baseClass="dark"===ot(this.el)?"instant-apps-filter-list calcite-mode-dark":Ot,await this.initializeModules(),nt(this),this.hasLayerExpression=null!=this.layerExpressions,this.filterLayerExpressions=null!=this.layerExpressions?JSON.parse(JSON.stringify(this.layerExpressions)):void 0,this.disabled=!(null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)||void 0,this.reactiveUtils.whenOnce((()=>this.view)).then((()=>this.handleLayerExpressionsUpdate()))}componentShouldUpdate(t,i,e){"view"===e&&null!=t?this.handleWhenView():"layerExpressions"===e&&(this.hasLayerExpression&&this.resetAllFilters(),this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}componentWillRender(){var t;this.disabled=!((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0)||void 0}disconnectedCallback(){this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.resetAllFilters()}async initializeModules(){const[t,i,e]=await at(["esri/intl","esri/geometry/support/jsonUtils","esri/core/reactiveUtils"]);return this.geometryJsonUtils=i,this.reactiveUtils=e,this.locale=t.getLocale(),this.intl=t,Promise.resolve()}render(){const t=this.loading?this.renderLoading():this.initFilterConfig(),i=this.closeBtn?this.renderFullFooter():this.renderFooter();return e(s,null,e("calcite-panel",{class:this.baseClass,ref:t=>this.panelEl=t},e("slot",{slot:"header-content",name:"filter-header-content"}),e("slot",{slot:"header-actions-end",name:"filter-header-actions-end"}),e("div",{key:"filter-container",class:"instant-apps-filter-list__container"},t,i)))}renderLoading(){return e("calcite-loader",{label:"Loading filters..."})}renderFilter(t){const{id:i}=t;return t.expressions.map(((s,a)=>"checkbox"==s.type||null==s.type?e("div",{key:`${i}-${a}`,class:"instant-apps-filter-list__item-container"},e("div",{class:"instant-apps-filter-list__title"},e("p",null,s.name)),e("div",{class:"instant-apps-filter-list__checkbox-container"},e("calcite-checkbox",{id:s.id.toString(),scale:"l",checked:null==s?void 0:s.active,onCalciteCheckboxChange:this.handleCheckboxChange.bind(this,t,s)}))):this.initInput(t,s)))}renderLayerBlock(){return this.filterLayerExpressions.map((t=>this.renderFilterBlocks(t)))}renderFilterBlocks(t){var i;const s=this.renderFilter(t),{operator:a}=t,n="OR"===(null==a?void 0:a.trim())?"orOperator":"andOperator",o=this.renderZoomTo(t);return e("calcite-block",{key:t.id,heading:t.title,description:null===(i=this.messages)||void 0===i?void 0:i[n],open:!!this.openFilters||void 0,collapsible:!0},o,s)}renderCombobox(t,i){var s;return e("label",{key:"combo-select",class:Wt},e("span",null,i.name),e("calcite-combobox",{id:i.id.toString(),onCalciteComboboxChange:this.handleComboSelect.bind(this,i,t),label:i.name,placeholder:i.placeholder,selectionMode:"multiple","max-items":"6",scale:"s",overlayPositioning:this.comboboxOverlayPositioning},null===(s=i.fields)||void 0===s?void 0:s.map(((t,e)=>this.renderComboboxItem(i,t,e)))))}renderComboboxItem(t,i,s){var a;const n=this.createLabel(t,i),o=null==t?void 0:t.selectedFields,l=null!==(a=null==o?void 0:o.includes(i))&&void 0!==a&&a;return e("calcite-combobox-item",{key:`${n}-${s}`,value:i,textLabel:`${n}`,selected:l})}initFilterConfig(){var t,i;if((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0){if(1===this.filterLayerExpressions.length){const{operator:t}=this.filterLayerExpressions[0],s="OR"===(null==t?void 0:t.trim())?"orOperator":"andOperator",a=this.renderZoomTo(this.filterLayerExpressions[0]);return e("calcite-block",{class:"instant-apps-filter-list__operator-description",heading:null===(i=this.messages)||void 0===i?void 0:i[s],open:!0},a,this.renderFilter(this.filterLayerExpressions[0]))}if(this.filterLayerExpressions.length>1)return this.renderLayerBlock()}}renderNumberSlider(t,i){var s,a,n,o,l,r,c,h;const d=null==i?void 0:i.min,p=null==i?void 0:i.max,u=(null==i?void 0:i.step)?i.step:1,v=null!==(s=null==i?void 0:i.field)&&void 0!==s?s:"",m=[null!=(null===(a=null==i?void 0:i.range)||void 0===a?void 0:a.min)?i.range.min:d,null!=(null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.max)?i.range.max:p];return null!=d&&null!=p?e("label",{key:null==i?void 0:i.id.toString(),class:Wt},e("span",null,null==i?void 0:i.name),e("div",{class:"instant-apps-filter-list__number-input-container"},e("calcite-slider",{id:null==i?void 0:i.id.toString(),onCalciteSliderChange:this.handleSliderChange.bind(this,i,t),min:d,max:p,minValue:d,maxValue:p,"min-label":null===(l=null===(o=this.messages)||void 0===o?void 0:o.minSlider)||void 0===l?void 0:l.replace("{field}",v),"max-label":null===(c=null===(r=this.messages)||void 0===r?void 0:r.maxSlider)||void 0===c?void 0:c.replace("{field}",v),step:u,labelHandles:!0,snap:!0,value:m,"group-separator":null===(h=null==i?void 0:i.format)||void 0===h?void 0:h.digitSeparator}))):void 0}renderDatePicker(t,i){var s,a,n,o;const{min:l,max:r}=i,c=[null===(s=null==i?void 0:i.range)||void 0===s?void 0:s.min,null===(a=null==i?void 0:i.range)||void 0===a?void 0:a.max];return null!=l&&null!=r?e("label",{class:Wt},e("span",null,null==i?void 0:i.name),e("div",{class:"instant-apps-filter-list__date-picker-input-container"},e("calcite-input-date-picker",{id:null==i?void 0:i.id.toString(),onCalciteInputDatePickerChange:this.handleDatePickerRangeChange.bind(this,i,t),min:l,max:r,"overlay-positioning":"fixed",lang:null!==(n=this.locale)&&void 0!==n?n:"en",layout:"vertical",value:c,range:!0}),e("calcite-action",{onClick:this.handleResetDatePicker.bind(this,i,t),icon:"reset",text:null===(o=this.messages)||void 0===o?void 0:o.resetDatePicker,scale:"s"}))):null}renderFooter(){var t;return e("div",{class:Bt,slot:"footer"},e("calcite-button",{appearance:"outline",width:"full",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(t=this.messages)||void 0===t?void 0:t.resetFilter))}renderFullFooter(){var t,i,s;const a=null!=this.closeBtnText?this.closeBtnText:null===(t=this.messages)||void 0===t?void 0:t.close;return e("div",{class:Bt,slot:"footer"},e("calcite-button",{appearance:"outline",width:"half",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(i=this.messages)||void 0===i?void 0:i.resetFilter),e("calcite-button",{appearance:"solid",width:"half",kind:"brand",onClick:null===(s=this.closeBtnOnClick)||void 0===s?void 0:s.bind(this)},a))}renderZoomTo(t){var i;return this.zoomBtn?e("div",{class:"instant-apps-filter-list__zoom-to"},e("calcite-button",{id:(null==t?void 0:t.sublayerId)?`zoom-to-${t.id}-${t.sublayerId}`:`zoom-to-${t.id}`,appearance:"transparent",kind:"neutral",scale:"s",iconStart:"magnifying-glass-plus",onClick:this.handleZoomTo.bind(this,t)},null===(i=this.messages)||void 0===i?void 0:i.zoomTo)):void 0}handleResetDatePicker(t,i){Tt(this.panelEl.querySelector(`[id='${t.id}']`)),t.active=!1,t.definitionExpression=void 0,t.range=void 0,this.generateOutput(i)}initInput(t,i){const{type:e}=i;return"string"===e||"coded-value"==e?this.renderCombobox(t,i):"number"===e||"range"==e?"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?this.renderCombobox(t,i):this.renderNumberSlider(t,i):"date"===e?"drop-down"===(null==i?void 0:i.displayOption)?this.renderCombobox(t,i):this.renderDatePicker(t,i):void 0}async initExpressions(){if(this.loading=!0,null==this.filterLayerExpressions)return;const t=this.filterLayerExpressions;for(let i=0;i<(null==t?void 0:t.length);i++){const e=t[i].expressions;for(let s=0;s<(null==e?void 0:e.length);s++)null==e[s].active&&null!=e[s].definitionExpression&&(e[s].active=!1),await this.setInitExpression(t[i],e[s])}this.loading=!1,this.filterLayerExpressions=[...t]}handleResetFilter(){var t;null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=t.expressions)||void 0===i||i.forEach((t=>{const{type:i}=t;"string"===i||"coded-value"===i?this.resetCombobox(t):"date"===i?"drop-down"===(null==t?void 0:t.numDisplayOption)||"drop-down"===(null==t?void 0:t.displayOption)?this.resetCombobox(t):this.resetDatePicker(t):"number"===i||"range"===i?"drop-down"===(null==t?void 0:t.numDisplayOption)||"drop-down"===(null==t?void 0:t.displayOption)?this.resetCombobox(t):this.resetNumberRange(t):this.resetCheckbox(t),t.active=!1}))})),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetCombobox(t){const{id:i}=t;t.selectedFields=void 0;const e=this.panelEl.querySelector(`[id='${i}']`);if(null!=e)for(let t=0;t<e.children.length;t++)e.children[t].selected=!1}resetDatePicker(t){const{id:i}=t;t.range=void 0,Tt(this.panelEl.querySelector(`[id='${i}']`))}resetNumberRange(t){t.range=void 0;const{id:i,max:e,min:s}=t,a=this.panelEl.querySelector(`[id='${i}']`);null!=a&&(a.minValue=s,a.maxValue=e)}resetCheckbox(t){const{id:i}=t,e=this.panelEl.querySelector(`[id='${i}']`);null!=e&&(e.checked=!1)}resetAllFilters(){var t,i,e,s,a;const n=null===(e=null===(i=null===(t=this.view)||void 0===t?void 0:t.map)||void 0===i?void 0:i.allLayers)||void 0===e?void 0:e.concat(null===(a=null===(s=this.view)||void 0===s?void 0:s.map)||void 0===a?void 0:a.allTables);null==n||n.forEach((t=>{var i,e;if(jt.includes(t.type)){const s=t;"point-cloud"===s.type?s.filters=null===(i=this.initPointCloudFilters)||void 0===i?void 0:i[s.id]:"map-image"===s.type?s.allSublayers.forEach((t=>{var i,e;t.definitionExpression=null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[s.id])||void 0===e?void 0:e[t.id]})):s.definitionExpression=null===(e=this.initDefExpressions)||void 0===e?void 0:e[s.id]}}))}async updateStringExpression(t,i){const{field:e,type:s}=i,a=this.findFilterLayer(t);if(i.fields=await this.getFeatureAttributes(a,e),"date"===s){const t=a.fields.find((({name:t})=>t===e));"date-only"===(null==t?void 0:t.type)&&(i.dateOnly=!0)}if(null==i?void 0:i.selectedFields){const t=i.selectedFields.map((t=>"number"==typeof t?t:`'${Mt(t)}'`));return i.definitionExpression=`${e} IN (${t.join(",")})`,Promise.resolve(!0)}return Promise.resolve(!1)}async updateNumberExpression(t,i){var e,s;if(!(null==i?void 0:i.min)&&0!==(null==i?void 0:i.min)||!(null==i?void 0:i.max)&&0!==(null==i?void 0:i.max)){const a=this.findFilterLayer(t),{field:n}=i;if(null!=n)if(this.setExpressionFormat(a,i,n),"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)){const t=await this.getFeatureAttributes(a,n);t.sort(((t,i)=>t-i)),i.fields=t}else{const t=await this.calculateMinMaxStatistics(a,n),o=null===(e=null==t?void 0:t[0])||void 0===e?void 0:e.attributes;if(null!=(null===(s=i.format)||void 0===s?void 0:s.places)?(i.min=this.roundMinNumberDown(o[`min${n}`],i.format.places),i.max=this.roundMaxNumberUp(o[`max${n}`],i.format.places)):(i.min=o[`min${n}`],i.max=o[`max${n}`]),(null==i?void 0:i.range)&&Object.keys(i.range).length){const{min:t,max:e}=i.range;return i.definitionExpression=`${i.field} BETWEEN ${t} AND ${e}`,!0}}}return!1}async updateDateExpression(t,i){var e;const{field:s,range:a}=i,n=this.findFilterLayer(t),o=await this.calculateMinMaxStatistics(n,s),l=null===(e=null==o?void 0:o[0])||void 0===e?void 0:e.attributes;if(i.min=Nt(l[`min${s}`]),i.max=Nt(l[`max${s}`]),null!=a&&(null!=(null==a?void 0:a.max)||null!=(null==a?void 0:a.min))){let{min:t,max:e}=a;if(t=null==t?void 0:t.replace("+"," "),e=null==e?void 0:e.replace("+"," "),t||e){const a=e&&!t?"<":!e&&t?">":null;return i.definitionExpression=a?`${s} ${a} '${null!=t?t:e}'`:`${s} BETWEEN '${t}' AND '${e}'`,!0}}return!1}updateCodedValueExpression(t,i){var e;const{field:s}=t,a=[];t.codedValues={};const n=null==i?void 0:i.domain;if(null===(e=null==n?void 0:n.codedValues)||void 0===e||e.forEach((i=>{const{code:e,name:s}=i;a.push(e),null!=t.codedValues&&(t.codedValues[e]=s)})),t.fields=a,null==t?void 0:t.selectedFields){const i=t.selectedFields.map((t=>"number"==typeof t?t:`'${Mt(t)}'`)),e=`${s} IN (${i.join(",")})`;return t.definitionExpression=e,!0}return!1}updateRangeExpression(t,i){const{field:e,range:s}=t,a=null==i?void 0:i.domain;if(t.min=null==a?void 0:a.minValue,t.max=null==a?void 0:a.maxValue,s&&Object.keys(s).length){const{min:i,max:a}=s;return t.definitionExpression=`${e} BETWEEN ${i} AND ${a}`,!0}return!1}async getFeatureAttributes(t,i){var e,s,a;if(t&&jt.includes(t.type)){const n=t.createQuery();if((null===(s=null===(e=null==t?void 0:t.capabilities)||void 0===e?void 0:e.query)||void 0===s?void 0:s.supportsCacheHint)&&(n.cacheHint=!0),i){const e=this.getInitDefExprFromLayer(t);if(n.where=e||"1=1",n.outFields=[i],n.orderByFields=[`${i} DESC`],n.returnDistinctValues=!0,n.returnGeometry=!1,n.maxRecordCountFactor=3,this.extentSelector&&this.extentSelectorConfig){const t=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=t&&(n.geometry=t),n.spatialRelationship="intersects"}return null===(a=await this.queryForFeatures(t,n,i))||void 0===a?void 0:a.sort()}}return[]}async queryForFeatures(t,i,e){const s=await t.queryFeatures(i),a=null==s?void 0:s.features.filter((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[e]}));return null==a?void 0:a.map((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[e]}))}async calculateMinMaxStatistics(t,i){var e,s;if(t&&jt.includes(t.type)){const a=t.createQuery();let n=this.getInitDefExprFromLayer(t);if(a.where=n||"1=1",(null===(s=null===(e=null==t?void 0:t.capabilities)||void 0===e?void 0:e.query)||void 0===s?void 0:s.supportsCacheHint)&&(a.cacheHint=!0),i){if(a.outStatistics=[{onStatisticField:i,outStatisticFieldName:`max${i}`,statisticType:"max"},{onStatisticField:i,outStatisticFieldName:`min${i}`,statisticType:"min"}],this.extentSelector&&this.extentSelectorConfig){const t=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=t&&(a.geometry=t),a.spatialRelationship="intersects"}const e=await t.queryFeatures(a);return null==e?void 0:e.features}}return[]}getExtent(t,i){if(t&&i){const{constraints:t}=i;let e=Object.assign({},t);const s=null==e?void 0:e.geometry;if(s){const t="extent"in s?s:this.geometryJsonUtils.fromJSON(s);if("extent"===(null==t?void 0:t.type)||"polygon"===(null==t?void 0:t.type))return t}}}setInitExpression(t,i){if(i.field&&i.type){const e=this.findFilterLayer(t);return null==e?Promise.resolve():("not-loaded"!==e.loadStatus&&"failed"!==e.loadStatus||e.load(),e.when((async()=>{var s,a;const n=null===(s=e.fields)||void 0===s?void 0:s.find((({name:t})=>t===i.field)),o=null===(a=null==n?void 0:n.domain)||void 0===a?void 0:a.type;i.type="coded-value"===o||"range"===o?o:i.type,await this.updateExpression(t,i,n)})))}return this.updateExpression(t,i,void 0),Promise.resolve()}async updateExpression(t,i,e){let s=!1;const{type:a}=i;"string"===a?s=await this.updateStringExpression(t,i):"number"===a?s=await this.updateNumberExpression(t,i):"date"===a?s="drop-down"===i.displayOption?await this.updateStringExpression(t,i):await this.updateDateExpression(t,i):"coded-value"===a?s=this.updateCodedValueExpression(i,e):"range"===a?s=this.updateRangeExpression(i,e):!i.active||"checkbox"!==a&&null!=a||(s=!0),s&&this.generateOutput(t)}updateRangeExpressions(t,i,e,s){const a=this.getInitDefExprFromLayerExpression(i);!s&&0!==s||!e&&0!==e||(s===(null==t?void 0:t.min)&&e===(null==t?void 0:t.max)?(t.definitionExpression=void 0,t.active=!1):(t.definitionExpression=a?`(${a}) AND ${null==t?void 0:t.field} BETWEEN ${s} AND ${e}`:`${null==t?void 0:t.field} BETWEEN ${s} AND ${e}`,t.active=!0)),t.range={min:s,max:e}}handleCheckboxChange(t,i,e){i.active=e.target.checked,this.generateOutput(t)}handleSliderChange(t,i,e){const{maxValue:s,minValue:a}=e.target;this.updateRangeExpressions(t,i,s,a),this.generateOutput(i)}handleComboSelect(t,i,e){const s=e.target.selectedItems,{field:a,type:n}=t;if(s&&s.length){const i=s.map((({value:t})=>"number"==typeof t?t:`'${Mt(t)}'`));if("date"===n)t.selectedFields=s.map((({value:t})=>t)),t.definitionExpression=i.map((t=>this.buildDateExpression(t,a))).join(" OR ");else{t.selectedFields=s.map((({value:t})=>t));const e=`${a} IN (${i.join(",")})`;t.definitionExpression=e}t.active=!0}else t.definitionExpression=void 0,t.active=!1;this.generateOutput(i)}handleDatePickerRangeChange(t,i,e){const s=e.target,[a,n]=s.valueAsDate,o=null!=a?Nt(Math.floor(a.getTime()),!0):void 0,l=null!=n?Nt(Math.floor(n.getTime()),!0):void 0;if(null!=o||null!=l){const e=l&&null==o?"<":null==l&&o?">":null;t.definitionExpression=e?`${t.field} ${e} '${null!=o?o:l}'`:`${t.field} BETWEEN '${o}' AND '${l}'`,t.range={min:o,max:l},t.active=!0,this.generateOutput(i)}}handleURLParams(){var t;if("URLSearchParams"in window){const i=null===(t=new URLSearchParams(document.location.search).get("filter"))||void 0===t?void 0:t.split(";");let e=0;null==i||i.forEach((t=>{var i;const s=JSON.parse(t);null===(i=this.filterLayerExpressions)||void 0===i||i.forEach((t=>{var i;(null==s?void 0:s.layerId)===t.id&&(null===(i=t.expressions)||void 0===i||i.forEach((t=>{var i,a;(null===(i=t.id)||void 0===i?void 0:i.toString())===(null===(a=null==s?void 0:s.expressionId)||void 0===a?void 0:a.toString())&&(t.active=!0,e++,"range"===s.type?t.range=s.range:"select"===s.type&&(t.selectedFields=s.selectedFields))})))}))})),this.filterCount=e}}createURLParamExpression(t,i){const{id:e,range:s,selectedFields:a,type:n}=i;return"string"===n||"coded-value"===n||"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?{type:"select",layerId:t.id,expressionId:e.toString(),selectedFields:a}:"number"===n||"range"===n||"date"===n?{type:"range",layerId:t.id,expressionId:e.toString(),range:s}:{layerId:t.id,expressionId:e.toString()}}autoUpdateURLCheck(t){this.autoUpdateUrl&&(t.toString()?window.history.replaceState({},"",`${window.location.pathname}?${t} `):window.history.replaceState({},"",window.location.pathname))}generateURLParams(){var t;if("URLSearchParams"in window){const i=new URLSearchParams(window.location.search),e=[];let s=0;null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=null==t?void 0:t.expressions)||void 0===i||i.forEach((i=>{if(i.active){s++;const a=this.createURLParamExpression(t,i);e.push(JSON.stringify(a))}}))})),this.filterCount=s,e.length>0?i.set("filter",e.join(";")):i.delete("filter"),this.autoUpdateURLCheck(i),this.urlParams=i}}updateFilter(t,i,e){const{id:s}=t,a=this.view.map.findLayerById(s)||this.view.map.findTableById(s);if(null!=a)if("point-cloud"===a.type)this.updateFilterLayerPCLFilter(a,e);else if("map-image"===a.type){const e=a.findSublayerById(null==t?void 0:t.sublayerId);null!=e&&this.updateFilterLayerDefExpression(e,i,t)}else this.updateFilterLayerDefExpression(a,i,t)}updateFilterLayerDefExpression(t,i,e){const{operator:s}=e;let a=this.getInitDefExprFromLayer(t);const n=(null==i?void 0:i.length)>0&&null!=a?`(${i.join(s)}) AND (${a})`:i.length>0?i.join(s):a;t.definitionExpression=n}updateFilterLayerPCLFilter(t,i){t.filters=i}async handleWhenView(){if(null==this.view)return;const t=this.view.map;await t.loadAll(),this.handleLayerExpressionsUpdate()}async handleLayerExpressionsUpdate(){if(null==this.view)return;const t=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={};const i=t.allLayers.concat(t.allTables);for(let t=0;t<i.length;t++){const e=i.getItemAt(t);if(jt.includes(e.type)){const t=e;"point-cloud"===t.type?this.initPointCloudFilters[t.id]=t.filters:"map-image"===t.type?(this.initMapImageExpressions[t.id]={},t.allSublayers.forEach((i=>{this.initMapImageExpressions[t.id][i.id]=i.definitionExpression}))):this.initDefExpressions[t.id]=t.definitionExpression}}this.initExpressions(),this.handleURLParams()}async handleZoomTo(t){const i=this.panelEl.querySelector((null==t?void 0:t.sublayerId)?`#zoom-to-${t.id}-${t.sublayerId}`:`#zoom-to-${t.id}`);null!=i&&(i.loading=!0,i.disabled=!0),this.zoomToGraphics=[];let e=0,s=!1;const a=setInterval((()=>{e>=1e3&&s&&(this.view.goTo(this.zoomToGraphics),null!=i&&(i.loading=!1,i.disabled=!1),clearInterval(a)),e+=500}),500);await this.getZoomToGraphics(t),s=!0}async getZoomToGraphics(t){var i,e,s,a,n;const o=this.view.allLayerViews.find((({layer:i})=>i.id===t.id)),l=o.layer,r="map-image"===l.type?l.findSublayerById(t.sublayerId):l;if("point-cloud"!==r.type&&jt.includes(null==r?void 0:r.type)){const t=r.createQuery();if((null===(e=null===(i=null==l?void 0:l.capabilities)||void 0===i?void 0:i.query)||void 0===e?void 0:e.supportsCacheHint)&&(t.cacheHint=!0),t.where=null!==(s=r.definitionExpression)&&void 0!==s?s:"1=1",t.returnGeometry=!0,t.returnDistinctValues=!0,t.maxRecordCountFactor=3,t.returnExceededLimitFeatures=!0,t.outFields=[],this.extentSelector&&this.extentSelectorConfig){const i=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=i&&(t.geometry=i),t.spatialRelationship="intersects"}const c=null!=(null===(a=null==o?void 0:o.featureEffect)||void 0===a?void 0:a.filter)?o.featureEffect.filter:o.filter;null!=c&&(null!=c.objectIds&&(t.objectIds=c.objectIds),null!=c.distance&&(t.distance=c.distance),null!=c.geometry&&(t.geometry=c.geometry),null!=c.distance&&(t.distance=c.distance),null!=c.spatialRelationship&&(t.spatialRelationship=c.spatialRelationship),null!=c.units&&(t.units=c.units),null!=c.where&&(t.where=c.where),null!=c.timeExtent&&(t.timeExtent=c.timeExtent));try{const i=await r.queryFeatures(t);this.zoomToGraphics.push(...i.features)}catch(i){if(null===(n=null==i?void 0:i.message)||void 0===n?void 0:n.toLowerCase().includes("distinct"))try{t.returnDistinctValues=!1;const i=await r.queryFeatures(t);this.zoomToGraphics.push(...i.features)}catch(t){}}}return Promise.resolve()}generateOutput(t){if(null==this.view)return;const i=[];let e=[];if(t){for(const s of t.expressions){const{active:t,definitionExpression:a,pointCloudFilters:n}=s;t&&a&&i.push(`(${a})`),t&&null!=n&&n.length>0&&(e=e.concat(n))}this.updateFilter(t,i,e),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(t){return t.toLocaleString("en-US",{maximumFractionDigits:20})}roundMinNumberDown(t,i){if(null!=t){if((""+t).includes("e")){var e=(""+t).split("e"),s="";return+e[1]+i>0&&(s="+"),+(Math.floor(+e[0]+"e"+s+(+e[1]+i))+"e-"+i)}return+(Math.floor(t+"e+"+i)+"e-"+i)}}roundMaxNumberUp(t,i){if(null!=t){if((""+t).includes("e")){var e=(""+t).split("e"),s="";return+e[1]+i>0&&(s="+"),+(Math.ceil(+e[0]+"e"+s+(+e[1]+i))+"e-"+i)}return+(Math.ceil(t+"e+"+i)+"e-"+i)}}roundNumber(t,i){if(null!=t){if((""+t).includes("e")){var e=(""+t).split("e"),s="";return+e[1]+i>0&&(s="+"),+(Math.round(+e[0]+"e"+s+(+e[1]+i))+"e-"+i)}return+(Math.round(t+"e+"+i)+"e-"+i)}}setExpressionFormat(t,i,e){if(null!=(null==t?void 0:t.popupTemplate)){const s=t.popupTemplate.fieldInfos.find((({fieldName:t})=>t===e));i.format=null==s?void 0:s.format}}getInitDefExprFromLayer(t){var i,e,s;return"sublayer"===t.type?null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.layer.id])||void 0===e?void 0:e[t.id]:null===(s=this.initDefExpressions)||void 0===s?void 0:s[t.id]}getInitDefExprFromLayerExpression(t){var i,e,s;return null!=(null==t?void 0:t.sublayerId)?null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.id])||void 0===e?void 0:e[t.sublayerId]:null===(s=this.initDefExpressions)||void 0===s?void 0:s[t.id]}findFilterLayer(t){const i=this.view.map.allLayers.concat(this.view.map.allTables).find((({id:i})=>i===t.id));return"map-image"===i.type?null==i?void 0:i.findSublayerById(t.sublayerId):i}createLabel(t,i){var e;let s=i;if("coded-value"===t.type)s=null===(e=t.codedValues)||void 0===e?void 0:e[i];else if("number"===t.type&&"number"==typeof i&&null!=t.format)null!=t.format.places&&(s=this.roundNumber(i,t.format.places)),t.format.digitSeparator&&(s=this.numberWithCommas(s));else if("date"===t.type&&!t.dateOnly){const e=t.dateOnly?this.intl.convertDateFormatToIntlOptions("short-date-long-time"):void 0;s=this.intl.formatDate(i,e)}return s}buildDateExpression(t,i){if(t){const e=new Date(t),s=new Date(t),a=new Date(s.setDate(e.getDate()+1)),n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`,o=`${e.getHours()}:${e.getMinutes()}:${e.getSeconds()}`,l=`${a.getHours()}:${a.getMinutes()}:${a.getSeconds()}`;return`${i} BETWEEN '${n} ${o}' AND '${a.getFullYear()}-${a.getMonth()+1}-${a.getDate()} ${l}'`}}get el(){return a(this)}static get watchers(){return{view:["watchViewHandler"],layerExpressions:["watchLayerExpressions"]}}};Ht.style=":host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:normal}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;font-size:16px;--calcite-combobox-input-height:24px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:64px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:normal;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1:12px}.instant-apps-filter-list__zoom-to{display:flex;justify-content:flex-end;margin:8px 0 20px}.instant-apps-filter-list__zoom-to calcite-action{width:-moz-min-content;width:min-content}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1:16px}@media (prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor:2;--calcite-internal-animation-timing-slow:calc(300ms * 2)}}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}";const Ut="instant-apps-social-share",Vt={base:Ut,dialog:`${Ut}__dialog`,dialogEmbed:`${Ut}__dialog-embed`,dialogContent:`${Ut}__dialog-content`,options:`${Ut}__options`,tipContainer:`${Ut}__tip`,tipHeader:`${Ut}__tip-header`,tipContent:`${Ut}__tip-content`,icon:`${Ut}__icon`,iconContainer:`${Ut}__icon-container`,optionText:`${Ut}__option-text`,popoverButton:`${Ut}__popover-button`,layout:{vertical:`${Ut}__layout--vertical`,horizontal:`${Ut}__layout--horizontal`},xLogo:{light:`${Ut}__x-logo--light`,dark:`${Ut}__x-logo--dark`},success:{container:`${Ut}__success`,header:`${Ut}__success-header`,message:`${Ut}__success-message`,icon:`${Ut}__success-icon`},embed:{container:`${Ut}__embed`,header:`${Ut}__embed-header`,embedCode:{container:`${Ut}__embed-code`,textArea:`${Ut}__embed-code-text-area`,copyButton:`${Ut}__embed-code-copy-button`},textAreaText:`${Ut}__embed-text-area-text`,dimensions:{container:`${Ut}__embed-dimensions`,input:`${Ut}__embed-dimensions-input`}},rtl:{optionText:`${Ut}__option-text--rtl`,textArea:`${Ut}__text-area--rtl`}},qt={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",x:"https://x.com/intent/post?url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}"},Jt=class{constructor(i){t(this,i),this.mode="popover",this.shareUrl=window.location.href,this.autoUpdateShareUrl=!0,this.shareText="",this.embed=!1,this.shareButtonColor="neutral",this.shareButtonType="button",this.shareButtonScale=void 0,this.iframeInnerText="",this.popoverButtonIconScale="m",this.view=void 0,this.displayTipText=!0,this.shortenShareUrl=!0,this.socialMedia=!0,this.shareIconsLayout="vertical",this.scale="m",this.successMessage="",this.defaultUrlParams=null,this.inlineSuccessPopoverPlacement="trailing",this.messages=void 0,this.opened=!1,this.copied=!1,this.inlineCopyLinkOpened=!1,this.inlineCopyEmbedOpened=!1,this.embedWidth=400,this.embedHeight=600}componentDidLoad(){var t,i;nt(this),this.setupAutoCloseListeners(),"popover"===this.mode&&(this.opened&&(this.popoverRef.open=!0),this.popoverRef.addEventListener("calcitePopoverOpen",(()=>{this.shareListRef&&this.shareListRef.children[0].focus()})),this.popoverRef.addEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))),this.embed&&(null===(t=this.embedWidthRef)||void 0===t||t.addEventListener("change",this.updateDimensions.bind(this,"width")),null===(i=this.embedHeightRef)||void 0===i||i.addEventListener("change",this.updateDimensions.bind(this,"height")))}disconnectedCallback(){var t,i,e;document.documentElement.removeEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?null!=this.popoverRef&&(this.popoverRef.removeEventListener("click",this.stopPropagationCallback.bind(this)),this.popoverRef.removeEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this)),this.popoverRef.removeEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))):(null===(t=this.embedWidthRef)||void 0===t||t.removeEventListener("change",this.updateDimensions.bind(this)),null===(i=this.embedHeightRef)||void 0===i||i.removeEventListener("change",this.updateDimensions.bind(this)),null===(e=this.dialogContentRef)||void 0===e||e.removeEventListener("click",this.stopPropagationCallback.bind(this)))}setupAutoCloseListeners(){var t,i,e;document.documentElement.addEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?(null===(t=this.popoverRef)||void 0===t||t.addEventListener("click",this.stopPropagationCallback.bind(this)),null===(i=this.popoverRef)||void 0===i||i.addEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this))):null===(e=this.dialogContentRef)||void 0===e||e.addEventListener("click",this.stopPropagationCallback.bind(this))}handlePopoverRefKeyDown(t){var i,e;if("Tab"===t.code){if(!this.shareListRef)return;const e=t.target,s=this.shareListRef.children[0],a=this.shareListRef.children[(null===(i=this.shareListRef)||void 0===i?void 0:i.children.length)-1];t.shiftKey&&e===s?(t.preventDefault(),a.focus()):t.shiftKey||e!==a||(t.preventDefault(),s.focus())}else"Escape"===t.code&&(this.closePopover(),null===(e=this.popoverButtonRef)||void 0===e||e.setFocus())}autoCloseCallback(){"popover"===this.mode?(this.opened=!1,this.popoverRef.open=this.opened):(this.copyLinkPopoverRef&&(this.copyLinkPopoverRef.open=!1),this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef&&(this.copyEmbedPopoverRef.open=!1),this.inlineCopyEmbedOpened=!1)}stopPropagationCallback(t){t.stopPropagation()}resetPopoverCopyState(){var t;null===(t=this.popoverButtonRef)||void 0===t||t.setFocus(),setTimeout((()=>{this.copied=!1}),200)}updateDimensions(t){var i,e;if("width"===t){const t=null===(i=this.embedWidthRef)||void 0===i?void 0:i.value;this.embedWidth=parseInt(t)}else{const t=null===(e=this.embedHeightRef)||void 0===e?void 0:e.value;this.embedHeight=parseInt(t)}}render(){var t,i,a,n,o,l;const r=this.copied&&"popover"===this.mode?this.renderSuccess():e("div",{class:Vt.dialogContent},this.renderOptions(),this.displayTipText?this.renderTip():null,this.embed?this.renderEmbed():null),c=e("div",{ref:t=>this.dialogContentRef=t,class:`${Vt.dialog}${"vertical"===this.shareIconsLayout?` ${Vt.layout.vertical}`:` ${Vt.layout.horizontal}`}`},r);return e(s,null,"popover"===this.mode?[e("calcite-popover",{ref:t=>this.popoverRef=t,label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,referenceElement:"shareButton",placement:"bottom-start",scale:this.scale},c),this.renderButton()]:[c,e("calcite-popover",{ref:t=>this.copyLinkPopoverRef=t,label:null===(n=null===(a=this.messages)||void 0===a?void 0:a.share)||void 0===n?void 0:n.label,referenceElement:"copyToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderSuccess()),e("calcite-popover",{ref:t=>this.copyEmbedPopoverRef=t,label:null===(l=null===(o=this.messages)||void 0===o?void 0:o.share)||void 0===l?void 0:l.label,referenceElement:"copyEmbedToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderEmbedSuccess())])}renderButton(){var t,i,s,a,n,o,l,r;const c=null!=this.shareButtonScale?this.shareButtonScale:this.scale;return"button"===this.shareButtonType?e("calcite-button",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:Vt.popoverButton,kind:this.shareButtonColor,appearance:"transparent",label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,title:null===(a=null===(s=this.messages)||void 0===s?void 0:s.share)||void 0===a?void 0:a.label,scale:c},e("div",{class:Vt.iconContainer},e("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale}))):e("calcite-action",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:Vt.popoverButton,appearance:"transparent",label:null===(o=null===(n=this.messages)||void 0===n?void 0:n.share)||void 0===o?void 0:o.label,title:null===(r=null===(l=this.messages)||void 0===l?void 0:l.share)||void 0===r?void 0:r.label,scale:c,text:"",alignment:"center"},e("div",{class:Vt.iconContainer},e("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale})))}renderSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return e("div",{class:Vt.success.container},e("span",{class:Vt.success.header},e("span",{class:Vt.success.icon},e("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),e("span",{class:Vt.success.message},this.successMessage||(null==i?void 0:i.url)))}renderEmbedSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return e("div",{class:Vt.success.container},e("span",{class:Vt.success.header},e("span",{class:Vt.success.icon},e("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),e("span",{class:Vt.success.message},null==i?void 0:i.embed))}renderOptions(){var t,i,s,a;const n=null===(t=this.messages)||void 0===t?void 0:t.options,o="rtl"===document.dir?` ${Vt.rtl.optionText}`:"";return e("ul",{ref:t=>this.shareListRef=t,class:Vt.options,role:"menu"},e("li",{id:"copyToClipboard",onClick:this.handleShareItem.bind(this,"link"),onKeyDown:this.handleOptionKeyDown("link"),role:"menuitem",tabindex:"0"},e("span",{class:Vt.icon},e("calcite-icon",{icon:"link",scale:this.scale})),e("span",{class:`${Vt.optionText}${o}`},null===(i=null==n?void 0:n.link)||void 0===i?void 0:i.label)),this.socialMedia?[e("li",{onClick:this.handleShareItem.bind(this,"facebook"),onKeyDown:this.handleOptionKeyDown("facebook"),role:"menuitem",tabindex:"0"},e("span",{class:Vt.icon},this.renderFacebookIcon()),e("span",{class:`${Vt.optionText}${o}`},null===(s=null==n?void 0:n.facebook)||void 0===s?void 0:s.label)),e("li",{onClick:this.handleShareItem.bind(this,"x"),onKeyDown:this.handleOptionKeyDown("x"),role:"menuitem",tabindex:"0"},e("span",{class:Vt.icon},this.renderXIcon()),e("span",{class:`${Vt.optionText}${o}`},"X")),e("li",{onClick:this.handleShareItem.bind(this,"linkedIn"),onKeyDown:this.handleOptionKeyDown("linkedIn"),role:"menuitem",tabindex:"0"},e("span",{class:Vt.icon},this.renderLinkedInIcon()),e("span",{class:`${Vt.optionText}${o}`},null===(a=null==n?void 0:n.linkedIn)||void 0===a?void 0:a.label))]:null)}handleOptionKeyDown(t){return i=>{const e=i.code;("Space"===e||"Enter"===e)&&this.handleShareItem(t)}}renderFacebookIcon(){return e("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},e("g",null,e("path",{d:"M512,256c0,-141.385 -114.615,-256 -256,-256c-141.385,0 -256,114.615 -256,256c0,127.777 93.616,233.685 216,252.89l0,-178.89l-65,0l0,-74l65,0l0,-56.4c0,-64.16 38.219,-99.6 96.695,-99.6c28.009,0 57.305,5 57.305,5l0,63l-32.281,0c-31.801,0 -41.719,19.733 -41.719,39.978l0,48.022l71,0l-11.35,74l-59.65,0l0,178.89c122.385,-19.205 216,-125.113 216,-252.89Z",style:{fill:"#1877f2",fillRule:"nonzero"}}),e("path",{d:"M355.65,330l11.35,-74l-71,0l0,-48.022c0,-20.245 9.917,-39.978 41.719,-39.978l32.281,0l0,-63c0,0 -29.297,-5 -57.305,-5c-58.476,0 -96.695,35.44 -96.695,99.6l0,56.4l-65,0l0,74l65,0l0,178.89c13.033,2.045 26.392,3.11 40,3.11c13.608,0 26.966,-1.065 40,-3.11l0,-178.89l59.65,0Z",style:{fill:"#fff",fillRule:"nonzero"}})))}renderXIcon(){const t=!!this.el.closest(".calcite-mode-dark");return e("svg",{class:t?Vt.xLogo.dark:Vt.xLogo.light,width:"1200",height:"1227",viewBox:"0 0 1200 1227",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("rect",{height:"400",style:{fill:"none"},width:"400",x:"56",y:"56"}),e("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",fill:t?"white":"black"}))}renderLinkedInIcon(){return e("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},e("g",{id:"g5891"},e("path",{d:"M512,64c0,-35.323 -28.677,-64 -64,-64l-384,0c-35.323,0 -64,28.677 -64,64l0,384c0,35.323 28.677,64 64,64l384,0c35.323,0 64,-28.677 64,-64l0,-384Z",id:"background",style:{fill:"#2867b2"}}),e("g",{id:"shapes"},e("rect",{height:"257.962",id:"rect11",style:{fill:"#fff"},width:"85.76",x:"61.053",y:"178.667"}),e("path",{d:"M104.512,54.28c-29.341,0 -48.512,19.29 -48.512,44.573c0,24.752 18.588,44.574 47.377,44.574l0.554,0c29.903,0 48.516,-19.822 48.516,-44.574c-0.555,-25.283 -18.611,-44.573 -47.935,-44.573Z",id:"path13-0",style:{fill:"#fff",fillRule:"nonzero"}}),e("path",{d:"M357.278,172.601c-45.49,0 -65.866,25.017 -77.276,42.589l0,-36.523l-85.738,0c1.137,24.197 0,257.961 0,257.961l85.737,0l0,-144.064c0,-7.711 0.554,-15.42 2.827,-20.931c6.188,-15.4 20.305,-31.352 43.993,-31.352c31.012,0 43.436,23.664 43.436,58.327l0,138.02l85.741,0l0,-147.93c0,-79.237 -42.305,-116.097 -98.72,-116.097Z",id:"path15",style:{fill:"#fff",fillRule:"nonzero"}}))))}renderTip(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.info;return e("div",{class:Vt.tipContainer},e("span",{class:Vt.tipHeader},e("calcite-icon",{icon:"lightbulb",scale:this.scale}),e("span",null,null==i?void 0:i.label)),e("p",{class:Vt.tipContent},null==i?void 0:i.tooltip))}renderEmbed(){var t,i,s;const a=null===(t=this.messages)||void 0===t?void 0:t.embed,n="rtl"===document.dir?` ${Vt.rtl.textArea}`:"";return e("div",{class:Vt.embed.container},e("span",{class:Vt.embed.header},e("calcite-icon",{icon:"code",scale:this.scale}),e("span",null,null===(s=null===(i=this.messages)||void 0===i?void 0:i.embed)||void 0===s?void 0:s.label)),e("div",{class:Vt.embed.embedCode.container},e("div",{class:Vt.embed.embedCode.textArea},e("textarea",{ref:t=>this.embedCodeRef=t,cols:30,rows:5,readonly:!0,class:n,value:this.getEmbedCode()}),e("button",{id:"copyEmbedToClipboard",onClick:this.copyEmbedCode.bind(this),class:Vt.embed.embedCode.copyButton},e("calcite-icon",{icon:"copy",scale:this.scale}),e("span",null,null==a?void 0:a.copy))),e("span",{class:Vt.embed.textAreaText},e("slot",{name:"text-area-text"})),e("div",{class:Vt.embed.dimensions.container},e("label",{class:Vt.embed.dimensions.input},e("span",null,null==a?void 0:a.width),e("input",{ref:t=>this.embedWidthRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("width"),value:this.embedWidth,min:"1"})),e("label",{class:Vt.embed.dimensions.input},e("span",null,null==a?void 0:a.height),e("input",{ref:t=>this.embedHeightRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("height"),value:this.embedHeight,min:"1"})))))}handleNumberInputOnChange(t){const i="width"===t?this.embedWidthRef:this.embedHeightRef,e="width"===t?"embedWidth":"embedHeight";return()=>{i&&parseFloat(i.value)<=0&&(this[e]=parseInt("1"),i.value="1")}}togglePopover(t){t.stopPropagation(),this.opened=!this.opened,this.popoverRef.open=this.opened}closePopover(){this.opened=!1,this.popoverRef.open=this.opened}async handleShareItem(t){var i,e,s,a;this.shareUrl=await this.generateShareUrl();let n=null;const o=null!==(e=null===(i=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===i?void 0:i.includes("Chrome"))&&void 0!==e&&e,l=null!==(a=null===(s=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===s?void 0:s.includes("Safari"))&&void 0!==a&&a&&!o;!l&&this.shortenShareUrl&&(n=await this.shortenUrl(this.shareUrl));let r=n||this.shareUrl;switch(t){case"link":return navigator.clipboard.writeText(r),this.embed&&(this.copyEmbedPopoverRef.open=!1,this.inlineCopyEmbedOpened=!1),"inline"===this.mode&&(this.copyLinkPopoverRef.open=!0,setTimeout((()=>this.copyLinkPopoverRef.open=!1),3e3)),this.inlineCopyLinkOpened=!0,this.copied=!0,void("popover"===this.mode&&setTimeout((()=>this.closePopover()),2e3));case"facebook":case"x":case"linkedIn":let i;l&&(i=window.open("","_blank"),this.shortenShareUrl&&(r=await this.shortenUrl(this.shareUrl)||r));const e={url:encodeURI(r)},s="x"===t?Object.assign(Object.assign({},e),{text:this.shareText}):e,[a]=await at(["esri/intl"]),n=a.substitute(qt[t],s);return"popover"===this.mode&&this.closePopover(),void(l&&i?(i.location=n,i.focus()):window.open(encodeURI(n),"_blank"))}}async shortenUrl(t){var i,e;const[s]=await at(["esri/request"]),a=await s("https://arcg.is/prod/shorten",{query:{longUrl:t,f:"json"}}),n=null===(e=null===(i=null==a?void 0:a.data)||void 0===i?void 0:i.data)||void 0===e?void 0:e.url;if(n)return n.replace("http://","https://")}getEmbedCode(){return`<iframe src="${this.shareUrl}" width="${this.embedWidth}" height="${this.embedHeight}" frameborder="0" style="border:0" allowfullscreen>${this.iframeInnerText}</iframe>`}copyEmbedCode(){navigator.clipboard.writeText(this.getEmbedCode()),this.copyLinkPopoverRef.open=!1,this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef.open=!0,setTimeout((()=>this.copyEmbedPopoverRef.open=!1),3e3),this.inlineCopyEmbedOpened=!0}async generateShareUrl(){var t;if(this.autoUpdateShareUrl&&(this.shareUrl=window.location.href),!this.view||!(null===(t=this.view)||void 0===t?void 0:t.ready))return this.shareUrl;const{x:i,y:e}=this.view.center,{spatialReference:s}=this.view,[a,n]=await at(["esri/geometry/Point","esri/geometry/SpatialReference"]),o=new a({x:i,y:e,spatialReference:new n(Object.assign({},s.toJSON()))}),l=await this.processPoint(o),{isWGS84:r,isWebMercator:c}=l.spatialReference;return this.generateShareUrlParams(l,r||c)}async processPoint(t){const{isWGS84:i,isWebMercator:e}=t.spatialReference;if(i||e)return t;const[s,a]=await at(["esri/geometry/SpatialReference","esri/geometry/projection"]),n=new s({wkid:4326});try{await a.load();const i=a.project(t,n);return Promise.resolve(i)}catch(t){return console.error("Failed to project point",t),Promise.reject(null)}}generateShareUrlParams(t,i){var e,s,a,n;const{longitude:o,latitude:l,x:r,y:c}=t;if(void 0===o||void 0===l)return this.shareUrl;const h=this.roundValue(i?o:r),d=this.roundValue(i?l:c),{zoom:p}=this.view,u=this.roundValue(p),v=null===(s=null===(e=this.view)||void 0===e?void 0:e.popup)||void 0===s?void 0:s.selectedFeature,m=null===(n=null===(a=this.view)||void 0===a?void 0:a.popup)||void 0===n?void 0:n.visible;let f,g;if(v&&m){const t=null==v?void 0:v.layer;f=t.id,g=v.attributes[t.objectIdField]}const b=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";"),{type:x}=this.view,{defaultUrlParams:y}=this,w=new URL(this.shareUrl),{searchParams:_}=w;if(_.get("center")&&_.delete("center"),_.get("level")&&_.delete("level"),_.get("selectedFeature")&&_.delete("selectedFeature"),_.get("hiddenLayers")&&_.delete("hiddenLayers"),_.get("viewpoint")&&_.delete("viewpoint"),"3d"===x){const{camera:t}=this.view,{heading:i,position:e,tilt:s}=t,{longitude:a,latitude:n,z:o}=e,l={longitude:this.roundValue(a,8),latitude:this.roundValue(n,8),z:this.roundValue(o,3),heading:this.roundValue(i,3),tilt:this.roundValue(s,3)};return!1!==(null==y?void 0:y.viewpoint)&&w.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),f&&g&&!1!==(null==y?void 0:y.selectedFeature)&&w.searchParams.set("selectedFeature",`${f};${g}`),b&&!1!==(null==y?void 0:y.hiddenLayers)&&w.searchParams.set("hiddenLayers",b),w.search=decodeURIComponent(w.search),w.href}return!1!==(null==y?void 0:y.center)&&w.searchParams.set("center",`${h};${d}`),!1!==(null==y?void 0:y.level)&&w.searchParams.set("level",`${u}`),f&&g&&!1!==(null==y?void 0:y.selectedFeature)&&w.searchParams.set("selectedFeature",`${f};${g}`),b&&!1!==(null==y?void 0:y.hiddenLayers)&&w.searchParams.set("hiddenLayers",b),w.search=decodeURIComponent(w.search),w.href}roundValue(t,i=4){return parseFloat(t.toFixed(i))}get el(){return a(this)}};Jt.style=":host{display:block;--instant-apps-social-share-action-width:initial;--instant-apps-social-share-width--s:200px;--instant-apps-social-share-width--m:280px;--instant-apps-social-share-width--l:320px;--instant-apps-social-share-width-horizontal--s:300px;--instant-apps-social-share-width-horizontal--m:380px;--instant-apps-social-share-width-horizontal--l:420px;--instant-apps-social-share-background-color:var(--calcite-color-foreground-1);--instant-apps-social-share-popover-button-background-color:transparent;--instant-apps-social-share-popover-button-icon-color:var(--calcite-ui-icon-color);--instant-apps-social-share-embed-border:1px solid $border;--instant-apps-social-share-embed-text-area-text:#468540}:host .instant-apps-social-share__popover-button{background-color:var(--instant-apps-social-share-popover-button-background-color)}:host .instant-apps-social-share__popover-button calcite-icon{color:var(--instant-apps-social-share-popover-button-icon-color)}:host .instant-apps-social-share__dialog,:host .instant-apps-social-share__dialog-embed{background-color:var(--instant-apps-social-share-background-color);border:var(--instant-apps-social-share-embed-border)}:host .instant-apps-social-share__dialog{box-sizing:border-box;height:auto;padding:10px 0;border-radius:5px}:host .instant-apps-social-share__options{margin:0;padding:1% 0 0 0;list-style-type:none}:host .instant-apps-social-share__options li{box-sizing:border-box;display:flex;align-items:center;width:100%;padding:5%;transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__options li .instant-apps-social-share__icon,:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{display:inline-block}:host .instant-apps-social-share__options li .instant-apps-social-share__icon{display:flex;align-items:center}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{width:85%;margin-left:10px;word-break:break-word}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text--rtl{margin-left:0;margin-right:10px}:host .instant-apps-social-share__options li:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}:host .instant-apps-social-share__options__x-logo--light path{fill:#000000}:host .instant-apps-social-share__options__x-logo--dark path{fill:#ffffff}:host .instant-apps-social-share__tip{box-sizing:border-box;padding:0 5% 1% 5%}:host .instant-apps-social-share__tip-header{display:flex;align-items:center;color:#007ac2;margin:8px 0 5px 0}:host .instant-apps-social-share__tip-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__tip-content{line-height:17px;margin:0;padding-top:2%}:host .instant-apps-social-share__success{display:flex;flex-direction:column;padding:15px}:host .instant-apps-social-share__success-header{display:flex;align-items:center;font-weight:bold;margin-bottom:10px}:host .instant-apps-social-share__success-icon{display:flex;align-items:center;margin-right:5px}:host .instant-apps-social-share__success-icon calcite-icon{color:var(--calcite-color-status-success)}:host .instant-apps-social-share__success-message{line-height:16px}:host .instant-apps-social-share__embed{box-sizing:border-box;width:100%;padding:5%;margin-bottom:10px;border-top:1px solid #d3d3d3}:host .instant-apps-social-share__embed-header{display:flex;align-items:center;margin-bottom:5px}:host .instant-apps-social-share__embed-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__embed-code-text-area{border:1px solid #d3d3d3}:host .instant-apps-social-share__embed-code-text-area textarea{box-sizing:border-box;padding:4%;border:none;resize:none;background:transparent;width:100%;font-family:var(--calcite-sans-family);color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button{display:flex;align-items:center;text-align:start;width:100%;border:none;border-top:1px solid #d3d3d3;background-color:transparent;line-height:16px;font-weight:400;padding:3%;color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button calcite-icon{color:#007ac2;margin-right:3px}:host .instant-apps-social-share__embed-code-text-area button:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2);transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__embed-text-area-text{font-weight:600;color:var(--instant-apps-social-share-embed-text-area-text)}:host .instant-apps-social-share__embed .instant-apps-social-share__text-area--rtl{text-align:left;direction:ltr}:host .instant-apps-social-share__embed-dimensions{display:flex;justify-content:space-between;margin-top:10px}:host .instant-apps-social-share__embed-dimensions-input{width:47%;box-sizing:border-box}:host .instant-apps-social-share__embed-dimensions-input input{border:1px solid #d3d3d3;width:100%;height:25px;font-family:var(--calcite-sans-family)}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options{display:flex;justify-content:space-around;margin-bottom:8%}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li{flex-direction:column;padding:0}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li .instant-apps-social-share__option-text{word-break:break-word;margin-left:0;margin-top:10px;text-align:center}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li:hover{background-color:unset}:host .instant-apps-social-share__icon-container{display:flex;align-items:center}:host calcite-action{width:var(--instant-apps-social-share-action-width)}:host([scale=s]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--s)}:host([scale=s]) .instant-apps-social-share__icon{width:16px;height:16px}:host([scale=s]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size--1)}:host([scale=s]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--s)}:host([scale=s]) .instant-apps-social-share__tip-header,:host([scale=s]) .instant-apps-social-share__tip-content,:host([scale=s]) .instant-apps-social-share__embed-header,:host([scale=s]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--2)}:host([scale=m]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--m)}:host([scale=m]) .instant-apps-social-share__icon{width:24px;height:24px}:host([scale=m]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-0)}:host([scale=m]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--m)}:host([scale=m]) .instant-apps-social-share__tip-header,:host([scale=m]) .instant-apps-social-share__tip-content,:host([scale=m]) .instant-apps-social-share__embed-header,:host([scale=m]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--1)}:host([scale=l]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--l)}:host([scale=l]) .instant-apps-social-share__icon{width:32px;height:32px}:host([scale=l]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-1)}:host([scale=l]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--l)}:host([scale=l]) .instant-apps-social-share__tip-header,:host([scale=l]) .instant-apps-social-share__tip-content,:host([scale=l]) .instant-apps-social-share__embed-header,:host([scale=l]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size-0)}";export{xt as calcite_block,Ct as calcite_date_picker,Rt as calcite_input_date_picker,Ht as instant_apps_filter_list,Jt as instant_apps_social_share}
29
+ function(t){if(!t)return!1;const{year:i}=R(t);return Number(i)<100}(t))return t;const{day:i,month:e,year:s}=R(t);return`${function(t){const i=(new Date).getFullYear();return 100*Math.floor(i/100)+t}(Number(s))}-${e}-${i}`}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],disabled:["handleDisabledAndReadOnlyChange"],readOnly:["handleDisabledAndReadOnlyChange"],value:["valueWatcher"],valueAsDate:["valueAsDateWatcher"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],min:["onMinChanged"],max:["onMaxChanged"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],layout:["setReferenceEl"],focusedInput:["setReferenceEl"],effectiveLocale:["loadLocaleData"]}}};Rt.style=":host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:inline-block;inline-size:100%;overflow:visible;vertical-align:top;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host .menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host .menu-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}:host .menu-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}:host .menu-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}:host .menu-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([scale=s]){--calcite-toggle-spacing:0.5rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1rem)}:host([scale=m]){--calcite-toggle-spacing:0.75rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1.5rem)}:host([scale=l]){--calcite-toggle-spacing:1rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 2rem)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.calendar-wrapper{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:translate3d(0, 0, 0)}.input-wrapper{position:relative}.input-wrapper .chevron-icon{color:var(--calcite-color-text-3)}.input-wrapper:focus-within .chevron-icon,.input-wrapper:active .chevron-icon,.input-wrapper:hover .chevron-icon{color:var(--calcite-color-text-1)}.toggle-icon{position:absolute;display:flex;cursor:pointer;align-items:center;inset-inline-end:0;inset-block:0;padding-inline:var(--calcite-toggle-spacing)}:host([range]) .input-container{display:flex}:host([range]) .input-wrapper{flex:1 1 auto}:host([range]) .horizontal-arrow-container{display:flex;align-items:center;border-width:1px;border-inline-start-width:0px;border-inline-end-width:0px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);padding-block:0px;padding-inline:0.25rem}:host([range][layout=vertical]) .input-wrapper{inline-size:100%}:host([range][layout=vertical]) .input-container{flex-direction:column;align-items:flex-start}:host([range][layout=vertical]) .calendar-wrapper--end{transform:translate3d(0, 0, 0)}:host([range][layout=vertical]) .vertical-arrow-container{inset-block-start:1.5rem;position:absolute;z-index:var(--calcite-z-index);margin-inline:1px;background-color:var(--calcite-color-foreground-1);padding-inline:0.625rem;inset-inline-start:0}.menu-container{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.menu-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.menu-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.menu-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.menu-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .menu-container{visibility:visible}.menu-container--active{visibility:visible}.input .calcite-input__wrapper{margin-block-start:0px}:host([range][layout=vertical][scale=m]) .vertical-arrow-container{inset-block-start:1.5rem;padding-inline-start:0.75rem}:host([range][layout=vertical][scale=m]) .vertical-arrow-container calcite-icon{block-size:0.75rem;inline-size:0.75rem;min-inline-size:0px}:host([range][layout=vertical][scale=l]) .vertical-arrow-container{inset-block-start:2.25rem;padding-inline:0.875rem}:host([range][layout=vertical][open]) .vertical-arrow-container{display:none}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}";const Ot="instant-apps-filter-list calcite-mode-light",jt=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function Mt(t){return t.replaceAll("'","''")}function Nt(t,i=!1){if(t){const e=new Date(t),s=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;return i?`${s} ${e.getHours()}:${e.getMinutes()}:${e.getSeconds()}`:s}}function Tt(t){var i;if(null!=t){t.value=["",""];const e=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll("calcite-input");if(null!=e)for(const t of e)t.value=""}}const Bt="instant-apps-filter-list__footer",Wt="instant-apps-filter-list__item-container--user-input",Ht=class{constructor(e){t(this,e),this.filterListReset=i(this,"filterListReset",7),this.filterUpdate=i(this,"filterUpdate",7),this.layerExpressions=void 0,this.autoUpdateUrl=!1,this.closeBtn=!1,this.closeBtnOnClick=void 0,this.comboboxOverlayPositioning="absolute",this.closeBtnText=void 0,this.openFilters=!1,this.extentSelector=!1,this.extentSelectorConfig=void 0,this.urlParams=void 0,this.filterCount=0,this.view=void 0,this.zoomBtn=!0,this.loading=void 0,this.filterLayerExpressions=void 0,this.messages=void 0,this.baseClass=Ot,this.disabled=!0,this.hasLayerExpression=!1,this.initDefExpressions=void 0,this.initMapImageExpressions=void 0,this.initPointCloudFilters=void 0}watchViewHandler(){this.handleWhenView()}watchLayerExpressions(){this.hasLayerExpression||(this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}async componentWillLoad(){var t;this.baseClass="dark"===ot(this.el)?"instant-apps-filter-list calcite-mode-dark":Ot,await this.initializeModules(),nt(this),this.hasLayerExpression=null!=this.layerExpressions,this.filterLayerExpressions=null!=this.layerExpressions?JSON.parse(JSON.stringify(this.layerExpressions)):void 0,this.disabled=!(null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)||void 0,this.reactiveUtils.whenOnce((()=>this.view)).then((()=>this.handleLayerExpressionsUpdate()))}componentShouldUpdate(t,i,e){"view"===e&&null!=t?this.handleWhenView():"layerExpressions"===e&&(this.hasLayerExpression&&this.resetAllFilters(),this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}componentWillRender(){var t;this.disabled=!((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0)||void 0}disconnectedCallback(){this.filterLayerExpressions=JSON.parse(JSON.stringify(this.layerExpressions)),this.resetAllFilters()}async initializeModules(){const[t,i,e]=await at(["esri/intl","esri/geometry/support/jsonUtils","esri/core/reactiveUtils"]);return this.geometryJsonUtils=i,this.reactiveUtils=e,this.locale=t.getLocale(),this.intl=t,Promise.resolve()}render(){const t=this.loading?this.renderLoading():this.initFilterConfig(),i=this.closeBtn?this.renderFullFooter():this.renderFooter();return e(s,null,e("calcite-panel",{class:this.baseClass,ref:t=>this.panelEl=t},e("slot",{slot:"header-content",name:"filter-header-content"}),e("slot",{slot:"header-actions-end",name:"filter-header-actions-end"}),e("div",{key:"filter-container",class:"instant-apps-filter-list__container"},t,i)))}renderLoading(){return e("calcite-loader",{label:"Loading filters..."})}renderFilter(t){const{id:i}=t;return t.expressions.map(((s,a)=>"checkbox"==s.type||null==s.type?e("div",{key:`${i}-${a}`,class:"instant-apps-filter-list__item-container"},e("div",{class:"instant-apps-filter-list__title"},e("p",null,s.name)),e("div",{class:"instant-apps-filter-list__checkbox-container"},e("calcite-checkbox",{id:s.id.toString(),scale:"l",checked:null==s?void 0:s.active,onCalciteCheckboxChange:this.handleCheckboxChange.bind(this,t,s)}))):this.initInput(t,s)))}renderLayerBlock(){return this.filterLayerExpressions.map((t=>this.renderFilterBlocks(t)))}renderFilterBlocks(t){var i;const s=this.renderFilter(t),{operator:a}=t,n="OR"===(null==a?void 0:a.trim())?"orOperator":"andOperator",o=this.renderZoomTo(t);return e("calcite-block",{key:t.id,heading:t.title,description:null===(i=this.messages)||void 0===i?void 0:i[n],open:!!this.openFilters||void 0,collapsible:!0},o,s)}renderCombobox(t,i){var s;return e("label",{key:"combo-select",class:Wt},e("span",null,i.name),e("calcite-combobox",{id:i.id.toString(),onCalciteComboboxChange:this.handleComboSelect.bind(this,i,t),label:i.name,placeholder:i.placeholder,selectionMode:"multiple","max-items":"6",scale:"s",overlayPositioning:this.comboboxOverlayPositioning},null===(s=i.fields)||void 0===s?void 0:s.map(((t,e)=>this.renderComboboxItem(i,t,e)))))}renderComboboxItem(t,i,s){var a;const n=this.createLabel(t,i),o=null==t?void 0:t.selectedFields,l=null!==(a=null==o?void 0:o.includes(i))&&void 0!==a&&a;return e("calcite-combobox-item",{key:`${n}-${s}`,value:i,textLabel:`${n}`,selected:l})}initFilterConfig(){var t,i;if((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0){if(1===this.filterLayerExpressions.length){const{operator:t}=this.filterLayerExpressions[0],s="OR"===(null==t?void 0:t.trim())?"orOperator":"andOperator",a=this.renderZoomTo(this.filterLayerExpressions[0]);return e("calcite-block",{class:"instant-apps-filter-list__operator-description",heading:null===(i=this.messages)||void 0===i?void 0:i[s],open:!0},a,this.renderFilter(this.filterLayerExpressions[0]))}if(this.filterLayerExpressions.length>1)return this.renderLayerBlock()}}renderNumberSlider(t,i){var s,a,n,o,l,r,c,h;const d=null==i?void 0:i.min,p=null==i?void 0:i.max,u=(null==i?void 0:i.step)?i.step:1,v=null!==(s=null==i?void 0:i.field)&&void 0!==s?s:"",m=[null!=(null===(a=null==i?void 0:i.range)||void 0===a?void 0:a.min)?i.range.min:d,null!=(null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.max)?i.range.max:p];return null!=d&&null!=p?e("label",{key:null==i?void 0:i.id.toString(),class:Wt},e("span",null,null==i?void 0:i.name),e("div",{class:"instant-apps-filter-list__number-input-container"},e("calcite-slider",{id:null==i?void 0:i.id.toString(),onCalciteSliderChange:this.handleSliderChange.bind(this,i,t),min:d,max:p,minValue:d,maxValue:p,"min-label":null===(l=null===(o=this.messages)||void 0===o?void 0:o.minSlider)||void 0===l?void 0:l.replace("{field}",v),"max-label":null===(c=null===(r=this.messages)||void 0===r?void 0:r.maxSlider)||void 0===c?void 0:c.replace("{field}",v),step:u,labelHandles:!0,snap:!0,value:m,"group-separator":null===(h=null==i?void 0:i.format)||void 0===h?void 0:h.digitSeparator}))):void 0}renderDatePicker(t,i){var s,a,n,o;const{min:l,max:r}=i,c=[null===(s=null==i?void 0:i.range)||void 0===s?void 0:s.min,null===(a=null==i?void 0:i.range)||void 0===a?void 0:a.max];return null!=l&&null!=r?e("label",{class:Wt},e("span",null,null==i?void 0:i.name),e("div",{class:"instant-apps-filter-list__date-picker-input-container"},e("calcite-input-date-picker",{id:null==i?void 0:i.id.toString(),onCalciteInputDatePickerChange:this.handleDatePickerRangeChange.bind(this,i,t),min:l,max:r,"overlay-positioning":"fixed",lang:null!==(n=this.locale)&&void 0!==n?n:"en",layout:"vertical",value:c,range:!0}),e("calcite-action",{onClick:this.handleResetDatePicker.bind(this,i,t),icon:"reset",text:null===(o=this.messages)||void 0===o?void 0:o.resetDatePicker,scale:"s"}))):null}renderFooter(){var t;return e("div",{class:Bt,slot:"footer"},e("calcite-button",{appearance:"outline",width:"full",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(t=this.messages)||void 0===t?void 0:t.resetFilter))}renderFullFooter(){var t,i,s;const a=null!=this.closeBtnText?this.closeBtnText:null===(t=this.messages)||void 0===t?void 0:t.close;return e("div",{class:Bt,slot:"footer"},e("calcite-button",{appearance:"outline",width:"half",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(i=this.messages)||void 0===i?void 0:i.resetFilter),e("calcite-button",{appearance:"solid",width:"half",kind:"brand",onClick:null===(s=this.closeBtnOnClick)||void 0===s?void 0:s.bind(this)},a))}renderZoomTo(t){var i;return this.zoomBtn?e("div",{class:"instant-apps-filter-list__zoom-to"},e("calcite-button",{id:(null==t?void 0:t.sublayerId)?`zoom-to-${t.id}-${t.sublayerId}`:`zoom-to-${t.id}`,appearance:"transparent",kind:"neutral",scale:"s",iconStart:"magnifying-glass-plus",onClick:this.handleZoomTo.bind(this,t)},null===(i=this.messages)||void 0===i?void 0:i.zoomTo)):void 0}handleResetDatePicker(t,i){Tt(this.panelEl.querySelector(`[id='${t.id}']`)),t.active=!1,t.definitionExpression=void 0,t.range=void 0,this.generateOutput(i)}initInput(t,i){const{type:e}=i;return"string"===e||"coded-value"==e?this.renderCombobox(t,i):"number"===e||"range"==e?"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?this.renderCombobox(t,i):this.renderNumberSlider(t,i):"date"===e?"drop-down"===(null==i?void 0:i.displayOption)?this.renderCombobox(t,i):this.renderDatePicker(t,i):void 0}async initExpressions(){if(this.loading=!0,null==this.filterLayerExpressions)return;const t=this.filterLayerExpressions;for(let i=0;i<(null==t?void 0:t.length);i++){const e=t[i].expressions;for(let s=0;s<(null==e?void 0:e.length);s++)null==e[s].active&&null!=e[s].definitionExpression&&(e[s].active=!1),await this.setInitExpression(t[i],e[s])}this.loading=!1,this.filterLayerExpressions=[...t]}handleResetFilter(){var t;null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=t.expressions)||void 0===i||i.forEach((t=>{const{type:i}=t;"string"===i||"coded-value"===i?this.resetCombobox(t):"date"===i?"drop-down"===(null==t?void 0:t.numDisplayOption)||"drop-down"===(null==t?void 0:t.displayOption)?this.resetCombobox(t):this.resetDatePicker(t):"number"===i||"range"===i?"drop-down"===(null==t?void 0:t.numDisplayOption)||"drop-down"===(null==t?void 0:t.displayOption)?this.resetCombobox(t):this.resetNumberRange(t):this.resetCheckbox(t),t.active=!1}))})),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetCombobox(t){const{id:i}=t;t.selectedFields=void 0;const e=this.panelEl.querySelector(`[id='${i}']`);if(null!=e)for(let t=0;t<e.children.length;t++)e.children[t].selected=!1}resetDatePicker(t){const{id:i}=t;t.range=void 0,Tt(this.panelEl.querySelector(`[id='${i}']`))}resetNumberRange(t){t.range=void 0;const{id:i,max:e,min:s}=t,a=this.panelEl.querySelector(`[id='${i}']`);null!=a&&(a.minValue=s,a.maxValue=e)}resetCheckbox(t){const{id:i}=t,e=this.panelEl.querySelector(`[id='${i}']`);null!=e&&(e.checked=!1)}resetAllFilters(){var t,i,e,s,a;const n=null===(e=null===(i=null===(t=this.view)||void 0===t?void 0:t.map)||void 0===i?void 0:i.allLayers)||void 0===e?void 0:e.concat(null===(a=null===(s=this.view)||void 0===s?void 0:s.map)||void 0===a?void 0:a.allTables);null==n||n.forEach((t=>{var i,e;if(jt.includes(t.type)){const s=t;"point-cloud"===s.type?s.filters=null===(i=this.initPointCloudFilters)||void 0===i?void 0:i[s.id]:"map-image"===s.type?s.allSublayers.forEach((t=>{var i,e;t.definitionExpression=null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[s.id])||void 0===e?void 0:e[t.id]})):s.definitionExpression=null===(e=this.initDefExpressions)||void 0===e?void 0:e[s.id]}}))}async updateStringExpression(t,i){const{field:e,type:s}=i,a=this.findFilterLayer(t);if(i.fields=await this.getFeatureAttributes(a,e),"date"===s){const t=a.fields.find((({name:t})=>t===e));"date-only"===(null==t?void 0:t.type)&&(i.dateOnly=!0)}if(null==i?void 0:i.selectedFields){const t=i.selectedFields.map((t=>"number"==typeof t?t:`'${Mt(t)}'`));return i.definitionExpression=`${e} IN (${t.join(",")})`,Promise.resolve(!0)}return Promise.resolve(!1)}async updateNumberExpression(t,i){var e,s;if(!(null==i?void 0:i.min)&&0!==(null==i?void 0:i.min)||!(null==i?void 0:i.max)&&0!==(null==i?void 0:i.max)){const a=this.findFilterLayer(t),{field:n}=i;if(null!=n)if(this.setExpressionFormat(a,i,n),"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)){const t=await this.getFeatureAttributes(a,n);t.sort(((t,i)=>t-i)),i.fields=t}else{const t=await this.calculateMinMaxStatistics(a,n),o=null===(e=null==t?void 0:t[0])||void 0===e?void 0:e.attributes;if(null!=(null===(s=i.format)||void 0===s?void 0:s.places)?(i.min=this.roundMinNumberDown(o[`min${n}`],i.format.places),i.max=this.roundMaxNumberUp(o[`max${n}`],i.format.places)):(i.min=o[`min${n}`],i.max=o[`max${n}`]),(null==i?void 0:i.range)&&Object.keys(i.range).length){const{min:t,max:e}=i.range;return i.definitionExpression=`${i.field} BETWEEN ${t} AND ${e}`,!0}}}return!1}async updateDateExpression(t,i){var e;const{field:s,range:a}=i,n=this.findFilterLayer(t),o=await this.calculateMinMaxStatistics(n,s),l=null===(e=null==o?void 0:o[0])||void 0===e?void 0:e.attributes;if(i.min=Nt(l[`min${s}`]),i.max=Nt(l[`max${s}`]),null!=a&&(null!=(null==a?void 0:a.max)||null!=(null==a?void 0:a.min))){let{min:t,max:e}=a;if(t=null==t?void 0:t.replace("+"," "),e=null==e?void 0:e.replace("+"," "),t||e){const a=e&&!t?"<":!e&&t?">":null;return i.definitionExpression=a?`${s} ${a} '${null!=t?t:e}'`:`${s} BETWEEN '${t}' AND '${e}'`,!0}}return!1}updateCodedValueExpression(t,i){var e;const{field:s}=t,a=[];t.codedValues={};const n=null==i?void 0:i.domain;if(null===(e=null==n?void 0:n.codedValues)||void 0===e||e.forEach((i=>{const{code:e,name:s}=i;a.push(e),null!=t.codedValues&&(t.codedValues[e]=s)})),t.fields=a,null==t?void 0:t.selectedFields){const i=t.selectedFields.map((t=>"number"==typeof t?t:`'${Mt(t)}'`)),e=`${s} IN (${i.join(",")})`;return t.definitionExpression=e,!0}return!1}updateRangeExpression(t,i){const{field:e,range:s}=t,a=null==i?void 0:i.domain;if(t.min=null==a?void 0:a.minValue,t.max=null==a?void 0:a.maxValue,s&&Object.keys(s).length){const{min:i,max:a}=s;return t.definitionExpression=`${e} BETWEEN ${i} AND ${a}`,!0}return!1}async getFeatureAttributes(t,i){var e,s,a;if(t&&jt.includes(t.type)){const n=t.createQuery();if((null===(s=null===(e=null==t?void 0:t.capabilities)||void 0===e?void 0:e.query)||void 0===s?void 0:s.supportsCacheHint)&&(n.cacheHint=!0),i){const e=this.getInitDefExprFromLayer(t);if(n.where=e||"1=1",n.outFields=[i],n.orderByFields=[`${i} DESC`],n.returnDistinctValues=!0,n.returnGeometry=!1,n.maxRecordCountFactor=3,this.extentSelector&&this.extentSelectorConfig){const t=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=t&&(n.geometry=t),n.spatialRelationship="intersects"}return null===(a=await this.queryForFeatures(t,n,i))||void 0===a?void 0:a.sort()}}return[]}async queryForFeatures(t,i,e){const s=await t.queryFeatures(i),a=null==s?void 0:s.features.filter((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[e]}));return null==a?void 0:a.map((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[e]}))}async calculateMinMaxStatistics(t,i){var e,s;if(t&&jt.includes(t.type)){const a=t.createQuery();let n=this.getInitDefExprFromLayer(t);if(a.where=n||"1=1",(null===(s=null===(e=null==t?void 0:t.capabilities)||void 0===e?void 0:e.query)||void 0===s?void 0:s.supportsCacheHint)&&(a.cacheHint=!0),i){if(a.outStatistics=[{onStatisticField:i,outStatisticFieldName:`max${i}`,statisticType:"max"},{onStatisticField:i,outStatisticFieldName:`min${i}`,statisticType:"min"}],this.extentSelector&&this.extentSelectorConfig){const t=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=t&&(a.geometry=t),a.spatialRelationship="intersects"}const e=await t.queryFeatures(a);return null==e?void 0:e.features}}return[]}getExtent(t,i){if(t&&i){const{constraints:t}=i;let e=Object.assign({},t);const s=null==e?void 0:e.geometry;if(s){const t="extent"in s?s:this.geometryJsonUtils.fromJSON(s);if("extent"===(null==t?void 0:t.type)||"polygon"===(null==t?void 0:t.type))return t}}}setInitExpression(t,i){if(i.field&&i.type){const e=this.findFilterLayer(t);return null==e?Promise.resolve():("not-loaded"!==e.loadStatus&&"failed"!==e.loadStatus||e.load(),e.when((async()=>{var s,a;const n=null===(s=e.fields)||void 0===s?void 0:s.find((({name:t})=>t===i.field)),o=null===(a=null==n?void 0:n.domain)||void 0===a?void 0:a.type;i.type="coded-value"===o||"range"===o?o:i.type,await this.updateExpression(t,i,n)})))}return this.updateExpression(t,i,void 0),Promise.resolve()}async updateExpression(t,i,e){let s=!1;const{type:a}=i;"string"===a?s=await this.updateStringExpression(t,i):"number"===a?s=await this.updateNumberExpression(t,i):"date"===a?s="drop-down"===i.displayOption?await this.updateStringExpression(t,i):await this.updateDateExpression(t,i):"coded-value"===a?s=this.updateCodedValueExpression(i,e):"range"===a?s="drop-down"===i.displayOption?await this.updateStringExpression(t,i):this.updateRangeExpression(i,e):!i.active||"checkbox"!==a&&null!=a||(s=!0),s&&this.generateOutput(t)}updateRangeExpressions(t,i,e,s){const a=this.getInitDefExprFromLayerExpression(i);!s&&0!==s||!e&&0!==e||(s===(null==t?void 0:t.min)&&e===(null==t?void 0:t.max)?(t.definitionExpression=void 0,t.active=!1):(t.definitionExpression=a?`(${a}) AND ${null==t?void 0:t.field} BETWEEN ${s} AND ${e}`:`${null==t?void 0:t.field} BETWEEN ${s} AND ${e}`,t.active=!0)),t.range={min:s,max:e}}handleCheckboxChange(t,i,e){i.active=e.target.checked,this.generateOutput(t)}handleSliderChange(t,i,e){const{maxValue:s,minValue:a}=e.target;this.updateRangeExpressions(t,i,s,a),this.generateOutput(i)}handleComboSelect(t,i,e){const s=e.target.selectedItems,{field:a,type:n}=t;if(s&&s.length){const i=s.map((({value:t})=>"number"==typeof t?t:`'${Mt(t)}'`));if("date"===n)t.selectedFields=s.map((({value:t})=>t)),t.definitionExpression=i.map((t=>this.buildDateExpression(t,a))).join(" OR ");else{t.selectedFields=s.map((({value:t})=>t));const e=`${a} IN (${i.join(",")})`;t.definitionExpression=e}t.active=!0}else t.definitionExpression=void 0,t.active=!1;this.generateOutput(i)}handleDatePickerRangeChange(t,i,e){const s=e.target,[a,n]=s.valueAsDate,o=null!=a?Nt(Math.floor(a.getTime()),!0):void 0,l=null!=n?Nt(Math.floor(n.getTime()),!0):void 0;if(null!=o||null!=l){const e=l&&null==o?"<":null==l&&o?">":null;t.definitionExpression=e?`${t.field} ${e} '${null!=o?o:l}'`:`${t.field} BETWEEN '${o}' AND '${l}'`,t.range={min:o,max:l},t.active=!0,this.generateOutput(i)}}handleURLParams(){var t;if("URLSearchParams"in window){const i=null===(t=new URLSearchParams(document.location.search).get("filter"))||void 0===t?void 0:t.split(";");let e=0;null==i||i.forEach((t=>{var i;const s=JSON.parse(t);null===(i=this.filterLayerExpressions)||void 0===i||i.forEach((t=>{var i;(null==s?void 0:s.layerId)===t.id&&(null===(i=t.expressions)||void 0===i||i.forEach((t=>{var i,a;(null===(i=t.id)||void 0===i?void 0:i.toString())===(null===(a=null==s?void 0:s.expressionId)||void 0===a?void 0:a.toString())&&(t.active=!0,e++,"range"===s.type?t.range=s.range:"select"===s.type&&(t.selectedFields=s.selectedFields))})))}))})),this.filterCount=e}}createURLParamExpression(t,i){const{id:e,range:s,selectedFields:a,type:n}=i;return"string"===n||"coded-value"===n||"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?{type:"select",layerId:t.id,expressionId:e.toString(),selectedFields:a}:"number"===n||"range"===n||"date"===n?{type:"range",layerId:t.id,expressionId:e.toString(),range:s}:{layerId:t.id,expressionId:e.toString()}}autoUpdateURLCheck(t){this.autoUpdateUrl&&(t.toString()?window.history.replaceState({},"",`${window.location.pathname}?${t} `):window.history.replaceState({},"",window.location.pathname))}generateURLParams(){var t;if("URLSearchParams"in window){const i=new URLSearchParams(window.location.search),e=[];let s=0;null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=null==t?void 0:t.expressions)||void 0===i||i.forEach((i=>{if(i.active){s++;const a=this.createURLParamExpression(t,i);e.push(JSON.stringify(a))}}))})),this.filterCount=s,e.length>0?i.set("filter",e.join(";")):i.delete("filter"),this.autoUpdateURLCheck(i),this.urlParams=i}}updateFilter(t,i,e){const{id:s}=t,a=this.view.map.findLayerById(s)||this.view.map.findTableById(s);if(null!=a)if("point-cloud"===a.type)this.updateFilterLayerPCLFilter(a,e);else if("map-image"===a.type){const e=a.findSublayerById(null==t?void 0:t.sublayerId);null!=e&&this.updateFilterLayerDefExpression(e,i,t)}else this.updateFilterLayerDefExpression(a,i,t)}updateFilterLayerDefExpression(t,i,e){const{operator:s}=e;let a=this.getInitDefExprFromLayer(t);const n=(null==i?void 0:i.length)>0&&null!=a?`(${i.join(s)}) AND (${a})`:i.length>0?i.join(s):a;t.definitionExpression=n}updateFilterLayerPCLFilter(t,i){t.filters=i}async handleWhenView(){if(null==this.view)return;const t=this.view.map;await t.loadAll(),this.handleLayerExpressionsUpdate()}async handleLayerExpressionsUpdate(){if(null==this.view)return;const t=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={};const i=t.allLayers.concat(t.allTables);for(let t=0;t<i.length;t++){const e=i.getItemAt(t);if(jt.includes(e.type)){const t=e;"point-cloud"===t.type?this.initPointCloudFilters[t.id]=t.filters:"map-image"===t.type?(this.initMapImageExpressions[t.id]={},t.allSublayers.forEach((i=>{this.initMapImageExpressions[t.id][i.id]=i.definitionExpression}))):this.initDefExpressions[t.id]=t.definitionExpression}}this.initExpressions(),this.handleURLParams()}async handleZoomTo(t){const i=this.panelEl.querySelector((null==t?void 0:t.sublayerId)?`#zoom-to-${t.id}-${t.sublayerId}`:`#zoom-to-${t.id}`);null!=i&&(i.loading=!0,i.disabled=!0),this.zoomToGraphics=[];let e=0,s=!1;const a=setInterval((()=>{e>=1e3&&s&&(this.view.goTo(this.zoomToGraphics),null!=i&&(i.loading=!1,i.disabled=!1),clearInterval(a)),e+=500}),500);await this.getZoomToGraphics(t),s=!0}async getZoomToGraphics(t){var i,e,s,a,n;const o=this.view.allLayerViews.find((({layer:i})=>i.id===t.id)),l=o.layer,r="map-image"===l.type?l.findSublayerById(t.sublayerId):l;if("point-cloud"!==r.type&&jt.includes(null==r?void 0:r.type)){const t=r.createQuery();if((null===(e=null===(i=null==l?void 0:l.capabilities)||void 0===i?void 0:i.query)||void 0===e?void 0:e.supportsCacheHint)&&(t.cacheHint=!0),t.where=null!==(s=r.definitionExpression)&&void 0!==s?s:"1=1",t.returnGeometry=!0,t.returnDistinctValues=!0,t.maxRecordCountFactor=3,t.returnExceededLimitFeatures=!0,t.outFields=[],this.extentSelector&&this.extentSelectorConfig){const i=this.getExtent(this.extentSelector,this.extentSelectorConfig);null!=i&&(t.geometry=i),t.spatialRelationship="intersects"}const c=null!=(null===(a=null==o?void 0:o.featureEffect)||void 0===a?void 0:a.filter)?o.featureEffect.filter:o.filter;null!=c&&(null!=c.objectIds&&(t.objectIds=c.objectIds),null!=c.distance&&(t.distance=c.distance),null!=c.geometry&&(t.geometry=c.geometry),null!=c.distance&&(t.distance=c.distance),null!=c.spatialRelationship&&(t.spatialRelationship=c.spatialRelationship),null!=c.units&&(t.units=c.units),null!=c.where&&(t.where=c.where),null!=c.timeExtent&&(t.timeExtent=c.timeExtent));try{const i=await r.queryFeatures(t);this.zoomToGraphics.push(...i.features)}catch(i){if(null===(n=null==i?void 0:i.message)||void 0===n?void 0:n.toLowerCase().includes("distinct"))try{t.returnDistinctValues=!1;const i=await r.queryFeatures(t);this.zoomToGraphics.push(...i.features)}catch(t){}}}return Promise.resolve()}generateOutput(t){if(null==this.view)return;const i=[];let e=[];if(t){for(const s of t.expressions){const{active:t,definitionExpression:a,pointCloudFilters:n}=s;t&&a&&i.push(`(${a})`),t&&null!=n&&n.length>0&&(e=e.concat(n))}this.updateFilter(t,i,e),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(t){return t.toLocaleString("en-US",{maximumFractionDigits:20})}roundMinNumberDown(t,i){if(null!=t){if((""+t).includes("e")){var e=(""+t).split("e"),s="";return+e[1]+i>0&&(s="+"),+(Math.floor(+e[0]+"e"+s+(+e[1]+i))+"e-"+i)}return+(Math.floor(t+"e+"+i)+"e-"+i)}}roundMaxNumberUp(t,i){if(null!=t){if((""+t).includes("e")){var e=(""+t).split("e"),s="";return+e[1]+i>0&&(s="+"),+(Math.ceil(+e[0]+"e"+s+(+e[1]+i))+"e-"+i)}return+(Math.ceil(t+"e+"+i)+"e-"+i)}}roundNumber(t,i){if(null!=t){if((""+t).includes("e")){var e=(""+t).split("e"),s="";return+e[1]+i>0&&(s="+"),+(Math.round(+e[0]+"e"+s+(+e[1]+i))+"e-"+i)}return+(Math.round(t+"e+"+i)+"e-"+i)}}setExpressionFormat(t,i,e){if(null!=(null==t?void 0:t.popupTemplate)){const s=t.popupTemplate.fieldInfos.find((({fieldName:t})=>t===e));i.format=null==s?void 0:s.format}}getInitDefExprFromLayer(t){var i,e,s;return"sublayer"===t.type?null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.layer.id])||void 0===e?void 0:e[t.id]:null===(s=this.initDefExpressions)||void 0===s?void 0:s[t.id]}getInitDefExprFromLayerExpression(t){var i,e,s;return null!=(null==t?void 0:t.sublayerId)?null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.id])||void 0===e?void 0:e[t.sublayerId]:null===(s=this.initDefExpressions)||void 0===s?void 0:s[t.id]}findFilterLayer(t){const i=this.view.map.allLayers.concat(this.view.map.allTables).find((({id:i})=>i===t.id));return"map-image"===i.type?null==i?void 0:i.findSublayerById(t.sublayerId):i}createLabel(t,i){var e;let s=i;if("coded-value"===t.type)s=null===(e=t.codedValues)||void 0===e?void 0:e[i];else if("number"===t.type&&"number"==typeof i&&null!=t.format)null!=t.format.places&&(s=this.roundNumber(i,t.format.places)),t.format.digitSeparator&&(s=this.numberWithCommas(s));else if("date"===t.type&&!t.dateOnly){const e=t.dateOnly?this.intl.convertDateFormatToIntlOptions("short-date-long-time"):void 0;s=this.intl.formatDate(i,e)}return s}buildDateExpression(t,i){if(t){const e=new Date(t),s=new Date(t),a=new Date(s.setDate(e.getDate()+1)),n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`,o=`${e.getHours()}:${e.getMinutes()}:${e.getSeconds()}`,l=`${a.getHours()}:${a.getMinutes()}:${a.getSeconds()}`;return`${i} BETWEEN '${n} ${o}' AND '${a.getFullYear()}-${a.getMonth()+1}-${a.getDate()} ${l}'`}}get el(){return a(this)}static get watchers(){return{view:["watchViewHandler"],layerExpressions:["watchLayerExpressions"]}}};Ht.style=":host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:normal}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;font-size:16px;--calcite-combobox-input-height:24px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:64px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:normal;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1:12px}.instant-apps-filter-list__zoom-to{display:flex;justify-content:flex-end;margin:8px 0 20px}.instant-apps-filter-list__zoom-to calcite-action{width:-moz-min-content;width:min-content}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1:16px}@media (prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor:2;--calcite-internal-animation-timing-slow:calc(300ms * 2)}}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}";const Ut="instant-apps-social-share",Vt={base:Ut,dialog:`${Ut}__dialog`,dialogEmbed:`${Ut}__dialog-embed`,dialogContent:`${Ut}__dialog-content`,options:`${Ut}__options`,tipContainer:`${Ut}__tip`,tipHeader:`${Ut}__tip-header`,tipContent:`${Ut}__tip-content`,icon:`${Ut}__icon`,iconContainer:`${Ut}__icon-container`,optionText:`${Ut}__option-text`,popoverButton:`${Ut}__popover-button`,layout:{vertical:`${Ut}__layout--vertical`,horizontal:`${Ut}__layout--horizontal`},xLogo:{light:`${Ut}__x-logo--light`,dark:`${Ut}__x-logo--dark`},success:{container:`${Ut}__success`,header:`${Ut}__success-header`,message:`${Ut}__success-message`,icon:`${Ut}__success-icon`},embed:{container:`${Ut}__embed`,header:`${Ut}__embed-header`,embedCode:{container:`${Ut}__embed-code`,textArea:`${Ut}__embed-code-text-area`,copyButton:`${Ut}__embed-code-copy-button`},textAreaText:`${Ut}__embed-text-area-text`,dimensions:{container:`${Ut}__embed-dimensions`,input:`${Ut}__embed-dimensions-input`}},rtl:{optionText:`${Ut}__option-text--rtl`,textArea:`${Ut}__text-area--rtl`}},qt={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",x:"https://x.com/intent/post?url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}"},Jt=class{constructor(i){t(this,i),this.mode="popover",this.shareUrl=window.location.href,this.autoUpdateShareUrl=!0,this.shareText="",this.embed=!1,this.shareButtonColor="neutral",this.shareButtonType="button",this.shareButtonScale=void 0,this.iframeInnerText="",this.popoverButtonIconScale="m",this.view=void 0,this.displayTipText=!0,this.shortenShareUrl=!0,this.socialMedia=!0,this.shareIconsLayout="vertical",this.scale="m",this.successMessage="",this.defaultUrlParams=null,this.inlineSuccessPopoverPlacement="trailing",this.popoverPositioning="absolute",this.removePopoverOffset=!1,this.messages=void 0,this.opened=!1,this.copied=!1,this.inlineCopyLinkOpened=!1,this.inlineCopyEmbedOpened=!1,this.embedWidth=400,this.embedHeight=600}componentDidLoad(){var t,i;nt(this),this.setupAutoCloseListeners(),"popover"===this.mode&&(this.opened&&(this.popoverRef.open=!0),this.popoverRef.addEventListener("calcitePopoverOpen",(()=>{this.shareListRef&&this.shareListRef.children[0].focus()})),this.popoverRef.addEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))),this.embed&&(null===(t=this.embedWidthRef)||void 0===t||t.addEventListener("change",this.updateDimensions.bind(this,"width")),null===(i=this.embedHeightRef)||void 0===i||i.addEventListener("change",this.updateDimensions.bind(this,"height")))}disconnectedCallback(){var t,i,e;document.documentElement.removeEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?null!=this.popoverRef&&(this.popoverRef.removeEventListener("click",this.stopPropagationCallback.bind(this)),this.popoverRef.removeEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this)),this.popoverRef.removeEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))):(null===(t=this.embedWidthRef)||void 0===t||t.removeEventListener("change",this.updateDimensions.bind(this)),null===(i=this.embedHeightRef)||void 0===i||i.removeEventListener("change",this.updateDimensions.bind(this)),null===(e=this.dialogContentRef)||void 0===e||e.removeEventListener("click",this.stopPropagationCallback.bind(this)))}setupAutoCloseListeners(){var t,i,e;document.documentElement.addEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?(null===(t=this.popoverRef)||void 0===t||t.addEventListener("click",this.stopPropagationCallback.bind(this)),null===(i=this.popoverRef)||void 0===i||i.addEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this))):null===(e=this.dialogContentRef)||void 0===e||e.addEventListener("click",this.stopPropagationCallback.bind(this))}handlePopoverRefKeyDown(t){var i,e;if("Tab"===t.code){if(!this.shareListRef)return;const e=t.target,s=this.shareListRef.children[0],a=this.shareListRef.children[(null===(i=this.shareListRef)||void 0===i?void 0:i.children.length)-1];t.shiftKey&&e===s?(t.preventDefault(),a.focus()):t.shiftKey||e!==a||(t.preventDefault(),s.focus())}else"Escape"===t.code&&(this.closePopover(),null===(e=this.popoverButtonRef)||void 0===e||e.setFocus())}autoCloseCallback(){"popover"===this.mode?(this.opened=!1,this.popoverRef.open=this.opened):(this.copyLinkPopoverRef&&(this.copyLinkPopoverRef.open=!1),this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef&&(this.copyEmbedPopoverRef.open=!1),this.inlineCopyEmbedOpened=!1)}stopPropagationCallback(t){t.stopPropagation()}resetPopoverCopyState(){var t;null===(t=this.popoverButtonRef)||void 0===t||t.setFocus(),setTimeout((()=>{this.copied=!1}),200)}updateDimensions(t){var i,e;if("width"===t){const t=null===(i=this.embedWidthRef)||void 0===i?void 0:i.value;this.embedWidth=parseInt(t)}else{const t=null===(e=this.embedHeightRef)||void 0===e?void 0:e.value;this.embedHeight=parseInt(t)}}render(){var t,i,a,n,o,l;const r=this.copied&&"popover"===this.mode?this.renderSuccess():e("div",{class:Vt.dialogContent},this.renderOptions(),this.displayTipText?this.renderTip():null,this.embed?this.renderEmbed():null),c=e("div",{ref:t=>this.dialogContentRef=t,class:`${Vt.dialog}${"vertical"===this.shareIconsLayout?` ${Vt.layout.vertical}`:` ${Vt.layout.horizontal}`}`},r);return e(s,null,"popover"===this.mode?[e("calcite-popover",{ref:t=>this.popoverRef=t,label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,referenceElement:"shareButton",placement:"bottom-start",scale:this.scale,"overlay-positioning":this.popoverPositioning,"offset-distance":this.removePopoverOffset?0:6,"pointer-disabled":this.removePopoverOffset},c),this.renderButton()]:[c,e("calcite-popover",{ref:t=>this.copyLinkPopoverRef=t,label:null===(n=null===(a=this.messages)||void 0===a?void 0:a.share)||void 0===n?void 0:n.label,referenceElement:"copyToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderSuccess()),e("calcite-popover",{ref:t=>this.copyEmbedPopoverRef=t,label:null===(l=null===(o=this.messages)||void 0===o?void 0:o.share)||void 0===l?void 0:l.label,referenceElement:"copyEmbedToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderEmbedSuccess())])}renderButton(){var t,i,s,a,n,o,l,r;const c=null!=this.shareButtonScale?this.shareButtonScale:this.scale;return"button"===this.shareButtonType?e("calcite-button",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:Vt.popoverButton,kind:this.shareButtonColor,appearance:"transparent",label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,title:null===(a=null===(s=this.messages)||void 0===s?void 0:s.share)||void 0===a?void 0:a.label,scale:c},e("div",{class:Vt.iconContainer},e("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale}))):e("calcite-action",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:Vt.popoverButton,appearance:"transparent",label:null===(o=null===(n=this.messages)||void 0===n?void 0:n.share)||void 0===o?void 0:o.label,title:null===(r=null===(l=this.messages)||void 0===l?void 0:l.share)||void 0===r?void 0:r.label,scale:c,text:"",alignment:"center"},e("div",{class:Vt.iconContainer},e("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale})))}renderSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return e("div",{class:Vt.success.container},e("span",{class:Vt.success.header},e("span",{class:Vt.success.icon},e("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),e("span",{class:Vt.success.message},this.successMessage||(null==i?void 0:i.url)))}renderEmbedSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return e("div",{class:Vt.success.container},e("span",{class:Vt.success.header},e("span",{class:Vt.success.icon},e("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),e("span",{class:Vt.success.message},null==i?void 0:i.embed))}renderOptions(){var t,i,s,a;const n=null===(t=this.messages)||void 0===t?void 0:t.options,o="rtl"===document.dir?` ${Vt.rtl.optionText}`:"";return e("ul",{ref:t=>this.shareListRef=t,class:Vt.options,role:"menu"},e("li",{id:"copyToClipboard",onClick:this.handleShareItem.bind(this,"link"),onKeyDown:this.handleOptionKeyDown("link"),role:"menuitem",tabindex:"0"},e("span",{class:Vt.icon},e("calcite-icon",{icon:"link",scale:this.scale})),e("span",{class:`${Vt.optionText}${o}`},null===(i=null==n?void 0:n.link)||void 0===i?void 0:i.label)),this.socialMedia?[e("li",{onClick:this.handleShareItem.bind(this,"facebook"),onKeyDown:this.handleOptionKeyDown("facebook"),role:"menuitem",tabindex:"0"},e("span",{class:Vt.icon},this.renderFacebookIcon()),e("span",{class:`${Vt.optionText}${o}`},null===(s=null==n?void 0:n.facebook)||void 0===s?void 0:s.label)),e("li",{onClick:this.handleShareItem.bind(this,"x"),onKeyDown:this.handleOptionKeyDown("x"),role:"menuitem",tabindex:"0"},e("span",{class:Vt.icon},this.renderXIcon()),e("span",{class:`${Vt.optionText}${o}`},"X")),e("li",{onClick:this.handleShareItem.bind(this,"linkedIn"),onKeyDown:this.handleOptionKeyDown("linkedIn"),role:"menuitem",tabindex:"0"},e("span",{class:Vt.icon},this.renderLinkedInIcon()),e("span",{class:`${Vt.optionText}${o}`},null===(a=null==n?void 0:n.linkedIn)||void 0===a?void 0:a.label))]:null)}handleOptionKeyDown(t){return i=>{const e=i.code;("Space"===e||"Enter"===e)&&this.handleShareItem(t)}}renderFacebookIcon(){return e("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},e("g",null,e("path",{d:"M512,256c0,-141.385 -114.615,-256 -256,-256c-141.385,0 -256,114.615 -256,256c0,127.777 93.616,233.685 216,252.89l0,-178.89l-65,0l0,-74l65,0l0,-56.4c0,-64.16 38.219,-99.6 96.695,-99.6c28.009,0 57.305,5 57.305,5l0,63l-32.281,0c-31.801,0 -41.719,19.733 -41.719,39.978l0,48.022l71,0l-11.35,74l-59.65,0l0,178.89c122.385,-19.205 216,-125.113 216,-252.89Z",style:{fill:"#1877f2",fillRule:"nonzero"}}),e("path",{d:"M355.65,330l11.35,-74l-71,0l0,-48.022c0,-20.245 9.917,-39.978 41.719,-39.978l32.281,0l0,-63c0,0 -29.297,-5 -57.305,-5c-58.476,0 -96.695,35.44 -96.695,99.6l0,56.4l-65,0l0,74l65,0l0,178.89c13.033,2.045 26.392,3.11 40,3.11c13.608,0 26.966,-1.065 40,-3.11l0,-178.89l59.65,0Z",style:{fill:"#fff",fillRule:"nonzero"}})))}renderXIcon(){const t=!!this.el.closest(".calcite-mode-dark");return e("svg",{class:t?Vt.xLogo.dark:Vt.xLogo.light,viewBox:"0 0 1200 1227",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("rect",{height:"400",style:{fill:"none"},width:"400",x:"56",y:"56"}),e("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",fill:t?"white":"black"}))}renderLinkedInIcon(){return e("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},e("g",{id:"g5891"},e("path",{d:"M512,64c0,-35.323 -28.677,-64 -64,-64l-384,0c-35.323,0 -64,28.677 -64,64l0,384c0,35.323 28.677,64 64,64l384,0c35.323,0 64,-28.677 64,-64l0,-384Z",id:"background",style:{fill:"#2867b2"}}),e("g",{id:"shapes"},e("rect",{height:"257.962",id:"rect11",style:{fill:"#fff"},width:"85.76",x:"61.053",y:"178.667"}),e("path",{d:"M104.512,54.28c-29.341,0 -48.512,19.29 -48.512,44.573c0,24.752 18.588,44.574 47.377,44.574l0.554,0c29.903,0 48.516,-19.822 48.516,-44.574c-0.555,-25.283 -18.611,-44.573 -47.935,-44.573Z",id:"path13-0",style:{fill:"#fff",fillRule:"nonzero"}}),e("path",{d:"M357.278,172.601c-45.49,0 -65.866,25.017 -77.276,42.589l0,-36.523l-85.738,0c1.137,24.197 0,257.961 0,257.961l85.737,0l0,-144.064c0,-7.711 0.554,-15.42 2.827,-20.931c6.188,-15.4 20.305,-31.352 43.993,-31.352c31.012,0 43.436,23.664 43.436,58.327l0,138.02l85.741,0l0,-147.93c0,-79.237 -42.305,-116.097 -98.72,-116.097Z",id:"path15",style:{fill:"#fff",fillRule:"nonzero"}}))))}renderTip(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.info;return e("div",{class:Vt.tipContainer},e("span",{class:Vt.tipHeader},e("calcite-icon",{icon:"lightbulb",scale:this.scale}),e("span",null,null==i?void 0:i.label)),e("p",{class:Vt.tipContent},null==i?void 0:i.tooltip))}renderEmbed(){var t,i,s;const a=null===(t=this.messages)||void 0===t?void 0:t.embed,n="rtl"===document.dir?` ${Vt.rtl.textArea}`:"";return e("div",{class:Vt.embed.container},e("span",{class:Vt.embed.header},e("calcite-icon",{icon:"code",scale:this.scale}),e("span",null,null===(s=null===(i=this.messages)||void 0===i?void 0:i.embed)||void 0===s?void 0:s.label)),e("div",{class:Vt.embed.embedCode.container},e("div",{class:Vt.embed.embedCode.textArea},e("textarea",{ref:t=>this.embedCodeRef=t,cols:30,rows:5,readonly:!0,class:n,value:this.getEmbedCode()}),e("button",{id:"copyEmbedToClipboard",onClick:this.copyEmbedCode.bind(this),class:Vt.embed.embedCode.copyButton},e("calcite-icon",{icon:"copy",scale:this.scale}),e("span",null,null==a?void 0:a.copy))),e("span",{class:Vt.embed.textAreaText},e("slot",{name:"text-area-text"})),e("div",{class:Vt.embed.dimensions.container},e("label",{class:Vt.embed.dimensions.input},e("span",null,null==a?void 0:a.width),e("input",{ref:t=>this.embedWidthRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("width"),value:this.embedWidth,min:"1"})),e("label",{class:Vt.embed.dimensions.input},e("span",null,null==a?void 0:a.height),e("input",{ref:t=>this.embedHeightRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("height"),value:this.embedHeight,min:"1"})))))}handleNumberInputOnChange(t){const i="width"===t?this.embedWidthRef:this.embedHeightRef,e="width"===t?"embedWidth":"embedHeight";return()=>{i&&parseFloat(i.value)<=0&&(this[e]=parseInt("1"),i.value="1")}}togglePopover(t){t.stopPropagation(),this.opened=!this.opened,this.popoverRef.open=this.opened}closePopover(){this.opened=!1,this.popoverRef.open=this.opened}async handleShareItem(t){var i,e,s,a;this.shareUrl=await this.generateShareUrl();let n=null;const o=null!==(e=null===(i=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===i?void 0:i.includes("Chrome"))&&void 0!==e&&e,l=null!==(a=null===(s=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===s?void 0:s.includes("Safari"))&&void 0!==a&&a&&!o;!l&&this.shortenShareUrl&&(n=await this.shortenUrl(this.shareUrl));let r=n||this.shareUrl;switch(t){case"link":return navigator.clipboard.writeText(r),this.embed&&(this.copyEmbedPopoverRef.open=!1,this.inlineCopyEmbedOpened=!1),"inline"===this.mode&&(this.copyLinkPopoverRef.open=!0,setTimeout((()=>this.copyLinkPopoverRef.open=!1),3e3)),this.inlineCopyLinkOpened=!0,this.copied=!0,void("popover"===this.mode&&setTimeout((()=>this.closePopover()),2e3));case"facebook":case"x":case"linkedIn":let i;l&&(i=window.open("","_blank"),this.shortenShareUrl&&(r=await this.shortenUrl(this.shareUrl)||r));const e={url:encodeURI(r)},s="x"===t?Object.assign(Object.assign({},e),{text:this.shareText}):e,[a]=await at(["esri/intl"]),n=a.substitute(qt[t],s);return"popover"===this.mode&&this.closePopover(),void(l&&i?(i.location=n,i.focus()):window.open(encodeURI(n),"_blank"))}}async shortenUrl(t){var i,e;const[s]=await at(["esri/request"]),a=await s("https://arcg.is/prod/shorten",{query:{longUrl:t,f:"json"}}),n=null===(e=null===(i=null==a?void 0:a.data)||void 0===i?void 0:i.data)||void 0===e?void 0:e.url;if(n)return n.replace("http://","https://")}getEmbedCode(){return`<iframe src="${this.shareUrl}" width="${this.embedWidth}" height="${this.embedHeight}" frameborder="0" style="border:0" allowfullscreen>${this.iframeInnerText}</iframe>`}copyEmbedCode(){navigator.clipboard.writeText(this.getEmbedCode()),this.copyLinkPopoverRef.open=!1,this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef.open=!0,setTimeout((()=>this.copyEmbedPopoverRef.open=!1),3e3),this.inlineCopyEmbedOpened=!0}async generateShareUrl(){var t;if(this.autoUpdateShareUrl&&(this.shareUrl=window.location.href),!this.view||!(null===(t=this.view)||void 0===t?void 0:t.ready))return this.shareUrl;const{x:i,y:e}=this.view.center,{spatialReference:s}=this.view,[a,n]=await at(["esri/geometry/Point","esri/geometry/SpatialReference"]),o=new a({x:i,y:e,spatialReference:new n(Object.assign({},s.toJSON()))}),l=await this.processPoint(o),{isWGS84:r,isWebMercator:c}=l.spatialReference;return this.generateShareUrlParams(l,r||c)}async processPoint(t){const{isWGS84:i,isWebMercator:e}=t.spatialReference;if(i||e)return t;const[s,a]=await at(["esri/geometry/SpatialReference","esri/geometry/projection"]),n=new s({wkid:4326});try{await a.load();const i=a.project(t,n);return Promise.resolve(i)}catch(t){return console.error("Failed to project point",t),Promise.reject(null)}}generateShareUrlParams(t,i){var e,s,a,n;const{longitude:o,latitude:l,x:r,y:c}=t;if(void 0===o||void 0===l)return this.shareUrl;const h=this.roundValue(i?o:r),d=this.roundValue(i?l:c),{zoom:p}=this.view,u=this.roundValue(p),v=null===(s=null===(e=this.view)||void 0===e?void 0:e.popup)||void 0===s?void 0:s.selectedFeature,m=null===(n=null===(a=this.view)||void 0===a?void 0:a.popup)||void 0===n?void 0:n.visible;let f,g;if(v&&m){const t=null==v?void 0:v.layer;f=t.id,g=v.attributes[t.objectIdField]}const b=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";"),{type:x}=this.view,{defaultUrlParams:y}=this,w=new URL(this.shareUrl),{searchParams:_}=w;if(_.get("center")&&_.delete("center"),_.get("level")&&_.delete("level"),_.get("selectedFeature")&&_.delete("selectedFeature"),_.get("hiddenLayers")&&_.delete("hiddenLayers"),_.get("viewpoint")&&_.delete("viewpoint"),"3d"===x){const{camera:t}=this.view,{heading:i,position:e,tilt:s}=t,{longitude:a,latitude:n,z:o}=e,l={longitude:this.roundValue(a,8),latitude:this.roundValue(n,8),z:this.roundValue(o,3),heading:this.roundValue(i,3),tilt:this.roundValue(s,3)};return!1!==(null==y?void 0:y.viewpoint)&&w.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),f&&g&&!1!==(null==y?void 0:y.selectedFeature)&&w.searchParams.set("selectedFeature",`${f};${g}`),b&&!1!==(null==y?void 0:y.hiddenLayers)&&w.searchParams.set("hiddenLayers",b),w.search=decodeURIComponent(w.search),w.href}return!1!==(null==y?void 0:y.center)&&w.searchParams.set("center",`${h};${d}`),!1!==(null==y?void 0:y.level)&&w.searchParams.set("level",`${u}`),f&&g&&!1!==(null==y?void 0:y.selectedFeature)&&w.searchParams.set("selectedFeature",`${f};${g}`),b&&!1!==(null==y?void 0:y.hiddenLayers)&&w.searchParams.set("hiddenLayers",b),w.search=decodeURIComponent(w.search),w.href}roundValue(t,i=4){return parseFloat(t.toFixed(i))}get el(){return a(this)}};Jt.style=":host{display:block;--instant-apps-social-share-action-width:initial;--instant-apps-social-share-width--s:200px;--instant-apps-social-share-width--m:280px;--instant-apps-social-share-width--l:320px;--instant-apps-social-share-width-horizontal--s:300px;--instant-apps-social-share-width-horizontal--m:380px;--instant-apps-social-share-width-horizontal--l:420px;--instant-apps-social-share-background-color:var(--calcite-color-foreground-1);--instant-apps-social-share-popover-button-background-color:transparent;--instant-apps-social-share-popover-button-icon-color:var(--calcite-ui-icon-color);--instant-apps-social-share-embed-border:1px solid $border;--instant-apps-social-share-embed-text-area-text:#468540}:host .instant-apps-social-share__popover-button{background-color:var(--instant-apps-social-share-popover-button-background-color)}:host .instant-apps-social-share__popover-button calcite-icon{color:var(--instant-apps-social-share-popover-button-icon-color)}:host .instant-apps-social-share__dialog,:host .instant-apps-social-share__dialog-embed{background-color:var(--instant-apps-social-share-background-color);border:var(--instant-apps-social-share-embed-border)}:host .instant-apps-social-share__dialog{box-sizing:border-box;height:auto;padding:10px 0;border-radius:5px}:host .instant-apps-social-share__options{margin:0;padding:1% 0 0 0;list-style-type:none}:host .instant-apps-social-share__options li{box-sizing:border-box;display:flex;align-items:center;width:100%;padding:5%;transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__options li .instant-apps-social-share__icon,:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{display:inline-block}:host .instant-apps-social-share__options li .instant-apps-social-share__icon{display:flex;align-items:center}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{width:85%;margin-left:10px;word-break:break-word}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text--rtl{margin-left:0;margin-right:10px}:host .instant-apps-social-share__options li:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}:host .instant-apps-social-share__options__x-logo--light path{fill:#000000}:host .instant-apps-social-share__options__x-logo--dark path{fill:#ffffff}:host .instant-apps-social-share__tip{box-sizing:border-box;padding:0 5% 1% 5%}:host .instant-apps-social-share__tip-header{display:flex;align-items:center;color:#007ac2;margin:8px 0 5px 0}:host .instant-apps-social-share__tip-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__tip-content{line-height:17px;margin:0;padding-top:2%}:host .instant-apps-social-share__success{display:flex;flex-direction:column;padding:15px}:host .instant-apps-social-share__success-header{display:flex;align-items:center;font-weight:bold;margin-bottom:10px}:host .instant-apps-social-share__success-icon{display:flex;align-items:center;margin-right:5px}:host .instant-apps-social-share__success-icon calcite-icon{color:var(--calcite-color-status-success)}:host .instant-apps-social-share__success-message{line-height:16px}:host .instant-apps-social-share__embed{box-sizing:border-box;width:100%;padding:5%;margin-bottom:10px;border-top:1px solid #d3d3d3}:host .instant-apps-social-share__embed-header{display:flex;align-items:center;margin-bottom:5px}:host .instant-apps-social-share__embed-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__embed-code-text-area{border:1px solid #d3d3d3}:host .instant-apps-social-share__embed-code-text-area textarea{box-sizing:border-box;padding:4%;border:none;resize:none;background:transparent;width:100%;font-family:var(--calcite-sans-family);color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button{display:flex;align-items:center;text-align:start;width:100%;border:none;border-top:1px solid #d3d3d3;background-color:transparent;line-height:16px;font-weight:400;padding:3%;color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button calcite-icon{color:#007ac2;margin-right:3px}:host .instant-apps-social-share__embed-code-text-area button:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2);transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__embed-text-area-text{font-weight:600;color:var(--instant-apps-social-share-embed-text-area-text)}:host .instant-apps-social-share__embed .instant-apps-social-share__text-area--rtl{text-align:left;direction:ltr}:host .instant-apps-social-share__embed-dimensions{display:flex;justify-content:space-between;margin-top:10px}:host .instant-apps-social-share__embed-dimensions-input{width:47%;box-sizing:border-box}:host .instant-apps-social-share__embed-dimensions-input input{border:1px solid #d3d3d3;width:100%;height:25px;font-family:var(--calcite-sans-family)}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options{display:flex;justify-content:space-around;margin-bottom:8%}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li{flex-direction:column;padding:0}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li .instant-apps-social-share__option-text{word-break:break-word;margin-left:0;margin-top:10px;text-align:center}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li:hover{background-color:unset}:host .instant-apps-social-share__icon-container{display:flex;align-items:center}:host calcite-action{width:var(--instant-apps-social-share-action-width)}:host([scale=s]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--s)}:host([scale=s]) .instant-apps-social-share__icon{width:16px;height:16px}:host([scale=s]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size--1)}:host([scale=s]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--s)}:host([scale=s]) .instant-apps-social-share__tip-header,:host([scale=s]) .instant-apps-social-share__tip-content,:host([scale=s]) .instant-apps-social-share__embed-header,:host([scale=s]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--2)}:host([scale=m]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--m)}:host([scale=m]) .instant-apps-social-share__icon{width:24px;height:24px}:host([scale=m]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-0)}:host([scale=m]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--m)}:host([scale=m]) .instant-apps-social-share__tip-header,:host([scale=m]) .instant-apps-social-share__tip-content,:host([scale=m]) .instant-apps-social-share__embed-header,:host([scale=m]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--1)}:host([scale=l]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--l)}:host([scale=l]) .instant-apps-social-share__icon{width:32px;height:32px}:host([scale=l]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-1)}:host([scale=l]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--l)}:host([scale=l]) .instant-apps-social-share__tip-header,:host([scale=l]) .instant-apps-social-share__tip-content,:host([scale=l]) .instant-apps-social-share__embed-header,:host([scale=l]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size-0)}";export{xt as calcite_block,Ct as calcite_date_picker,Rt as calcite_input_date_picker,Ht as instant_apps_filter_list,Jt as instant_apps_social_share}
@@ -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{r as t,c as e,h as i,H as n,g as o}from"./p-6d753a3d.js";import{t as a,d as s,e as r}from"./p-67b26725.js";import{f as c,c as l,d,a as h,F as p,r as m}from"./p-8f760a96.js";import{g as b}from"./p-b85be429.js";import{c as f,u,d as w,I as g}from"./p-9db9645e.js";import{i as v}from"./p-f50a294b.js";import{c as k,s as y,a as x}from"./p-a25bbcc1.js";import{c as z}from"./p-bfd3d428.js";import{o as D}from"./p-12c80030.js";import{g as I}from"./p-e6e50975.js";import{C as E}from"./p-c41997d5.js";import"./p-db50226e.js";import"./p-c8d3207e.js";import"./p-820d8935.js";
7
+ /*!
8
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
+ * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
10
+ * v2.8.2
11
+ */const C=class{constructor(i){t(this,i),this.calciteDropdownSelect=e(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=e(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=e(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=e(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=e(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=z("mutation",(()=>this.updateItems())),this.resizeObserver=z("resize",(t=>this.resizeObserverCallback(t))),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${b()}`,this.defaultAssignedElements=[],this.slotChangeHandler=t=>{this.defaultAssignedElements=t.target.assignedElements({flatten:!0}),this.updateItems()},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:e}=this;this.filteredFlipPlacements=e?c(e,t):null},this.updateTriggers=t=>{this.triggers=t.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map((t=>Array.from(null==t?void 0:t.querySelectorAll("calcite-dropdown-item")))).reduce(((t,e)=>[...t,...e]),[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach((t=>t.scale=this.scale))},this.updateGroups=t=>{const e=t.target.assignedElements({flatten:!0}).filter((t=>null==t?void 0:t.matches("calcite-dropdown-group")));this.groups=e,this.updateItems()},this.resizeObserverCallback=t=>{t.forEach((t=>{const{target:e}=t;e===this.referenceEl?this.setDropdownWidth():e===this.scrollerEl&&this.setMaxScrollerHeight()}))},this.setDropdownWidth=()=>{const{referenceEl:t,scrollerEl:e}=this,i=null==t?void 0:t.clientWidth;i&&e&&(e.style.minWidth=`${i}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:t}=this;if(!t)return;this.reposition(!0);const e=this.getMaxScrollerHeight();t.style.maxHeight=e>0?`${e}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=t=>{this.resizeObserver.observe(t),this.scrollerEl=t,this.transitionEl=t},this.setReferenceEl=t=>{this.referenceEl=t,l(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(t)},this.setFloatingEl=t=>{this.floatingEl=t,l(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=t=>{if(!t.composedPath().includes(this.referenceEl))return;const{defaultPrevented:e,key:i}=t;if(!e){if(this.open){if("Escape"===i)return this.closeCalciteDropdown(),void t.preventDefault();if(t.shiftKey&&"Tab"===i)return this.closeCalciteDropdown(),void t.preventDefault()}v(i)?(this.openCalciteDropdown(),t.preventDefault()):"Escape"===i&&(this.closeCalciteDropdown(),t.preventDefault())}},this.focusOnFirstActiveOrFirstItem=()=>{this.getFocusableElement(this.getTraversableItems().find((t=>t.selected))||this.items[0])},this.toggleOpenEnd=()=>{this.focusOnFirstActiveOrFirstItem(),this.el.removeEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.openCalciteDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=d,this.selectedItems=[],this.type="click",this.widthScale=void 0,this.scale="m"}openHandler(){D(this),this.disabled?this.open=!1:this.reposition(!0)}handleDisabledChange(t){t||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems()}async setFocus(){await k(this),this.el.focus()}connectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.open&&(this.openHandler(),D(this)),f(this),this.updateItems(),l(this,this.referenceEl,this.floatingEl)}componentWillLoad(){y(this)}componentDidLoad(){x(this),l(this,this.referenceEl,this.floatingEl)}componentDidRender(){u(this)}disconnectedCallback(){var t,e;null===(t=this.mutationObserver)||void 0===t||t.disconnect(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),w(this),h(this,this.referenceEl,this.floatingEl)}render(){const{open:t,guid:e}=this;return i(n,{key:"aad82a6a5bce5a29f6c309bb9ff20911b3ec9482"},i(g,{key:"b559473528a0142c058c6e6de499e981748e369c",disabled:this.disabled},i("div",{key:"089a4a3e39800339c21e50f167c1154dd90f0194",class:"calcite-trigger-container",id:`${e}-menubutton`,onClick:this.openCalciteDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},i("slot",{key:"1a6ded94e643359a5d9a6168d3abe0db4d96d57e","aria-controls":`${e}-menu`,"aria-expanded":a(t),"aria-haspopup":"menu",name:"trigger",onSlotchange:this.updateTriggers})),i("div",{key:"3c8a8fcda5b885baadd1aaaf2b8181b9dfd24ddf","aria-hidden":a(!t),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},i("div",{key:"8c04cadcb38268f20386f9e80f519b99f702054e","aria-labelledby":`${e}-menubutton`,class:{"calcite-dropdown-content":!0,[p.animation]:!0,[p.animationActive]:t},id:`${e}-menu`,role:"menu",ref:this.setScrollerAndTransitionEl},i("slot",{key:"92b1d20e253dc2253aa2f998076bf640e696ff91",onSlotchange:this.updateGroups})))))}async reposition(t=!1){const{floatingEl:e,referenceEl:i,placement:n,overlayPositioning:o,filteredFlipPlacements:a}=this;return m(this,{floatingEl:e,referenceEl:i,overlayPositioning:o,placement:n,flipPlacements:a,type:"menu"},t)}closeCalciteDropdownOnClick(t){this.disabled||!this.open||t.composedPath().includes(this.el)||this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(t){this.closeCalciteDropdown(),t.stopPropagation()}closeCalciteDropdownOnOpenEvent(t){t.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||"hover"!==this.type||this.openCalciteDropdown()}pointerLeaveHandler(){this.disabled||"hover"!==this.type||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter((t=>!t.disabled&&!t.hidden))}calciteInternalDropdownItemKeyEvent(t){const{keyboardEvent:e}=t.detail,i=e.target,n=this.getTraversableItems();switch(e.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(i);break;case"ArrowDown":s(n,i,"next");break;case"ArrowUp":s(n,i,"previous");break;case"Home":s(n,i,"first");break;case"End":s(n,i,"last")}t.stopPropagation()}handleItemSelect(t){this.updateSelectedItems(),t.stopPropagation(),this.calciteDropdownSelect.emit(),this.closeOnSelectDisabled&&"none"!==t.detail.requestedDropdownGroup.selectionMode||this.closeCalciteDropdown(),t.stopPropagation()}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter((t=>t.selected))}getMaxScrollerHeight(){const{maxItems:t,items:e}=this;let i,n=0,o=0;return this.groups.forEach((e=>{t>0&&n<t&&Array.from(e.children).forEach(((e,a)=>{0===a&&(isNaN(i)&&(i=e.offsetTop),o+=i),n<t&&(o+=e.offsetHeight,n+=1)}))})),e.length>t?o:0}closeCalciteDropdown(t=!0){this.open=!1,t&&r(this.triggers[0])}getFocusableElement(t){t&&r(t)}updateTabIndexOfItems(t){this.items.forEach((e=>{e.tabIndex=t!==e?-1:0}))}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}};C.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;block-size:100%;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width-scale=s]){--calcite-dropdown-width:12rem}:host([width-scale=m]){--calcite-dropdown-width:14rem}:host([width-scale=l]){--calcite-dropdown-width:16rem}:host([hidden]){display:none}[hidden]{display:none}";const H=class{constructor(i){t(this,i),this.calciteDropdownItemSelect=e(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=e(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=e(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=e(this,"calciteInternalDropdownCloseRequest",6),this.disabled=!1,this.href=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.label=void 0,this.rel=void 0,this.selected=!1,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){var t;await k(this),null===(t=this.el)||void 0===t||t.focus()}componentWillLoad(){y(this),this.initialize()}componentDidLoad(){x(this)}connectedCallback(){this.initialize()}componentDidRender(){u(this)}render(){const{href:t,selectionMode:e,label:o,iconFlipRtl:s,scale:r}=this,c=i("calcite-icon",{key:"10985dba962cc1582cc6b2896e1c274b21e1dc20",class:E.iconStart,flipRtl:"start"===s||"both"===s,icon:this.iconStart,scale:I(this.scale)}),l=i("span",{key:"e72a06cc3d3f325ec8e0e8eff407dc9149b29b14",class:E.itemContent},i("slot",{key:"e8d4e201f5903a2811c642d441d4b33d20abd7b2"})),d=i("calcite-icon",{key:"fd15f4aea96916ffa674591adc6887dafccc8218",class:E.iconEnd,flipRtl:"end"===s||"both"===s,icon:this.iconEnd,scale:I(this.scale)}),h=this.iconStart&&this.iconEnd?[c,l,d]:this.iconStart?[c,l]:this.iconEnd?[l,d]:l,p=t?i("a",{"aria-label":o,class:E.link,href:t,rel:this.rel,tabIndex:-1,target:this.target,ref:t=>this.childLink=t},h):h,m=t?null:"single"===e?"menuitemradio":"multiple"===e?"menuitemcheckbox":"menuitem",b="none"!==e?a(this.selected):null,{disabled:f}=this;return i(n,{key:"6cdbba40456cde099120c69e8b743db43a044279","aria-checked":b,"aria-label":t?"":o,role:m,tabIndex:f?-1:0},i(g,{key:"ad9f797dba175a65095cb209f0230043ca19247c",disabled:f},i("div",{key:"6380f6b0db4dfada44886e8e003d6d973598b252",class:{[E.container]:!0,[E.containerLink]:!!t,[`${E.container}--${r}`]:!0,[E.containerMulti]:"multiple"===e,[E.containerSingle]:"single"===e,[E.containerNone]:"none"===e}},"none"!==e?i("calcite-icon",{class:E.icon,icon:"multiple"===e?"check":"bullet-point",scale:I(this.scale)}):null,p)))}onClick(){this.emitRequestedItem()}keyDownHandler(t){switch(t.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),t.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),t.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:t});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":t.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:t})}}updateActiveItemOnChange(t){t.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.determineActiveItem()),t.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),"none"===this.selectionMode&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return o(this)}};H.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.container--s{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}.container--s.container--none-selection{padding-inline-start:0.25rem}.container--s.container--none-selection .dropdown-link{padding-inline-start:0px}.container--m.container--none-selection{padding-inline-start:0.5rem}.container--m.container--none-selection .dropdown-link{padding-inline-start:0px}.container--l.container--none-selection{padding-inline-start:0.75rem}.container--l.container--none-selection .dropdown-link{padding-inline-start:0px}:host{position:relative;display:flex;flex-grow:1;align-items:center}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem;padding-inline-end:auto;padding-inline-start:0.25rem}:host,.container--link a{outline-color:transparent}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-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 )}.container--link{padding:0px}.container--link a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.container--s .dropdown-link{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m .dropdown-link{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l .dropdown-link{padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}:host(:hover:not([disabled])) .container,:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:hover:not([disabled])) .container--link .dropdown-link,:host(:active:not([disabled])) .container--link .dropdown-link{color:var(--calcite-color-text-1)}:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-3)}:host(:focus) .container{color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host([selected]) .container:not(.container--none-selection),:host([selected]) .container--link .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .container--link .dropdown-link calcite-icon{color:var(--calcite-color-brand)}.dropdown-item-icon{position:absolute;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}.container--s .dropdown-item-icon{inset-inline-start:0.25rem}.container--m .dropdown-item-icon{inset-inline-start:0.5rem}.container--l .dropdown-item-icon{inset-inline-start:0.75rem}:host(:hover:not([disabled])) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}.container--s .dropdown-item-icon-start{margin-inline-end:0.5rem;margin-inline-start:0.25rem}.container--s .dropdown-item-icon-end{margin-inline-start:0.5rem}.container--m .dropdown-item-icon-start{margin-inline-end:0.75rem;margin-inline-start:0.25rem}.container--m .dropdown-item-icon-end{margin-inline-start:0.75rem}.container--l .dropdown-item-icon-start{margin-inline-end:1rem;margin-inline-start:0.25rem}.container--l .dropdown-item-icon-end{margin-inline-start:1rem}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}";export{C as calcite_dropdown,H as calcite_dropdown_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 a,c as t,h as n,H as s,F as e,g as i}from"./p-6d753a3d.js";import{g as r,a as l,s as o,E as c,b as p,l as g,c as u}from"./p-2775f82b.js";import{l as d}from"./p-4ba6f8f0.js";import{c as h}from"./p-6bdafe3f.js";import{g as v,f as m}from"./p-08a1e120.js";import"./p-bdcf99c0.js";import"./p-82e085d0.js";import"./p-deb3adb8.js";const _="instant-apps-language-translator",b={BASE:_,header:`${_}__header`,headerText:`${_}__header-text`,savingIndicator:`${_}__saving-indicator`,closeButton:`${_}__close-button`,headerTip:`${_}__header-tip`,topBar:`${_}__top-bar`,topBarSection:`${_}__top-bar-section`,collapseSearchContainer:`${_}__collapse-search-container`,userLangText:`${_}__user-lang-text`,lastItem:`${_}--last-item`,writingIcon:`${_}__writing-icon`},f=class{constructor(n){a(this,n),this.translatorDataUpdated=t(this,"translatorDataUpdated",7),this.portalItem=void 0,this.appSettings=void 0,this.locales=void 0,this.open=!1,this.userLocaleInputOnChangeCallback=void 0,this.translatedLocaleInputOnChangeCallback=void 0,this.saving=!1,this.messages=void 0,this.isCollapse=!0}handleT9nItemUpdate(){this.translatorDataUpdated.emit()}handleLocaleChange(){this.initUIData(),this.initSelectLanguage()}handleAppSettings(){this.initUIData(),this.initSelectLanguage()}async componentDidLoad(){this.initialize()}async initialize(){const[a,t]=await d(["esri/intl","esri/request"]);this.intl=a,this.request=t,await this.initMessages(),this.initUIData(),this.initPortalItemResourceT9nData(),this.initSelectLanguage()}async initMessages(){try{const{el:a}=this,t=await r(a);return this.messages=t,Promise.resolve()}catch(a){return Promise.reject()}}initUIData(){const{appSettings:a,locales:t}=this,n=l(a,t);o.set("uiData",n)}initSelectLanguage(){var a,t;if(!this.intl)return;const{locales:n}=this,s=null!==(t=null===(a=null==n?void 0:n[0])||void 0===a?void 0:a.locale)&&void 0!==t?t:this.intl.getLocale(),e=o.get("currentLanguage");0===this.locales.filter((a=>a.locale===e)).length&&o.set("currentLanguage",s)}async initPortalItemResourceT9nData(){try{const a=await v(this.portalItem);o.set("portalItemResource",a);const t=await m(this.request,a);o.set("portalItemResourceT9n",null!=t?t:{})}catch(a){}}render(){return n(s,null,this.renderModal(),this.renderPopoverTip())}renderModal(){return n("calcite-modal",{open:this.open,scale:"l",fullscreen:!0,onCalciteModalClose:this.close.bind(this)},this.renderHeader(),this.renderContent(),this.renderPrimaryButton())}renderPopoverTip(){var a;return n("calcite-popover",{label:"",referenceElement:"headerTip",placement:"trailing","auto-close":!0,closable:!0},n("div",{class:b.headerTip},null===(a=this.messages)||void 0===a?void 0:a.headerTip))}renderHeader(){const a=o.get("saving");return n("header",{class:b.header,slot:"header"},this.renderHeaderText(),a?this.renderSavingIndicator():null)}renderHeaderText(){const{messages:a}=this;return n("div",{class:b.headerText},n("span",null,null==a?void 0:a.header),n("calcite-button",{id:"headerTip",appearance:"transparent"},n("calcite-icon",{icon:c.Popover,scale:"s"})))}renderSavingIndicator(){var a;const t=o.get("saving"),s=null===(a=this.messages)||void 0===a?void 0:a.saving;return n("div",{class:b.savingIndicator},t?n("calcite-loader",{label:s,inline:!0}):null,n("span",null,s))}renderContent(){const a=p(this.locales);return n("div",{slot:"content"},this.renderTopBar(),(null==a?void 0:a.length)>0?this.renderUIData():this.renderNotice())}renderTopBar(){return n("div",{class:b.topBar},this.renderLeadingTopBarSection(),this.renderTrailingTopBarSection())}renderLeadingTopBarSection(){return n("div",{class:b.topBarSection},this.renderUserLocale(),this.renderCollapseSearchContainer())}renderUserLocale(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.languages,s=h(this.el);return n("div",{class:b.userLangText},null==t?void 0:t[s])}renderCollapseSearchContainer(){return n("div",{class:b.collapseSearchContainer},this.renderExpandCollapseButton(),this.renderSearch())}renderExpandCollapseButton(){const{isCollapse:a,messages:t}=this,s=a?null==t?void 0:t.collapseAll:null==t?void 0:t.expandAll;return n(e,null,n("slot",{name:"primary-custom-action"}),n("slot",{name:"secondary-custom-action"}),n("calcite-button",{onClick:this.handleExpandCollapseAll.bind(this),appearance:"transparent","icon-start":c.ExpandCollapse},s))}renderSearch(){var a;return n("instant-apps-language-translator-search",{onSuggestionSelected:this.onSuggestionSelect.bind(this),t9nPlaceholder:null===(a=this.messages)||void 0===a?void 0:a.searchPlaceholder})}renderTrailingTopBarSection(){return n("div",{class:b.topBarSection},this.renderLanguageSelection(),n("slot",{name:"translation-custom-action"}))}renderLanguageSelection(){var a;return n("calcite-label",{layout:"inline"},null===(a=this.messages)||void 0===a?void 0:a.translatedLanguage,n("calcite-select",{label:"",onCalciteSelectChange:this.handleLanguageSelection.bind(this)},this.renderTranslatedLangOptions()))}renderTranslatedLangOptions(){const a=o.get("uiData"),t=null==a?void 0:a.get("locales"),s=p(t);return null==s?void 0:s.map((a=>{const{messages:t}=this,s=null==t?void 0:t.translatedLanguageNames,e=null==t?void 0:t.languages;return n("calcite-option",{key:`translated-lang-option-${a}`,value:a},`${null==s?void 0:s[a]} - ${null==e?void 0:e[a]}`)}))}renderUIData(){if(!(null==g?void 0:g.uiData))return;const a=u();return n("div",null,null==a?void 0:a.map(((t,n)=>this.renderUIDataItem(t,n,a.length))))}renderNotice(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.noLanguage;return n("calcite-notice",{open:!0,icon:"exclamation-mark-triangle",kind:"warning"},n("div",{slot:"title"},null==t?void 0:t.title),n("div",{slot:"message"},null==t?void 0:t.message))}renderUIDataItem(a,t,s){var e,i;const r=null===(i=null===(e=this.appSettings)||void 0===e?void 0:e.translatedLanguageLabels)||void 0===i?void 0:i[g.currentLanguage],l=`${t===s-1?b.lastItem:""}`,o=this.appSettings.content.filter((t=>t.id===a))[0];return n("instant-apps-language-translator-item",{key:`${a}-${t}`,class:l,fieldName:a,translatedLanguageLabels:r,setting:o,userLocaleInputOnChangeCallback:this.userLocaleInputOnChangeCallback,translatedLocaleInputOnChangeCallback:this.translatedLocaleInputOnChangeCallback})}renderPrimaryButton(){var a;return n("calcite-button",{onClick:()=>this.open=!1,slot:"primary",class:b.closeButton},null===(a=this.messages)||void 0===a?void 0:a.close)}handleExpandCollapseAll(){this.isCollapse=!this.isCollapse;const a=new Map(g.uiData);u().forEach((t=>a.get(t).expanded=this.isCollapse)),o.set("uiData",a)}onSuggestionSelect(a){const t=a.detail,n=new Map(g.uiData);u().forEach((a=>{n.get(a).selected=a===t})),o.set("uiData",n)}close(){this.open=!1}handleLanguageSelection(a){o.set("currentLanguage",a.target.value)}async getTranslationData(){return o.get("portalItemResourceT9n")}async setTranslationData(a){return o.set("portalItemResourceT9n",a)}async getPortalItemResource(){return o.get("portalItemResource")}async batchWriteToPortalItemResource(a){o.set("saving",!0);try{const t=await this.getPortalItemResource(),n=JSON.stringify(a),s=new Blob([n],{type:"application/json"});return await t.update(s),setTimeout((()=>o.set("saving",!1)),1500),this.translatorDataUpdated.emit(),Promise.resolve()}catch(a){return console.error("Error writing to portal item resource: ",a),o.set("saving",!1),Promise.reject()}}get el(){return i(this)}static get watchers(){return{locales:["handleLocaleChange"],appSettings:["handleAppSettings"]}}};f.style=".sc-instant-apps-language-translator-h{display:block}.sc-instant-apps-language-translator-h calcite-modal.sc-instant-apps-language-translator{--calcite-modal-content-padding:0}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header.sc-instant-apps-language-translator{display:flex;justify-content:space-between;width:100%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-text.sc-instant-apps-language-translator{font-size:18px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__saving-indicator.sc-instant-apps-language-translator{display:flex;align-items:center;font-size:14.5px;color:var(--calcite-color-brand)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__writing-icon.sc-instant-apps-language-translator{display:flex;justify-content:center;align-items:center;margin-right:5px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__close-button.sc-instant-apps-language-translator{width:175px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-tip.sc-instant-apps-language-translator{padding:20px;max-width:45vw}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator{display:flex;width:100%;position:sticky;top:0;background:var(--calcite-color-foreground-1);z-index:1}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator calcite-label.sc-instant-apps-language-translator{--calcite-label-margin-bottom:0;font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator{box-sizing:border-box;display:flex;align-items:center;width:50%;padding:0.5%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__user-lang-text.sc-instant-apps-language-translator{font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:first-child{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:nth-child(2) calcite-select.sc-instant-apps-language-translator{width:255px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator calcite-input.sc-instant-apps-language-translator{width:300px;margin-left:30px}.ck.ck-reset.ck-editor.ck-rounded-corners.sc-instant-apps-language-translator{margin-top:10px !important;margin-left:55px !important}.ck-editor__editable.sc-instant-apps-language-translator{height:70px !important;font-size:0.875rem !important;line-height:1.375 !important}.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:first-child,.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:last-child{--ck-spacing-large:0.5rem !important}";export{f as instant_apps_language_translator}
6
+ import{r as a,c as t,h as n,H as s,F as e,g as i}from"./p-6d753a3d.js";import{g as r,a as l,s as o,E as c,b as p,l as g,c as u}from"./p-2775f82b.js";import{l as d}from"./p-4ba6f8f0.js";import{c as h}from"./p-6bdafe3f.js";import{g as v,f as m}from"./p-84913712.js";import"./p-bdcf99c0.js";import"./p-82e085d0.js";import"./p-deb3adb8.js";const _="instant-apps-language-translator",b={BASE:_,header:`${_}__header`,headerText:`${_}__header-text`,savingIndicator:`${_}__saving-indicator`,closeButton:`${_}__close-button`,headerTip:`${_}__header-tip`,topBar:`${_}__top-bar`,topBarSection:`${_}__top-bar-section`,collapseSearchContainer:`${_}__collapse-search-container`,userLangText:`${_}__user-lang-text`,lastItem:`${_}--last-item`,writingIcon:`${_}__writing-icon`},f=class{constructor(n){a(this,n),this.translatorDataUpdated=t(this,"translatorDataUpdated",7),this.portalItem=void 0,this.appSettings=void 0,this.locales=void 0,this.open=!1,this.userLocaleInputOnChangeCallback=void 0,this.translatedLocaleInputOnChangeCallback=void 0,this.saving=!1,this.messages=void 0,this.isCollapse=!0}handleT9nItemUpdate(){this.translatorDataUpdated.emit()}handleLocaleChange(){this.initUIData(),this.initSelectLanguage()}handleAppSettings(){this.initUIData(),this.initSelectLanguage()}async componentDidLoad(){this.initialize()}async initialize(){const[a,t]=await d(["esri/intl","esri/request"]);this.intl=a,this.request=t,await this.initMessages(),this.initUIData(),this.initPortalItemResourceT9nData(),this.initSelectLanguage()}async initMessages(){try{const{el:a}=this,t=await r(a);return this.messages=t,Promise.resolve()}catch(a){return Promise.reject()}}initUIData(){const{appSettings:a,locales:t}=this,n=l(a,t);o.set("uiData",n)}initSelectLanguage(){var a,t;if(!this.intl)return;const{locales:n}=this,s=null!==(t=null===(a=null==n?void 0:n[0])||void 0===a?void 0:a.locale)&&void 0!==t?t:this.intl.getLocale(),e=o.get("currentLanguage");0===this.locales.filter((a=>a.locale===e)).length&&o.set("currentLanguage",s)}async initPortalItemResourceT9nData(){try{const a=await v(this.portalItem);o.set("portalItemResource",a);const t=await m(this.request,a);o.set("portalItemResourceT9n",null!=t?t:{})}catch(a){}}render(){return n(s,null,this.renderModal(),this.renderPopoverTip())}renderModal(){return n("calcite-modal",{open:this.open,scale:"l",fullscreen:!0,onCalciteModalClose:this.close.bind(this)},this.renderHeader(),this.renderContent(),this.renderPrimaryButton())}renderPopoverTip(){var a;return n("calcite-popover",{label:"",referenceElement:"headerTip",placement:"trailing","auto-close":!0,closable:!0},n("div",{class:b.headerTip},null===(a=this.messages)||void 0===a?void 0:a.headerTip))}renderHeader(){const a=o.get("saving");return n("header",{class:b.header,slot:"header"},this.renderHeaderText(),a?this.renderSavingIndicator():null)}renderHeaderText(){const{messages:a}=this;return n("div",{class:b.headerText},n("span",null,null==a?void 0:a.header),n("calcite-button",{id:"headerTip",appearance:"transparent"},n("calcite-icon",{icon:c.Popover,scale:"s"})))}renderSavingIndicator(){var a;const t=o.get("saving"),s=null===(a=this.messages)||void 0===a?void 0:a.saving;return n("div",{class:b.savingIndicator},t?n("calcite-loader",{label:s,inline:!0}):null,n("span",null,s))}renderContent(){const a=p(this.locales);return n("div",{slot:"content"},this.renderTopBar(),(null==a?void 0:a.length)>0?this.renderUIData():this.renderNotice())}renderTopBar(){return n("div",{class:b.topBar},this.renderLeadingTopBarSection(),this.renderTrailingTopBarSection())}renderLeadingTopBarSection(){return n("div",{class:b.topBarSection},this.renderUserLocale(),this.renderCollapseSearchContainer())}renderUserLocale(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.languages,s=h(this.el);return n("div",{class:b.userLangText},null==t?void 0:t[s])}renderCollapseSearchContainer(){return n("div",{class:b.collapseSearchContainer},this.renderExpandCollapseButton(),this.renderSearch())}renderExpandCollapseButton(){const{isCollapse:a,messages:t}=this,s=a?null==t?void 0:t.collapseAll:null==t?void 0:t.expandAll;return n(e,null,n("slot",{name:"primary-custom-action"}),n("slot",{name:"secondary-custom-action"}),n("calcite-button",{onClick:this.handleExpandCollapseAll.bind(this),appearance:"transparent","icon-start":c.ExpandCollapse},s))}renderSearch(){var a;return n("instant-apps-language-translator-search",{onSuggestionSelected:this.onSuggestionSelect.bind(this),t9nPlaceholder:null===(a=this.messages)||void 0===a?void 0:a.searchPlaceholder})}renderTrailingTopBarSection(){return n("div",{class:b.topBarSection},this.renderLanguageSelection(),n("slot",{name:"translation-custom-action"}))}renderLanguageSelection(){var a;return n("calcite-label",{layout:"inline"},null===(a=this.messages)||void 0===a?void 0:a.translatedLanguage,n("calcite-select",{label:"",onCalciteSelectChange:this.handleLanguageSelection.bind(this)},this.renderTranslatedLangOptions()))}renderTranslatedLangOptions(){const a=o.get("uiData"),t=null==a?void 0:a.get("locales"),s=p(t);return null==s?void 0:s.map((a=>{const{messages:t}=this,s=null==t?void 0:t.translatedLanguageNames,e=null==t?void 0:t.languages;return n("calcite-option",{key:`translated-lang-option-${a}`,value:a},`${null==s?void 0:s[a]} - ${null==e?void 0:e[a]}`)}))}renderUIData(){if(!(null==g?void 0:g.uiData))return;const a=u();return n("div",null,null==a?void 0:a.map(((t,n)=>this.renderUIDataItem(t,n,a.length))))}renderNotice(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.noLanguage;return n("calcite-notice",{open:!0,icon:"exclamation-mark-triangle",kind:"warning"},n("div",{slot:"title"},null==t?void 0:t.title),n("div",{slot:"message"},null==t?void 0:t.message))}renderUIDataItem(a,t,s){var e,i;const r=null===(i=null===(e=this.appSettings)||void 0===e?void 0:e.translatedLanguageLabels)||void 0===i?void 0:i[g.currentLanguage],l=`${t===s-1?b.lastItem:""}`,o=this.appSettings.content.filter((t=>t.id===a))[0];return n("instant-apps-language-translator-item",{key:`${a}-${t}`,class:l,fieldName:a,translatedLanguageLabels:r,setting:o,userLocaleInputOnChangeCallback:this.userLocaleInputOnChangeCallback,translatedLocaleInputOnChangeCallback:this.translatedLocaleInputOnChangeCallback})}renderPrimaryButton(){var a;return n("calcite-button",{onClick:()=>this.open=!1,slot:"primary",class:b.closeButton},null===(a=this.messages)||void 0===a?void 0:a.close)}handleExpandCollapseAll(){this.isCollapse=!this.isCollapse;const a=new Map(g.uiData);u().forEach((t=>a.get(t).expanded=this.isCollapse)),o.set("uiData",a)}onSuggestionSelect(a){const t=a.detail,n=new Map(g.uiData);u().forEach((a=>{n.get(a).selected=a===t})),o.set("uiData",n)}close(){this.open=!1}handleLanguageSelection(a){o.set("currentLanguage",a.target.value)}async getTranslationData(){return o.get("portalItemResourceT9n")}async setTranslationData(a){return o.set("portalItemResourceT9n",a)}async getPortalItemResource(){return o.get("portalItemResource")}async batchWriteToPortalItemResource(a){o.set("saving",!0);try{const t=await this.getPortalItemResource(),n=JSON.stringify(a),s=new Blob([n],{type:"application/json"});return await t.update(s),setTimeout((()=>o.set("saving",!1)),1500),this.translatorDataUpdated.emit(),Promise.resolve()}catch(a){return console.error("Error writing to portal item resource: ",a),o.set("saving",!1),Promise.reject()}}get el(){return i(this)}static get watchers(){return{locales:["handleLocaleChange"],appSettings:["handleAppSettings"]}}};f.style=".sc-instant-apps-language-translator-h{display:block}.sc-instant-apps-language-translator-h calcite-modal.sc-instant-apps-language-translator{--calcite-modal-content-padding:0}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header.sc-instant-apps-language-translator{display:flex;justify-content:space-between;width:100%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-text.sc-instant-apps-language-translator{font-size:18px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__saving-indicator.sc-instant-apps-language-translator{display:flex;align-items:center;font-size:14.5px;color:var(--calcite-color-brand)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__writing-icon.sc-instant-apps-language-translator{display:flex;justify-content:center;align-items:center;margin-right:5px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__close-button.sc-instant-apps-language-translator{width:175px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-tip.sc-instant-apps-language-translator{padding:20px;max-width:45vw}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator{display:flex;width:100%;position:sticky;top:0;background:var(--calcite-color-foreground-1);z-index:1}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator calcite-label.sc-instant-apps-language-translator{--calcite-label-margin-bottom:0;font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator{box-sizing:border-box;display:flex;align-items:center;width:50%;padding:0.5%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__user-lang-text.sc-instant-apps-language-translator{font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:first-child{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:nth-child(2) calcite-select.sc-instant-apps-language-translator{width:255px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator calcite-input.sc-instant-apps-language-translator{width:300px;margin-left:30px}.ck.ck-reset.ck-editor.ck-rounded-corners.sc-instant-apps-language-translator{margin-top:10px !important;margin-left:55px !important}.ck-editor__editable.sc-instant-apps-language-translator{height:70px !important;font-size:0.875rem !important;line-height:1.375 !important}.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:first-child,.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:last-child{--ck-spacing-large:0.5rem !important}";export{f as instant_apps_language_translator}
@@ -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 e,h as a,H as s,g as i}from"./p-6d753a3d.js";import{g as n}from"./p-deb3adb8.js";import{S as h}from"./p-a230b270.js";import{w as o}from"./p-abea8ef5.js";import{g as r}from"./p-eeee7c7a.js";import"./p-82e085d0.js";const d={base:"instant-apps-header--standard",headerContainer:"instant-apps-header__header-container",headerContent:"instant-apps-header__header-content",flipRtl:"instant-apps-header--rtl",logoScale:"instant-apps-header__logo-scale--",logoHeight:"instant-apps-header__logo-height--",standardHeight:"instant-apps-header__standard-height",actionsEndContainer:"instant-apps-header__actions-end-container",alignment:{center:"instant-apps-header__header-content--center",right:"instant-apps-header__header-content--right"}},l=class{constructor(a){t(this,a),this.infoIsOpenChanged=e(this,"infoIsOpenChanged",6),this._sanitizer=new h({whiteList:{h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],img:["style","src","width","height"],pre:["style"],p:["id","class","style"],div:["id","class","style","role"],span:["id","class","style","role"],figure:["class","style"],header:["id","class","style","role"]}},!0),this.dir=void 0,this.titleText=void 0,this.titleTextLink=void 0,this.backgroundColor=void 0,this.textColor=void 0,this.logoImage=void 0,this.logoScale="m",this.logoImageAltText=void 0,this.logoLink=void 0,this.infoButton=!1,this.infoIsOpen=!1,this.infoTitleText=void 0,this.customHeaderHtml=void 0,this.headerAlignment="left",this.customHeaderCss=void 0,this.fontFamily="var(--calcite-sans-family);",this.mobileWidthBreakpoint=o.medium[1],this.initialScale="m"}sanitizeCustomHeaderHtml(){this.customHeaderHtml=this._sanitizer.sanitize(this.customHeaderHtml)}componentWillLoad(){this.dir=n(this.el),this.handleMobileBreakpoints(),this.dir=n(this.el),this.customHeaderHtml=this._sanitizer.sanitize(this.customHeaderHtml)}render(){var t,e,i,n;const h="undefined"===this.logoImage||"undefined"===(null===(e=null===(t=this.logoImage)||void 0===t?void 0:t.split("?"))||void 0===e?void 0:e[0])||""===(null===(n=null===(i=this.logoImage)||void 0===i?void 0:i.split("?"))||void 0===n?void 0:n[0])||!this.logoImage,o=this.renderLogo(h),l=this.renderTitle(),p="right"===this.headerAlignment||"center"===this.headerAlignment?d.headerContent.concat(" ",d.alignment[this.headerAlignment]):d.headerContent,c=r(this.fontFamily);return a(s,null,this.customHeaderHtml?[a("style",null,this.customHeaderCss),a("div",{id:"customHeader",innerHTML:this.customHeaderHtml})]:a("header",{class:`${d.base}${"rtl"===this.dir?` ${d.flipRtl}`:""}${this.logoImage&&!h?` ${d.logoHeight}${this.logoScale}`:` ${d.standardHeight}`}`,style:{backgroundColor:this.backgroundColor,fontFamily:c}},a("div",{class:d.headerContainer},a("span",{class:p},o,l,this.infoButton?a("calcite-button",{style:{"--calcite-color-text-1":this.textColor},id:"infoButton",alignment:"start",appearance:"transparent",kind:"neutral","icon-start":"information-f",scale:"s",label:this.infoTitleText,title:this.infoTitleText,onClick:this.toggleInfo.bind(this)}):null),a("div",{class:d.actionsEndContainer},a("slot",{name:"actions-end"})))))}renderLogo(t){return t?"":this.logoImage&&this.logoLink?a("a",{href:`${this.logoLink}`,target:"_blank"},a("img",{class:`${d.logoScale}${this.logoScale}`,src:`${this.logoImage}`,alt:`${this.logoImageAltText}`})):this.logoImage?a("img",{class:`${d.logoScale}${this.logoScale}`,src:`${this.logoImage}`,alt:this.logoImageAltText}):""}renderTitle(){return this.titleText&&this.titleTextLink?a("a",{style:{color:this.textColor},href:`${this.titleTextLink}`,rel:"noopener noreferrer",target:"_blank"},a("h1",{style:{color:this.textColor}},this.titleText)):a("h1",{style:{color:this.textColor}},this.titleText)}toggleInfo(){this.infoIsOpen=!this.infoIsOpen,this.infoIsOpenChanged.emit(this.infoIsOpen)}mqlCallback(){return t=>{const{matches:e}=t;this.logoScale=e?"s":this.initialScale}}handleMobileBreakpoints(){this.initialScale=this.logoScale;const t=window.matchMedia(`(max-width: ${this.mobileWidthBreakpoint}px)`);t.matches&&(this.logoScale="s"),t.addEventListener("change",this.mqlCallback())}get el(){return i(this)}static get watchers(){return{customHeaderHtml:["sanitizeCustomHeaderHtml"]}}};l.style=":host{--instant-apps-header-height:auto;--instant-apps-header-min-height:50px;--instant-apps-header-title-text-link-decoration:underline;--instant-apps-header-height--logo-scale--s:55px;--instant-apps-header-logo-width--logo-scale--s:35px;--instant-apps-header-logo-height--logo-scale--s:35px;--instant-apps-header-height--logo-scale--m:70px;--instant-apps-header-logo-width--logo-scale--m:50px;--instant-apps-header-logo-height--logo-scale--m:50px;--instant-apps-header-height--logo-scale--l:80px;--instant-apps-header-logo-width--logo-scale--l:60px;--instant-apps-header-logo-height--logo-scale--l:60px;width:100%}:host .image.image_resized img{width:100%}:host .instant-apps-header--standard{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;width:100%;height:var(--instant-apps-header-height);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);font-family:var(--calcite-sans-family);min-height:var(--instant-apps-header-min-height)}:host .instant-apps-header--standard .instant-apps-header__header-container{display:flex;align-items:center;width:100%;height:inherit}:host .instant-apps-header--standard .instant-apps-header__header-container slot{display:flex;height:inherit}:host .instant-apps-header--standard .instant-apps-header__header-container ::slotted(*){display:flex;min-height:var(--instant-apps-header-min-height);height:var(--instant-apps-header-height)}:host .instant-apps-header--standard .instant-apps-header__header-container ::slotted(*) calcite-button{height:100%}:host .instant-apps-header--standard .instant-apps-header__header-content{box-sizing:border-box;display:flex;align-items:center;width:100%;min-width:0;height:inherit;padding:5px 10px}:host .instant-apps-header--standard .instant-apps-header__header-content a{display:flex;align-items:center;-webkit-text-decoration:var(--instant-apps-header-title-text-link-decoration);text-decoration:var(--instant-apps-header-title-text-link-decoration)}:host .instant-apps-header--standard .instant-apps-header__header-content a img{padding-right:0}:host .instant-apps-header--standard .instant-apps-header__header-content img{margin:10px}:host .instant-apps-header--standard .instant-apps-header__header-content h1{margin:0;font-size:1.25rem;color:var(--calcite-color-text-1);font-weight:430;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .instant-apps-header--standard .instant-apps-header__header-content #infoButton{margin-inline-start:10px}:host .instant-apps-header--standard .instant-apps-header__header-content--center{justify-content:center}:host .instant-apps-header--standard .instant-apps-header__header-content--right{justify-content:end}:host .instant-apps-header__logo-height--s{height:var(--instant-apps-header-height--logo-scale--s)}:host .instant-apps-header__logo-height--s .instant-apps-header__header-content h1{font-size:1.125rem}:host .instant-apps-header__logo-scale--s{width:var(--instant-apps-header-logo-width--logo-scale--s);height:var(--instant-apps-header-logo-height--logo-scale--s)}:host .instant-apps-header__logo-height--m{height:var(--instant-apps-header-height--logo-scale--m)}:host .instant-apps-header__logo-scale--m{width:var(--instant-apps-header-logo-width--logo-scale--m);height:var(--instant-apps-header-logo-height--logo-scale--m)}:host .instant-apps-header__logo-height--l{height:var(--instant-apps-header-height--logo-scale--l)}:host .instant-apps-header__logo-height--l .instant-apps-header__header-content h1{font-size:1.375rem}:host .instant-apps-header__logo-scale--l{width:var(--instant-apps-header-logo-width--logo-scale--l);height:var(--instant-apps-header-logo-height--logo-scale--l)}:host .instant-apps-header__actions-end-container{display:flex}:host .instant-apps-header__sign-in-container{height:inherit;display:flex;align-items:center}:host .instant-apps-header__sign-in-container calcite-dropdown,:host .instant-apps-header__sign-in-container calcite-navigation-user{height:100%}:host .instant-apps-header__sign-in-container calcite-button{margin:0 10px}:host .instant-apps-header__sign-in-container calcite-dropdown-group{min-width:140px}";export{l as instant_apps_header}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as i,h as n,g as t,H as a}from"./p-6d753a3d.js";import{l as s}from"./p-4ba6f8f0.js";import{g as o}from"./p-6bdafe3f.js";import"./p-82e085d0.js";import"./p-deb3adb8.js";const e=class{constructor(n){i(this,n),this.type="navigation",this.portal=void 0,this.oauthappid=void 0,this.openInPopup=void 0,this.landingPage=void 0,this.isSignedIn=void 0,this.user=void 0,this.titleText=void 0,this.subtitleText=void 0,this.descriptionText=void 0,this.closeLandingPage=void 0,this.ready=!1,this.messages=void 0}async watchPortal(){await this.initSignIn()}async watchOauthappid(){await this.initSignIn()}async componentWillLoad(){o(this),await this.initSignIn()}render(){const i=this.ready?this.renderContent():null;return n(a,null,i)}renderContent(){return"landingPage"===this.type?this.renderLandingPageSignIn():this.renderSignInContainer()}renderSignInContainer(){return n("div",{class:"instant-apps-sign-in__container"},this.isSignedIn?this.renderSignInDropdown():this.renderSignInButton())}renderSignInDropdown(){var i,t,a,s,o,e,r;return n("calcite-dropdown",{placement:"bottom-end",scale:"navigation"===this.type?"m":"s"},"navigation"===this.type?n("calcite-navigation-user",{slot:"trigger",thumbnail:null===(i=this.user)||void 0===i?void 0:i.thumbnailUrl,"full-name":null===(t=this.user)||void 0===t?void 0:t.fullName,username:null===(a=this.user)||void 0===a?void 0:a.username,textDisabled:!0}):n("button",{slot:"trigger"},n("calcite-avatar",{thumbnail:null===(s=this.user)||void 0===s?void 0:s.thumbnailUrl,"full-name":null===(o=this.user)||void 0===o?void 0:o.fullName,username:null===(e=this.user)||void 0===e?void 0:e.username})),n("calcite-dropdown-group",{"selection-mode":"none"},n("calcite-dropdown-item",{onClick:this.signOut.bind(this)},null===(r=this.messages)||void 0===r?void 0:r.signOut)))}renderSignInButton(){var i;const t="navigation"===this.type?"transparent":"brand";return n("calcite-button",{class:"navigation"===this.type?"instant-apps-sign-in__sign-in-btn":"",onClick:this.signIn.bind(this),scale:"s","icon-start":"sign-in",appearance:t},null===(i=this.messages)||void 0===i?void 0:i.signIn)}renderLandingPageSignIn(){var i,t;return n("div",{class:"instant-apps-sign-in__landing-page"},n("h1",null,this.titleText),n("h2",null,this.subtitleText),n("p",null,this.descriptionText),n("div",{class:"instant-apps-sign-in__landing-page-btns"},n("calcite-button",{onClick:this.landingPageSignIn.bind(this)},null===(i=this.messages)||void 0===i?void 0:i.signIn),n("calcite-button",{onClick:this.guestOnClick.bind(this),appearance:"outline"},null===(t=this.messages)||void 0===t?void 0:t.continueAsGuest)))}async initSignIn(){if(null==this.portal||null==this.oauthappid)return;const[i,n,t]=await s(["esri/identity/OAuthInfo","esri/identity/IdentityManager","esri/core/reactiveUtils"]);this.idManager=n,this.info=new i({appId:this.oauthappid,portalUrl:this.portal.url,flowType:"authorization-code",popup:this.openInPopup}),this.idManager.registerOAuthInfos([this.info]),this.isSignedIn=await this.checkSignInStatus(),this.ready=!0,this.watchCredential(),t.whenOnce((()=>this.portal.user)).then((()=>{this.user=this.portal.user,this.ready=!0}))}signIn(){this.landingPage&&this.setSignInLocalStorage(),this.idManager.getCredential(this.info.portalUrl+"/sharing",{oAuthPopupConfirmation:!1}).then((async()=>{await this.checkSignInStatus()}))}signOut(){this.idManager.destroyCredentials(),this.portal.authMode="anonymous",localStorage.removeItem("_AGO_SESSION_"),this.isSignedIn=!1,this.portal.credential=null}landingPageSignIn(){this.isSignedIn?null!=this.closeLandingPage&&this.closeLandingPage():(this.setSignInLocalStorage(),this.signIn())}guestOnClick(){this.signOut(),null!=this.closeLandingPage&&this.closeLandingPage()}checkSignInStatus(){return new Promise((i=>{this.idManager.checkSignInStatus(this.info.portalUrl+"/sharing").then((async n=>{this.portal.credential=n,i(!0)})).catch((()=>{this.portal.credential=null,i(!1)}))}))}watchCredential(){this.portal.addHandles(this.portal.watch("credential",(i=>{this.isSignedIn=null!=i})))}setSignInLocalStorage(){const i=new Date;localStorage.setItem("signing-in",i.getTime().toString()),setTimeout((()=>{localStorage.removeItem("signing-in")}),2e3)}get el(){return t(this)}static get watchers(){return{portal:["watchPortal"],oauthappid:["watchOauthappid"]}}};e.style=":host{display:block;box-shadow:none !important}:host .instant-apps-sign-in__container{height:inherit;display:flex;align-items:center}:host .instant-apps-sign-in__container calcite-dropdown,:host .instant-apps-sign-in__container calcite-navigation-user{height:100%}:host .instant-apps-sign-in__container .instant-apps-sign-in__sign-in-btn{margin:10px}:host .instant-apps-sign-in__container calcite-dropdown[scale=m] calcite-dropdown-group{min-width:140px}:host .instant-apps-sign-in__container calcite-dropdown[scale=s] calcite-dropdown-group{min-width:100px}:host .instant-apps-sign-in__container calcite-dropdown-item{--calcite-color-text-1:#d83020;--calcite-color-text-3:#d83020}:host .instant-apps-sign-in__container button{height:32px;width:32px;padding:0;box-sizing:border-box;display:flex;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;appearance:none;-moz-appearance:none;-webkit-appearance:none;-webkit-text-decoration-line:none;text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;border:none;border-radius:50%;background:#000}:host .instant-apps-sign-in__container button:hover calcite-avatar{opacity:0.7;transition:0.3s}:host .instant-apps-sign-in__landing-page{display:flex;flex-direction:column;justify-content:center;padding:40px;width:50%;min-height:30%;background:rgba(255, 255, 255, 0.8);color:#151515;text-align:center}:host .instant-apps-sign-in__landing-page h1{font-size:22px;margin:10px 0}:host .instant-apps-sign-in__landing-page h2{font-size:16px;margin:0 0 10px}:host .instant-apps-sign-in__landing-page p{font-size:16px;margin:0}:host .instant-apps-sign-in__landing-page-btns{display:flex;justify-content:space-between;margin-top:40px}:host .instant-apps-sign-in__landing-page-btns calcite-button{width:calc(50% - 5px);--calcite-color-brand:var(--instant-apps-landing-page-entry-button-color);--calcite-color-brand-hover:var(--instant-apps-landing-page-entry-button-color);--calcite-color-brand-press:var(--instant-apps-landing-page-entry-button-color)}:host .instant-apps-sign-in__landing-page-btns calcite-button:hover{filter:contrast(0.8)}@media screen and (max-width: 767px){:host .instant-apps-sign-in__landing-page-btns{flex-direction:column;width:100%;align-items:center;height:76px}:host .instant-apps-sign-in__landing-page-btns calcite-button{width:100%}}";export{e as instant_apps_sign_in}
@@ -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 e,f as t,h as n,g as i,c as a}from"./p-6d753a3d.js";import{l as s}from"./p-4ba6f8f0.js";import{g as r,i as l,q as c,r as o,t as p,m as d,w as v,x as g,k as h,v as m}from"./p-599dcc29.js";import"./p-82e085d0.js";import"./p-bdcf99c0.js";const u=class{constructor(t){e(this,t),this.showTotal=!1,this.legendvm=void 0,this.activeLayerInfo=void 0,this.categoryId=void 0,this.infoIndex=void 0,this.messages=void 0,this.selected=void 0,this.legendElement=void 0}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0});const[e]=await s(["esri/intl","esri/core/reactiveUtils","esri/core/Handles"]);this.intl=e}render(){var e;return n("div",{key:"int-legend-count"},this.showTotal?n("span",null,null===(e=this.messages)||void 0===e?void 0:e.totalFeatureCount,": ",this.getTotalFeatureCount()):n("span",{key:"element-info-count",class:` instant-apps-interactive-legend__info-count-text ${r(this.el)}${this.selected?" instant-apps-interactive-legend__info-count-text--selected":""}`},this.getCount()))}getCount(){var e,t;const{categoryId:n}=this,i=this.activeLayerInfo.layer.id,a=null===(t=null===(e=l.data[i])||void 0===e?void 0:e.categories)||void 0===t?void 0:t.size;if(!(l.data&&i&&n||a))return"";const s=l.data[i];if(!s)return;const{categories:r}=s,c=r.get(n);let o;return o=(null==c?void 0:c.nestedInfos)?g(c,this.infoIndex):c,isNaN(null==o?void 0:o.count)?"":this.intl.formatNumber(o.count)}getTotalFeatureCount(){const e=this.activeLayerInfo.layer.id;if(!l.data||!e)return"";const t=l.data[e];if(!t)return;const{categories:n}=t,i=c(n);let a;if(o(n))a=p(i);else if(d(this.activeLayerInfo)){const e=h(this.activeLayerInfo.layer);a=c(e.categories)[1].count}else a=v(i);return this.intl.formatNumber(a)}get el(){return i(this)}};u.style=".sc-instant-apps-interactive-legend-count-h{display:flex;align-items:center}.instant-apps-interactive-legend__info-count-text.sc-instant-apps-interactive-legend-count{font-size:var(--instant-apps-interactive-legend-info-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.calcite-mode-dark.instant-apps-interactive-legend__info-count-text.instant-apps-interactive-legend__info-count-text--selected.sc-instant-apps-interactive-legend-count{color:var(--calcite-color-text-inverse)}html[dir=rtl] .sc-instant-apps-interactive-legend-count-h{margin-left:0;margin-right:auto}";const y=class{constructor(t){e(this,t),this.layerCaptionElementExpandUpdatedEvent=a(this,"layerCaptionElementExpandUpdated",7),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}render(){var e,t,i;const a=m(this.activeLayerInfo),{expanded:s}=this,l=s?null===(e=this.messages)||void 0===e?void 0:e.collapse:null===(t=this.messages)||void 0===t?void 0:t.expand,c=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return n("header",{class:`instant-apps-interactive-legend__header ${r(this.el)}`},n("calcite-action",{onClick:this.toggleExpanded(),icon:s?"chevron-down":"chevron-up",appearance:"transparent",text:l,label:l,scale:"s"}),n("span",null,n("span",{class:"instant-apps-interactive-legend__header-action-container"},n("h3",{class:`esri-widget__heading esri-legend__service-label${c}`},null===(i=this.activeLayerInfo)||void 0===i?void 0:i.title)),this.featureCount&&a?n("instant-apps-interactive-legend-count",{activeLayerInfo:this.activeLayerInfo,"show-total":!0,messages:this.messages,legendvm:this.legendvm}):null))}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.layerCaptionElementExpandUpdatedEvent.emit(this.expanded)}}get el(){return i(this)}};y.style=".sc-instant-apps-interactive-legend-layer-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption{overflow:hidden;margin:0;overflow-x:hidden;display:inline-block;font-size:var(--instant-apps-interactive-legend-heading-font-size);font-weight:var(--instant-apps-interactive-legend-heading-font-weight)}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption header.sc-instant-apps-interactive-legend-layer-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption{display:flex;text-align:left;padding:var(--instant-apps-interactive-legend-ui-padding);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption h3.sc-instant-apps-interactive-legend-layer-element-caption{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal;color:var(--instant-apps-interactive-legend-secondary-color);margin-bottom:5px}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption .instant-apps-interactive-legend__heading-text--group-item.sc-instant-apps-interactive-legend-layer-element-caption{-webkit-line-clamp:2;line-clamp:2}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption span.sc-instant-apps-interactive-legend-layer-element-caption{width:100%;font-size:var(--instant-apps-interactive-legend-total-feature-count-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption .instant-apps-interactive-legend__header-action-container.sc-instant-apps-interactive-legend-layer-element-caption{display:flex;align-items:center}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption header.sc-instant-apps-interactive-legend-layer-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget--panel.sc-instant-apps-interactive-legend-layer-element-caption{margin:0}.calcite-mode-dark.sc-instant-apps-interactive-legend-layer-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-layer-element-caption{background-color:#242424;color:var(--calcite-color-text-1)}.calcite-mode-light.sc-instant-apps-interactive-legend-layer-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-layer-element-caption{background-color:#ffffff;color:var(--calcite-color-text-1)}";export{u as instant_apps_interactive_legend_count,y as instant_apps_interactive_legend_layer_element_caption}
6
+ import{r as e,f as t,h as n,g as i,c as a}from"./p-6d753a3d.js";import{l as s}from"./p-4ba6f8f0.js";import{g as r,i as l,q as c,r as o,t as p,m as d,w as v,x as g,k as h,v as m}from"./p-614ebce7.js";import"./p-82e085d0.js";import"./p-bdcf99c0.js";const u=class{constructor(t){e(this,t),this.showTotal=!1,this.legendvm=void 0,this.activeLayerInfo=void 0,this.categoryId=void 0,this.infoIndex=void 0,this.messages=void 0,this.selected=void 0,this.legendElement=void 0}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0});const[e]=await s(["esri/intl","esri/core/reactiveUtils","esri/core/Handles"]);this.intl=e}render(){var e;return n("div",{key:"int-legend-count"},this.showTotal?n("span",null,null===(e=this.messages)||void 0===e?void 0:e.totalFeatureCount,": ",this.getTotalFeatureCount()):n("span",{key:"element-info-count",class:` instant-apps-interactive-legend__info-count-text ${r(this.el)}${this.selected?" instant-apps-interactive-legend__info-count-text--selected":""}`},this.getCount()))}getCount(){var e,t;const{categoryId:n}=this,i=this.activeLayerInfo.layer.id,a=null===(t=null===(e=l.data[i])||void 0===e?void 0:e.categories)||void 0===t?void 0:t.size;if(!(l.data&&i&&n||a))return"";const s=l.data[i];if(!s)return;const{categories:r}=s,c=r.get(n);let o;return o=(null==c?void 0:c.nestedInfos)?g(c,this.infoIndex):c,isNaN(null==o?void 0:o.count)?"":this.intl.formatNumber(o.count)}getTotalFeatureCount(){const e=this.activeLayerInfo.layer.id;if(!l.data||!e)return"";const t=l.data[e];if(!t)return;const{categories:n}=t,i=c(n);let a;if(o(n))a=p(i);else if(d(this.activeLayerInfo)){const e=h(this.activeLayerInfo.layer);a=c(e.categories)[1].count}else a=v(i);return this.intl.formatNumber(a)}get el(){return i(this)}};u.style=".sc-instant-apps-interactive-legend-count-h{display:flex;align-items:center}.instant-apps-interactive-legend__info-count-text.sc-instant-apps-interactive-legend-count{font-size:var(--instant-apps-interactive-legend-info-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.calcite-mode-dark.instant-apps-interactive-legend__info-count-text.instant-apps-interactive-legend__info-count-text--selected.sc-instant-apps-interactive-legend-count{color:var(--calcite-color-text-inverse)}html[dir=rtl] .sc-instant-apps-interactive-legend-count-h{margin-left:0;margin-right:auto}";const y=class{constructor(t){e(this,t),this.layerCaptionElementExpandUpdatedEvent=a(this,"layerCaptionElementExpandUpdated",7),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}render(){var e,t,i;const a=m(this.activeLayerInfo),{expanded:s}=this,l=s?null===(e=this.messages)||void 0===e?void 0:e.collapse:null===(t=this.messages)||void 0===t?void 0:t.expand,c=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return n("header",{class:`instant-apps-interactive-legend__header ${r(this.el)}`},n("calcite-action",{onClick:this.toggleExpanded(),icon:s?"chevron-down":"chevron-up",appearance:"transparent",text:l,label:l,scale:"s"}),n("span",null,n("span",{class:"instant-apps-interactive-legend__header-action-container"},n("h3",{class:`esri-widget__heading esri-legend__service-label${c}`},null===(i=this.activeLayerInfo)||void 0===i?void 0:i.title)),this.featureCount&&a?n("instant-apps-interactive-legend-count",{activeLayerInfo:this.activeLayerInfo,"show-total":!0,messages:this.messages,legendvm:this.legendvm}):null))}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.layerCaptionElementExpandUpdatedEvent.emit(this.expanded)}}get el(){return i(this)}};y.style=".sc-instant-apps-interactive-legend-layer-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption{overflow:hidden;margin:0;overflow-x:hidden;display:inline-block;font-size:var(--instant-apps-interactive-legend-heading-font-size);font-weight:var(--instant-apps-interactive-legend-heading-font-weight)}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption header.sc-instant-apps-interactive-legend-layer-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption{display:flex;text-align:left;padding:var(--instant-apps-interactive-legend-ui-padding);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption h3.sc-instant-apps-interactive-legend-layer-element-caption{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal;color:var(--instant-apps-interactive-legend-secondary-color);margin-bottom:5px}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption .instant-apps-interactive-legend__heading-text--group-item.sc-instant-apps-interactive-legend-layer-element-caption{-webkit-line-clamp:2;line-clamp:2}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption span.sc-instant-apps-interactive-legend-layer-element-caption{width:100%;font-size:var(--instant-apps-interactive-legend-total-feature-count-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-layer-element-caption-h header.sc-instant-apps-interactive-legend-layer-element-caption .instant-apps-interactive-legend__header-action-container.sc-instant-apps-interactive-legend-layer-element-caption{display:flex;align-items:center}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget__heading.sc-instant-apps-interactive-legend-layer-element-caption header.sc-instant-apps-interactive-legend-layer-element-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-layer-element-caption-h .esri-widget--panel.sc-instant-apps-interactive-legend-layer-element-caption{margin:0}.calcite-mode-dark.sc-instant-apps-interactive-legend-layer-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-layer-element-caption{background-color:#242424;color:var(--calcite-color-text-1)}.calcite-mode-light.sc-instant-apps-interactive-legend-layer-element-caption-h .instant-apps-interactive-legend__header.sc-instant-apps-interactive-legend-layer-element-caption{background-color:#ffffff;color:var(--calcite-color-text-1)}";export{u as instant_apps_interactive_legend_count,y as instant_apps_interactive_legend_layer_element_caption}
@@ -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,h as s,g as e}from"./p-6d753a3d.js";import{l as a,g as h}from"./p-896c9644.js";import{P as n}from"./p-a1037b19.js";import{g as o,c,h as l}from"./p-583e5dd0.js";import"./p-82e085d0.js";import"./p-6f69de4d.js";import"./p-334e6394.js";import"./p-a230b270.js";import"./p-530b73ce.js";import"./p-c1cf3ebc.js";const r=class{constructor(s){t(this,s),this.featureSelect=i(this,"featureSelect",7),this.selectedLayerId=void 0,this.mapView=void 0,this.noFeaturesFoundMsg=void 0,this.pageSize=100,this.highlightOnMap=!1,this.highlightOnHover=!1,this.sortingInfo=void 0,this.whereClause=void 0,this.textSize="large",this.showInitialLoading=!0,this.showErrorWhenNoFeatures=!0,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._translations=void 0}async selectedLayerWatchHandler(){this._selectedLayer=await o(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async sortingInfoWatchHandler(){await this.initializeFeatureItems()}async whereClauseHandler(){await this.initializeFeatureItems()}async refresh(){await this.initializeFeatureItems()}async componentWillLoad(){await this.initModules(),await this._getTranslations(),this._isLoading=this.showInitialLoading,this._popupUtils=new n,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await o(this.mapView,this.selectedLayerId))}async componentDidLoad(){await this.initializeFeatureItems()}render(){return s("calcite-panel",{key:"6184d07592669fd8884996475b7eeb26e0604790","full-height":!0,"full-width":!0},this._isLoading&&s("calcite-loader",{key:"282127215213a28b9cfdf484aaf5730145b6bb55",label:"",scale:"m"}),this.showErrorWhenNoFeatures&&0===this._featureItems.length&&!this._isLoading&&s("calcite-notice",{key:"25fcfeb1d19a089b092050515c3d69401bc17dc8",class:"error-msg",icon:"feature-details",kind:"info",open:!0},s("div",{key:"2ac81a338df9d0e0f43c659a24be0c9b7b95d027",slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),s("calcite-list",{key:"70453e8ded4f859076a5f00d8f04152cd78278d8","selection-appearance":"border","selection-mode":"none"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&s("div",{key:"db1003ace54cd599acefad04e94fe54248327126",class:"width-full",slot:"footer"},s("calcite-pagination",{key:"67764a051381b0e7ef26dbd16dc9226d7e152c20",class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,ref:t=>this._pagination=t,"start-item":"1","total-items":this._featuresCount})))}async initModules(){const[t]=await a(["esri/Color"]);this.Color=t}getWhereCondition(){var t;let i="1=1";return this.whereClause&&(i=this.whereClause),(null===(t=this._selectedLayer)||void 0===t?void 0:t.definitionExpression)&&(i=i+" AND "+this._selectedLayer.definitionExpression),i}async initializeFeatureItems(){var t;if(this._selectedLayer){null===(t=this._pagination)||void 0===t||t.goTo("start"),this._isLoading=this.showInitialLoading,this._featureItems=await this.queryPage(0);const i={where:this.getWhereCondition()};this._featuresCount=await this._selectedLayer.queryFeatureCount(i),this._isLoading=!1}}async pageChanged(t){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null);const i=t.target.startItem-1;this._featureItems=await this.queryPage(i),this._isLoading=!1}async featureClicked(t,i){if(this.clearHighlights(),this.highlightOnMap){const i=Number(t.target.value),s=await c(this.mapView,this.selectedLayerId);this._highlightHandle=await l([i],s,this.mapView,!0)}await this.emitSelectedFeature(i)}async emitSelectedFeature(t){const i=t.layer,s=i.createQuery();s.returnGeometry=!0,s.objectIds=[t.getObjectId()];const e=await i.queryFeatures(s);this.featureSelect.emit(e.features[0])}async onFeatureHover(t){if(this.clearHighlights(),this.highlightOnHover){const i=t.getObjectId(),s=await c(this.mapView,this.selectedLayerId);s.highlightOptions={color:new this.Color("#FFFF00")},this._highlightHandle=s.highlight([i])}}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}async queryPage(t){var i,s;const e=this._selectedLayer,a=(null===(i=this.sortingInfo)||void 0===i?void 0:i.field)?this.sortingInfo.field:e.objectIdField,h=(null===(s=this.sortingInfo)||void 0===s?void 0:s.order)?this.sortingInfo.order:"desc",n={start:t,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:this.getWhereCondition(),outSpatialReference:this.mapView.spatialReference.toJSON()};a&&h&&(n.orderByFields=[a.toString()+" "+h]);const o=await e.queryFeatures(n);return await this.createFeatureItem(o)}async createFeatureItem(t){const i=(null==t?void 0:t.features).map((async t=>{const i=await this._popupUtils.getPopupTitle(t,this.mapView.map);return this.getFeatureItem(t,i)}));return Promise.all(i)}getFeatureItem(t,i){const e=t.attributes[this._selectedLayer.objectIdField].toString();return s("calcite-list-item",{onCalciteListItemSelect:i=>{this.featureClicked(i,t)},onMouseLeave:()=>{this.clearHighlights()},onMouseOver:()=>{this.onFeatureHover(t)},value:e},s("div",{class:"small"===this.textSize?"feature-list-popup-title-small":"feature-list-popup-title",slot:"content-start"},i=null!=i?i:e),s("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{selectedLayerId:["selectedLayerWatchHandler"],sortingInfo:["sortingInfoWatchHandler"],whereClause:["whereClauseHandler"]}}};r.style=":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;padding:10px 12px}.feature-list-popup-title-small{font-size:small;padding:10px 12px}";export{r as feature_list}