@esri/solutions-components 0.8.39 → 0.8.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) hide show
  1. package/dist/assets/t9n/solution-spatial-ref/resources.json +3 -3
  2. package/dist/assets/t9n/solution-spatial-ref/resources_en.json +2 -2
  3. package/dist/assets/t9n/solution-spatial-ref/resources_fr.json +2 -2
  4. package/dist/assets/t9n/solution-spatial-ref/resources_he.json +2 -2
  5. package/dist/cjs/_commonjsHelpers-baf43783.js +20 -0
  6. package/dist/cjs/basemap-gallery_7.cjs.entry.js +3 -2
  7. package/dist/cjs/buffer-tools_3.cjs.entry.js +3 -2
  8. package/dist/cjs/calcite-action-pad_2.cjs.entry.js +3 -2
  9. package/dist/cjs/calcite-alert_4.cjs.entry.js +7 -6
  10. package/dist/cjs/calcite-block_5.cjs.entry.js +5 -4
  11. package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
  12. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +3 -2
  13. package/dist/cjs/calcite-flow_6.cjs.entry.js +3 -2
  14. package/dist/cjs/calcite-pagination.cjs.entry.js +1 -1
  15. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +9 -8
  16. package/dist/cjs/card-manager_3.cjs.entry.js +6 -5
  17. package/dist/cjs/{common-03600219.js → common-7ee7ad73.js} +1 -1
  18. package/dist/cjs/consent-manager.cjs.entry.js +3 -2
  19. package/dist/cjs/{core-b459e4f2.js → core-7f0bcc12.js} +1 -1
  20. package/dist/cjs/crowdsource-manager.cjs.entry.js +3 -2
  21. package/dist/cjs/crowdsource-reporter.cjs.entry.js +3 -2
  22. package/dist/cjs/{downloadUtils-839a1425.js → downloadUtils-2e169425.js} +7 -7
  23. package/dist/cjs/{esri-loader-fce6a9cb.js → esri-loader-a56cbcbe.js} +2 -13
  24. package/dist/cjs/feature-list.cjs.entry.js +7 -6
  25. package/dist/cjs/{helpers-7cee3150.js → helpers-95c28cf3.js} +1 -1
  26. package/dist/cjs/{html2canvas-ef5cae40.js → html2canvas-29c6b9cc.js} +2 -2
  27. package/dist/cjs/{index.es-dd4d4842.js → index.es-301b8d18.js} +11 -10
  28. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +6 -5
  29. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +3 -2
  30. package/dist/cjs/instant-apps-create.cjs.entry.js +5 -4
  31. package/dist/cjs/instant-apps-export.cjs.entry.js +5 -4
  32. package/dist/cjs/instant-apps-header.cjs.entry.js +3 -2
  33. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +5 -4
  34. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +4 -3
  35. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +4 -3
  36. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +4 -3
  37. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +6 -5
  38. package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +5 -4
  39. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +7 -6
  40. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +7 -6
  41. package/dist/cjs/instant-apps-measurement.cjs.entry.js +5 -4
  42. package/dist/cjs/instant-apps-popover.cjs.entry.js +5 -4
  43. package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +5 -4
  44. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +5 -4
  45. package/dist/cjs/instant-apps-splash.cjs.entry.js +5 -4
  46. package/dist/cjs/{languageSwitcher-1154d55d.js → languageSwitcher-f0bb94fa.js} +1 -1
  47. package/dist/cjs/{languageUtil-d23251cd.js → languageUtil-f22ce913.js} +1 -1
  48. package/dist/cjs/layout-manager.cjs.entry.js +3 -2
  49. package/dist/cjs/{loadModules-4189814e.js → loadModules-36d49819.js} +1 -1
  50. package/dist/cjs/loader.cjs.js +1 -1
  51. package/dist/cjs/{locale-62f4cef2.js → locale-708985a1.js} +2 -2
  52. package/dist/cjs/{locale-6973733d.js → locale-f6fd03d2.js} +1 -1
  53. package/dist/cjs/map-select-tools_3.cjs.entry.js +6 -5
  54. package/dist/cjs/{popupUtils-bae7f923.js → popupUtils-36e57a27.js} +2 -2
  55. package/dist/cjs/public-notification.cjs.entry.js +6 -5
  56. package/dist/cjs/{purify-4a0e9dfb.js → purify-17c0fc4a.js} +2 -2
  57. package/dist/cjs/{restHelpersGet-afc74285.js → restHelpersGet-be451f4a.js} +1 -1
  58. package/dist/cjs/solution-configuration.cjs.entry.js +10 -350
  59. package/dist/cjs/solution-contents_3.cjs.entry.js +58 -48
  60. package/dist/cjs/solution-resource-a09a6fe0.js +145 -0
  61. package/dist/cjs/{solution-store-c8bada29.js → solution-store-d9f3ea44.js} +8 -10
  62. package/dist/cjs/solutions-components.cjs.js +1 -1
  63. package/dist/cjs/spatial-ref.cjs.entry.js +6 -5
  64. package/dist/cjs/store-manager.cjs.entry.js +17 -13
  65. package/dist/cjs/templates-f7a3bf48.js +401 -0
  66. package/dist/cjs/{utils-1de4eaa0.js → utils-31a22d49.js} +1 -1
  67. package/dist/collection/components/solution-item/solution-item.js +1 -1
  68. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.css +11 -1
  69. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +83 -47
  70. package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +25 -24
  71. package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
  72. package/dist/collection/components/solution-variables/solution-variables.js +1 -1
  73. package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
  74. package/dist/collection/components/store-manager/store-manager.js +11 -13
  75. package/dist/collection/demos/data/election-outreach.json +2981 -0
  76. package/dist/collection/demos/solution-item.html +7 -6
  77. package/dist/collection/demos/solution-spatial-ref.html +10 -4
  78. package/dist/collection/demos/solution-template-data.html +5 -5
  79. package/dist/collection/utils/interfaces.ts +0 -2
  80. package/dist/collection/utils/solution-store.js +6 -8
  81. package/dist/collection/utils/solution-store.ts +12 -13
  82. package/dist/collection/utils/templates.js +113 -26
  83. package/dist/collection/utils/templates.ts +125 -30
  84. package/dist/collection/utils/test/templates.e2e.js +2 -2
  85. package/dist/collection/utils/test/templates.e2e.ts +2 -2
  86. package/dist/components/_commonjsHelpers.js +16 -0
  87. package/dist/components/core.js +1 -1
  88. package/dist/components/downloadUtils.js +1 -1
  89. package/dist/components/esri-loader.js +2 -10
  90. package/dist/components/html2canvas.js +1 -1
  91. package/dist/components/index.es.js +1 -1
  92. package/dist/components/instant-apps-interactive-legend-classic2.js +1 -1
  93. package/dist/components/pagination.js +1 -1
  94. package/dist/components/purify.js +1 -1
  95. package/dist/components/solution-configuration.js +1 -342
  96. package/dist/components/solution-item2.js +1 -1
  97. package/dist/components/solution-resource.js +1 -1
  98. package/dist/components/solution-spatial-ref2.js +52 -44
  99. package/dist/components/solution-store.js +6 -8
  100. package/dist/components/solution-template-data2.js +1 -1
  101. package/dist/components/solution-variables2.js +1 -1
  102. package/dist/components/spatial-ref2.js +1 -1
  103. package/dist/components/store-manager.js +11 -13
  104. package/dist/components/templates.js +395 -0
  105. package/dist/esm/_commonjsHelpers-089957fe.js +16 -0
  106. package/dist/esm/basemap-gallery_7.entry.js +3 -2
  107. package/dist/esm/buffer-tools_3.entry.js +3 -2
  108. package/dist/esm/calcite-action-pad_2.entry.js +3 -2
  109. package/dist/esm/calcite-alert_4.entry.js +7 -6
  110. package/dist/esm/calcite-block_5.entry.js +5 -4
  111. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  112. package/dist/esm/calcite-dropdown-group_2.entry.js +3 -2
  113. package/dist/esm/calcite-flow_6.entry.js +3 -2
  114. package/dist/esm/calcite-pagination.entry.js +1 -1
  115. package/dist/esm/calcite-shell-panel_14.entry.js +9 -8
  116. package/dist/esm/card-manager_3.entry.js +6 -5
  117. package/dist/esm/{common-8697fccd.js → common-96e3ddb0.js} +1 -1
  118. package/dist/esm/consent-manager.entry.js +3 -2
  119. package/dist/esm/{core-4bd4a70f.js → core-6a3c13ac.js} +1 -1
  120. package/dist/esm/crowdsource-manager.entry.js +3 -2
  121. package/dist/esm/crowdsource-reporter.entry.js +3 -2
  122. package/dist/esm/{downloadUtils-97acca92.js → downloadUtils-5fbd8a40.js} +6 -6
  123. package/dist/esm/{esri-loader-3080dcc0.js → esri-loader-781d738a.js} +2 -10
  124. package/dist/esm/feature-list.entry.js +7 -6
  125. package/dist/esm/{helpers-7c88b974.js → helpers-3d53560f.js} +1 -1
  126. package/dist/esm/{html2canvas-fd387d87.js → html2canvas-6443b68e.js} +1 -1
  127. package/dist/esm/{index.es-ee5497bc.js → index.es-66571353.js} +6 -5
  128. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +6 -5
  129. package/dist/esm/instant-apps-control-panel.entry.js +3 -2
  130. package/dist/esm/instant-apps-create.entry.js +5 -4
  131. package/dist/esm/instant-apps-export.entry.js +5 -4
  132. package/dist/esm/instant-apps-header.entry.js +3 -2
  133. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +4 -3
  134. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +4 -3
  135. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +4 -3
  136. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +4 -3
  137. package/dist/esm/instant-apps-interactive-legend.entry.js +6 -5
  138. package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +5 -4
  139. package/dist/esm/instant-apps-language-switcher.entry.js +7 -6
  140. package/dist/esm/instant-apps-language-translator.entry.js +7 -6
  141. package/dist/esm/instant-apps-measurement.entry.js +5 -4
  142. package/dist/esm/instant-apps-popover.entry.js +5 -4
  143. package/dist/esm/instant-apps-scoreboard.entry.js +5 -4
  144. package/dist/esm/instant-apps-sign-in.entry.js +5 -4
  145. package/dist/esm/instant-apps-splash.entry.js +5 -4
  146. package/dist/esm/{languageSwitcher-0f693a04.js → languageSwitcher-b665499d.js} +1 -1
  147. package/dist/esm/{languageUtil-de206286.js → languageUtil-a3e6adf6.js} +1 -1
  148. package/dist/esm/layout-manager.entry.js +3 -2
  149. package/dist/esm/{loadModules-43119ac8.js → loadModules-9c062d08.js} +1 -1
  150. package/dist/esm/loader.js +1 -1
  151. package/dist/esm/{locale-42369411.js → locale-28d48640.js} +1 -1
  152. package/dist/esm/{locale-70630b7c.js → locale-b4e7d56f.js} +2 -2
  153. package/dist/esm/map-select-tools_3.entry.js +6 -5
  154. package/dist/esm/{popupUtils-98ad70f3.js → popupUtils-4a91aa2a.js} +2 -2
  155. package/dist/esm/public-notification.entry.js +6 -5
  156. package/dist/esm/{purify-caded4cd.js → purify-72515357.js} +1 -1
  157. package/dist/esm/{restHelpersGet-dab84057.js → restHelpersGet-5c822bcd.js} +1 -1
  158. package/dist/esm/solution-configuration.entry.js +7 -347
  159. package/dist/esm/solution-contents_3.entry.js +58 -48
  160. package/dist/esm/{solution-resource-a2fff3bf.js → solution-resource-3108caf7.js} +1 -1
  161. package/dist/esm/{solution-store-30a19a45.js → solution-store-1c36ce1d.js} +8 -10
  162. package/dist/esm/solutions-components.js +1 -1
  163. package/dist/esm/spatial-ref.entry.js +6 -5
  164. package/dist/esm/store-manager.entry.js +17 -13
  165. package/dist/esm/templates-824ea028.js +395 -0
  166. package/dist/esm/{utils-9bb48951.js → utils-5484fcbf.js} +1 -1
  167. package/dist/solutions-components/demos/data/election-outreach.json +2981 -0
  168. package/dist/solutions-components/demos/solution-item.html +7 -6
  169. package/dist/solutions-components/demos/solution-spatial-ref.html +10 -4
  170. package/dist/solutions-components/demos/solution-template-data.html +5 -5
  171. package/dist/solutions-components/{p-3eb49703.js → p-00291b93.js} +3 -3
  172. package/dist/solutions-components/p-0cd87dca.entry.js +6 -0
  173. package/dist/solutions-components/p-13404ad7.entry.js +6 -0
  174. package/dist/solutions-components/{p-bf27cd5f.js → p-1c3c83a5.js} +1 -1
  175. package/dist/solutions-components/p-1e6c6ec4.entry.js +6 -0
  176. package/dist/solutions-components/p-219f209e.entry.js +6 -0
  177. package/dist/solutions-components/{p-b1abf15c.entry.js → p-2467b476.entry.js} +3 -3
  178. package/dist/solutions-components/p-295f850a.entry.js +6 -0
  179. package/dist/solutions-components/p-2961c63c.entry.js +6 -0
  180. package/dist/solutions-components/{p-946ee345.js → p-2afdcdfc.js} +2 -2
  181. package/dist/solutions-components/p-2d6d44b5.entry.js +6 -0
  182. package/dist/solutions-components/p-36e199e0.entry.js +6 -0
  183. package/dist/solutions-components/{p-d27ab863.js → p-3d7cff5e.js} +1 -1
  184. package/dist/solutions-components/{p-b2f11718.entry.js → p-3e8562b5.entry.js} +1 -1
  185. package/dist/solutions-components/{p-49250010.js → p-427b4593.js} +1 -1
  186. package/dist/solutions-components/{p-f1ae51dc.js → p-44fea43a.js} +1 -1
  187. package/dist/solutions-components/{p-afd2b67b.entry.js → p-4b27da06.entry.js} +1 -1
  188. package/dist/solutions-components/{p-7fe77355.js → p-5cc6eb18.js} +1 -1
  189. package/dist/solutions-components/p-61f88049.entry.js +6 -0
  190. package/dist/solutions-components/{p-d029b513.js → p-65581d83.js} +1 -1
  191. package/dist/solutions-components/p-6a68306c.js +6 -0
  192. package/dist/solutions-components/p-6c7a990a.entry.js +6 -0
  193. package/dist/solutions-components/p-6e6e6d23.entry.js +6 -0
  194. package/dist/solutions-components/p-7696af8e.entry.js +6 -0
  195. package/dist/solutions-components/{p-7afca6b4.js → p-7d1af07b.js} +1 -1
  196. package/dist/solutions-components/{p-6c7e34c1.entry.js → p-881ead62.entry.js} +2 -2
  197. package/dist/solutions-components/p-90864588.entry.js +6 -0
  198. package/dist/solutions-components/{p-59f016a1.js → p-91142a26.js} +1 -1
  199. package/dist/solutions-components/p-932d6f29.entry.js +6 -0
  200. package/dist/solutions-components/{p-71c212e6.entry.js → p-969828ab.entry.js} +1 -1
  201. package/dist/solutions-components/p-986ee365.entry.js +6 -0
  202. package/dist/solutions-components/p-9e3b0220.entry.js +6 -0
  203. package/dist/solutions-components/{p-7996f123.js → p-a0300d31.js} +1 -1
  204. package/dist/solutions-components/p-a8d62b7d.entry.js +6 -0
  205. package/dist/solutions-components/p-ae50581b.entry.js +6 -0
  206. package/dist/solutions-components/{p-89f6ff72.js → p-af2c8aa9.js} +1 -1
  207. package/dist/solutions-components/p-b7123452.entry.js +6 -0
  208. package/dist/solutions-components/p-b92e9047.entry.js +6 -0
  209. package/dist/solutions-components/p-bb7463ed.entry.js +6 -0
  210. package/dist/solutions-components/p-bbc7dd5e.entry.js +6 -0
  211. package/dist/solutions-components/p-bd871071.entry.js +21 -0
  212. package/dist/solutions-components/p-c6fd40f9.entry.js +6 -0
  213. package/dist/solutions-components/{p-42ea2581.js → p-c742acd9.js} +1 -1
  214. package/dist/solutions-components/p-cb4842dd.entry.js +6 -0
  215. package/dist/solutions-components/{p-bd459df3.entry.js → p-ccd1e256.entry.js} +2 -2
  216. package/dist/solutions-components/p-ce4b6931.entry.js +6 -0
  217. package/dist/solutions-components/p-d2de2b2a.entry.js +6 -0
  218. package/dist/solutions-components/p-d300430b.entry.js +6 -0
  219. package/dist/solutions-components/p-d4056c1c.js +6 -0
  220. package/dist/solutions-components/p-d73b90ab.entry.js +6 -0
  221. package/dist/solutions-components/{p-4e92c1ba.entry.js → p-dae9d5b3.entry.js} +1 -1
  222. package/dist/solutions-components/p-df56c019.entry.js +6 -0
  223. package/dist/solutions-components/p-e80751f4.entry.js +6 -0
  224. package/dist/solutions-components/{p-132b1138.entry.js → p-e8ed3fa6.entry.js} +2 -2
  225. package/dist/solutions-components/{p-1d369231.js → p-eed41e1a.js} +1 -1
  226. package/dist/solutions-components/p-fdd93685.js +22 -0
  227. package/dist/solutions-components/{p-6acf6c8f.js → p-ff87b9de.js} +1 -1
  228. package/dist/solutions-components/{p-c9b22653.js → p-ffd41e25.js} +1 -1
  229. package/dist/solutions-components/solutions-components.esm.js +1 -1
  230. package/dist/solutions-components/utils/interfaces.ts +0 -2
  231. package/dist/solutions-components/utils/solution-store.ts +12 -13
  232. package/dist/solutions-components/utils/templates.ts +125 -30
  233. package/dist/solutions-components/utils/test/templates.e2e.ts +2 -2
  234. package/dist/solutions-components_commit.txt +8 -0
  235. package/dist/types/components/solution-spatial-ref/solution-spatial-ref.d.ts +21 -25
  236. package/dist/types/components/store-manager/store-manager.d.ts +3 -3
  237. package/dist/types/components.d.ts +10 -2
  238. package/dist/types/utils/templates.d.ts +35 -5
  239. package/package.json +5 -4
  240. package/dist/cjs/solution-resource-ffe3c333.js +0 -145
  241. package/dist/solutions-components/p-11b4cd1a.entry.js +0 -6
  242. package/dist/solutions-components/p-123fcb43.entry.js +0 -6
  243. package/dist/solutions-components/p-12b84e3b.entry.js +0 -36
  244. package/dist/solutions-components/p-1a8f7075.entry.js +0 -6
  245. package/dist/solutions-components/p-2a7111ad.entry.js +0 -6
  246. package/dist/solutions-components/p-36f5dee9.entry.js +0 -6
  247. package/dist/solutions-components/p-52bcd209.entry.js +0 -6
  248. package/dist/solutions-components/p-57961ae0.entry.js +0 -6
  249. package/dist/solutions-components/p-5b2d9899.entry.js +0 -6
  250. package/dist/solutions-components/p-5bd6a732.entry.js +0 -6
  251. package/dist/solutions-components/p-5fb4ddc2.entry.js +0 -6
  252. package/dist/solutions-components/p-622f33ee.entry.js +0 -6
  253. package/dist/solutions-components/p-652140aa.entry.js +0 -6
  254. package/dist/solutions-components/p-6d0404a6.entry.js +0 -6
  255. package/dist/solutions-components/p-789eb1c2.entry.js +0 -6
  256. package/dist/solutions-components/p-7a2f1801.entry.js +0 -6
  257. package/dist/solutions-components/p-7dcf6b16.entry.js +0 -6
  258. package/dist/solutions-components/p-8413a2ae.entry.js +0 -6
  259. package/dist/solutions-components/p-941e55f0.entry.js +0 -6
  260. package/dist/solutions-components/p-9b38e6a0.entry.js +0 -6
  261. package/dist/solutions-components/p-9c1fbf73.entry.js +0 -6
  262. package/dist/solutions-components/p-9d82f0e3.entry.js +0 -6
  263. package/dist/solutions-components/p-9fa1855f.entry.js +0 -6
  264. package/dist/solutions-components/p-a2390bee.entry.js +0 -6
  265. package/dist/solutions-components/p-a805c11f.entry.js +0 -6
  266. package/dist/solutions-components/p-af1c9389.entry.js +0 -6
  267. package/dist/solutions-components/p-b7d060b0.entry.js +0 -6
  268. package/dist/solutions-components/p-c4160bf7.js +0 -6
  269. package/dist/solutions-components/p-da75df88.entry.js +0 -6
  270. package/dist/solutions-components/p-e0277e0b.entry.js +0 -6
  271. package/dist/solutions-components/p-e11a4728.entry.js +0 -6
  272. package/dist/solutions-components/p-e89c05d6.entry.js +0 -6
  273. /package/dist/solutions-components/{p-8ad54f5c.js → p-e3196917.js} +0 -0
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as i,h as e,H as s,g as a,a as n}from"./p-fa1ceaf9.js";import{c as o,d as l}from"./p-27c68097.js";import{f as r,g as c,t as h}from"./p-67b26725.js";import{c as d,d as p,u,I as v}from"./p-9c6c056a.js";import{c as m,d as f,g,n as b,a as x,b as y}from"./p-813d004f.js";import{u as w,c as _,d as k,s as $}from"./p-44bfa87d.js";import{H as C}from"./p-cc388a08.js";import{c as D,s as z,a as E}from"./p-8ed6ce4d.js";import{o as I}from"./p-ba569f8b.js";import{d as L,g as P,a as S,b as A,s as F,c as R,e as O,f as j,i as M}from"./p-df0a1d4b.js";import{f as N,c as T,d as B,r as W,a as H,F as U}from"./p-5eb6219c.js";import{s as V,c as q,d as J,H as K}from"./p-716a0878.js";import{n as Z}from"./p-f50a294b.js";import{c as Y,d as G}from"./p-6127f49e.js";import{c as X,d as Q,a as tt}from"./p-97f0e1b6.js";import{g as it}from"./p-b85be429.js";import{g as et}from"./p-e6e50975.js";import{V as st}from"./p-5f1fdaf9.js";import{l as at}from"./p-d029b513.js";import{g as nt}from"./p-49250010.js";import{g as ot}from"./p-a9a72626.js";import"./p-e6c9e6af.js";import"./p-db50226e.js";import"./p-b64cc55e.js";import"./p-c8d3207e.js";import"./p-c4160bf7.js";import"./p-89f6ff72.js";
6
+ import{r as t,c as i,h as e,H as s,g as a,a as n}from"./p-fa1ceaf9.js";import{c as o,d as l}from"./p-27c68097.js";import{f as r,g as c,t as h}from"./p-67b26725.js";import{c as d,d as p,u,I as v}from"./p-9c6c056a.js";import{c as m,d as f,g,n as b,a as x,b as y}from"./p-813d004f.js";import{u as w,c as _,d as k,s as $}from"./p-44bfa87d.js";import{H as C}from"./p-cc388a08.js";import{c as D,s as z,a as E}from"./p-8ed6ce4d.js";import{o as I}from"./p-ba569f8b.js";import{d as L,g as P,a as S,b as A,s as F,c as R,e as j,f as O,i as M}from"./p-df0a1d4b.js";import{f as N,c as T,d as B,r as W,a as H,F as U}from"./p-5eb6219c.js";import{s as V,c as q,d as J,H as K}from"./p-716a0878.js";import{n as Z}from"./p-f50a294b.js";import{c as Y,d as G}from"./p-6127f49e.js";import{c as X,d as Q,a as tt}from"./p-97f0e1b6.js";import{g as it}from"./p-b85be429.js";import{g as et}from"./p-e6e50975.js";import{V as st}from"./p-5f1fdaf9.js";import{l as at}from"./p-65581d83.js";import{g as nt}from"./p-427b4593.js";import{g as ot}from"./p-a9a72626.js";import"./p-e6c9e6af.js";import"./p-db50226e.js";import"./p-b64cc55e.js";import"./p-c8d3207e.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
@@ -20,10 +20,10 @@ const yt={dateStyle:"full"},wt={},_t={};async function kt(t){const i=g(t);if(wt[
20
20
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
21
21
  * v2.8.2
22
22
  */
23
- const Dt="calendar-wrapper",zt="calendar-wrapper--end",Et="border-top-color-one",It="no-bottom-border",Lt="input-wrapper",Pt="input",St="menu-container",At="menu-container--active",Ft="toggle-icon",Rt=class{constructor(e){t(this,e),this.calciteInputDatePickerChange=i(this,"calciteInputDatePickerChange",6),this.calciteInputDatePickerBeforeClose=i(this,"calciteInputDatePickerBeforeClose",6),this.calciteInputDatePickerClose=i(this,"calciteInputDatePickerClose",6),this.calciteInputDatePickerBeforeOpen=i(this,"calciteInputDatePickerBeforeOpen",6),this.calciteInputDatePickerOpen=i(this,"calciteInputDatePickerOpen",6),this.calciteInternalInputInputHandler=t=>{const i=t.target,e=i.value,s=this.parseNumerals(e),a=this.formatNumerals(s);i.value=a;const{year:n}=O(e,this.localeData);if(n&&n.length<4)return;const o=j(e,this.localeData);M(o,this.min,this.max)&&(this.datePickerActiveDate=o)},this.calciteInternalInputBlurHandler=()=>{this.commitValue()},this.dialogId=`date-picker-dialog--${it()}`,this.focusOnOpen=!1,this.userChangedValue=!1,this.openTransitionProp="opacity",this.valueAsDateChangedExternally=!1,this.placeholderTextId=`calcite-input-date-picker-placeholder-${it()}`,this.onInputWrapperPointerDown=()=>{this.currentOpenInput=this.focusedInput},this.onInputWrapperClick=t=>{const{range:i,endInput:e,startInput:s,currentOpenInput:a}=this,n=t.currentTarget.getAttribute("data-position");t.composedPath().find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains(Ft)}))&&("start"===n?s:e).setFocus(),i&&this.open&&a!==n||(this.open=!this.open)},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:i}=this;this.filteredFlipPlacements=i?N(i,t):null},this.setTransitionEl=t=>{this.transitionEl=t},this.setStartInput=t=>{this.startInput=t},this.setEndInput=t=>{this.endInput=t},this.blurHandler=()=>{this.open=!1},this.keyDownHandler=t=>{var i,e;const{defaultPrevented:s,key:a}=t;s||("Enter"===a?(t.preventDefault(),this.commitValue(),this.shouldFocusRangeEnd()?null===(i=this.endInput)||void 0===i||i.setFocus():this.shouldFocusRangeStart()&&(null===(e=this.startInput)||void 0===e||e.setFocus()),V(this)&&this.restoreInputFocus()):"ArrowDown"===a?(this.open=!0,this.focusOnOpen=!0,t.preventDefault()):"Escape"===a&&(this.open=!1,t.preventDefault(),this.restoreInputFocus()))},this.startInputFocus=()=>{this.focusedInput="start"},this.endInputFocus=()=>{this.focusedInput="end"},this.setFloatingEl=t=>{this.floatingEl=t,T(this,this.referenceEl,this.floatingEl)},this.setStartWrapper=t=>{this.startWrapper=t,this.setReferenceEl()},this.setEndWrapper=t=>{this.endWrapper=t,this.setReferenceEl()},this.setDatePickerRef=t=>{this.datePickerEl=t,X(this,{focusTrapEl:t,focusTrapOptions:{initialFocus:!1,setReturnFocus:!1}})},this.handleDateChange=t=>{this.range||(t.stopPropagation(),this.setValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.handleDateRangeChange=t=>{this.range&&(t.stopPropagation(),this.setRangeValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.setInputValue=(t,i="start")=>{const e=this[`${i}Input`];e&&(e.value=t)},this.setRangeValue=t=>{if(!this.range)return;const{value:i}=this,e=Array.isArray(i),s=Array.isArray(t);let a=s?S(s?t[0]:null):"";a&&(a=this.getNormalizedDate(a));let n=s?S(s?t[1]:null):"";n&&(n=this.getNormalizedDate(n));const o=a||n?[a,n]:"";if(o===i)return;this.userChangedValue=!0,this.value=o,this.valueAsDate=o?$t(o):void 0;const l=this.calciteInputDatePickerChange.emit();l&&l.defaultPrevented&&(this.value=i,e?(this.setInputValue(i[0],"start"),this.setInputValue(i[1],"end")):(this.value=i,this.setInputValue(i)))},this.setValue=t=>{if(this.range)return;const i=this.value;let e=S(t);e=this.getNormalizedDate(e),e!==i&&(this.userChangedValue=!0,this.valueAsDate=e?L(e):void 0,this.value=e||"",this.calciteInputDatePickerChange.emit().defaultPrevented&&(this.value=i,this.setInputValue(i)))},this.commonDateSeparators=[".","-","/"],this.formatNumerals=t=>t?t.split("").map((t=>{var i,e,s;return(null===(i=this.commonDateSeparators)||void 0===i?void 0:i.includes(t))?null===(e=this.localeData)||void 0===e?void 0:e.separator:(null==Z?void 0:Z.includes(t))?null===(s=null==b?void 0:b.numberFormatter)||void 0===s?void 0:s.format(Number(t)):t})).join(""):"",this.parseNumerals=t=>t?t.split("").map((t=>Z.includes(t)?b.delocalize(t):t)).join(""):"",this.disabled=!1,this.focusTrapDisabled=!1,this.form=void 0,this.readOnly=!1,this.value="",this.flipPlacements=void 0,this.headingLevel=void 0,this.valueAsDate=void 0,this.messageOverrides=void 0,this.messages=void 0,this.minAsDate=void 0,this.maxAsDate=void 0,this.min=void 0,this.max=void 0,this.open=!1,this.validationMessage=void 0,this.validationIcon=void 0,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.name=void 0,this.numberingSystem=void 0,this.scale="m",this.status="idle",this.placement=B,this.range=!1,this.required=!1,this.overlayPositioning="absolute",this.proximitySelectionDisabled=!1,this.layout="horizontal",this.datePickerActiveDate=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.focusedInput="start",this.localeData=void 0}handleFocusTrapDisabled(t){this.open&&(t?Q(this):tt(this))}handleDisabledAndReadOnlyChange(t){t||(this.open=!1)}valueWatcher(t){if(!this.userChangedValue){let i;i=Array.isArray(t)?$t(t):t?L(t):void 0,this.valueAsDateChangedExternally||i===this.valueAsDate||(this.valueAsDate=i),this.localizeInputValues()}this.userChangedValue=!1}valueAsDateWatcher(t){this.datePickerActiveDate=t;const i=this.range&&Array.isArray(t)?[S(t[0]),S(t[1])]:S(t);this.value!==i&&(this.valueAsDateChangedExternally=!0,this.value=i,this.valueAsDateChangedExternally=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}onMinChanged(t){t&&(this.minAsDate=L(t))}onMaxChanged(t){t&&(this.maxAsDate=L(t))}openHandler(){I(this),this.disabled||this.readOnly?this.open=!1:this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}calciteDaySelectHandler(){this.shouldFocusRangeStart()||this.shouldFocusRangeEnd()||(this.open=!1)}async setFocus(){await D(this),this.el.focus()}async reposition(t=!1){const{floatingEl:i,referenceEl:e,placement:s,overlayPositioning:a,filteredFlipPlacements:n}=this;return W(this,{floatingEl:i,referenceEl:e,overlayPositioning:a,placement:s,flipPlacements:n,type:"menu"},t)}connectedCallback(){d(this),m(this);const{open:t}=this;if(t&&this.openHandler(),Array.isArray(this.value))this.valueAsDate=$t(this.value);else if(this.value)try{this.valueAsDate=L(this.value)}catch(t){this.warnAboutInvalidValue(this.value),this.value=""}else this.valueAsDate&&(this.range?this.setRangeValue(this.valueAsDate):Array.isArray(this.valueAsDate)||(this.value=S(this.valueAsDate)));this.min&&(this.minAsDate=L(this.min)),this.max&&(this.maxAsDate=L(this.max)),Y(this),q(this),_(this),this.setFilteredPlacements(),b.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.open&&I(this),T(this,this.referenceEl,this.floatingEl)}async componentWillLoad(){z(this),await Promise.all([this.loadLocaleData(),$(this)]),this.onMinChanged(this.min),this.onMaxChanged(this.max)}componentDidLoad(){E(this),this.localizeInputValues(),T(this,this.referenceEl,this.floatingEl)}disconnectedCallback(){Q(this),p(this),G(this),J(this),H(this,this.referenceEl,this.floatingEl),f(this),k(this)}componentDidRender(){u(this)}render(){var t,i,a;const{disabled:n,effectiveLocale:o,messages:l,numberingSystem:r,readOnly:c}=this;return b.numberFormatOptions={numberingSystem:r,locale:o,useGrouping:!1},e(s,{key:"fd558a11028d7d967811f2a1236d46e82d45161b",onBlur:this.blurHandler,onKeyDown:this.keyDownHandler},e(v,{key:"ebf90902c5f3056147f91ee4690e6e69ab452042",disabled:this.disabled},this.localeData&&e("div",{key:"5e5cfbb9688e08aaf1e12b3527882ee3911d8e84",class:"input-container"},e("div",{key:"63014b5695465c3a1b4fe54be6f036a1aa8393e8",class:Lt,"data-position":"start",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setStartWrapper},e("calcite-input-text",{key:"5cfeff37fb1998954f4e17296f15fcf6b9ea10cd","aria-autocomplete":"none","aria-controls":this.dialogId,"aria-describedby":this.placeholderTextId,"aria-expanded":h(this.open),"aria-haspopup":"dialog",class:{[Pt]:!0,[It]:"vertical"===this.layout&&this.range},disabled:n,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.startInputFocus,placeholder:null===(t=this.localeData)||void 0===t?void 0:t.placeholder,readOnly:c,role:"combobox",scale:this.scale,status:this.status,ref:this.setStartInput}),!this.readOnly&&this.renderToggleIcon(this.open&&"start"===this.focusedInput),e("span",{key:"f3a99326b0ee83dded0efcce2bacc2acca82741a","aria-hidden":"true",class:"assistive-text",id:this.placeholderTextId},"Date Format: ",null===(i=this.localeData)||void 0===i?void 0:i.placeholder)),e("div",{key:"87d96dd359485c1c192f63f694365f6767346207","aria-hidden":h(!this.open),"aria-label":l.chooseDate,"aria-live":"polite","aria-modal":"true",class:{[St]:!0,[At]:this.open},id:this.dialogId,role:"dialog",ref:this.setFloatingEl},e("div",{key:"7bb0daff0e3017152b69a7bec09de23d96539749",class:{[Dt]:!0,[zt]:"end"===this.focusedInput,[U.animation]:!0,[U.animationActive]:this.open},ref:this.setTransitionEl},e("calcite-date-picker",{key:"e9a771765f104b79391396ead9d7e359aa0325cb",activeDate:this.datePickerActiveDate,activeRange:this.focusedInput,headingLevel:this.headingLevel,max:this.max,maxAsDate:this.maxAsDate,messageOverrides:this.messageOverrides,min:this.min,minAsDate:this.minAsDate,numberingSystem:r,onCalciteDatePickerChange:this.handleDateChange,onCalciteDatePickerRangeChange:this.handleDateRangeChange,proximitySelectionDisabled:this.proximitySelectionDisabled,range:this.range,scale:this.scale,tabIndex:this.open?void 0:-1,valueAsDate:this.valueAsDate,ref:this.setDatePickerRef}))),this.range&&"horizontal"===this.layout&&e("div",{key:"61b5787f2990d8143bf62da9e33e1253ab196a47",class:"horizontal-arrow-container"},e("calcite-icon",{key:"c665d2196d7cc71535ae1e352729ad7c3eb606e6",flipRtl:!0,icon:"arrow-right",scale:et(this.scale)})),this.range&&"vertical"===this.layout&&"s"!==this.scale&&e("div",{key:"3b5b05e60ad4dc6e866f2a2e3b8da8427e0d8769",class:"vertical-arrow-container"},e("calcite-icon",{key:"395db3f34af565b7403ce50a1455833a43a86463",icon:"arrow-down",scale:et(this.scale)})),this.range&&e("div",{key:"596548166a4798cbd04ee76938a5a5e8ae2a9081",class:Lt,"data-position":"end",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setEndWrapper},e("calcite-input-text",{key:"1d56b70f902730c20cd0d501d5ece75635bd503b","aria-autocomplete":"none","aria-controls":this.dialogId,"aria-expanded":h(this.open),"aria-haspopup":"dialog",class:{[Pt]:!0,[Et]:"vertical"===this.layout&&this.range},disabled:n,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.endInputFocus,placeholder:null===(a=this.localeData)||void 0===a?void 0:a.placeholder,readOnly:c,role:"combobox",scale:this.scale,status:this.status,ref:this.setEndInput}),!this.readOnly&&this.renderToggleIcon(this.open&&"end"===this.focusedInput))),e(K,{key:"7f09766af52aaa2db452431301dfa55cd8af3a2e",component:this}),this.validationMessage&&"invalid"===this.status?e(st,{icon:this.validationIcon,message:this.validationMessage,scale:this.scale,status:this.status}):null))}renderToggleIcon(t){return e("span",{class:Ft,tabIndex:-1},e("calcite-icon",{class:"chevron-icon",icon:t?"chevron-up":"chevron-down",scale:et(this.scale)}))}setReferenceEl(){const{focusedInput:t,layout:i,endWrapper:e,startWrapper:s}=this;this.referenceEl="end"===t||"vertical"===i?e||s:s||e,requestAnimationFrame((()=>T(this,this.referenceEl,this.floatingEl)))}onLabelClick(){this.setFocus()}onBeforeOpen(){this.calciteInputDatePickerBeforeOpen.emit()}onOpen(){tt(this,{onActivate:()=>{this.focusOnOpen&&(this.datePickerEl.setFocus(),this.focusOnOpen=!1)}}),this.calciteInputDatePickerOpen.emit()}onBeforeClose(){this.calciteInputDatePickerBeforeClose.emit()}onClose(){this.calciteInputDatePickerClose.emit(),Q(this),this.restoreInputFocus(),this.focusOnOpen=!1,this.datePickerEl.reset()}commitValue(){const{focusedInput:t,value:i}=this,e=j(this[`${t}Input`].value,this.localeData),s=S(e),a=Array.isArray(i);if(this.range)if(a){if(s===i["start"===t?0:1])return;e?(this.setRangeValue(["start"===t?e:L(i[0]),"end"===t?e:L(i[1])]),this.localizeInputValues()):this.setRangeValue(["end"===t&&L(i[0]),"start"===t&&L(i[1])])}else e&&(this.setRangeValue(["start"===t?e:L(i[0]),"end"===t?e:L(i[1])]),this.localizeInputValues());else{if(s===i)return;this.setValue(e),this.localizeInputValues()}}async loadLocaleData(){b.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.localeData=await kt(this.effectiveLocale),this.localizeInputValues()}shouldFocusRangeStart(){return!(!this.value[1]||this.value[0]||"end"!==this.focusedInput||!this.startInput)}shouldFocusRangeEnd(){return!(!this.value[0]||this.value[1]||"start"!==this.focusedInput||!this.endInput)}restoreInputFocus(){this.range?("start"===this.focusedInput?this.startInput:this.endInput).setFocus():this.startInput.setFocus()}localizeInputValues(){var t;const i=A(this.range?Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0:this.valueAsDate,this.minAsDate,this.maxAsDate),e=this.range?A(Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0,this.minAsDate,this.maxAsDate):null,s={numberingSystem:y(this.numberingSystem)},a=i&&i.toLocaleDateString(this.effectiveLocale,s),n=e&&e.toLocaleDateString(this.effectiveLocale,s);this.setInputValue(null!=a?a:"","start"),this.setInputValue(null!==(t=this.range&&n)&&void 0!==t?t:"","end")}warnAboutInvalidValue(t){console.warn(`The specified value "${t}" does not conform to the required format, "YYYY-MM-DD".`)}getNormalizedDate(t){if(!t)return"";if(!
23
+ const Dt="calendar-wrapper",zt="calendar-wrapper--end",Et="border-top-color-one",It="no-bottom-border",Lt="input-wrapper",Pt="input",St="menu-container",At="menu-container--active",Ft="toggle-icon",Rt=class{constructor(e){t(this,e),this.calciteInputDatePickerChange=i(this,"calciteInputDatePickerChange",6),this.calciteInputDatePickerBeforeClose=i(this,"calciteInputDatePickerBeforeClose",6),this.calciteInputDatePickerClose=i(this,"calciteInputDatePickerClose",6),this.calciteInputDatePickerBeforeOpen=i(this,"calciteInputDatePickerBeforeOpen",6),this.calciteInputDatePickerOpen=i(this,"calciteInputDatePickerOpen",6),this.calciteInternalInputInputHandler=t=>{const i=t.target,e=i.value,s=this.parseNumerals(e),a=this.formatNumerals(s);i.value=a;const{year:n}=j(e,this.localeData);if(n&&n.length<4)return;const o=O(e,this.localeData);M(o,this.min,this.max)&&(this.datePickerActiveDate=o)},this.calciteInternalInputBlurHandler=()=>{this.commitValue()},this.dialogId=`date-picker-dialog--${it()}`,this.focusOnOpen=!1,this.userChangedValue=!1,this.openTransitionProp="opacity",this.valueAsDateChangedExternally=!1,this.placeholderTextId=`calcite-input-date-picker-placeholder-${it()}`,this.onInputWrapperPointerDown=()=>{this.currentOpenInput=this.focusedInput},this.onInputWrapperClick=t=>{const{range:i,endInput:e,startInput:s,currentOpenInput:a}=this,n=t.currentTarget.getAttribute("data-position");t.composedPath().find((t=>{var i;return null===(i=t.classList)||void 0===i?void 0:i.contains(Ft)}))&&("start"===n?s:e).setFocus(),i&&this.open&&a!==n||(this.open=!this.open)},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:i}=this;this.filteredFlipPlacements=i?N(i,t):null},this.setTransitionEl=t=>{this.transitionEl=t},this.setStartInput=t=>{this.startInput=t},this.setEndInput=t=>{this.endInput=t},this.blurHandler=()=>{this.open=!1},this.keyDownHandler=t=>{var i,e;const{defaultPrevented:s,key:a}=t;s||("Enter"===a?(t.preventDefault(),this.commitValue(),this.shouldFocusRangeEnd()?null===(i=this.endInput)||void 0===i||i.setFocus():this.shouldFocusRangeStart()&&(null===(e=this.startInput)||void 0===e||e.setFocus()),V(this)&&this.restoreInputFocus()):"ArrowDown"===a?(this.open=!0,this.focusOnOpen=!0,t.preventDefault()):"Escape"===a&&(this.open=!1,t.preventDefault(),this.restoreInputFocus()))},this.startInputFocus=()=>{this.focusedInput="start"},this.endInputFocus=()=>{this.focusedInput="end"},this.setFloatingEl=t=>{this.floatingEl=t,T(this,this.referenceEl,this.floatingEl)},this.setStartWrapper=t=>{this.startWrapper=t,this.setReferenceEl()},this.setEndWrapper=t=>{this.endWrapper=t,this.setReferenceEl()},this.setDatePickerRef=t=>{this.datePickerEl=t,X(this,{focusTrapEl:t,focusTrapOptions:{initialFocus:!1,setReturnFocus:!1}})},this.handleDateChange=t=>{this.range||(t.stopPropagation(),this.setValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.handleDateRangeChange=t=>{this.range&&(t.stopPropagation(),this.setRangeValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.setInputValue=(t,i="start")=>{const e=this[`${i}Input`];e&&(e.value=t)},this.setRangeValue=t=>{if(!this.range)return;const{value:i}=this,e=Array.isArray(i),s=Array.isArray(t);let a=s?S(s?t[0]:null):"";a&&(a=this.getNormalizedDate(a));let n=s?S(s?t[1]:null):"";n&&(n=this.getNormalizedDate(n));const o=a||n?[a,n]:"";if(o===i)return;this.userChangedValue=!0,this.value=o,this.valueAsDate=o?$t(o):void 0;const l=this.calciteInputDatePickerChange.emit();l&&l.defaultPrevented&&(this.value=i,e?(this.setInputValue(i[0],"start"),this.setInputValue(i[1],"end")):(this.value=i,this.setInputValue(i)))},this.setValue=t=>{if(this.range)return;const i=this.value;let e=S(t);e=this.getNormalizedDate(e),e!==i&&(this.userChangedValue=!0,this.valueAsDate=e?L(e):void 0,this.value=e||"",this.calciteInputDatePickerChange.emit().defaultPrevented&&(this.value=i,this.setInputValue(i)))},this.commonDateSeparators=[".","-","/"],this.formatNumerals=t=>t?t.split("").map((t=>{var i,e,s;return(null===(i=this.commonDateSeparators)||void 0===i?void 0:i.includes(t))?null===(e=this.localeData)||void 0===e?void 0:e.separator:(null==Z?void 0:Z.includes(t))?null===(s=null==b?void 0:b.numberFormatter)||void 0===s?void 0:s.format(Number(t)):t})).join(""):"",this.parseNumerals=t=>t?t.split("").map((t=>Z.includes(t)?b.delocalize(t):t)).join(""):"",this.disabled=!1,this.focusTrapDisabled=!1,this.form=void 0,this.readOnly=!1,this.value="",this.flipPlacements=void 0,this.headingLevel=void 0,this.valueAsDate=void 0,this.messageOverrides=void 0,this.messages=void 0,this.minAsDate=void 0,this.maxAsDate=void 0,this.min=void 0,this.max=void 0,this.open=!1,this.validationMessage=void 0,this.validationIcon=void 0,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.name=void 0,this.numberingSystem=void 0,this.scale="m",this.status="idle",this.placement=B,this.range=!1,this.required=!1,this.overlayPositioning="absolute",this.proximitySelectionDisabled=!1,this.layout="horizontal",this.datePickerActiveDate=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.focusedInput="start",this.localeData=void 0}handleFocusTrapDisabled(t){this.open&&(t?Q(this):tt(this))}handleDisabledAndReadOnlyChange(t){t||(this.open=!1)}valueWatcher(t){if(!this.userChangedValue){let i;i=Array.isArray(t)?$t(t):t?L(t):void 0,this.valueAsDateChangedExternally||i===this.valueAsDate||(this.valueAsDate=i),this.localizeInputValues()}this.userChangedValue=!1}valueAsDateWatcher(t){this.datePickerActiveDate=t;const i=this.range&&Array.isArray(t)?[S(t[0]),S(t[1])]:S(t);this.value!==i&&(this.valueAsDateChangedExternally=!0,this.value=i,this.valueAsDateChangedExternally=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}onMinChanged(t){t&&(this.minAsDate=L(t))}onMaxChanged(t){t&&(this.maxAsDate=L(t))}openHandler(){I(this),this.disabled||this.readOnly?this.open=!1:this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}calciteDaySelectHandler(){this.shouldFocusRangeStart()||this.shouldFocusRangeEnd()||(this.open=!1)}async setFocus(){await D(this),this.el.focus()}async reposition(t=!1){const{floatingEl:i,referenceEl:e,placement:s,overlayPositioning:a,filteredFlipPlacements:n}=this;return W(this,{floatingEl:i,referenceEl:e,overlayPositioning:a,placement:s,flipPlacements:n,type:"menu"},t)}connectedCallback(){d(this),m(this);const{open:t}=this;if(t&&this.openHandler(),Array.isArray(this.value))this.valueAsDate=$t(this.value);else if(this.value)try{this.valueAsDate=L(this.value)}catch(t){this.warnAboutInvalidValue(this.value),this.value=""}else this.valueAsDate&&(this.range?this.setRangeValue(this.valueAsDate):Array.isArray(this.valueAsDate)||(this.value=S(this.valueAsDate)));this.min&&(this.minAsDate=L(this.min)),this.max&&(this.maxAsDate=L(this.max)),Y(this),q(this),_(this),this.setFilteredPlacements(),b.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.open&&I(this),T(this,this.referenceEl,this.floatingEl)}async componentWillLoad(){z(this),await Promise.all([this.loadLocaleData(),$(this)]),this.onMinChanged(this.min),this.onMaxChanged(this.max)}componentDidLoad(){E(this),this.localizeInputValues(),T(this,this.referenceEl,this.floatingEl)}disconnectedCallback(){Q(this),p(this),G(this),J(this),H(this,this.referenceEl,this.floatingEl),f(this),k(this)}componentDidRender(){u(this)}render(){var t,i,a;const{disabled:n,effectiveLocale:o,messages:l,numberingSystem:r,readOnly:c}=this;return b.numberFormatOptions={numberingSystem:r,locale:o,useGrouping:!1},e(s,{key:"fd558a11028d7d967811f2a1236d46e82d45161b",onBlur:this.blurHandler,onKeyDown:this.keyDownHandler},e(v,{key:"ebf90902c5f3056147f91ee4690e6e69ab452042",disabled:this.disabled},this.localeData&&e("div",{key:"5e5cfbb9688e08aaf1e12b3527882ee3911d8e84",class:"input-container"},e("div",{key:"63014b5695465c3a1b4fe54be6f036a1aa8393e8",class:Lt,"data-position":"start",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setStartWrapper},e("calcite-input-text",{key:"5cfeff37fb1998954f4e17296f15fcf6b9ea10cd","aria-autocomplete":"none","aria-controls":this.dialogId,"aria-describedby":this.placeholderTextId,"aria-expanded":h(this.open),"aria-haspopup":"dialog",class:{[Pt]:!0,[It]:"vertical"===this.layout&&this.range},disabled:n,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.startInputFocus,placeholder:null===(t=this.localeData)||void 0===t?void 0:t.placeholder,readOnly:c,role:"combobox",scale:this.scale,status:this.status,ref:this.setStartInput}),!this.readOnly&&this.renderToggleIcon(this.open&&"start"===this.focusedInput),e("span",{key:"f3a99326b0ee83dded0efcce2bacc2acca82741a","aria-hidden":"true",class:"assistive-text",id:this.placeholderTextId},"Date Format: ",null===(i=this.localeData)||void 0===i?void 0:i.placeholder)),e("div",{key:"87d96dd359485c1c192f63f694365f6767346207","aria-hidden":h(!this.open),"aria-label":l.chooseDate,"aria-live":"polite","aria-modal":"true",class:{[St]:!0,[At]:this.open},id:this.dialogId,role:"dialog",ref:this.setFloatingEl},e("div",{key:"7bb0daff0e3017152b69a7bec09de23d96539749",class:{[Dt]:!0,[zt]:"end"===this.focusedInput,[U.animation]:!0,[U.animationActive]:this.open},ref:this.setTransitionEl},e("calcite-date-picker",{key:"e9a771765f104b79391396ead9d7e359aa0325cb",activeDate:this.datePickerActiveDate,activeRange:this.focusedInput,headingLevel:this.headingLevel,max:this.max,maxAsDate:this.maxAsDate,messageOverrides:this.messageOverrides,min:this.min,minAsDate:this.minAsDate,numberingSystem:r,onCalciteDatePickerChange:this.handleDateChange,onCalciteDatePickerRangeChange:this.handleDateRangeChange,proximitySelectionDisabled:this.proximitySelectionDisabled,range:this.range,scale:this.scale,tabIndex:this.open?void 0:-1,valueAsDate:this.valueAsDate,ref:this.setDatePickerRef}))),this.range&&"horizontal"===this.layout&&e("div",{key:"61b5787f2990d8143bf62da9e33e1253ab196a47",class:"horizontal-arrow-container"},e("calcite-icon",{key:"c665d2196d7cc71535ae1e352729ad7c3eb606e6",flipRtl:!0,icon:"arrow-right",scale:et(this.scale)})),this.range&&"vertical"===this.layout&&"s"!==this.scale&&e("div",{key:"3b5b05e60ad4dc6e866f2a2e3b8da8427e0d8769",class:"vertical-arrow-container"},e("calcite-icon",{key:"395db3f34af565b7403ce50a1455833a43a86463",icon:"arrow-down",scale:et(this.scale)})),this.range&&e("div",{key:"596548166a4798cbd04ee76938a5a5e8ae2a9081",class:Lt,"data-position":"end",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setEndWrapper},e("calcite-input-text",{key:"1d56b70f902730c20cd0d501d5ece75635bd503b","aria-autocomplete":"none","aria-controls":this.dialogId,"aria-expanded":h(this.open),"aria-haspopup":"dialog",class:{[Pt]:!0,[Et]:"vertical"===this.layout&&this.range},disabled:n,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.endInputFocus,placeholder:null===(a=this.localeData)||void 0===a?void 0:a.placeholder,readOnly:c,role:"combobox",scale:this.scale,status:this.status,ref:this.setEndInput}),!this.readOnly&&this.renderToggleIcon(this.open&&"end"===this.focusedInput))),e(K,{key:"7f09766af52aaa2db452431301dfa55cd8af3a2e",component:this}),this.validationMessage&&"invalid"===this.status?e(st,{icon:this.validationIcon,message:this.validationMessage,scale:this.scale,status:this.status}):null))}renderToggleIcon(t){return e("span",{class:Ft,tabIndex:-1},e("calcite-icon",{class:"chevron-icon",icon:t?"chevron-up":"chevron-down",scale:et(this.scale)}))}setReferenceEl(){const{focusedInput:t,layout:i,endWrapper:e,startWrapper:s}=this;this.referenceEl="end"===t||"vertical"===i?e||s:s||e,requestAnimationFrame((()=>T(this,this.referenceEl,this.floatingEl)))}onLabelClick(){this.setFocus()}onBeforeOpen(){this.calciteInputDatePickerBeforeOpen.emit()}onOpen(){tt(this,{onActivate:()=>{this.focusOnOpen&&(this.datePickerEl.setFocus(),this.focusOnOpen=!1)}}),this.calciteInputDatePickerOpen.emit()}onBeforeClose(){this.calciteInputDatePickerBeforeClose.emit()}onClose(){this.calciteInputDatePickerClose.emit(),Q(this),this.restoreInputFocus(),this.focusOnOpen=!1,this.datePickerEl.reset()}commitValue(){const{focusedInput:t,value:i}=this,e=O(this[`${t}Input`].value,this.localeData),s=S(e),a=Array.isArray(i);if(this.range)if(a){if(s===i["start"===t?0:1])return;e?(this.setRangeValue(["start"===t?e:L(i[0]),"end"===t?e:L(i[1])]),this.localizeInputValues()):this.setRangeValue(["end"===t&&L(i[0]),"start"===t&&L(i[1])])}else e&&(this.setRangeValue(["start"===t?e:L(i[0]),"end"===t?e:L(i[1])]),this.localizeInputValues());else{if(s===i)return;this.setValue(e),this.localizeInputValues()}}async loadLocaleData(){b.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.localeData=await kt(this.effectiveLocale),this.localizeInputValues()}shouldFocusRangeStart(){return!(!this.value[1]||this.value[0]||"end"!==this.focusedInput||!this.startInput)}shouldFocusRangeEnd(){return!(!this.value[0]||this.value[1]||"start"!==this.focusedInput||!this.endInput)}restoreInputFocus(){this.range?("start"===this.focusedInput?this.startInput:this.endInput).setFocus():this.startInput.setFocus()}localizeInputValues(){var t;const i=A(this.range?Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0:this.valueAsDate,this.minAsDate,this.maxAsDate),e=this.range?A(Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0,this.minAsDate,this.maxAsDate):null,s={numberingSystem:y(this.numberingSystem)},a=i&&i.toLocaleDateString(this.effectiveLocale,s),n=e&&e.toLocaleDateString(this.effectiveLocale,s);this.setInputValue(null!=a?a:"","start"),this.setInputValue(null!==(t=this.range&&n)&&void 0!==t?t:"","end")}warnAboutInvalidValue(t){console.warn(`The specified value "${t}" does not conform to the required format, "YYYY-MM-DD".`)}getNormalizedDate(t){if(!t)return"";if(!
24
24
  /*!
25
25
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
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,{key:"5548c6406452810de75b821ef07cd394fbf1dd06"},e("calcite-panel",{key:"54b4a9bb11b500ae56f71ecbc9928b0e51337d50",class:this.baseClass,ref:t=>this.panelEl=t},e("slot",{key:"69ae0bcf9f347dc3b4813611c9edbb38eba8ee72",slot:"header-content",name:"filter-header-content"}),e("slot",{key:"5122cfc894077bd7dcffe8ec973e9d67293da43a",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",{key:"e3ae70f01dba11ef4bc9e293e13b922a38eab5a3",ref:t=>this.dialogContentRef=t,class:`${Vt.dialog}${"vertical"===this.shareIconsLayout?` ${Vt.layout.vertical}`:` ${Vt.layout.horizontal}`}`},r);return e(s,{key:"84a7ab996010b4263040db789d4d726a874af30a"},"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,o;const{longitude:l,latitude:r,x:c,y:h}=t;if(void 0===l||void 0===r)return this.shareUrl;const d=this.roundValue(i?l:c),p=this.roundValue(i?r:h),{zoom:u}=this.view,v=this.roundValue(u),m=null===(s=null===(e=this.view)||void 0===e?void 0:e.popup)||void 0===s?void 0:s.selectedFeature,f=null===(n=null===(a=this.view)||void 0===a?void 0:a.popup)||void 0===n?void 0:n.visible;let g,b,x;if(m&&f&&"feature"===(null===(o=null==m?void 0:m.layer)||void 0===o?void 0:o.type)){const t=null==m?void 0:m.layer;g=null==t?void 0:t.id,b=m.attributes[t.objectIdField],x=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";")}const{type:y}=this.view,{defaultUrlParams:w}=this,_=new URL(this.shareUrl),{searchParams:k}=_;if(k.get("center")&&k.delete("center"),k.get("level")&&k.delete("level"),k.get("selectedFeature")&&k.delete("selectedFeature"),k.get("hiddenLayers")&&k.delete("hiddenLayers"),k.get("viewpoint")&&k.delete("viewpoint"),"3d"===y){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==w?void 0:w.viewpoint)&&_.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),g&&b&&!1!==(null==w?void 0:w.selectedFeature)&&_.searchParams.set("selectedFeature",`${g};${b}`),x&&!1!==(null==w?void 0:w.hiddenLayers)&&_.searchParams.set("hiddenLayers",x),_.search=decodeURIComponent(_.search),_.href}return!1!==(null==w?void 0:w.center)&&_.searchParams.set("center",`${d};${p}`),!1!==(null==w?void 0:w.level)&&_.searchParams.set("level",`${v}`),g&&b&&!1!==(null==w?void 0:w.selectedFeature)&&_.searchParams.set("selectedFeature",`${g};${b}`),x&&!1!==(null==w?void 0:w.hiddenLayers)&&_.searchParams.set("hiddenLayers",x),_.search=decodeURIComponent(_.search),_.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 jt="instant-apps-filter-list calcite-mode-light",Ot=["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=jt,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":jt,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,{key:"5548c6406452810de75b821ef07cd394fbf1dd06"},e("calcite-panel",{key:"54b4a9bb11b500ae56f71ecbc9928b0e51337d50",class:this.baseClass,ref:t=>this.panelEl=t},e("slot",{key:"69ae0bcf9f347dc3b4813611c9edbb38eba8ee72",slot:"header-content",name:"filter-header-content"}),e("slot",{key:"5122cfc894077bd7dcffe8ec973e9d67293da43a",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(Ot.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&&Ot.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&&Ot.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(Ot.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&&Ot.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",{key:"e3ae70f01dba11ef4bc9e293e13b922a38eab5a3",ref:t=>this.dialogContentRef=t,class:`${Vt.dialog}${"vertical"===this.shareIconsLayout?` ${Vt.layout.vertical}`:` ${Vt.layout.horizontal}`}`},r);return e(s,{key:"84a7ab996010b4263040db789d4d726a874af30a"},"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,o;const{longitude:l,latitude:r,x:c,y:h}=t;if(void 0===l||void 0===r)return this.shareUrl;const d=this.roundValue(i?l:c),p=this.roundValue(i?r:h),{zoom:u}=this.view,v=this.roundValue(u),m=null===(s=null===(e=this.view)||void 0===e?void 0:e.popup)||void 0===s?void 0:s.selectedFeature,f=null===(n=null===(a=this.view)||void 0===a?void 0:a.popup)||void 0===n?void 0:n.visible;let g,b,x;if(m&&f&&"feature"===(null===(o=null==m?void 0:m.layer)||void 0===o?void 0:o.type)){const t=null==m?void 0:m.layer;g=null==t?void 0:t.id,b=m.attributes[t.objectIdField],x=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";")}const{type:y}=this.view,{defaultUrlParams:w}=this,_=new URL(this.shareUrl),{searchParams:k}=_;if(k.get("center")&&k.delete("center"),k.get("level")&&k.delete("level"),k.get("selectedFeature")&&k.delete("selectedFeature"),k.get("hiddenLayers")&&k.delete("hiddenLayers"),k.get("viewpoint")&&k.delete("viewpoint"),"3d"===y){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==w?void 0:w.viewpoint)&&_.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),g&&b&&!1!==(null==w?void 0:w.selectedFeature)&&_.searchParams.set("selectedFeature",`${g};${b}`),x&&!1!==(null==w?void 0:w.hiddenLayers)&&_.searchParams.set("hiddenLayers",x),_.search=decodeURIComponent(_.search),_.href}return!1!==(null==w?void 0:w.center)&&_.searchParams.set("center",`${d};${p}`),!1!==(null==w?void 0:w.level)&&_.searchParams.set("level",`${v}`),g&&b&&!1!==(null==w?void 0:w.selectedFeature)&&_.searchParams.set("selectedFeature",`${g};${b}`),x&&!1!==(null==w?void 0:w.hiddenLayers)&&_.searchParams.set("hiddenLayers",x),_.search=decodeURIComponent(_.search),_.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,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-fa1ceaf9.js";import{g as n}from"./p-af2c8aa9.js";import{S as h}from"./p-a230b270.js";import{w as o}from"./p-04674a1e.js";import{g as r}from"./p-a42ff7fe.js";import"./p-6a68306c.js";import"./p-d4056c1c.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"}},p=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),p=this.renderTitle(),l="right"===this.headerAlignment||"center"===this.headerAlignment?d.headerContent.concat(" ",d.alignment[this.headerAlignment]):d.headerContent,c=r(this.fontFamily);return a(s,{key:"f93285efa9fe03f2cdedfe0e870f7cb44802e151"},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:l},o,p,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"]}}};p.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;--instant-apps-header-actions-end-height:auto;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{height:var(--instant-apps-header-actions-end-height);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{p 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 t,h as o,H as e,g as s}from"./p-fa1ceaf9.js";import{l as n}from"./p-65581d83.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";const a="components",i=`[slot="${a}"]`,r=class{constructor(o){t(this,o),this.components=[],this.view=void 0}async componentWillLoad(){const[t]=await n(["esri/widgets/Expand"]);this.Expand=t,this._handleComponents()}componentWillUpdate(){this._handleComponents()}render(){return o(e,{key:"b4eb66870fea801441c2c4410fce060a7785b66a"},o("slot",{key:"9fadbc49629b92b3ae909da5171f2f0ae87e2daf",name:a}))}_handleComponents(){const t=this._getComponentsNode();t&&(this._resetUI(t),this._attachComponents(t))}_attachComponents(t){this.components.forEach(this._attachmentComponent(t))}_attachmentComponent(t){return(o,e)=>{let s=o.content;o.isExpand&&(s=this._getExpand(o),o.expandIconClass&&(s.expandIconClass=o.expandIconClass),o.expandIcon&&(s.expandIcon=o.expandIcon),o.collapseTooltip&&(s.collapseTooltip=o.collapseTooltip),o.expandTooltip&&(s.expandTooltip=o.expandTooltip)),s.container||(s.container=document.createElement("div")),null==t||t.appendChild(s.container),e!==this.components.length-1&&(s.container.style="border-bottom: 1px solid var(--calcite-color-border-3)")}}_getExpand(t){const{view:o}=this,{content:e}=t;return new this.Expand({content:e,view:o,expanded:!1,mode:"floating",group:"instant-apps-control-panel"})}_getComponentsNode(){return this.el.querySelector(i)}_resetUI(t){if(t.children.length>0){const{firstChild:o}=t;for(;o;)t.removeChild(o)}}get el(){return s(this)}};r.style=":host{display:block}";export{r as instant_apps_control_panel}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{c as e}from"./p-8c6d9b5a.js";import{d as t}from"./p-c1cf3ebc.js";import{E as r,J as i,S as s}from"./p-d27ab863.js";import"./p-a230b270.js";import{c as n,r as a,b as o,d as c,f as u,h as l,a as f,s as p}from"./p-7996f123.js";
6
+ import{c as e}from"./p-8c6d9b5a.js";import{d as t}from"./p-c1cf3ebc.js";import{E as r,J as i,S as s}from"./p-3d7cff5e.js";import"./p-a230b270.js";import{c as n,r as a,b as o,d as c,f as u,h as l,a as f,s as p}from"./p-a0300d31.js";
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
9
9
 
@@ -142,4 +142,4 @@ function b(e,t,r,s=40){return new Promise((n=>{let a=[];const o=[];e.length>0&&f
142
142
  * See the License for the specific language governing permissions and
143
143
  * limitations under the License.
144
144
  */
145
- const _={solutionItemId:"",defaultWkid:void 0,solutionData:{metadata:{},templates:[]},templateEdits:{},featureServices:[],spatialReferenceInfo:{enabled:!1,services:{},spatialReference:void 0}},g=class{static get Store(){return this._instance||(this._instance=new this)}constructor(){this._hasChanges=!1,this._store=e(Object.assign({},_))}getItemInfo(e){let t;return this._store.get("solutionData").templates.some((r=>e==r.itemId&&(t=r,!0))),t}getStoreInfo(e){return this._store.get(e)}async loadSolution(e,t){this._authentication=t;const r=await l(e,t);if(r){const i=f(r,"params.wkid.default");await this._prepareSolutionItemsForEditing(e,r.templates,t);const s=this._getFeatureServices(r.templates),n=this._getSpatialReferenceInfo(s,i);this._store.set("solutionItemId",e),this._store.set("defaultWkid",i),this._store.set("solutionData",r),this._store.set("featureServices",s),this._store.set("spatialReferenceInfo",n)}this._flagStoreHasChanges(!1)}replaceItemThumbnail(e){e.resourceFilePaths.forEach((e=>{e.type===r.Thumbnail&&(e.updateType===t.None?e.updateType=t.Remove:e.updateType!==t.Add&&e.updateType!==t.Update||(e.updateType=t.Obsolete))})),e.resourceFilePaths=e.resourceFilePaths.filter((e=>e.updateType!=t.Obsolete)),e.resourceFilePaths.push({blob:e.thumbnail,filename:e.thumbnail.name,type:r.Thumbnail,updateType:t.Add}),this.setItemInfo(e)}async saveSolution(){const e=this._store.get("solutionItemId"),t=this._store.get("solutionData"),r=this._store.get("spatialReferenceInfo");await this._prepareSolutionItemsForStorage(e,t.templates,this._authentication);const i=this._setSpatialReferenceInfo(r,t.templates);p(t,"params.wkid",i?{label:"Spatial Reference",default:i,valueType:"spatialReference",attributes:{required:"true"}}:{});const s={id:e,text:t};await function(e,t){return new Promise(((r,i)=>{var s;(s={item:e,folderId:void 0,authentication:t,params:{}},h(s).then((function(e){var t,r,i,n=s.folderId?d(s)+"/content/users/"+e+"/"+s.folderId+"/items/"+s.item.id+"/update":d(s)+"/content/users/"+e+"/items/"+s.item.id+"/update";return s.params=m(m({},s.params),(t=s.item,(r=JSON.parse(JSON.stringify(t))).data&&("undefined"!=typeof Blob&&t.data instanceof Blob||"ReadStream"===t.data.constructor.name?r.file=t.data:r.text=t.data,delete r.data),r)),s.params.extent&&(i=s.params.extent,Array.isArray(i)&&Array.isArray(i[0])&&Array.isArray(i[1]))&&(s.params.extent=function(e){return e.join(",")}(s.params.extent)),a(n,s)}))).then((e=>e.success?r(e):i(e)),(e=>i(e)))}))}(s,this._authentication)}setItemInfo(e){const t=this._store.get("solutionData");t.templates.some((r=>e.itemId==r.itemId&&(r=e,this._store.set("solutionData",t),this._flagStoreHasChanges(!0),!0)))}setStoreInfo(e,t){this._store.set(e,t),this._flagStoreHasChanges(!0)}_testAccess(e,t,r,i){switch(e){case"_emptyTheStore":this._emptyTheStore();break;case"_getFeatureServices":return this._getFeatureServices(t);case"_getItemsSharedWithThisGroup":return this._getItemsSharedWithThisGroup(t,r);case"_getResourceFilePaths":return this._getResourceFilePaths(t,r,i);case"_getResourceStorageName":return this._getResourceStorageName(t,r);case"_getSpatialReferenceInfo":return this._getSpatialReferenceInfo(t,r);case"_prepareSolutionItemsForEditing":return this._prepareSolutionItemsForEditing(t,r,i);case"_prepareSolutionItemsForStorage":return this._prepareSolutionItemsForStorage(t,r,i);case"_setSpatialReferenceInfo":return this._setSpatialReferenceInfo(t,r);case"_splitFilename":return this._splitFilename(t)}return null}_emptyTheStore(){this._store.set("solutionItemId",_.solutionItemId),this._store.set("defaultWkid",_.defaultWkid),this._store.set("solutionData",_.solutionData),this._store.set("templateEdits",_.templateEdits),this._store.set("featureServices",_.featureServices),this._store.set("spatialReferenceInfo",_.spatialReferenceInfo)}_flagStoreHasChanges(e){this._hasChanges!==e&&window.dispatchEvent(new CustomEvent("solutionStoreHasChanges",{detail:e,bubbles:!0,cancelable:!1,composed:!0})),this._hasChanges=e}_getCustomizableFeatureServices(e){return e.reduce(((e,t)=>("Feature Service"===t.type&&t.item.typeKeywords.indexOf("View Service")<0&&e.push(t),e)),[])}_getFeatureServices(e){return this._getCustomizableFeatureServices(e).map((e=>({name:e.item.title||e.item.name,enabled:f(e,"properties.service.spatialReference.wkid").toString().startsWith("{{params.wkid||")})))}_getItemsSharedWithThisGroup(e,t){return t.reduce(((t,r)=>(r.itemId!==e.itemId&&"Group"!==r.type&&t.push({id:r.itemId,title:r.item.name||r.item.title,isShared:(r.groups||[]).indexOf(e.itemId)>-1,shareItem:(r.groups||[]).indexOf(e.itemId)>-1,type:r.type,typeKeywords:r.item.typeKeywords}),t)),[])}_getResourceFilePaths(e,r,i){return function(e,t,r=[],i=0){return r.map((r=>{return{url:(s=e,n=t,a=r,c(s)+"content/items/"+n+"/resources/"+a),...w(r,i)};var s,n,a}))}(i,e,r.resources,s).map((e=>(e.updateType=t.None,e)))}_getResourceStorageName(e,t){let i=e;switch(t.type){case r.Data:i=`${i}_info_data`;break;case r.Info:i=`${i}_info`;break;case r.Metadata:i=`${i}_info_metadata`;break;case r.Resource:break;case r.Thumbnail:i=`${i}_info_thumbnail`}let s=t.filename;return t.type==r.Data&&s&&!function(e){const t=e.match(/\.([a-z]+)$/i);return!!t&&"|.json|.xml|.txt|.png|.pbf|.zip|.jpeg|.jpg|.gif|.bmp|.gz|.svg|.svgz|.geodatabase|".indexOf("|"+t[0]+"|")>=0}(s)&&(s+=".zip",i+="z"),i+"/"+(t.folder?t.folder+"/"+s:s)}_getSpatialReferenceInfo(e,t){const r={};return e.forEach((e=>{r[e.name]=e.enabled})),{enabled:void 0!==t,services:r,spatialReference:t||void 0}}async _prepareSolutionItemsForEditing(e,t,i){const s=[];t.forEach((n=>{n.resourceFilePaths=this._getResourceFilePaths(e,n,i.portal),s.push(n.resourceFilePaths.length>0?function(e,t){let i,s;return t.forEach((e=>{e.type===r.Thumbnail&&(i=e.url,s=e.filename)})),i?u(i,s,e):Promise.resolve(null)}(i,n.resourceFilePaths):Promise.resolve()),n.groupDetails="Group"===n.type?this._getItemsSharedWithThisGroup(n,t):[]}));const n=await Promise.all(s);return t.forEach(((e,t)=>{e.thumbnail=n[t]?n[t]:void 0})),Promise.resolve()}async _prepareSolutionItemsForStorage(e,r,i){const s=[],n=[];return r.forEach((r=>{r.resourceFilePaths.forEach((async o=>{const c=this._getResourceStorageName(r.itemId,o);switch(o.updateType){case t.Add:const{prefix:u,suffix:l}=this._splitFilename(c);r.resources.push(c),s.push({itemId:r.itemId,file:o.blob,folder:u,filename:l});break;case t.Update:n.push(new Promise((async t=>{try{await function(e,t,r,i){const s=t.split("/"),n=s.length>1?s.slice(0,s.length-1).join("/"):void 0;return h(o={id:e,prefix:n,name:s[s.length-1],resource:r,authentication:i}).then((function(e){var t=d(o)+"/content/users/"+e+"/items/"+o.id+"/updateResources";return o.params=m({file:o.resource,fileName:o.name,resourcesPrefix:o.prefix,text:o.content},o.params),void 0!==o.private&&(o.params.access=o.private?"private":"inherit"),a(t,o)}));var o}(e,c,o.blob,i)}catch(e){console.log("Unable to update "+c+" for item "+r.itemId+": "+JSON.stringify(e))}t()})));break;case t.Remove:n.push(new Promise((async t=>{try{await function(e,t,r){return h(i={id:e,resource:t,authentication:r}).then((function(e){var t=d(i)+"/content/users/"+e+"/items/"+i.id+"/removeResources";return i.params=m(m({},i.params),{resource:i.resource}),void 0!==i.deleteAll&&(i.params.deleteAll=i.deleteAll),a(t,i)}));var i}(e,c,i),r.resources=r.resources.filter((e=>e!==c))}catch(e){console.log("Unable to remove "+c+" for item "+r.itemId+": "+JSON.stringify(e))}t()})))}return Promise.resolve()})),delete r.resourceFilePaths,delete r.thumbnail,delete r.groupDetails})),Promise.all(n).then((async()=>{var t,r,n;return s.length>0&&await(t=s,r=e,n=i,new Promise((e=>{b(t,r,n).then((t=>{e(t.filter((e=>e.fetchedFromSource&&e.copiedToDestination)).map((e=>e.folder+"/"+e.filename)))}))}))),Promise.resolve()}))}_setSpatialReferenceInfo(e,t){const r="{{params.wkid||",i=this._getCustomizableFeatureServices(t);return e.enabled?(i.forEach((t=>{let i;e.services[t.item.title||t.item.name]?(i=`{{params.wkid||${e.spatialReference}}}`,p(t,"properties.service.spatialReference.wkid",i)):(i=f(t,"properties.service.spatialReference.wkid"),i.toString().startsWith(r)&&(i=i.toString().substring(15,i.length-2),p(t,"properties.service.spatialReference.wkid",i)))})),e.spatialReference):void i.forEach((e=>{const t=f(e,"properties.service.spatialReference.wkid");t.toString().startsWith(r)&&p(e,"properties.service.spatialReference.wkid",t.toString().substring(15,t.length-2))}))}_splitFilename(e){const t=e.split("/");return{prefix:t.length>1?t.slice(0,t.length-1).join("/"):void 0,suffix:t[t.length-1]}}}.Store;export{g as s}
145
+ const _={solutionItemId:"",defaultWkid:void 0,solutionData:{metadata:{},templates:[]},templateEdits:{},featureServices:[],spatialReferenceInfo:{enabled:!1,services:{},spatialReference:void 0}},g=class{static get Store(){return this._instance||(this._instance=new this)}constructor(){this._hasChanges=!1,this._store=e(Object.assign({},_))}getItemInfo(e){let t;return this._store.get("solutionData").templates.some((r=>e==r.itemId&&(t=r,!0))),t}getStoreInfo(e){return this._store.get(e)}async loadSolution(e,t){this._authentication=t;const r=await l(e,t);if(r){const i=f(r,"params.wkid.default");await this._prepareSolutionItemsForEditing(e,r.templates,t);const s=this._getFeatureServices(r.templates),n=this._getSpatialReferenceInfo(s,i);this._store.set("solutionItemId",e),this._store.set("defaultWkid",i),this._store.set("solutionData",r),this._store.set("featureServices",s),this._store.set("spatialReferenceInfo",n)}this._flagStoreHasChanges(!1)}replaceItemThumbnail(e){e.resourceFilePaths.forEach((e=>{e.type===r.Thumbnail&&(e.updateType===t.None?e.updateType=t.Remove:e.updateType!==t.Add&&e.updateType!==t.Update||(e.updateType=t.Obsolete))})),e.resourceFilePaths=e.resourceFilePaths.filter((e=>e.updateType!=t.Obsolete)),e.resourceFilePaths.push({blob:e.thumbnail,filename:e.thumbnail.name,type:r.Thumbnail,updateType:t.Add}),this.setItemInfo(e)}async saveSolution(){const e=this._store.get("solutionItemId"),t=this._store.get("solutionData"),r=this._store.get("spatialReferenceInfo");await this._prepareSolutionItemsForStorage(e,t.templates,this._authentication);const i=this._setSpatialReferenceInfo(r,t.templates);p(t,"params.wkid",i?{label:"Spatial Reference",default:i,valueType:"spatialReference",attributes:{required:"true"}}:{});const s={id:e,text:t};await function(e,t){return new Promise(((r,i)=>{var s;(s={item:e,folderId:void 0,authentication:t,params:{}},h(s).then((function(e){var t,r,i,n=s.folderId?d(s)+"/content/users/"+e+"/"+s.folderId+"/items/"+s.item.id+"/update":d(s)+"/content/users/"+e+"/items/"+s.item.id+"/update";return s.params=m(m({},s.params),(t=s.item,(r=JSON.parse(JSON.stringify(t))).data&&("undefined"!=typeof Blob&&t.data instanceof Blob||"ReadStream"===t.data.constructor.name?r.file=t.data:r.text=t.data,delete r.data),r)),s.params.extent&&(i=s.params.extent,Array.isArray(i)&&Array.isArray(i[0])&&Array.isArray(i[1]))&&(s.params.extent=function(e){return e.join(",")}(s.params.extent)),a(n,s)}))).then((e=>e.success?r(e):i(e)),(e=>i(e)))}))}(s,this._authentication)}setItemInfo(e){const t=this._store.get("solutionData");t.templates.some((r=>e.itemId==r.itemId&&(r=e,this._store.set("solutionData",t),this._flagStoreHasChanges(!0),!0)))}setStoreInfo(e,t){this._store.set(e,t),this._flagStoreHasChanges(!0)}_testAccess(e,t,r,i){switch(e){case"_emptyTheStore":this._emptyTheStore();break;case"_getFeatureServices":return this._getFeatureServices(t);case"_getItemsSharedWithThisGroup":return this._getItemsSharedWithThisGroup(t,r);case"_getResourceFilePaths":return this._getResourceFilePaths(t,r,i);case"_getResourceStorageName":return this._getResourceStorageName(t,r);case"_getSpatialReferenceInfo":return this._getSpatialReferenceInfo(t,r);case"_prepareSolutionItemsForEditing":return this._prepareSolutionItemsForEditing(t,r,i);case"_prepareSolutionItemsForStorage":return this._prepareSolutionItemsForStorage(t,r,i);case"_setSpatialReferenceInfo":return this._setSpatialReferenceInfo(t,r);case"_splitFilename":return this._splitFilename(t)}return null}_emptyTheStore(){this._store.set("solutionItemId",_.solutionItemId),this._store.set("defaultWkid",_.defaultWkid),this._store.set("solutionData",_.solutionData),this._store.set("templateEdits",_.templateEdits),this._store.set("featureServices",_.featureServices),this._store.set("spatialReferenceInfo",_.spatialReferenceInfo)}_flagStoreHasChanges(e){window.dispatchEvent(new CustomEvent("solutionStoreHasChanges",{detail:e,bubbles:!0,cancelable:!1,composed:!0})),this._hasChanges=e}_getCustomizableFeatureServices(e){return e.reduce(((e,t)=>("Feature Service"===t.type&&t.item.typeKeywords.indexOf("View Service")<0&&e.push(t),e)),[])}_getFeatureServices(e){return this._getCustomizableFeatureServices(e).map((e=>({name:e.item.title||e.item.name,enabled:f(e,"properties.service.spatialReference.wkid").toString().startsWith("{{params.wkid||")})))}_getItemsSharedWithThisGroup(e,t){return t.reduce(((t,r)=>(r.itemId!==e.itemId&&"Group"!==r.type&&t.push({id:r.itemId,title:r.item.name||r.item.title,isShared:(r.groups||[]).indexOf(e.itemId)>-1,shareItem:(r.groups||[]).indexOf(e.itemId)>-1,type:r.type,typeKeywords:r.item.typeKeywords}),t)),[])}_getResourceFilePaths(e,r,i){return function(e,t,r=[],i=0){return r.map((r=>{return{url:(s=e,n=t,a=r,c(s)+"content/items/"+n+"/resources/"+a),...w(r,i)};var s,n,a}))}(i,e,r.resources,s).map((e=>(e.updateType=t.None,e)))}_getResourceStorageName(e,t){let i=e;switch(t.type){case r.Data:i=`${i}_info_data`;break;case r.Info:i=`${i}_info`;break;case r.Metadata:i=`${i}_info_metadata`;break;case r.Resource:break;case r.Thumbnail:i=`${i}_info_thumbnail`}let s=t.filename;return t.type==r.Data&&s&&!function(e){const t=e.match(/\.([a-z]+)$/i);return!!t&&"|.json|.xml|.txt|.png|.pbf|.zip|.jpeg|.jpg|.gif|.bmp|.gz|.svg|.svgz|.geodatabase|".indexOf("|"+t[0]+"|")>=0}(s)&&(s+=".zip",i+="z"),i+"/"+(t.folder?t.folder+"/"+s:s)}_getSpatialReferenceInfo(e,t){const r={};return e.forEach((e=>{r[e.name]=e.enabled})),{enabled:void 0!==t,services:r,spatialReference:t||void 0}}async _prepareSolutionItemsForEditing(e,t,i){const s=[];t.forEach((n=>{n.resourceFilePaths=this._getResourceFilePaths(e,n,i.portal),s.push(n.resourceFilePaths.length>0?function(e,t){let i,s;return t.forEach((e=>{e.type===r.Thumbnail&&(i=e.url,s=e.filename)})),i?u(i,s,e):Promise.resolve(null)}(i,n.resourceFilePaths):Promise.resolve()),n.groupDetails="Group"===n.type?this._getItemsSharedWithThisGroup(n,t):[]}));const n=await Promise.all(s);return t.forEach(((e,t)=>{e.thumbnail=n[t]?n[t]:void 0})),Promise.resolve()}async _prepareSolutionItemsForStorage(e,r,i){const s=[],n=[];return r.forEach((r=>{r.resourceFilePaths.forEach((async o=>{const c=this._getResourceStorageName(r.itemId,o);switch(o.updateType){case t.Add:const{prefix:u,suffix:l}=this._splitFilename(c);r.resources.push(c),s.push({itemId:r.itemId,file:o.blob,folder:u,filename:l});break;case t.Update:n.push(new Promise((async t=>{try{await function(e,t,r,i){const s=t.split("/"),n=s.length>1?s.slice(0,s.length-1).join("/"):void 0;return h(o={id:e,prefix:n,name:s[s.length-1],resource:r,authentication:i}).then((function(e){var t=d(o)+"/content/users/"+e+"/items/"+o.id+"/updateResources";return o.params=m({file:o.resource,fileName:o.name,resourcesPrefix:o.prefix,text:o.content},o.params),void 0!==o.private&&(o.params.access=o.private?"private":"inherit"),a(t,o)}));var o}(e,c,o.blob,i)}catch(e){console.log("Unable to update "+c+" for item "+r.itemId+": "+JSON.stringify(e))}t()})));break;case t.Remove:n.push(new Promise((async t=>{try{await function(e,t,r){return h(i={id:e,resource:t,authentication:r}).then((function(e){var t=d(i)+"/content/users/"+e+"/items/"+i.id+"/removeResources";return i.params=m(m({},i.params),{resource:i.resource}),void 0!==i.deleteAll&&(i.params.deleteAll=i.deleteAll),a(t,i)}));var i}(e,c,i),r.resources=r.resources.filter((e=>e!==c))}catch(e){console.log("Unable to remove "+c+" for item "+r.itemId+": "+JSON.stringify(e))}t()})))}return Promise.resolve()})),delete r.resourceFilePaths,delete r.thumbnail,delete r.groupDetails})),Promise.all(n).then((async()=>{var t,r,n;return s.length>0&&await(t=s,r=e,n=i,new Promise((e=>{b(t,r,n).then((t=>{e(t.filter((e=>e.fetchedFromSource&&e.copiedToDestination)).map((e=>e.folder+"/"+e.filename)))}))}))),Promise.resolve()}))}_setSpatialReferenceInfo(e,t){const r="{{params.wkid||",i=this._getCustomizableFeatureServices(t);return e.enabled?(i.forEach((t=>{let i;e.services[t.item.title||t.item.name]?(i=`{{params.wkid||${e.spatialReference}}}`,p(t,"properties.service.spatialReference.wkid",i)):(i=f(t,"properties.service.spatialReference.wkid"),i.toString().startsWith(r)&&(i=i.toString().substring(15,i.length-2),p(t,"properties.service.spatialReference.wkid",i)))})),e.spatialReference):void i.forEach((e=>{const t=f(e,"properties.service.spatialReference.wkid");t.toString().startsWith(r)&&p(e,"properties.service.spatialReference.wkid",t.toString().substring(15,t.length-2))}))}_splitFilename(e){const t=e.split("/");return{prefix:t.length>1?t.slice(0,t.length-1).join("/"):void 0,suffix:t[t.length-1]}}}.Store;export{g as s}
@@ -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-fa1ceaf9.js";import{l as s}from"./p-65581d83.js";import{g as o}from"./p-427b4593.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.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,{key:"f95d3a2f68deee074ea01d6cc2282be0415f1bf5"},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":"solid";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 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;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}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as e,f as t,h as n,g as i,c as a}from"./p-fa1ceaf9.js";import{l as s}from"./p-65581d83.js";import{g as c,i as r,r as l,t as o,w as p,n as d,x as v,y as g,l as h,v as m}from"./p-1c3c83a5.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-8c6d9b5a.js";const f=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 ${c(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=r.data[i])||void 0===e?void 0:e.categories)||void 0===t?void 0:t.size;if(!(r.data&&i&&n||a))return"";const s=r.data[i];if(!s)return;const{categories:c}=s,l=c.get(n);let o;return o=(null==l?void 0:l.nestedInfos)?g(l,this.infoIndex):l,isNaN(null==o?void 0:o.count)?"":this.intl.formatNumber(o.count)}getTotalFeatureCount(){const e=this.activeLayerInfo.layer.id;if(!r.data||!e)return"";const t=r.data[e];if(!t)return;const{categories:n}=t,i=l(n);let a;if(o(n))a=p(i);else if(d(this.activeLayerInfo)){const e=h(this.activeLayerInfo.layer);a=l(e.categories)[1].count}else a=v(i);return this.intl.formatNumber(a)}get el(){return i(this)}};f.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 u=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,a;const s=m(this.activeLayerInfo),{expanded:r}=this,l=r?null===(e=this.messages)||void 0===e?void 0:e.collapse:null===(t=this.messages)||void 0===t?void 0:t.expand,o=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return n("header",{key:"3e8966360930dd6fbfc0bf3b822704922263f1fa",class:`instant-apps-interactive-legend__header ${c(this.el)}`},n("calcite-action",{key:"c12b32be05c449b5a915d813ae8dd5d8b0a22457",onClick:this.toggleExpanded(),icon:r?"chevron-down":"chevron-up",appearance:"transparent",text:l,label:l,scale:"s"}),n("span",{key:"baba497877c870983107258ef3497950021c3a1a"},n("span",{key:"495b24d9fc1237f9cd841451513a5e2b272ae467",class:"instant-apps-interactive-legend__header-action-container"},n("h3",{key:"dfbb8e1c08b6ce0bac789e983977c284a2b7efb3",class:`esri-widget__heading esri-legend__service-label${o}`,title:null===(i=this.activeLayerInfo)||void 0===i?void 0:i.title},null===(a=this.activeLayerInfo)||void 0===a?void 0:a.title)),this.featureCount&&s?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)}};u.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{f as instant_apps_interactive_legend_count,u as instant_apps_interactive_legend_layer_element_caption}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{c as t,a as r}from"./p-c4160bf7.js";import"./p-a230b270.js";
6
+ import{c as t,a as r}from"./p-d4056c1c.js";import"./p-a230b270.js";
7
7
  /** @license
8
8
  * Copyright 2018 Esri
9
9
  *