@esri/solutions-components 0.8.39 → 0.8.41
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/solution-spatial-ref/resources.json +3 -3
- package/dist/assets/t9n/solution-spatial-ref/resources_en.json +2 -2
- package/dist/assets/t9n/solution-spatial-ref/resources_fr.json +2 -2
- package/dist/assets/t9n/solution-spatial-ref/resources_he.json +2 -2
- package/dist/cjs/_commonjsHelpers-baf43783.js +20 -0
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +3 -2
- package/dist/cjs/buffer-tools_3.cjs.entry.js +3 -2
- package/dist/cjs/calcite-action-pad_2.cjs.entry.js +3 -2
- package/dist/cjs/calcite-alert_4.cjs.entry.js +7 -6
- package/dist/cjs/calcite-block_5.cjs.entry.js +5 -4
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +3 -2
- package/dist/cjs/calcite-flow_6.cjs.entry.js +3 -2
- package/dist/cjs/calcite-pagination.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +9 -8
- package/dist/cjs/card-manager_3.cjs.entry.js +6 -5
- package/dist/cjs/{common-03600219.js → common-7ee7ad73.js} +1 -1
- package/dist/cjs/consent-manager.cjs.entry.js +3 -2
- package/dist/cjs/{core-b459e4f2.js → core-7f0bcc12.js} +1 -1
- package/dist/cjs/crowdsource-manager.cjs.entry.js +3 -2
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +3 -2
- package/dist/cjs/{downloadUtils-839a1425.js → downloadUtils-2e169425.js} +7 -7
- package/dist/cjs/{esri-loader-fce6a9cb.js → esri-loader-a56cbcbe.js} +2 -13
- package/dist/cjs/feature-list.cjs.entry.js +7 -6
- package/dist/cjs/{helpers-7cee3150.js → helpers-95c28cf3.js} +1 -1
- package/dist/cjs/{html2canvas-ef5cae40.js → html2canvas-29c6b9cc.js} +2 -2
- package/dist/cjs/{index.es-dd4d4842.js → index.es-301b8d18.js} +11 -10
- package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +6 -5
- package/dist/cjs/instant-apps-control-panel.cjs.entry.js +3 -2
- package/dist/cjs/instant-apps-create.cjs.entry.js +5 -4
- package/dist/cjs/instant-apps-export.cjs.entry.js +5 -4
- package/dist/cjs/instant-apps-header.cjs.entry.js +3 -2
- package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +5 -4
- package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +4 -3
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +4 -3
- package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +4 -3
- package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +6 -5
- package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +5 -4
- package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +7 -6
- package/dist/cjs/instant-apps-language-translator.cjs.entry.js +7 -6
- package/dist/cjs/instant-apps-measurement.cjs.entry.js +5 -4
- package/dist/cjs/instant-apps-popover.cjs.entry.js +5 -4
- package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +5 -4
- package/dist/cjs/instant-apps-sign-in.cjs.entry.js +5 -4
- package/dist/cjs/instant-apps-splash.cjs.entry.js +5 -4
- package/dist/cjs/{languageSwitcher-1154d55d.js → languageSwitcher-f0bb94fa.js} +1 -1
- package/dist/cjs/{languageUtil-d23251cd.js → languageUtil-f22ce913.js} +1 -1
- package/dist/cjs/layout-manager.cjs.entry.js +3 -2
- package/dist/cjs/{loadModules-4189814e.js → loadModules-36d49819.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{locale-62f4cef2.js → locale-708985a1.js} +2 -2
- package/dist/cjs/{locale-6973733d.js → locale-f6fd03d2.js} +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +6 -5
- package/dist/cjs/{popupUtils-bae7f923.js → popupUtils-36e57a27.js} +2 -2
- package/dist/cjs/public-notification.cjs.entry.js +6 -5
- package/dist/cjs/{purify-4a0e9dfb.js → purify-17c0fc4a.js} +2 -2
- package/dist/cjs/{restHelpersGet-afc74285.js → restHelpersGet-be451f4a.js} +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +10 -350
- package/dist/cjs/solution-contents_3.cjs.entry.js +58 -48
- package/dist/cjs/solution-resource-a09a6fe0.js +145 -0
- package/dist/cjs/{solution-store-c8bada29.js → solution-store-d9f3ea44.js} +8 -10
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +6 -5
- package/dist/cjs/store-manager.cjs.entry.js +17 -13
- package/dist/cjs/templates-f7a3bf48.js +401 -0
- package/dist/cjs/{utils-1de4eaa0.js → utils-31a22d49.js} +1 -1
- package/dist/collection/components/solution-item/solution-item.js +1 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.css +11 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +83 -47
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +25 -24
- package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
- package/dist/collection/components/solution-variables/solution-variables.js +1 -1
- package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
- package/dist/collection/components/store-manager/store-manager.js +11 -13
- package/dist/collection/demos/data/election-outreach.json +2981 -0
- package/dist/collection/demos/solution-item.html +7 -6
- package/dist/collection/demos/solution-spatial-ref.html +10 -4
- package/dist/collection/demos/solution-template-data.html +5 -5
- package/dist/collection/utils/interfaces.ts +0 -2
- package/dist/collection/utils/solution-store.js +6 -8
- package/dist/collection/utils/solution-store.ts +12 -13
- package/dist/collection/utils/templates.js +113 -26
- package/dist/collection/utils/templates.ts +125 -30
- package/dist/collection/utils/test/templates.e2e.js +2 -2
- package/dist/collection/utils/test/templates.e2e.ts +2 -2
- package/dist/components/_commonjsHelpers.js +16 -0
- package/dist/components/core.js +1 -1
- package/dist/components/downloadUtils.js +1 -1
- package/dist/components/esri-loader.js +2 -10
- package/dist/components/html2canvas.js +1 -1
- package/dist/components/index.es.js +1 -1
- package/dist/components/instant-apps-interactive-legend-classic2.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/purify.js +1 -1
- package/dist/components/solution-configuration.js +1 -342
- package/dist/components/solution-item2.js +1 -1
- package/dist/components/solution-resource.js +1 -1
- package/dist/components/solution-spatial-ref2.js +52 -44
- package/dist/components/solution-store.js +6 -8
- package/dist/components/solution-template-data2.js +1 -1
- package/dist/components/solution-variables2.js +1 -1
- package/dist/components/spatial-ref2.js +1 -1
- package/dist/components/store-manager.js +11 -13
- package/dist/components/templates.js +395 -0
- package/dist/esm/_commonjsHelpers-089957fe.js +16 -0
- package/dist/esm/basemap-gallery_7.entry.js +3 -2
- package/dist/esm/buffer-tools_3.entry.js +3 -2
- package/dist/esm/calcite-action-pad_2.entry.js +3 -2
- package/dist/esm/calcite-alert_4.entry.js +7 -6
- package/dist/esm/calcite-block_5.entry.js +5 -4
- package/dist/esm/calcite-combobox_3.entry.js +1 -1
- package/dist/esm/calcite-dropdown-group_2.entry.js +3 -2
- package/dist/esm/calcite-flow_6.entry.js +3 -2
- package/dist/esm/calcite-pagination.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +9 -8
- package/dist/esm/card-manager_3.entry.js +6 -5
- package/dist/esm/{common-8697fccd.js → common-96e3ddb0.js} +1 -1
- package/dist/esm/consent-manager.entry.js +3 -2
- package/dist/esm/{core-4bd4a70f.js → core-6a3c13ac.js} +1 -1
- package/dist/esm/crowdsource-manager.entry.js +3 -2
- package/dist/esm/crowdsource-reporter.entry.js +3 -2
- package/dist/esm/{downloadUtils-97acca92.js → downloadUtils-5fbd8a40.js} +6 -6
- package/dist/esm/{esri-loader-3080dcc0.js → esri-loader-781d738a.js} +2 -10
- package/dist/esm/feature-list.entry.js +7 -6
- package/dist/esm/{helpers-7c88b974.js → helpers-3d53560f.js} +1 -1
- package/dist/esm/{html2canvas-fd387d87.js → html2canvas-6443b68e.js} +1 -1
- package/dist/esm/{index.es-ee5497bc.js → index.es-66571353.js} +6 -5
- package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +6 -5
- package/dist/esm/instant-apps-control-panel.entry.js +3 -2
- package/dist/esm/instant-apps-create.entry.js +5 -4
- package/dist/esm/instant-apps-export.entry.js +5 -4
- package/dist/esm/instant-apps-header.entry.js +3 -2
- package/dist/esm/instant-apps-interactive-legend-classic.entry.js +4 -3
- package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +4 -3
- package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +4 -3
- package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +4 -3
- package/dist/esm/instant-apps-interactive-legend.entry.js +6 -5
- package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +5 -4
- package/dist/esm/instant-apps-language-switcher.entry.js +7 -6
- package/dist/esm/instant-apps-language-translator.entry.js +7 -6
- package/dist/esm/instant-apps-measurement.entry.js +5 -4
- package/dist/esm/instant-apps-popover.entry.js +5 -4
- package/dist/esm/instant-apps-scoreboard.entry.js +5 -4
- package/dist/esm/instant-apps-sign-in.entry.js +5 -4
- package/dist/esm/instant-apps-splash.entry.js +5 -4
- package/dist/esm/{languageSwitcher-0f693a04.js → languageSwitcher-b665499d.js} +1 -1
- package/dist/esm/{languageUtil-de206286.js → languageUtil-a3e6adf6.js} +1 -1
- package/dist/esm/layout-manager.entry.js +3 -2
- package/dist/esm/{loadModules-43119ac8.js → loadModules-9c062d08.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{locale-42369411.js → locale-28d48640.js} +1 -1
- package/dist/esm/{locale-70630b7c.js → locale-b4e7d56f.js} +2 -2
- package/dist/esm/map-select-tools_3.entry.js +6 -5
- package/dist/esm/{popupUtils-98ad70f3.js → popupUtils-4a91aa2a.js} +2 -2
- package/dist/esm/public-notification.entry.js +6 -5
- package/dist/esm/{purify-caded4cd.js → purify-72515357.js} +1 -1
- package/dist/esm/{restHelpersGet-dab84057.js → restHelpersGet-5c822bcd.js} +1 -1
- package/dist/esm/solution-configuration.entry.js +7 -347
- package/dist/esm/solution-contents_3.entry.js +58 -48
- package/dist/esm/{solution-resource-a2fff3bf.js → solution-resource-3108caf7.js} +1 -1
- package/dist/esm/{solution-store-30a19a45.js → solution-store-1c36ce1d.js} +8 -10
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +6 -5
- package/dist/esm/store-manager.entry.js +17 -13
- package/dist/esm/templates-824ea028.js +395 -0
- package/dist/esm/{utils-9bb48951.js → utils-5484fcbf.js} +1 -1
- package/dist/solutions-components/demos/data/election-outreach.json +2981 -0
- package/dist/solutions-components/demos/solution-item.html +7 -6
- package/dist/solutions-components/demos/solution-spatial-ref.html +10 -4
- package/dist/solutions-components/demos/solution-template-data.html +5 -5
- package/dist/solutions-components/{p-3eb49703.js → p-00291b93.js} +3 -3
- package/dist/solutions-components/p-0cd87dca.entry.js +6 -0
- package/dist/solutions-components/p-13404ad7.entry.js +6 -0
- package/dist/solutions-components/{p-bf27cd5f.js → p-1c3c83a5.js} +1 -1
- package/dist/solutions-components/p-1e6c6ec4.entry.js +6 -0
- package/dist/solutions-components/p-219f209e.entry.js +6 -0
- package/dist/solutions-components/{p-b1abf15c.entry.js → p-2467b476.entry.js} +3 -3
- package/dist/solutions-components/p-295f850a.entry.js +6 -0
- package/dist/solutions-components/p-2961c63c.entry.js +6 -0
- package/dist/solutions-components/{p-946ee345.js → p-2afdcdfc.js} +2 -2
- package/dist/solutions-components/p-2d6d44b5.entry.js +6 -0
- package/dist/solutions-components/p-36e199e0.entry.js +6 -0
- package/dist/solutions-components/{p-d27ab863.js → p-3d7cff5e.js} +1 -1
- package/dist/solutions-components/{p-b2f11718.entry.js → p-3e8562b5.entry.js} +1 -1
- package/dist/solutions-components/{p-49250010.js → p-427b4593.js} +1 -1
- package/dist/solutions-components/{p-f1ae51dc.js → p-44fea43a.js} +1 -1
- package/dist/solutions-components/{p-afd2b67b.entry.js → p-4b27da06.entry.js} +1 -1
- package/dist/solutions-components/{p-7fe77355.js → p-5cc6eb18.js} +1 -1
- package/dist/solutions-components/p-61f88049.entry.js +6 -0
- package/dist/solutions-components/{p-d029b513.js → p-65581d83.js} +1 -1
- package/dist/solutions-components/p-6a68306c.js +6 -0
- package/dist/solutions-components/p-6c7a990a.entry.js +6 -0
- package/dist/solutions-components/p-6e6e6d23.entry.js +6 -0
- package/dist/solutions-components/p-7696af8e.entry.js +6 -0
- package/dist/solutions-components/{p-7afca6b4.js → p-7d1af07b.js} +1 -1
- package/dist/solutions-components/{p-6c7e34c1.entry.js → p-881ead62.entry.js} +2 -2
- package/dist/solutions-components/p-90864588.entry.js +6 -0
- package/dist/solutions-components/{p-59f016a1.js → p-91142a26.js} +1 -1
- package/dist/solutions-components/p-932d6f29.entry.js +6 -0
- package/dist/solutions-components/{p-71c212e6.entry.js → p-969828ab.entry.js} +1 -1
- package/dist/solutions-components/p-986ee365.entry.js +6 -0
- package/dist/solutions-components/p-9e3b0220.entry.js +6 -0
- package/dist/solutions-components/{p-7996f123.js → p-a0300d31.js} +1 -1
- package/dist/solutions-components/p-a8d62b7d.entry.js +6 -0
- package/dist/solutions-components/p-ae50581b.entry.js +6 -0
- package/dist/solutions-components/{p-89f6ff72.js → p-af2c8aa9.js} +1 -1
- package/dist/solutions-components/p-b7123452.entry.js +6 -0
- package/dist/solutions-components/p-b92e9047.entry.js +6 -0
- package/dist/solutions-components/p-bb7463ed.entry.js +6 -0
- package/dist/solutions-components/p-bbc7dd5e.entry.js +6 -0
- package/dist/solutions-components/p-bd871071.entry.js +21 -0
- package/dist/solutions-components/p-c6fd40f9.entry.js +6 -0
- package/dist/solutions-components/{p-42ea2581.js → p-c742acd9.js} +1 -1
- package/dist/solutions-components/p-cb4842dd.entry.js +6 -0
- package/dist/solutions-components/{p-bd459df3.entry.js → p-ccd1e256.entry.js} +2 -2
- package/dist/solutions-components/p-ce4b6931.entry.js +6 -0
- package/dist/solutions-components/p-d2de2b2a.entry.js +6 -0
- package/dist/solutions-components/p-d300430b.entry.js +6 -0
- package/dist/solutions-components/p-d4056c1c.js +6 -0
- package/dist/solutions-components/p-d73b90ab.entry.js +6 -0
- package/dist/solutions-components/{p-4e92c1ba.entry.js → p-dae9d5b3.entry.js} +1 -1
- package/dist/solutions-components/p-df56c019.entry.js +6 -0
- package/dist/solutions-components/p-e80751f4.entry.js +6 -0
- package/dist/solutions-components/{p-132b1138.entry.js → p-e8ed3fa6.entry.js} +2 -2
- package/dist/solutions-components/{p-1d369231.js → p-eed41e1a.js} +1 -1
- package/dist/solutions-components/p-fdd93685.js +22 -0
- package/dist/solutions-components/{p-6acf6c8f.js → p-ff87b9de.js} +1 -1
- package/dist/solutions-components/{p-c9b22653.js → p-ffd41e25.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +0 -2
- package/dist/solutions-components/utils/solution-store.ts +12 -13
- package/dist/solutions-components/utils/templates.ts +125 -30
- package/dist/solutions-components/utils/test/templates.e2e.ts +2 -2
- package/dist/solutions-components_commit.txt +8 -0
- package/dist/types/components/solution-spatial-ref/solution-spatial-ref.d.ts +21 -25
- package/dist/types/components/store-manager/store-manager.d.ts +3 -3
- package/dist/types/components.d.ts +10 -2
- package/dist/types/utils/templates.d.ts +35 -5
- package/package.json +6 -5
- package/dist/cjs/solution-resource-ffe3c333.js +0 -145
- package/dist/solutions-components/p-11b4cd1a.entry.js +0 -6
- package/dist/solutions-components/p-123fcb43.entry.js +0 -6
- package/dist/solutions-components/p-12b84e3b.entry.js +0 -36
- package/dist/solutions-components/p-1a8f7075.entry.js +0 -6
- package/dist/solutions-components/p-2a7111ad.entry.js +0 -6
- package/dist/solutions-components/p-36f5dee9.entry.js +0 -6
- package/dist/solutions-components/p-52bcd209.entry.js +0 -6
- package/dist/solutions-components/p-57961ae0.entry.js +0 -6
- package/dist/solutions-components/p-5b2d9899.entry.js +0 -6
- package/dist/solutions-components/p-5bd6a732.entry.js +0 -6
- package/dist/solutions-components/p-5fb4ddc2.entry.js +0 -6
- package/dist/solutions-components/p-622f33ee.entry.js +0 -6
- package/dist/solutions-components/p-652140aa.entry.js +0 -6
- package/dist/solutions-components/p-6d0404a6.entry.js +0 -6
- package/dist/solutions-components/p-789eb1c2.entry.js +0 -6
- package/dist/solutions-components/p-7a2f1801.entry.js +0 -6
- package/dist/solutions-components/p-7dcf6b16.entry.js +0 -6
- package/dist/solutions-components/p-8413a2ae.entry.js +0 -6
- package/dist/solutions-components/p-941e55f0.entry.js +0 -6
- package/dist/solutions-components/p-9b38e6a0.entry.js +0 -6
- package/dist/solutions-components/p-9c1fbf73.entry.js +0 -6
- package/dist/solutions-components/p-9d82f0e3.entry.js +0 -6
- package/dist/solutions-components/p-9fa1855f.entry.js +0 -6
- package/dist/solutions-components/p-a2390bee.entry.js +0 -6
- package/dist/solutions-components/p-a805c11f.entry.js +0 -6
- package/dist/solutions-components/p-af1c9389.entry.js +0 -6
- package/dist/solutions-components/p-b7d060b0.entry.js +0 -6
- package/dist/solutions-components/p-c4160bf7.js +0 -6
- package/dist/solutions-components/p-da75df88.entry.js +0 -6
- package/dist/solutions-components/p-e0277e0b.entry.js +0 -6
- package/dist/solutions-components/p-e11a4728.entry.js +0 -6
- package/dist/solutions-components/p-e89c05d6.entry.js +0 -6
- /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}from"./p-fa1ceaf9.js";import{s as o,t as n,g as l,y as c}from"./p-67b26725.js";import{g as r}from"./p-e6e50975.js";import{s as d,a as h,c as p}from"./p-8ed6ce4d.js";import{N as u,c as f,d as b}from"./p-813d004f.js";import{o as m}from"./p-ba569f8b.js";import{c as v,s as g,d as y,u as w}from"./p-44bfa87d.js";import{K as k}from"./p-37e40c37.js";import{g as x,l as z}from"./p-
|
6
|
+
import{r as t,c as i,h as e,H as s,g as a}from"./p-fa1ceaf9.js";import{s as o,t as n,g as l,y as c}from"./p-67b26725.js";import{g as r}from"./p-e6e50975.js";import{s as d,a as h,c as p}from"./p-8ed6ce4d.js";import{N as u,c as f,d as b}from"./p-813d004f.js";import{o as m}from"./p-ba569f8b.js";import{c as v,s as g,d as y,u as w}from"./p-44bfa87d.js";import{K as k}from"./p-37e40c37.js";import{g as x,l as z}from"./p-ffd41e25.js";import{a as C}from"./p-996c1ac5.js";import{P as _}from"./p-44fea43a.js";import"./p-b85be429.js";import"./p-db50226e.js";import"./p-f50a294b.js";import"./p-e6c9e6af.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-c1cf3ebc.js";import"./p-00291b93.js";import"./p-3d7cff5e.js";import"./p-a230b270.js";import"./p-a0300d31.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.
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{l as n}from"./p-
|
6
|
+
import{l as n}from"./p-65581d83.js";import{l as o}from"./p-af2c8aa9.js";function i(n){var i,t,a;const l=null!==(i=n.closest("[lang]"))&&void 0!==i?i:null===(a=null===(t=n.shadowRoot)||void 0===t?void 0:t.ownerDocument)||void 0===a?void 0:a.documentElement,c=((null==l?void 0:l.lang)||(null===navigator||void 0===navigator?void 0:navigator.language)||"en").toLowerCase();return o.has(c)?o.get(c):o.has(c.slice(0,2))?o.get(c.slice(0,2)):"en"}function t(n,o){return new Promise(((i,t)=>{const a=`./assets/t9n/${n}/resources_${o}.json`,{href:l}=new URL(a,window.location.href);fetch(l).then((n=>{n.ok?i(n.json()):t()}),(()=>t()))}))}function a(n,o){var i,t;const a=null===(i=null==o?void 0:o.user)||void 0===i?void 0:i.culture,l=null===(t=null===window||void 0===window?void 0:window.navigator)||void 0===t?void 0:t.language,c=n.getLocale();return n.normalizeMessageBundleLocale(a||l||c||"en")}async function l(n,o){const a=n.tagName.toLowerCase(),l=null!=o?o:i(n);let c;try{c=await t(a,l)}catch(n){console.warn(`no locale for ${a} (${l}) loading default locale en.`),c=await t(a,"en")}return[c,l]}async function c(o,i){e(o,await l(o.el),i);const[t]=await n(["esri/intl"]);t.onLocaleChange(function(n,o){return async i=>{const t=await l(n.el,i);e(n,t,o)}}(o,i))}function e(n,o,i){n.messages=o[0],i&&(n.messages=Object.assign(Object.assign({},n.messages),i))}export{a,l as b,i as c,c as g}
|
@@ -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{_ as t}from"./p-
|
6
|
+
import{_ as t}from"./p-00291b93.js";import{l as i}from"./p-ffd41e25.js";
|
7
7
|
/** @license
|
8
8
|
* Copyright 2022 Esri
|
9
9
|
*
|
@@ -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{h as t,r as i,c as e,H as s,g as a,f as n}from"./p-fa1ceaf9.js";import{d as l}from"./p-
|
6
|
+
import{h as t,r as i,c as e,H as s,g as a,f as n}from"./p-fa1ceaf9.js";import{d as l}from"./p-e3196917.js";import{f as o}from"./p-2db55da4.js";import{A as h,B as r,t as c,i as d,u as p}from"./p-67b26725.js";import{d as u,f as m,c as b,r as f,a as g,F as v}from"./p-5eb6219c.js";import{s as x,c as k,a as y,d as w,H as $}from"./p-716a0878.js";import{g as C}from"./p-b85be429.js";import{c as _,u as z,d as I,I as M}from"./p-9c6c056a.js";import{c as V,d as H,g as S}from"./p-6127f49e.js";import{b as L,c as D,s as A,a as E}from"./p-8ed6ce4d.js";import{c as j,d as P,n as F}from"./p-813d004f.js";import{c as O}from"./p-e6c9e6af.js";import{o as T}from"./p-ba569f8b.js";import{c as X,s as R,d as W,u as B}from"./p-44bfa87d.js";import{g as G}from"./p-e6e50975.js";import{V as U}from"./p-5f1fdaf9.js";import{i as N,h as Z,C as K,b as Y,c as q,d as J,e as Q,f as tt}from"./p-57a03a95.js";import{d as it}from"./p-c8d3207e.js";import{i as et}from"./p-f50a294b.js";import{d as st,c as at}from"./p-ebf59857.js";import"./p-db50226e.js";import"./p-b64cc55e.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.
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{b as n}from"./p-
|
6
|
+
import{b as n}from"./p-427b4593.js";import{c as t}from"./p-8c6d9b5a.js";var l,a,e,o;!function(n){n.User="user",n.Translation="translation"}(l||(l={})),function(n){n.String="string",n.TextEditor="textEditor"}(a||(a={})),function(n){n.ExpandCollapse="list-merge",n.SettingIndicator="list-button",n.Popover="information",n.Expanded="chevron-down",n.Collapsed="chevron-right",n.Copy="copy-to-clipboard",n.Breadcrumb="chevron-right",n.DefaultIcon="language",n.Title="title",n.Subtitle="subheading",n.Text="text",n.Description="description",n.Button="button",n.String="string"}(e||(e={})),function(n){n.Light="calcite-mode-light",n.Dark="calcite-mode-dark"}(o||(o={}));const u=t({uiData:null,currentLanguage:null,lastSave:null,saving:!1,currentLocaleSettingItem:null,portalItemResource:null,portalItemResourceT9n:null}),i=u.state,r=u;function c(n,t){var l;if(!n)return;const a=r.get("uiData"),e=new Map;e.set("locales",t),e.set("translatedLanguageLabels",Object.assign({},n.translatedLanguageLabels)),n.content.forEach((n=>{var t,l;const{type:o,label:u,value:i,uiLocation:r}=n,c=null==a?void 0:a.get(n.id);e.set(n.id,{userLocaleData:{type:null!=o?o:null,label:null!=u?u:null,value:null!=i?i:null},expanded:!0,selected:null!==(t=null==c?void 0:c.selected)&&void 0!==t&&t,uiLocation:r,tip:null!==(l=null==n?void 0:n.tip)&&void 0!==l?l:null})}));const o=n.content.map((n=>n.id)),u=o.every((n=>!e.get(n).selected)),i=e.get(o[0]);if(u&&i){const n=null==a?void 0:a.get(o[0]);i.selected=null===(l=null==n?void 0:n.selected)||void 0===l||l}return e}async function s(t){return(await n(t))[0]}function d(){var n;const t=[];return null===(n=i.uiData)||void 0===n||n.forEach(((n,l)=>{"locales"!==l&&"translatedLanguageLabels"!==l&&t.push(l)})),t}function v(n,t){const l=r.get("portalItemResourceT9n");let a;return(null==l?void 0:l[n])||(l[n]={}),a=Object.assign(Object.assign({},l),{[n]:Object.assign(Object.assign({},l[n]),t)}),a}function g(n){var t;return null!==(t=null==n?void 0:n.map((n=>n.locale)))&&void 0!==t?t:[]}function b(){return document.body.classList.contains(o.Dark)}export{e as E,c as a,g as b,d as c,a as d,o as e,l as f,s as g,v as h,b as i,i as l,r 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 t,h as i,g as o}from"./p-fa1ceaf9.js";import{g as n}from"./p-427b4593.js";import"./p-65581d83.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";const e=class{constructor(i){t(this,i),this.popoverTitle=void 0,this.subtitle=void 0,this.content=void 0,this.imgSrc=void 0,this.imgAlt=void 0,this.mediaSrc=void 0,this.index=void 0,this.referenceElement=void 0,this.parent=void 0,this.placement="trailing-start",this.refId=void 0,this.pagination=!1,this.disableAction=!1,this.popoverAction=void 0,this.messages=void 0,this.messageOverrides=void 0}async componentDidLoad(){n(this,this.messageOverrides)}componentDidUpdate(){this.popoverEl.referenceElement=this.referenceElement}render(){var t,o,n,e,a;return i("calcite-popover",{key:"11ee827bbe4001af1b881bbc05728dbff4c2869c",ref:t=>this.popoverEl=t,heading:this.popoverTitle,"auto-close":!0,placement:this.placement,messageOverrides:{close:null===(t=this.messages)||void 0===t?void 0:t.close},"trigger-disabled":!0,"ref-id":this.refId,closable:!0,referenceElement:this.referenceElement,label:this.popoverTitle},i("div",{key:"cec04f88bebd5c920a2449836880dcef516cd3a7",class:"instant-apps-popover__content"+(this.disableAction?" instant-apps-popover--action-disabled":"")},this.disableAction?null:i("calcite-action",{key:"popover-action",class:"instant-apps-popover__action",onClick:this.popoverAction,icon:"rtl"===document.dir?"chevron-right":"chevron-left",compact:!0,"text-enabled":!0,text:(null===(o=this.messageOverrides)||void 0===o?void 0:o.popoverAction)?this.messageOverrides.popoverAction:this.messages.back}),i("section",{key:"b388401688d359725090de56366d264f5b2e05fb"},i("span",{key:"a6fede03a223acdb9770947d81511fbee85c4f8e",id:"subtitle"},this.subtitle),i("p",{key:"c3ccf7e549eaeb61234d5ee53784b054f188788a"},this.content),this.imgSrc?i("img",{key:`iac-popover-img-${this.refId}`,class:"instant-apps-popover__img",src:this.imgSrc,alt:this.imgAlt?this.imgAlt:""}):null),this.pagination?i("div",{key:`iac-popover-footer-${this.index}`,class:"instant-apps-popover__footer"},i("span",null,this.index+1," ",null===(n=this.messages)||void 0===n?void 0:n.of," ",null===(a=null===(e=this.parent)||void 0===e?void 0:e.instantAppsPopovers)||void 0===a?void 0:a.size),this.renderPagination()):null))}renderPagination(){var t,o;const{index:n,messages:e,parent:a}=this,s=n===(null===(o=null===(t=this.parent)||void 0===t?void 0:t.instantAppsPopovers)||void 0===o?void 0:o.size)-1;return i("div",{key:"pagination-button-container",class:"instant-apps-popover__button-container"},0===n?null:i("calcite-button",{key:"prev",onClick:()=>null==a?void 0:a.previous(),appearance:"outline",kind:"neutral"},null==e?void 0:e.back),i("calcite-button",{key:"next",onClick:()=>{s?null==a||a.done():null==a||a.next()}},s?null==e?void 0:e.done:null==e?void 0:e.next))}get el(){return o(this)}};e.style=":host{display:block}.instant-apps-popover__content{display:flex;flex-direction:column;padding:0 5% 5% 5%;max-width:35vw;font-family:var(--calcite-sans-family);font-size:0.875rem}.instant-apps-popover__content .instant-apps-popover__action{align-self:flex-start;--calcite-color-foreground-2:transparent}.instant-apps-popover__content span{display:inline-block;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);margin:0 0 10px 0;font-family:var(--calcite-sans-family)}.instant-apps-popover__content p{line-height:19.12px;margin:0;margin-bottom:10px;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.instant-apps-popover__content .instant-apps-popover__footer span{margin-bottom:0;font-weight:normal;font-size:0.875rem;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:first-child{--calcite-color-foreground-3:transparent}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:last-child{margin-left:5px}.instant-apps-popover__content .instant-apps-popover__img{width:100%;margin-bottom:10px}.instant-apps-popover__content.instant-apps-popover--action-disabled{padding:5%}.instant-apps-popover__content.instant-apps-popover--action-disabled #subtitle{margin:0 0 10px 0}";export{e as instant_apps_popover}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{e as s}from"./p-
|
6
|
+
import{e as s}from"./p-6a68306c.js";const a=async(a,t)=>(s.exports.setDefaultOptions({url:"https://js.arcgis.com/4.30/"}),(await s.exports.loadModules(a,t)).map((s=>s.__esModule&&s.default?s.default:s)));export{a as l}
|
@@ -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{c as r}from"./p-d4056c1c.js";var n={exports:{}};!function(r){var n={Promise:"undefined"!=typeof window?window.Promise:void 0},e="4.25",t="next";function o(r){if(r.toLowerCase()===t)return t;var n=r&&r.match(/^(\d)\.(\d+)/);return n&&{major:parseInt(n[1],10),minor:parseInt(n[2],10)}}function i(r){return void 0===r&&(r=e),"https://js.arcgis.com/".concat(r,"/")}function a(r){return!r||o(r)?function(r){void 0===r&&(r=e);var n=i(r),a=o(r);if(a!==t&&3===a.major){var u=a.minor<=10?"js/":"";return"".concat(n).concat(u,"esri/css/esri.css")}return"".concat(n,"esri/themes/light/main.css")}(r):r}function u(r,n){var e=a(r),t=function(r){return document.querySelector('link[href*="'.concat(r,'"]'))}(e);return t||function(r,n){if(n){var e=document.querySelector(n);e.parentNode.insertBefore(r,e)}else document.head.appendChild(r)}(t=function(r){var n=document.createElement("link");return n.rel="stylesheet",n.href=r,n}(e),n),t}var c={};function d(r,n,e){var t;e&&(t=function(r,n){var e=function(t){n(t.error||new Error("There was an error attempting to load ".concat(r.src))),r.removeEventListener("error",e,!1)};return r.addEventListener("error",e,!1),e}(r,e));var o=function(){n(r),r.removeEventListener("load",o,!1),t&&r.removeEventListener("error",t,!1)};r.addEventListener("load",o,!1)}function f(){return document.querySelector("script[data-esri-loader]")}function s(){var r=window.require;return r&&r.on}function v(r){void 0===r&&(r={});var e={};[c,r].forEach((function(r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}));var t=e.version,o=e.url||i(t);return new n.Promise((function(r,n){var i=f();if(i){var a=i.getAttribute("src");a!==o?n(new Error("The ArcGIS API for JavaScript is already loaded (".concat(a,")."))):s()?r(i):d(i,r,n)}else if(s())n(new Error("The ArcGIS API for JavaScript is already loaded."));else{var c=e.css;c&&u(!0===c?t:c,e.insertCssBefore),d(i=function(r){var n=document.createElement("script");return n.type="text/javascript",n.src=r,n.setAttribute("data-esri-loader","loading"),n}(o),(function(){i.setAttribute("data-esri-loader","loaded"),r(i)}),n),document.body.appendChild(i)}}))}function l(r){return new n.Promise((function(n,e){var t=window.require.on("error",e);window.require(r,(function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];t.remove(),n(r)}))}))}r.utils=n,r.loadModules=function(r,n){if(void 0===n&&(n={}),s())return l(r);var e=f(),t=e&&e.getAttribute("src");return!n.url&&t&&(n.url=t),v(n).then((function(){return l(r)}))},r.getScript=f,r.isLoaded=s,r.loadScript=v,r.setDefaultOptions=function(r){void 0===r&&(r={}),c=r},r.loadCss=u,Object.defineProperty(r,"__esModule",{value:!0})}(n.exports);export{n as e}
|
@@ -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 i,H as s,g as e,c as a}from"./p-fa1ceaf9.js";import{l as h,g as o}from"./p-ffd41e25.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";const n=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"7fe5ef48d77de087f17498e2e1f3370a069e8629"},i("div",{key:"aca555c687352046a138343cab6f656234069644",ref:t=>{this._basemapElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t,i]=await h(["esri/widgets/BasemapGallery","esri/widgets/BasemapGallery/support/PortalBasemapsSource"]);this.BasemapGallery=t,this.PortalBasemapsSource=i}async _initBaseMapGallery(t){var i;if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const s=new this.PortalBasemapsSource({query:(null===(i=this.basemapConfig)||void 0===i?void 0:i.basemapGroupId)?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await s.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:s})}}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};n.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.facilityChanged=a(this,"facilityChanged",7),this.levelChanged=a(this,"levelChanged",7),this.siteChanged=a(this,"siteChanged",7),this.enabled=void 0,this.floorFilterWidget=void 0,this.mapView=void 0}async mapViewWatchHandler(){await this._initFloorFilter(this.mapView)}async enabledWatchHandler(){this.enabled?await this._initFloorFilter(this.mapView):this.enabled||this._destroyWidget()}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"c80a8d46fb48f3789d9fa09c2400faad49e2e236"},i("div",{key:"82919a3ba061a17c8aeaa0d2f6f4f13bc428b519",ref:t=>{this._floorFilterElement=t}}))}async componentDidLoad(){this.mapView&&!this.floorFilterWidget&&await this._initFloorFilter(this.mapView)}async _initModules(){const[t,i]=await h(["esri/widgets/FloorFilter","esri/core/reactiveUtils"]);this.FloorFilter=t,this.reactiveUtils=i}_destroyWidget(){this.floorFilterWidget&&(this.floorFilterWidget.destroy(),this.floorFilterWidget=void 0),this._floorFilterElement&&this._floorFilterElement.remove()}_initContainer(){this._destroyWidget(),this._floorFilterElement=document.createElement("div")}async _initFloorFilter(t){const i=null==t?void 0:t.map;await i.when((()=>{var s,e,a;t&&this.enabled&&this.FloorFilter&&(null==i?void 0:i.floorInfo)&&(this._initContainer(),this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}),null===(s=this._facilityHandle)||void 0===s||s.remove(),this._facilityHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.facility),(t=>{this.facilityChanged.emit(t)})),null===(e=this._levelHandle)||void 0===e||e.remove(),this._levelHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.level),(t=>{this.levelChanged.emit(t)})),null===(a=this._siteHandle)||void 0===a||a.remove(),this._siteHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.site),(t=>{this.siteChanged.emit(t)})))}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],enabled:["enabledWatchHandler"]}}};c.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.fullscreenStateChange=a(this,"fullscreenStateChange",7),this.mapView=void 0,this.fullscreenWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}async componentWillLoad(){await this._initModules()}render(){return i(s,{key:"943217d26f3cf5861c165c3300ba24736ce8f7dc"},i("div",{key:"6c76ebf6e63dab19f24d776cd27cd86b74ea93d0",class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){await this._initFullscreenWidget()}async componentDidLoad(){await this._initFullscreenWidget()}async _initModules(){const[t,i]=await h(["esri/widgets/Fullscreen","esri/core/reactiveUtils"]);this.Fullscreen=t,this.reactiveUtils=i}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?(this.fullscreenWidget=new this.Fullscreen({view:this.mapView}),await this.fullscreenWidget.when((()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=this.reactiveUtils.watch((()=>this.fullscreenWidget.viewModel.state),(t=>this.fullscreenStateChange.emit(t)))}))):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};r.style=":host{display:block}";const d=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"bdd3b848bec1aec6f8c7676f8bab5e9463b16064"},i("div",{key:"d7bb217db6971758ef8774d19d6ac5cfa94a0ddc",ref:t=>{this._legendElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,view:t}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};d.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapInfoChange=a(this,"mapInfoChange",7),this._loadedId="",this.mapInfos=[],this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=null==t?void 0:t.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t){var i;const s=null===(i=this.mapInfos)||void 0===i?void 0:i.filter((i=>i.id===t));t&&(null==s?void 0:s.length)>0&&this._webMapSelected(s[0])}async componentWillLoad(){await this._getTranslations()}render(){return i(s,{key:"86994e2c4d87809c1508b073c3af1c0975c2d81d"},this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){var t;const s="map-picker-expand-toggle";return i("div",{class:"width-full"},i("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",id:s,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},null===(t=this._webMapInfo)||void 0===t?void 0:t.name),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":s},i("span",null,this._translations.switchMap)))}_getToolbar(){return i("div",{class:"display-flex"},i("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return i("div",{class:t?"map-list border-bottom-1":"display-none"},i("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>i("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapInfo=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};l.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.align-center{align-items:center}";const p=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return i(s,{key:"5036a89c6a686b2486ff88dffd06f0bed1ea510e"},i("div",{key:"4c5ede4d9877ff0ca0f16706c99aba354df21fd1",class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};if(this.searchConfiguration){const i=this._getSearchConfig(this.searchConfiguration,this.mapView);t=Object.assign({},i)}this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return(null==s?void 0:s.length)>0?(t.includeDefaultSources=!1,s.forEach((t=>{var s,e;if(t.hasOwnProperty("layer")){const a=t,h=null===(s=a.layer)||void 0===s?void 0:s.id,o=h?i.map.findLayerById(h):null,n=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;o?a.layer=o:n&&(a.layer=new this.FeatureLayer(n))}})),null==s||s.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===(null==i?void 0:i.name)&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t=Object.assign(Object.assign({},t),{includeDefaultSources:!0}),t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}";const u=class{constructor(i){t(this,i),this._widgets=[],this.basemapConfig=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.enableHome=void 0,this.enableSingleExpand=void 0,this.homeZoomToolsSize="m",this.layout="vertical",this.mapView=void 0,this.mapWidgetsSize="m",this.position="top-right",this.searchConfiguration=void 0,this.stackTools=!0,this.toolOrder=void 0,this._hasFloorInfo=!1,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}async mapViewWatchHandler(){await this.mapView.when((()=>{var t,i;this._hasFloorInfo=null===(i=null===(t=this.mapView)||void 0===t?void 0:t.map)||void 0===i?void 0:i.floorInfo}))}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFloorFilterWatchHandler(t){const i=this._floorFilterElement.floorFilterWidget;t?this.mapView.ui.add(i,{position:this.position,index:1}):this.mapView.ui.remove(i)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?"ready"===i.viewModel.state&&i.viewModel.enter():"active"===i.viewModel.state&&i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){this._setZoomToolsSize();const t=this._showTools?"":"display-none",e=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",o=this._showFloorFilter?"":"display-none",n=this._showFullscreen?"":"display-none",c=this.enableSingleExpand?"margin-top-1-2":"",r=this.toolOrder?this.toolOrder:["legend","search","fullscreen","floorfilter"],d=this.stackTools?"box-shadow":"";return i(s,{key:"a1557491ffd833bed11843dbe1bd040a9d2d6b15"},i("div",{key:"8866b3bc6e05fa75605b078e1a3deecaf6392024",class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},this.enableSingleExpand?i("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))):void 0,i("div",{key:"6a4e62ad1afcca39365aa965ffabedf8933051d4",class:`${c} ${d} ${t}`},this._getMapWidgets(r))),i("basemap-gallery",{key:"4edade9536c0912a89f6a9335ae05ae46669e14d",basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),i("map-search",{key:"046d02c1927def025294645c6e855906fabd30aa",class:e,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),i("map-legend",{key:"54575e31073bdc68b611939eb0e619e4479b26f3",class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),i("map-fullscreen",{key:"9a54a22e12c372dd85717f83cf31b4ace80489eb",class:n,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),i("floor-filter",{key:"ffadf501a03186ed6f2fec8754cd758faea5b4dd",class:o,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Expand"]);this.Expand=t}_setZoomToolsSize(){var t,i;const s=null===(t=document.getElementsByClassName("esri-zoom")[0])||void 0===t?void 0:t.children[0],e=null===(i=document.getElementsByClassName("esri-zoom")[0])||void 0===i?void 0:i.children[1];if(s&&e){const t="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";s.style.width=t,s.style.height=t,e.style.width=t,e.style.height=t}}_getMapWidgets(t){const i=this._showFullscreen?"full-screen-exit":"full-screen",s=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return t.map((t=>{var e,a,h,o,n;switch(t){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):this.enableLegend?this._getWidget(t,null===(e=this._legendElement)||void 0===e?void 0:e.legendWidget,!0):void 0;case"search":return this.enableSearch&&this.enableSingleExpand?this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())):this.enableSearch?this._getWidget(t,null===(a=this._searchElement)||void 0===a?void 0:a.searchWidget,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getActionGroup(i,!1,s,(()=>this._expand())):this.enableFullscreen?this._getWidget(t,null===(h=this._fullscreenElement)||void 0===h?void 0:h.fullscreenWidget,!1):void 0;case"basemap":return this.enableBasemap&&this.enableSingleExpand?this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())):this.enableBasemap?this._getWidget(t,null===(o=this._basemapElement)||void 0===o?void 0:o.basemapWidget,!0):void 0;case"floorfilter":return this.enableFloorFilter&&this._hasFloorInfo&&this.enableSingleExpand?this._getActionGroup("urban-model",!1,this._translations.floorFilter,(()=>this._toggleFloorFilter())):this.enableFloorFilter&&this._hasFloorInfo?this._getWidget(t,null===(n=this._floorFilterElement)||void 0===n?void 0:n.floorFilterWidget,!0):void 0}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,s,e,a){return i("div",null,i("calcite-action",{alignment:"center",class:`${"s"===this.mapWidgetsSize?"square-32":"m"===this.mapWidgetsSize?"square-40":"square-48"} ${this.stackTools?"":"margin-bottom-1-2"} border-bottom ${this.stackTools?"":"box-shadow"}`,compact:!1,disabled:s,icon:t,id:t,onClick:a,scale:"s",text:""},i("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),i("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},i("span",null,e)))}_getWidget(t,i,s){if(this._widgets.indexOf(t)<0&&this.mapView&&i){const e=this.toolOrder.indexOf(t),a=new this.Expand({view:this.mapView,content:i});this.mapView.ui.add(s?a:i,{position:this.position,index:e>-1?e+(this.enableHome?2:1):1}),this._widgets.push(t)}}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};u.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-32{width:32px;height:32px}.square-40{width:40px;height:40px}.square-48{width:48px;height:48px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.margin-bottom-1-2{margin-bottom:0.5rem}";export{n as basemap_gallery,c as floor_filter,r as map_fullscreen,d as map_legend,l as map_picker,p as map_search,u as map_tools}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as s,h as i,H as o,g as e}from"./p-fa1ceaf9.js";import{l as n}from"./p-65581d83.js";import{b as a}from"./p-427b4593.js";import{w as r}from"./p-04674a1e.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";const l="instant-apps-scoreboard",d=`${l}--`,c=`${l}__`,p=r.medium[1],h={BASE:l,itemsContainer:`${c}items-container`,items:`${c}items`,item:`${c}item`,label:`${c}item-label`,value:`${c}item-value`,valuePlaceholder:`${c}item-value-placeholder`,position:{bottom:`${c}position--bottom`,side:`${c}position--side`,left:`${c}position--left`,right:`${c}position--right`},mode:{floating:`${c}mode--floating`,pinned:`${c}mode--pinned`}},b=class{constructor(i){t(this,i),this.scoreboardItemsUpdated=s(this,"scoreboardItemsUpdated",7),this.view=void 0,this.items=void 0,this.position="bottom",this.mode="floating",this.itemLimit=6,this.autoDockEnabled=!0,this.geometry=null,this.state="loading",this.messages=void 0,this.itemIndex=0,this.layers=void 0,this.layerViews=void 0,this.isMobile=!1}scoreboardItemsUpdatedHandler(){this.scoreboardItemsUpdated.emit(this.items)}generateUIDs(){this.itemIndex=0,this.items.forEach(this.generateUID())}async storeLayers(){this.state="calculating",await this.view.map.loadAll();const t=this.items.map((t=>{var s;return null===(s=null==t?void 0:t.layer)||void 0===s?void 0:s.id}));this.layers=this.view.map.allLayers.filter((s=>(s=>(t=>!t.isTable)(s)&&(t=>"feature"===t.type||"scene"===t.type)(s)&&(s=>t.indexOf(s.id)>-1)(s))(s))),this.watchLayerVisibility()}async storeLayerViews(){if(this.layers&&this.layers.length>0){this.layers.forEach((t=>t.outFields=["*"]));const t=[];this.layers.forEach((s=>{const i=this.view.whenLayerView(s);t.push(i)}));const s=(await Promise.allSettled(t)).filter((t=>"fulfilled"==t.status&&t.value)).map((t=>t.value)),i=[];s.forEach((t=>{var s;return i.push(null===(s=this.reactiveUtils)||void 0===s?void 0:s.whenOnce((()=>!t.updating)))})),await Promise.all(i),this.layerViews=new this.Collection([...s])}}calculateScoreboardItemValuesFromGeometry(){this.calculateScoreboardItemValues()}async calculateScoreboardItemValues(){if(this.layers&&0===this.layers.length||this.layerViews&&0===this.layerViews.length)return;this.state="calculating";const t=[...this.items],s=[];this.queryStatDefinitions(t,s);const i=await Promise.all(s);this.handleQueryFeaturesResponses(i,t),this.items.length=0,t.forEach((t=>this.items.push(t))),this.state="complete",this.scoreboardItemsUpdatedHandler(),this.initStationaryWatcher()}async componentWillLoad(){var t;new ResizeObserver((()=>{this.itemIndex=0,this.autoDockEnabled&&(this.isMobile=!!this.checkMobile)})).observe(null===(t=this.el)||void 0===t?void 0:t.parentElement);try{this.state="loading",await this.initMessages()}catch(t){return this.state="disabled",Promise.reject()}finally{if(!this.view||!this.items)return this.state="disabled",Promise.reject();try{return await this.initModules(),Promise.resolve()}catch(t){return this.state="disabled",Promise.reject()}}}async componentDidLoad(){var t;if("disabled"!==this.state)try{await(null===(t=this.reactiveUtils)||void 0===t?void 0:t.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready}))),this.generateUIDs(),await this.loadMapResources(),this.storeLayers(),this.initViewUpdateWatcher()}catch(t){this.state="disabled",console.error(`${l}: FAILED TO LOAD MAP RESOURCES`)}}disconnectedCallback(){var t,s,i,o,e,n;this.state="disabled",this.itemIndex=0,null===(t=this.layers)||void 0===t||t.removeAll(),null===(s=this.layers)||void 0===s||s.destroy(),this.layers=null,null===(i=this.layerViews)||void 0===i||i.removeAll(),null===(o=this.layerViews)||void 0===o||o.destroy(),this.layerViews=null,null===(e=this.handles)||void 0===e||e.removeAll(),null===(n=this.handles)||void 0===n||n.destroy(),this.handles=null}async initMessages(){let t;try{return t=(await a(this.el))[0],this.messages=Object.assign(Object.assign({},this.messages),t),Promise.resolve()}catch(t){console.error("FAILED TO LOAD MESSAGES"),Promise.reject()}}async initModules(){try{const[t,s,i,o]=await n(["esri/core/Handles","esri/core/reactiveUtils","esri/core/Collection","esri/intl"]);return this.reactiveUtils=s,this.Collection=i,this.intl=o,this.handles=new t,this.layers=new i,this.layerViews=new i,Promise.resolve()}catch(t){return console.error(t),this.state="disabled",Promise.reject()}}async loadMapResources(){const{map:t}=this.view,s=t;try{return await s.loadAll(),Promise.resolve()}catch(t){return console.error(t),this.state="disabled",Promise.reject()}}generateUID(){return t=>{const s=Math.random(),i=Math.floor(10*Math.random())+11,o=s.toString(i).replace("0.","");t.uid=o}}render(){var t,s;const{state:e}=this,n="disabled"===e,a="loading"===e||"calculating"===e||(null===(t=this.view)||void 0===t?void 0:t.updating)?this.renderProgress():null;return i(o,{key:"b74bee3afeabbef6595bfe6662ad69cf89b189a3",class:`${this.getPositionClass} ${this.getStyleClass}`},n?null:[a,(null===(s=this.items)||void 0===s?void 0:s.length)>0?this.renderBase():null])}renderBase(){return i("div",{key:"instant-apps-scoreboard-base",class:l},this.renderContent())}renderContent(){const{state:t}=this;return"loading"===t?this.renderLoader():"calculating"===t||"complete"===t?this.renderItemsContainer():null}renderItemsContainer(){const[t,s]=this.renderPreviousNextButtons();return i("div",{class:h.itemsContainer},t,this.renderItems(),s)}renderPreviousNextButtons(){var t,s,o;const e=this.getItemLimit(),n=(null===(t=this.items.filter((t=>t.visible)))||void 0===t?void 0:t.length)<=e,a=0===this.itemIndex,r=this.isEnd,l=!!this.isMobile||"bottom"===this.position,d=l?"start":"center",c={previous:l?"chevron-left":"chevron-up",next:l?"chevron-right":"chevron-down"},p=a||n?"blank":c.previous,h=r||n?"blank":c.next,b={previous:a||n,next:r||n},u="transparent",m=this.isMobile?"s":"l",v={previous:null===(s=this.messages)||void 0===s?void 0:s.previous,next:null===(o=this.messages)||void 0===o?void 0:o.next};return[i("calcite-action",{onClick:this.previousItem.bind(this),icon:p,disabled:b.previous,alignment:d,scale:m,appearance:u,text:v.previous,label:v.previous}),i("calcite-action",{onClick:this.nextItem.bind(this),icon:h,disabled:b.next,alignment:d,scale:m,appearance:u,text:v.next,label:v.next})]}renderItems(){const{items:t}=h,s=this.getItemsToDisplay.map((t=>this.renderItem(t)));return i("ul",{class:t},s)}renderItem(t){const{label:s}=t;return i("li",{class:h.item},i("span",{class:h.label,title:s},s),this.renderValue(t))}renderValue(t){var s,o,e;const{displayValue:n}=t,a="disabled"===this.state,r=void 0===n&&"calculating"===this.state,l=n||(null===(s=this.messages)||void 0===s?void 0:s.NA),d=null===(o=this.layers)||void 0===o?void 0:o.find((s=>{var i;return(null===(i=null==t?void 0:t.layer)||void 0===i?void 0:i.id)===s.id})),c=!(null==d?void 0:d.visible),p=r?this.renderValuePlaceholder():a?"":c?i("calcite-icon",{icon:"view-hide",scale:"l",title:null===(e=this.messages)||void 0===e?void 0:e.layerVisibilityOff}):l;return i("span",{class:h.value},p)}renderValuePlaceholder(){return i("span",{class:h.valuePlaceholder})}renderProgress(){return i("calcite-progress",{key:`${d}calcite-progress`,type:"indeterminate"})}renderLoader(){var t;const s=null===(t=this.messages)||void 0===t?void 0:t.loading;return i("calcite-loader",{key:`${d}calcite-loader`,label:s,text:s,scale:"m"})}get getPositionClass(){const{bottom:t,left:s,right:i,side:o}=h.position;return this.isMobile||"bottom"===this.position?t:`${"left"===this.position?s:i} ${o}`}get getStyleClass(){const{floating:t,pinned:s}=h.mode;return this.isMobile?s:"floating"===this.mode?t:s}get checkMobile(){var t,s;const i=null===(s=null===(t=this.el)||void 0===t?void 0:t.parentElement)||void 0===s?void 0:s.offsetWidth;return!isNaN(i)&&i>0&&i<p}get getItemsToDisplay(){const t=this.getItemLimit();return this.items.filter((t=>t.visible)).slice(this.itemIndex,t+this.itemIndex)}get isEnd(){const t=this.getItemLimit(),s=this.items.slice(this.items.length-t).map((t=>t.uid)),i=this.items.slice(this.itemIndex,this.itemIndex+t).map((t=>t.uid));return s.every(((t,s)=>t===i[s]))}previousItem(){this.itemIndex=this.itemIndex-1}nextItem(){this.itemIndex=this.itemIndex+1}queryStatDefinitions(t,s){const i=(t,s)=>{const i=t.createQuery(),o=this.geometry?this.geometry:this.view.extent;return i.outStatistics=[s],i.geometry=o,i};t.forEach((()=>async t=>{var o;const e=null===(o=this.layerViews)||void 0===o?void 0:o.find((s=>{var i;return s.layer.id===(null===(i=null==t?void 0:t.layer)||void 0===i?void 0:i.id)}));if(!e)return;const n=(t=>{const{field:s,operation:i}=t;return{onStatisticField:s,outStatisticFieldName:`${s}_${i}`,statisticType:i}})(t),a=i(e,n),r=e.queryFeatures(a);s.push(r)})())}handleQueryFeaturesResponses(t,s){t.forEach((()=>(t,i)=>{const o=(t=>{const s=t.features[0],{attributes:i}=s;return Object.values(i)[0]})(t),e=null!==o,n=e?this.intl.formatNumber(o,{notation:"compact",compactDisplay:"short"}):null;s[i].displayValue=e?`${n}`:"",s[i].value=o})())}initStationaryWatcher(){var t,s;const i={once:!0,initial:!0},o=()=>{var t;return null===(t=this.reactiveUtils)||void 0===t?void 0:t.when((()=>{var t;return!(null===(t=this.view)||void 0===t?void 0:t.interacting)}),(()=>this.calculateScoreboardItemValues()),i)},e="stationary-watcher-key";(null===(t=this.handles)||void 0===t?void 0:t.has(e))&&this.handles.remove(e),null===(s=this.handles)||void 0===s||s.add((()=>{var t;return null===(t=this.reactiveUtils)||void 0===t?void 0:t.when((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.stationary}),(()=>o()))})(),e)}initViewUpdateWatcher(){return this.reactiveUtils.watch((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.updating}),(()=>{this.reactiveUtils.when((()=>{var t;return!(null===(t=this.view)||void 0===t?void 0:t.updating)}),(()=>this.calculateScoreboardItemValues()),{once:!0,initial:!0})}),{initial:!0})}watchLayerVisibility(){var t,s;if(!this.layers)return;const i="visbilityWatcherKey";null===(t=this.handles)||void 0===t||t.remove(i);const o=[];this.layers.forEach((t=>{const s=async()=>{const s=await this.view.whenLayerView(t);await this.reactiveUtils.whenOnce((()=>!1===(null==s?void 0:s.updating))),this.calculateScoreboardItemValues()},i=this.reactiveUtils.watch((()=>null==t?void 0:t.visible),(async()=>s()));o.push(i)})),null===(s=this.handles)||void 0===s||s.add([...o],i)}getItemLimit(){return this.itemLimit<2||this.itemLimit>6?6:this.itemLimit}get el(){return e(this)}static get watchers(){return{items:["generateUIDs","storeLayers"],layers:["storeLayerViews"],geometry:["calculateScoreboardItemValuesFromGeometry"],layerViews:["calculateScoreboardItemValues"]}}};b.style=":host{display:block;--instant-apps-scoreboard-background-color:var(--calcite-color-foreground-1);--instant-apps-scoreboard-text-color:var(--calcite-color-text-1);--instant-apps-scoreboard-mobile-position-bottom:0;background-color:var(--instant-apps-scoreboard-background-color);color:var(--instant-apps-scoreboard-text-color)}:host .instant-apps-scoreboard{box-sizing:border-box;border:1px solid var(--calcite-color-border-1);box-shadow:0px 3px 15px rgba(0, 0, 0, 0.2);border-radius:3px}:host .instant-apps-scoreboard calcite-loader{--calcite-loader-padding:1rem}:host .instant-apps-scoreboard__items-container{display:flex}:host .instant-apps-scoreboard__items-container calcite-action{height:100%}:host .instant-apps-scoreboard__items,:host .instant-apps-scoreboard__item{box-sizing:border-box;display:flex}:host .instant-apps-scoreboard__items{list-style-type:none;padding-left:0;margin:0;padding-top:1.75%;padding-bottom:1.75%;width:100%}:host .instant-apps-scoreboard__item{flex-direction:column;justify-content:flex-end;align-items:center;padding:1%}:host .instant-apps-scoreboard__item-label{box-sizing:border-box;line-height:24px;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;word-break:break-word;font-size:1rem;font-weight:400;text-align:center}:host .instant-apps-scoreboard__item-value{display:flex;justify-content:center;align-items:center;min-width:32px;min-height:32px;margin-top:5px;font-size:1.5rem;font-weight:900}:host .instant-apps-scoreboard__item-value-placeholder{display:inline-block;width:32px;height:32px;background-color:var(--calcite-color-foreground-3);border-radius:4px}:host(.instant-apps-scoreboard__position--bottom){bottom:0}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__items{display:flex;justify-content:center}:host(.instant-apps-scoreboard__position--bottom) .instant-apps-scoreboard__item{min-width:10vw;vertical-align:top}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating){left:50%;max-width:calc(100% - 30px);transform:translate(-50%, -15px)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:25vw}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){left:unset;bottom:0;transform:unset;width:100%}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{min-width:unset}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{width:100%;justify-content:space-between}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard{display:flex;justify-content:center;align-items:center;width:10vw;overflow-y:auto}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container{flex-direction:column;height:100%;box-sizing:border-box}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items-container calcite-action{height:unset;width:100%}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__items{flex-direction:column;padding:10px}:host(.instant-apps-scoreboard__position--side) .instant-apps-scoreboard__item{padding-top:0.5vh;padding-bottom:0.5vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating){top:15px;left:15px;max-height:calc(100% - 30px)}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--floating) .instant-apps-scoreboard{min-width:10vw;min-height:35vh}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned){top:unset;left:unset;transform:unset;height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard{height:100%}:host(.instant-apps-scoreboard__position--side.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__items-container{justify-content:space-between}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--floating){left:15px}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--floating){left:unset;right:15px}:host(.instant-apps-scoreboard__position--left.instant-apps-scoreboard__mode--pinned){left:0}:host(.instant-apps-scoreboard__position--right.instant-apps-scoreboard__mode--pinned){left:unset;right:0}@media only screen and (min-width: 992px){:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned){bottom:var(--instant-apps-scoreboard-mobile-position-bottom)}:host(.instant-apps-scoreboard__position--bottom.instant-apps-scoreboard__mode--pinned) .instant-apps-scoreboard__item{justify-content:center;min-width:unset;flex-grow:1}}";export{b as instant_apps_scoreboard}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as i,c as t,h as e,H as s,g as a}from"./p-fa1ceaf9.js";import{a as l,l as h,g as n}from"./p-ffd41e25.js";import{e as o,h as r,k as d,l as c,c as p,m as b,n as g,o as f}from"./p-996c1ac5.js";import{a as y,e as v,f as u}from"./p-c1cf3ebc.js";import{s as m}from"./p-c4ddb206.js";import{d as w,a as S}from"./p-00291b93.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-8c6d9b5a.js";import"./p-3d7cff5e.js";import"./p-a230b270.js";import"./p-a0300d31.js";const _=class{constructor(e){i(this,e),this.selectionSetChange=t(this,"selectionSetChange",7),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.locale=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectionLayerIds=[],this.selectLayerView=void 0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._numSelected=0,this._searchDistanceEnabled=!1,this._searchTerm=void 0,this._selectionLoading=!1,this._translations=void 0,this._useLayerFeaturesEnabled=!1}async watchGeometriesHandler(i,t){if(i!==t){const t=0===i.length;if(await this._clearResults(t,t),i.length>0)return this._highlightWithOIDsOrGeoms()}}async mapViewWatchHandler(i,t){i&&i!==t&&await this._init()}async watchSearchConfigurationHandler(i,t){JSON.stringify(i)!==JSON.stringify(t)&&await this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this._searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this._useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(i){this.searchConfiguration=i.detail}async distanceChanged(i){await this._distanceChanged(i.detail)}async unitChanged(i){i.detail.newValue!==i.detail.oldValue&&(this._unit=i.detail.newValue,await this._updateLabel())}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){await this._init()}render(){return e(s,{key:"99818f04f6080010d564269d79ebf5e43904214f"},this._getMapLayerPicker(),e("div",{key:"1edcedfcfef21d9c8398ee84953439538bfab8c2",class:"border-bottom"}),e("div",{key:"4d37d5523d8333fd94acf31ba8d70be775176420",class:"padding-top-sides-1"},e("div",{key:"cf0143a8ff5eb8851ffb960202c003904604bb45",class:"search-widget",ref:i=>{this._searchElement=i}}),e("div",{key:"d187c7f1485c05a9f41070f497888c700ef31867",class:"padding-top-1"},e("map-draw-tools",{key:"416870b7e7f81614166b5381c3024af96a4cfe60",active:!0,editGraphicsEnabled:!this._useLayerFeaturesEnabled,graphics:this._graphics,mapView:this.mapView,onSketchGraphicsChange:i=>{this._sketchGraphicsChanged(i)},pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,ref:i=>{this._drawTools=i}})),this._getBufferOptions(),this._getUseLayerFeaturesOptions(),this._getNumSelected()),e("div",{key:"7e03cc8b0dce515e46e2701427e03d2f177092cc",class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){var i,t;const s=this._searchDistanceEnabled?"search-distance":"div-not-visible",a="number"==typeof(null===(i=this.selectionSet)||void 0===i?void 0:i.distance)?this.selectionSet.distance:this.defaultBufferDistance;return e("div",null,e("div",{class:"padding-top-1 display-flex"},e("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},e("div",{class:"tooltip-container"},this._translations.searchDistance,e("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale.toLowerCase()),icon:"question",id:"search-distance-icon",scale:"s"}))),e("calcite-popover",{closable:!0,label:"",referenceElement:"search-distance-icon"},e("span",{class:"tooltip-message"},this._translations.useSearchDistanceTootip)),e("calcite-switch",{checked:this._searchDistanceEnabled,onCalciteSwitchChange:()=>this._searchDistanceEnabled=!this._searchDistanceEnabled})),e("div",{class:s},e("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:a,geometries:this.geometries,onBufferComplete:i=>{this._bufferComplete(i)},ref:i=>this._bufferTools=i,unit:(null===(t=this.selectionSet)||void 0===t?void 0:t.unit)||this.defaultBufferUnit})))}_getUseLayerFeaturesOptions(){const i=this._useLayerFeaturesEnabled?"div-visible":"div-not-visible";return e("div",null,e("div",{class:"padding-top-1 display-flex"},e("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},e("div",{class:"tooltip-container"},this._translations.useLayerFeatures,e("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale.toLowerCase()),icon:"question",id:"use-layer-features-icon",scale:"s"}))),e("calcite-popover",{closable:!0,label:"",referenceElement:"use-layer-features-icon"},e("span",{class:"tooltip-message"},this._translations.useLayerFeaturesTooltip)),e("calcite-switch",{checked:this._useLayerFeaturesEnabled,onCalciteSwitchChange:()=>{this._useLayerFeaturesEnabledChanged()}})),e("div",{class:i+" padding-top-1"},e("map-layer-picker",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedIds:this.layerViews.map((i=>i.layer.id)),showTables:!1})))}_getNumSelected(){const i=l(this.el),t=i&&"en"===i?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return e("div",{class:"padding-top-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?e("div",null,e("calcite-loader",{class:"info-blue",inline:!0,label:t,scale:"m",type:"indeterminate"})):e("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),e("calcite-input-message",{class:"info-blue",scale:"m"},this._selectionLoading?t:this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())))}_getNameInput(){return e("div",{class:"padding-sides-1 padding-top-1 "+(this.customLabelEnabled?"":"display-none")},e("calcite-label",{class:"font-bold"},this._translations.listName,e("calcite-input",{onInput:()=>{this._selectionLabel=this._labelName.value},placeholder:this._translations.listNamePlaceholder,ref:i=>{this._labelName=i},value:this._selectionLabel||""})))}_getMapLayerPicker(){return e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-label",{class:"font-bold width-full label-margin-0"},this._translations.inputLayer,e("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._inputLayerSelectionChange(i)},selectedIds:this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet?[this.selectionSet.layerView.layer.id]:[],showTables:!1})))}async _initModules(){const[i,t,e,s,a]=await h(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=e,this._geometryEngine=s,this.FeatureLayer=a}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){var i,t,e,s;this.selectionSet&&(this._searchTerm=null===(i=this.selectionSet.searchResult)||void 0===i?void 0:i.name,this._searchResult=this.selectionSet.searchResult,this._selectLayers=this.selectionSet.selectLayers,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs,this._searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this._useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...(null===(t=this.selectionSet)||void 0===t?void 0:t.geometries)||[]],this._graphics=this.geometries.map((i=>new this.Graphic({geometry:i,symbol:"point"===i.type?this.sketchPointSymbol:"polyline"===i.type?this.sketchLineSymbol:this.sketchPolygonSymbol}))),this._selectionLabel=null===(e=this.selectionSet)||void 0===e?void 0:e.label,this._useLayerFeaturesEnabled||await(null===(s=this._drawTools)||void 0===s?void 0:s.updateGraphics()),await o(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}async _initSearchWidget(){if(this.mapView&&this._searchElement){const i=this._getSearchConfig(this.searchConfiguration,this.mapView),t=Object.assign({view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm},i);this._searchWidget=new this.Search(t),this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.on("search-clear",(()=>{const i=this._searchClearLabel();this._clearResults(!1,i)})),this._searchWidget.on("select-result",(i=>{var t,e;if(i.result){this._searchResult=i.result;const s=(null===(e=null===(t=i.source)||void 0===t?void 0:t.layer)||void 0===e?void 0:e.id)&&i.source.layer.id===this.selectLayerView.layer.id,a=s?[i.result.feature.getObjectId()]:void 0;this._workflowType=y.SEARCH,this._updateLabel();const l=[i.result.feature];this._updateSelection(l,s,a),this._drawTools.graphics=l,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}})),await this._searchWidget.when((()=>{var i;this._searchWidget.allPlaceholder=(null===(i=this.searchConfiguration)||void 0===i?void 0:i.allPlaceholder)&&"find address or place"!==this.searchConfiguration.allPlaceholder.toLowerCase()?this.searchConfiguration.allPlaceholder:this._translations.placeholder}))}}_searchClearLabel(){var i;return(null===(i=this._searchResult)||void 0===i?void 0:i.name)&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const e=null==i?void 0:i.sources;return(null==e?void 0:e.length)>0?(i.includeDefaultSources=!1,e.forEach((i=>{var e,s;if(i.hasOwnProperty("layer")){const a=i,l=null===(e=a.layer)||void 0===e?void 0:e.id,h=l?t.map.findLayerById(l):null,n=null===(s=null==a?void 0:a.layer)||void 0===s?void 0:s.url;h?a.layer=h:n&&(a.layer=new this.FeatureLayer(n))}})),null==e||e.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===(null==t?void 0:t.name)&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i=Object.assign(Object.assign({},i),{includeDefaultSources:!0}),i}_initGraphicsLayer(){const i=this._translations.bufferLayer;if(this.mapView){const t=this.mapView.map.layers.findIndex((t=>t.title===i));if(t>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(t);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),m.managedLayers[i]="buffer";const t=this.mapView.map.layers.findIndex((i=>i.title===this._translations.sketchLayer));t>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,t):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}}async _sketchGraphicsChanged(i,t=!1){const e=i.detail.graphics;if(e.length>0&&e[0])if(t||(this._sketchGraphic=e[0]),this._workflowType=this._useLayerFeaturesEnabled?y.SELECT:y.SKETCH,this._workflowType===y.SKETCH&&await this._drawTools.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(e)?e.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=e.reduce(((i,t)=>{var e;return(null===(e=null==t?void 0:t.layer)||void 0===e?void 0:e.objectIdField)?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i}),[]),s=i.detail.useOIDs&&t.length>0;this._updateSelection(e,s,t),s&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){var i;return(null===(i=this._skipGeomOIDs)||void 0===i?void 0:i.length)>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(i){m.removeHandles(),i.length>0&&m.highlightHandles.push(await r(i,this.selectLayerView,this.mapView)),this._numSelected=i.length,this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectionLoading=!0,this._selectedIds=await d(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,e=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),e=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:e})}_geomQuery(i){const t=c(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){var e;this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),m.removeHandles(),(null===(e=this._drawTools)||void 0===e?void 0:e.clear)&&(this._graphics=[],await this._drawTools.clear()),this.selectionSetChange.emit(this._selectedIds.length)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,e){this._selectedIds=t&&e?e:this._selectedIds,this._skipGeomOIDs=t?e:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}async _updateLabel(){var i,t;const e=this._selectionLabel.indexOf(this._translations.sketch)>-1,s=this._selectionLabel.indexOf(this._translations.select)>-1,a=this._selectionLabel.indexOf(null===(i=this._searchResult)||void 0===i?void 0:i.name)>-1,l=this._workflowType===y.SEARCH?null===(t=this._searchResult)||void 0===t?void 0:t.name:this._workflowType===y.SELECT?this._translations.select:this._translations.sketch,h=this._unit?this._unit:this._bufferTools.unit,n=await this._bufferTools.getTranslatedUnit(h),o=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=e||s||a||!this._selectionLabel?`${l} ${o} ${n}`:this._selectionLabel,this._labelName.value=this._selectionLabel}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){const t=i.detail.map((i=>p(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i,this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}))}}async _inputLayerSelectionChange(i){var t;const e=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";this.selectLayerView&&e===this.selectLayerView.layer.id||(this.selectLayerView=await p(this.mapView,e),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(i){i.newValue!==i.oldValue&&(this._distance=i.newValue,await this._updateLabel())}async _selectLayerFeatures(i){this._selectionLoading=!0;const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],b(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))}));let e=!1;t.forEach((i=>{var t;const s=i.geometry;i.symbol="point"===s.type?this.sketchPointSymbol:"polyline"===s.type?this.sketchLineSymbol:"polygon"===s.type?this.sketchPolygonSymbol:void 0,e=(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.hasOwnProperty("objectIdField"))||i.hasOwnProperty("getObjectId")}));const s=this.layerViews[0].layer.title===this.selectLayerView.layer.title&&e;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:s}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};_.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{border-inline-end:1px solid var(--calcite-color-border-2)}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:0.5rem}.icon{--calcite-color-icon-color:var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}';const k=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]}),L=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}async downloadCSV(i,t,e,s=!0){return w(i,t,!0,e,s)}async downloadPDF(i,t,e=!1,s="",a=""){var l;return S(i,t,null===(l=this._labelInfoElement.selectedOption)||void 0===l?void 0:l.value,e,s,a)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return e(s,{key:"7474ef13bc67b7c69b0605239748ec9f1816b3be"},e("calcite-select",{key:"2a6d379cb08aef1cafd5f568438f9981cef26962",disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidLoad(){this._renderOptions()}async _initModules(){const[i]=await h(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="‎"+i.descriptionPDF.labelWidthDisplay+" x "+i.descriptionPDF.labelHeightDisplay+"‏";return this._translations.pdfLabel.replace("{{n}}",i.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",t)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}_renderOptions(){(k.default||k).sort(((i,t)=>{const e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),s=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<s?-1:e>s?1:0})).forEach(((i,t)=>{const e=document.createElement("calcite-option");e.value=i,e.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(e),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(e.selected=!0,this._labelInfoElement.selectedOption=e)}))}get el(){return a(this)}};L.style=":host{display:block}";const P=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this._addEnabled=!0,this._refineSets=[],this._enabledLayerIds=[],this._featuresCollection={},this.addresseeLayer=void 0,this.enabledLayerIds=[],this.locale=void 0,this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=v.ADD,this._refineLayer=void 0}async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){var i,t;return e(s,{key:"5bd1d6b85fc43ca4bfdffefd6a19bbbbd37cc13e"},e("div",{key:"48312843133e3ece11ac8882aad91a570d809472",class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},e("div",{key:"dea13cbbe64fff8dc6dff1ea4816229ba04c6b51",class:"display-flex"},e("calcite-label",{key:"8184e95f8777e72e826d773aa212a32383983a51",class:"font-bold width-full label-margin-0"},e("div",{key:"b59989cfe2676fa520e7d2e23dd178425802536e",class:"display-flex"},this._translations.inputLayer,e("calcite-icon",{key:"05cdb91b52893a36988aee0c15af4aabded7bb1b",class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale.toLowerCase()),icon:"question",id:"refine-input-layer",scale:"s"})),e("map-layer-picker",{key:"c1bc3c6aba428a55b21be6ac5fedbdee881aaa2f",enabledLayerIds:this._enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},ref:i=>{this._layerPicker=i},selectedIds:[this._refineLayer.layer.id],showTables:!1})),e("calcite-popover",{key:"b3d82ec6d85749b4975d4c9ba35855f5dd142413",closable:!0,label:"",referenceElement:"refine-input-layer"},e("span",{key:"191e9702e37240472bbe0deda359c4dd1ca03c17",class:"tooltip-message"},this._translations.inputLayerTip)))),e("div",{key:"30bda6820fced55494db4d6ced4dee1ff20266bf",class:"padding-1"},e("div",{key:"67ec4b94cd37dfe80700c8053fb505170f872fdf",class:"padding-bottom-1"},e("calcite-segmented-control",{key:"707b7e1d20d65abec22727ae3750dd52aa542048",class:"w-100",width:"full"},e("calcite-segmented-control-item",{key:"82e70596aeb5a58d9b04eb5cafd92a4251480bad",checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(v.ADD),value:v.ADD},e("span",{key:"1cd4fba950d8590ec9af113f0eec2a6d29413f9b",class:"font-weight-500"},this._translations.add)),e("calcite-segmented-control-item",{key:"cff45118e731b3bcd5812752919f5fed1b8d8f0e",checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(v.REMOVE),value:v.REMOVE},e("span",{key:"fb603c594f7d71944bf46c11e4aa5f0ae547b560",class:"font-weight-500"},this._translations.remove)))),e("div",{key:"aeb9755c6e854c97045978aa1ea3ec1a32365351"},e("map-draw-tools",{key:"2c4c973d3de9b36c07973f7250dd91e7aab833eb",active:!0,drawMode:u.REFINE,mapView:this.mapView,onDrawRedo:()=>this._redo(),onDrawUndo:()=>this._undo(),onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,redoEnabled:(null===(i=this._refineSelectionSet)||void 0===i?void 0:i.redoStack.length)>0,ref:i=>{this._drawTools=i},undoEnabled:(null===(t=this._refineSelectionSet)||void 0===t?void 0:t.undoStack.length)>0})),e("br",{key:"dd122d761bcc924c7bcaad95342398414674e2a8"}),e("calcite-list",{key:"49986cdfdd61369adf348beaef1a49fdd87c38b9",class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){var t;const e=null===(t=i.detail)||void 0===t?void 0:t.graphics[0].geometry;this._selectFeatures(e)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{var e;const s=null===(e=null==t?void 0:t.layerView)||void 0===e?void 0:e.layer.id;return s&&i.indexOf(s)<0?i.push(s):t.workflowType===y.REFINE&&Object.keys(t.refineInfos).forEach((t=>{i.indexOf(t)<0&&i.push(t)})),i}),[])}async _setRefineSet(i){this.selectionSets.some((t=>{if(t.workflowType===y.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const e={};e[i]={addIds:[],removeIds:[],layerView:await p(this.mapView,i)},t?t.refineInfos=Object.assign(Object.assign({},t.refineInfos),e):(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:y.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:e,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===v.ADD?v.REMOVE:v.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===v.ADD?v.REMOVE:v.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===y.REFINE)return t=i,!0}));let s=0,a=0;return Object.keys(t.refineInfos).forEach((i=>{s+=t.refineInfos[i].addIds.length,a+=t.refineInfos[i].removeIds.length})),[e("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",s.toString()),"non-interactive":!0}),e("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),e("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getTotal(i){const t=g(i);return Object.keys(t).reduce(((i,e)=>i+t[e].ids.length),0)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}async _selectFeatures(i){var t,e;this.selectionLoadingChange.emit(!0),this._featuresCollection[null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id]=[];const s=await b(0,null===(e=this._refineLayer)||void 0===e?void 0:e.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let a=[];Object.keys(s).forEach((i=>{var t;i===(null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id)&&(a=a.concat(s[i]))}));const l=Array.isArray(a)?a.map((i=>{var t;return i.attributes[null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.objectIdField]})):[];await this._updateIds(l,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),m.highlightHandles=await f(this.selectionSets)}_clearHighlight(){m.removeHandles()}async _updateIds(i,t,e,s){let a=!1;const l=this._refineSelectionSet.refineInfos,h=s.layer.id,n={};n[h]={addIds:[],removeIds:[],layerView:s};const o=Object.keys(l).indexOf(h)>-1?l[h]:n[h];if(t===v.ADD)o.addIds=[...new Set([...i,...o.addIds])],o.addIds.length>0&&e.push({ids:i,mode:t,layerView:s}),o.removeIds.length>0&&(o.removeIds=o.removeIds.filter((t=>i.indexOf(t)<0)));else{const l=this.selectionSets.reduce(((t,e)=>(i.forEach((i=>{e.workflowType!==y.REFINE?e.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(e.refineInfos).some((a=>{const l=e.refineInfos[a];if(l.layerView.layer.id===s.layer.id&&l.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);o.removeIds=[...new Set([...l,...o.removeIds])],o.addIds=o.addIds.filter((i=>l.indexOf(i)<0)),o.removeIds.length>0&&e.push({ids:l,mode:t,layerView:s}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==y.REFINE&&t.layerView.layer.id===s.layer.id?(t.selectedIds=t.selectedIds.filter((i=>o.removeIds.indexOf(i)<0)),t.selectedIds.length>0?i.push(t):a=!0):i.push(t),i)),[])}this._refineSelectionSet.refineInfos[h]=o,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}get el(){return a(this)}};P.style=':host{display:block}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.border{outline:1px solid var(--calcite-color-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:var(--calcite-color-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110,110,110,.3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110,110,110,.3)}.display-flex{display:flex}.font-bold{font-weight:bold}.width-full{width:100%}.label-margin-0{--calcite-label-margin-bottom:0}.padding-start-1-2{padding-inline-start:0.5rem}.font-weight-500{font-weight:500}.word-wrap-anywhere{word-wrap:anywhere}';export{_ as map_select_tools,L as pdf_download,P as refine_selection}
|
@@ -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 A}from"./p-
|
6
|
+
import{c as A}from"./p-d4056c1c.js";var B={exports:{}};
|
7
7
|
/*!
|
8
8
|
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
9
9
|
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
@@ -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 e,h as i,f as a,g as s,H as o,d as n,F as l}from"./p-fa1ceaf9.js";import{c,d as r}from"./p-27c68097.js";import{a as d,i as h,h as b,s as p,n as u,d as f,z as v,t as m,e as g,g as w}from"./p-67b26725.js";import{c as y,d as x}from"./p-813d004f.js";import{c as k}from"./p-ebf59857.js";import{c as z,s as C,d as T,u as I}from"./p-44bfa87d.js";import{C as _}from"./p-db50226e.js";import{g as L}from"./p-b85be429.js";import{c as H,a as j,b as S}from"./p-
|
6
|
+
import{r as t,c as e,h as i,f as a,g as s,H as o,d as n,F as l}from"./p-fa1ceaf9.js";import{c,d as r}from"./p-27c68097.js";import{a as d,i as h,h as b,s as p,n as u,d as f,z as v,t as m,e as g,g as w}from"./p-67b26725.js";import{c as y,d as x}from"./p-813d004f.js";import{c as k}from"./p-ebf59857.js";import{c as z,s as C,d as T,u as I}from"./p-44bfa87d.js";import{C as _}from"./p-db50226e.js";import{g as L}from"./p-b85be429.js";import{c as H,a as j,b as S}from"./p-e3196917.js";import{c as A}from"./p-e6c9e6af.js";import{c as D,d as W,I as E,u as F}from"./p-9c6c056a.js";import{g as R}from"./p-e6e50975.js";import{s as $,a as M,c as N}from"./p-8ed6ce4d.js";import{q as B,m as O,d as P,a as U,s as V,h as J,b as q,g as G,k as K,t as X,i as Y,c as Q,f as Z,e as tt,n as et,r as it,j as at,l as st,o as ot,p as nt,L as lt}from"./p-7822e93b.js";import{d as ct,a as rt,c as dt}from"./p-3a862208.js";import{C as ht,S as bt}from"./p-5f0b29d4.js";import{I as pt}from"./p-f6e10506.js";import{g as ut}from"./p-ffd41e25.js";import{s as ft}from"./p-2afdcdfc.js";import{d as vt}from"./p-c1cf3ebc.js";import{E as mt}from"./p-3d7cff5e.js";import"./p-a230b270.js";import"./p-f50a294b.js";import"./p-b64cc55e.js";import"./p-21fd2b18.js";import"./p-23059533.js";import"./p-c8d3207e.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-8c6d9b5a.js";import"./p-a0300d31.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.
|
@@ -44,4 +44,4 @@ function Ut(t,e,i){const{items:a,messages:s}=i,o=a.length,n=B(i,t)+1;return func
|
|
44
44
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
45
45
|
* v2.8.2
|
46
46
|
*/
|
47
|
-
const qt="actions-end",Gt="actions-start",Kt=class{constructor(i){t(this,i),this.calciteListItemChange=e(this,"calciteListItemChange",6),this.calciteListItemRemove=e(this,"calciteListItemRemove",7),this.calciteValueListItemDragHandleBlur=e(this,"calciteValueListItemDragHandleBlur",6),this.pickListItem=null,this.guid=`calcite-value-list-item-${L()}`,this.getPickListRef=t=>this.pickListItem=t,this.handleKeyDown=t=>{" "===t.key&&(this.handleActivated=!this.handleActivated)},this.handleBlur=()=>{this.handleActivated=!1,this.calciteValueListItemDragHandleBlur.emit({item:this.el,handle:this.handleEl})},this.handleSelectChange=t=>{this.selected=t.detail.selected},this.description=void 0,this.disabled=!1,this.deselectDisabled=!1,this.nonInteractive=!1,this.handleActivated=!1,this.icon=null,this.iconFlipRtl=!1,this.label=void 0,this.metadata=void 0,this.removable=!1,this.selected=!1,this.value=void 0}connectedCallback(){c(this),D(this)}disconnectedCallback(){r(this),W(this)}componentWillLoad(){$(this)}componentDidLoad(){M(this)}componentDidRender(){F(this)}async toggleSelected(t){this.pickListItem.toggleSelected(t)}async setFocus(){var t;return await N(this),null===(t=this.pickListItem)||void 0===t?void 0:t.setFocus()}calciteListItemChangeHandler(t){t.detail.item=this.el}renderActionsEnd(){const{el:t}=this;return w(t,qt)?i("slot",{name:qt,slot:bt.actionsEnd}):null}renderActionsStart(){const{el:t}=this;return w(t,Gt)?i("slot",{name:Gt,slot:bt.actionsStart}):null}renderHandle(){const{icon:t,iconFlipRtl:e}=this;if(t===pt.grip)return i("span",{class:{[ht.handle]:!0,[ht.handleActivated]:this.handleActivated},"data-js-handle":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,role:"button",tabindex:"0",ref:t=>this.handleEl=t},i("calcite-icon",{flipRtl:e,icon:"drag",scale:"s"}))}render(){return i(o,{key:"14e426411cb528504d9b0e89d4378b6c22664878",id:this.el.id||this.guid},i(E,{key:"75e7cf666c5aae3e62c21d9160083ca17c926c15",disabled:this.disabled},this.renderHandle(),i("calcite-pick-list-item",{key:"9e82a64e2022bfb5c052112e9e804f98db8c45bb",description:this.description,deselectDisabled:this.deselectDisabled,disabled:this.disabled,label:this.label,metadata:this.metadata,nonInteractive:this.nonInteractive,onCalciteListItemChange:this.handleSelectChange,removable:this.removable,selected:this.selected,value:this.value,ref:this.getPickListRef},this.renderActionsStart(),this.renderActionsEnd())))}get el(){return s(this)}};Kt.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{margin-block-end:1px;box-sizing:border-box;display:flex;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-2);--tw-shadow:0 1px 0 var(--calcite-color-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition:background-color var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}:host *{box-sizing:border-box}calcite-pick-list-item{position:relative;margin:0px;flex-grow:1;--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([active]),:host([selected]){--tw-shadow:0 0 0 1px var(--calcite-color-brand);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.handle{display:flex;cursor:move;align-items:center;justify-content:center;border-style:none;background-color:transparent;padding-block:0px;padding-inline:0.25rem;color:var(--calcite-color-border-input);outline-color:transparent}.handle:hover{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.handle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.handle--activated{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}.handle calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}";const Xt=class{constructor(e){t(this,e),this._loaded=!1,this._useDiffEditor=!1,this.hasChanges=!1,this.hasErrors=!1,this.instanceid="",this.value=""}componentDidLoad(){const t=document.getElementById(`${this.instanceid}-container`);if(t){this._editor=monaco.editor.create(t,{value:this.value,language:"json",theme:"vs",minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1}),this._currentModel=this._editor.getModel(),this._contentChanged=this._currentModel.onDidChangeContent(this._onEditorChange.bind(this));const e=monaco.editor.setModelMarkers,i=this;monaco.editor.setModelMarkers=function(t,a,s){var o,n;t.id===i._currentModel.id&&(i._flagEditorHasErrors(s.length>0),i.hasErrors||(i._flagEditorHasChanges(null===(o=i._currentModel)||void 0===o?void 0:o.canUndo()),(null===(n=i._currentModel)||void 0===n?void 0:n.canUndo())&&i._flagEditorContentChanged()),document.getElementById(`${i.instanceid}-errorFlag`).style.visibility=i.hasErrors?"visible":"hidden"),e.call(monaco.editor,t,a,s)},this._diffEditor=monaco.editor.createDiffEditor(document.getElementById(`${this.instanceid}-diff-container`),{automaticLayout:!0}),this._setDiffModel(),this._loaded=!0,this._toggleUndoRedo()}}async componentWillLoad(){this._initValueObserver(),await this._getTranslations()}render(){return i(o,{key:"160ba6c2961d67add84b4f23b4aacd2213d064b2"},i("div",{key:"bf0a77eed1d206376244526db6a261cce163ca69",id:`${this.instanceid}-editor-container`,class:"editor-container padding-right"},i("div",{key:"65a0f2f69d4b7f9694a6617755c638d9ad19e168",class:"editor-controls"},i("div",{key:"3fccc399a3e2a45fe55a374c869a7a7c7533eafc",class:"editor-buttons"},i("calcite-icon",{key:"5007e48c8ecf9d5a037e062bbb3b5ee3710b18eb",id:`${this.instanceid}-errorFlag`,icon:"exclamation-mark-triangle",title:this._translations.errorFlag,scale:"s",class:"edit-error-flag"}),i("calcite-button",{key:"37f8abf8027e0743e373de473421d06884f61d0b",id:`${this.instanceid}-undo`,color:"blue",appearance:"solid",title:this._translations.undo,onClick:()=>this._undo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"31c88e27793f4e07ccc20df6d6c88fa0d6661977",icon:"undo",scale:"s"})),i("calcite-button",{key:"56a5945e706a5c66044678f768d567286893c7b1",id:`${this.instanceid}-redo`,color:"blue",appearance:"solid",title:this._translations.redo,onClick:()=>this._redo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"b2a2d56e6818ee09be15114fcab357732f9f0c99",icon:"redo",scale:"s"})),i("calcite-button",{key:"63acf48f78d1f9cdcd86c5862e399be2217a16c1",id:`${this.instanceid}-diff`,color:"blue",appearance:"solid",title:this._translations.diff,onClick:()=>this._toggleEditor(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"677f9c42bbb449fb51325a9dd4b60affd8a73cd7",icon:"compare",scale:"s"})),i("calcite-button",{key:"7cf8fac59ad4096ed541bfd1e6454cec70890c72",id:`${this.instanceid}-search`,appearance:"outline",color:"blue",title:this._translations.search,onClick:()=>this._search(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"1e2e4290e7b7254a533a99d85ea2745050b22e55",icon:"search",scale:"s"})),i("calcite-button",{key:"ec656bcb0a64a6ff6a42760710f8067eae18b9a5",id:`${this.instanceid}-reset`,color:"blue",appearance:"solid",disabled:!0,title:this._translations.cancelEdits,onClick:()=>this._reset(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"0210b400f5934c68c45fe61f4bf11d3efca97333",icon:"reset",scale:"s"})))),i("div",{key:"d14efe742fe79b18a436bf522e33924c2a7e72d5",class:"edit-parent"},i("div",{key:"e550bbc5968b71701220a44cba17afa9f5f61c48",id:`${this.instanceid}-container`,class:"json-edit-container"}),i("div",{key:"9778b7229d2f3ec994c8a8d707a7f7b394697823",id:`${this.instanceid}-diff-container`,class:"json-edit-container display-none"}))))}async getEditorContents(){return new Promise(((t,e)=>{try{t(this._currentModel.getValue())}catch(t){e(t)}}))}async prepareForDeletion(){var t,e,i,a,s;null===(t=this._searchBtnHandler)||void 0===t||t.removeEventListener("click",this._search),null===(e=this._cancelEditsBtnHandler)||void 0===e||e.removeEventListener("click",this._reset),null===(i=this._valueObserver)||void 0===i||i.disconnect(),null===(a=this._contentChanged)||void 0===a||a.dispose(),null===(s=this._editor)||void 0===s||s.dispose()}async replaceCurrentSelection(t){const e=this._editor.getSelection();this._editor.executeEdits("",[{range:e,text:t}])}async reset(){return new Promise(((t,e)=>{try{this._reset(),t({success:!0})}catch(t){e(t)}}))}_disableButton(t){var e;null===(e=document.getElementById(t))||void 0===e||e.setAttribute("disabled","")}_enableButton(t){var e;null===(e=document.getElementById(t))||void 0===e||e.removeAttribute("disabled")}_flagEditorContentChanged(){window.dispatchEvent(new CustomEvent("solutionEditorContentChanged",{detail:{id:this.instanceid,contents:this._currentModel.getValue()},bubbles:!0,cancelable:!1,composed:!0}))}_flagEditorHasChanges(t){this.hasChanges!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasChanges",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasChanges=t)}_flagEditorHasErrors(t){this.hasErrors!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasErrors",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasErrors=t)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}_initValueObserver(){this._valueObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"value"===t.attributeName&&t.target[t.attributeName]!==t.oldValue&&this._loaded&&this._currentModel.setValue(this.value)}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}_onEditorChange(){this._toggleUndoRedo()}_redo(){var t;(null===(t=this._currentModel)||void 0===t?void 0:t.canRedo())&&(this._currentModel.redo(),this._toggleUndoRedo())}_reset(){this._currentModel.setValue(this.value),this._toggleUndoRedo()}_search(){this._editor.trigger("toggleFind","actions.find")}_setDiffModel(){this._diffEditor&&this._diffEditor.setModel({original:monaco.editor.createModel(this.value,"json"),modified:this._editor.getModel()})}_toggleEditor(){this._useDiffEditor=!this._useDiffEditor;let t=document.getElementById(`${this.instanceid}-diff-container`),e=document.getElementById(`${this.instanceid}-container`);this._useDiffEditor?(this._setDiffModel(),t.classList.remove("display-none"),e.classList.add("display-none")):(t.classList.add("display-none"),e.classList.remove("display-none"))}_toggleUndoRedo(){var t,e,i,a;(null===(t=this._currentModel)||void 0===t?void 0:t.canUndo())?this._enableButton(`${this.instanceid}-undo`):this._disableButton(`${this.instanceid}-undo`),(null===(e=this._currentModel)||void 0===e?void 0:e.canRedo())?this._enableButton(`${this.instanceid}-redo`):this._disableButton(`${this.instanceid}-redo`),(null===(i=this._currentModel)||void 0===i?void 0:i.canUndo())||(null===(a=this._currentModel)||void 0===a?void 0:a.canRedo())?this._enableButton(`${this.instanceid}-reset`):this._disableButton(`${this.instanceid}-reset`)}_undo(){var t;(null===(t=this._currentModel)||void 0===t?void 0:t.canUndo())&&(this._currentModel.undo(),this._toggleUndoRedo())}static get assetsDirs(){return["assets"]}get el(){return s(this)}};Xt.style=":host{display:block}.editor-container{position:relative;height:100%}.editor-controls{height:2.75rem;padding-right:0.5rem;background-color:#F4F4F4}.editor-buttons{float:right}html[dir=rtl] .editor-buttons{float:left}.edit-error-flag{padding-top:0.5rem;color:red;visibility:hidden}.edit-button{padding-inline-start:0.5rem}.editor-text{width:100%;overflow-y:auto;background-color:#FFFFFF}.edit-width{width:100%}.edit-parent{box-sizing:border-box;width:100%;height:calc(100% - 46px)}.json-edit-container{height:100%;width:100%;border:1px #808080 solid}.padding-right{padding-inline-end:0.125rem}.btn{margin-bottom:1rem;display:flex;align-content:center;height:25px;width:120px}.select-ctrl{margin-bottom:1rem}.all-edits{margin-top:4rem}.floating-title{font-size:2rem;z-index:100;position:absolute;left:0.5rem;pointer-events:none}.floating-title-button{pointer-events:auto}.json-editor-position1{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:100%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2a{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2b{position:absolute;right:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}";const Yt=class{constructor(e){t(this,e),this.itemId="",this.itemDetails={accessInformation:"",description:"",licenseInfo:"",snippet:"",tags:[],title:""},this.itemEdit=void 0,this._translations=void 0,this.thumbnail=void 0,this.thumbnailContainer=void 0}async componentWillLoad(){return this._getTranslations()}async componentWillRender(){return this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit&&(this.itemDetails=this.itemEdit.item,this.itemType=this.itemDetails.type),Promise.resolve()}render(){return i(o,{key:"d4443b28db9314e9c6976d97af02e7af14d2a5ff"},i("div",{key:"bd2969f299df5fab6bab10a6cd6dbe7c7213aba4",class:"parent-container"},i("div",{key:"d7226027bddc89eb4ff89899ee45728534331a5d",class:"inputBottomSeparation"},i("calcite-input",{key:"9fcd5e9c9d5fe7ac652fff4fa06801fec240380f",id:"item-title",value:this.itemDetails.title})),i("div",{key:"9542faf04236ec293eff1f1abf0667ee4d26ab45",class:"inputBottomSeparation"},i("input",{key:"9a431fef50c9be4f084b33003c6be4cab65a7da0",accept:".jpg,.gif,.png,image/jpg,image/gif,image/png",class:"display-none",onChange:t=>this._updateThumbnail(t),ref:t=>this.browseForThumbnail=t,type:"file"}),i("button",{key:"9ed82a0e807acd0344bd52bcef653728419d3fc1",class:"font-size--3 btn-link inline-block trailer-quarter",onClick:()=>this._getThumbnail()},i("svg",{key:"230d6a270cd61f4785b7f39e951e996a7b37a1ca",class:"icon-inline icon-inline--on-left",height:"16",viewBox:"0 0 16 16",width:"16"},i("path",{key:"96a6c77691e152072aa0de03f63d8ec82f1ca051",d:"M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"})),this._translations.editThumbnail),i("div",{key:"de04396607c0a61eb1e13bb56581aae9e939b286",class:"flex"},i("div",{key:"3df8a6cde94bc275b85db55375aaa351453c46fb",class:"img-container",ref:t=>this.thumbnailContainer=t},i("img",{key:"a5084eff2ebee0514c5cac6acf4e1b8dcaaf47d5",class:"scale-down",height:"133",id:"item-thumbnail",ref:t=>this.thumbnail=t,width:"200"})),i("div",{key:"73199d7582082575282f36ecb6afed3ee6bd900e",class:"snippet-count-container"},i("calcite-input",{key:"7aa7c61d42be36c237c6bd9b72e4ec24ef6dc07d",id:"item-snippet",maxLength:250,type:"textarea",value:this.itemDetails.snippet}),i("label",{key:"9ae2f293b2cb64a475a0969b7e00951a1b55e251",class:"font-size--3",id:"item-snippet-count",ref:t=>this.itemSnippetCount=t})))),i("calcite-label",{key:"98cf6dd0f1f53e15c857baeb4f3a580586935762"},this._translations.description,i("label",{key:"2f54c0fd6d75e4b08e74cf5b30d9794d0375a267",id:"item-description-label"},i("calcite-input",{key:"91cf40b10f1bed0cd4bc83a988d9a4151ddec2e6",id:"item-description",type:"textarea",value:this.itemDetails.description}))),i("calcite-label",{key:"4261ff6e21385fb681cb6a52dbaa8e3d75973d8b"},this._translations.tags,i("label",{key:"cde48f34fd18fe530dea6be06c8fb5e602048266",id:"item-tags-label"},i("calcite-input",{key:"e11931c90df113bd512bab39be092257ffd92e42",id:"item-tags",value:(this.itemDetails.tags&&Array.isArray(this.itemDetails.tags)?this.itemDetails.tags:[this.itemDetails.tags]).join(",")}))),"Group"!==this.itemType?i("calcite-label",null,this._translations.credits,i("label",{id:"item-credits-label"},i("calcite-input",{id:"item-credits",value:this.itemDetails.accessInformation}))):null,"Group"!==this.itemType?i("calcite-label",null,i("label",{id:"item-terms-label"},this._translations.termsOfUse,i("calcite-input",{id:"item-terms",type:"textarea",value:this.itemDetails.licenseInfo}))):null))}componentDidRender(){this._loadThumb()}inputReceivedHandler(t){switch(t.target.id){case"item-title":this.itemDetails.title=t.target.value,this._updateStore();break;case"item-snippet":t.target.value.length>250&&(t.target.value=t.target.value.substring(0,250)),this.itemDetails.snippet=t.target.value,this._updateLengthLabel(this.itemDetails.snippet),this._updateStore();break;case"item-description":this.itemDetails.description=t.target.value,this._updateStore();break;case"item-tags":this.itemDetails.tags=t.target.value,this._updateStore();break;case"item-credits":this.itemDetails.accessInformation=t.target.value,this._updateStore();break;case"item-terms":this.itemDetails.licenseInfo=t.target.value,this._updateStore()}}_getThumbnail(){this.browseForThumbnail.click()}_loadThumb(){var t;this.thumbnail&&(null===(t=this.itemEdit)||void 0===t?void 0:t.thumbnail)?(this.thumbnail.src=URL.createObjectURL(this.itemEdit.thumbnail),this.thumbnailContainer.classList.remove("empty-box"),this.thumbnail.classList.remove("display-none")):(this.thumbnailContainer.classList.add("empty-box"),this.thumbnail.classList.add("display-none"))}_updateLengthLabel(t){this.itemSnippetCount.innerText=this._translations.snippetCountPattern.replace("{{n}}",t.length.toString())}_updateStore(){this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit.item=this.itemDetails,ft.setItemInfo(this.itemEdit)}_updateThumbnail(t){const e=t.target.files;e&&e[0]&&this.thumbnail&&(this.thumbnail.src=URL.createObjectURL(e[0]),this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit.thumbnail=e[0],ft.replaceItemThumbnail(this.itemEdit))}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}};Yt.style=".inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.icon-inline--on-left,.icon-inline--on-right{display:inline;vertical-align:middle;margin-inline-end:0.375rem;fill:#0079c1}.scale-down{-o-object-fit:scale-down;object-fit:scale-down}.img-container{display:inline;margin-inline-end:1rem;max-width:363px}.summary-count-container{display:inline;flex-grow:1;margin-inline-start:0.75rem}.snippet-count-container{width:calc(100vw - 363px)}.parent-container{max-width:100%;padding:1rem}label{position:relative;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem;display:block;min-width:-moz-min-content;min-width:min-content}";const Qt=class{constructor(e){t(this,e),this.groupId="",this._translations=void 0,this.sharing=[]}itemIdWatchHandler(){const t=ft.getItemInfo(this.groupId);this.sharing=t.groupDetails}async componentWillLoad(){return this._getTranslations()}render(){return i(o,{key:"7042ab9382712488f9184b305e417dd93379422f"},i("div",{key:"00baf7fac31f03b249592eb8603a74d6f93f2615",class:"container-border"},i("calcite-label",{key:"5328280b6ee86819366800e43eda0c44b55ca277"},this._translations.groupInfo),this._renderItems(this.sharing)))}async getShareInfo(){return this.sharing}_renderItems(t){return t&&t.length>0?t.map((t=>i("calcite-label",{layout:"inline"},i("calcite-switch",{checked:t.shareItem,id:t.id,name:"setting",onCalciteSwitchChange:t=>this._updateItem(t),scale:"m",value:"enabled"}),i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title)))):null}_updateItem(t){const e=t.target.id;this.sharing=this.sharing.map((i=>{if(i.id===e){i.shareItem=t.target.checked;const a=ft.getItemInfo(e);if(i.shareItem)a.groups?a.groups.indexOf(this.groupId)<0&&a.groups.push(this.groupId):a.groups=[this.groupId];else if(a.groups){const t=a.groups.indexOf(this.groupId);t>-1&&a.groups.splice(t,1)}ft.setItemInfo(a)}return i}))}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{groupId:["itemIdWatchHandler"]}}};Qt.style=":host{display:block}.container-border{padding:1rem}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const Zt=class{constructor(i){t(this,i),this.organizationVariableSelected=e(this,"organizationVariableSelected",7),this.value="",this._organizationVariables=[],this._translations=void 0}valueWatchHandler(){this._organizationVariables=JSON.parse(this.value)}async componentWillLoad(){return this._getTranslations()}render(){return i(o,{key:"a4456905e1abde8eca22dfb6f3da81959d509b75"},i("div",{key:"8fc37e2a59237ed0cca05b096f901a82da696151"},i("h4",{key:"7bdd9e95f37297c51778a866542517048622e5ca",class:"org-var-header"},this._translations.orgVariables)),i("div",{key:"10bfcebd83ddc363f04149a03298b0c5247fd265",class:"container-border"},i("calcite-tree",{key:"1d168ebbceaf566fb8f4ddea85acba39c08bbd53",id:"variable-label"},this._renderHierarchy(this._organizationVariables))))}_renderHierarchy(t){return t.map((t=>i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.organizationVariableSelected.emit({itemId:t,value:e})}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{value:["valueWatchHandler"]}}};Zt.style=":host{display:block}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";const te=class{constructor(e){t(this,e),this._removedResources={},this.authentication=void 0,this.itemId="",this.resourceFilePaths=[],this.resources=[],this._translations=void 0}itemIdWatchHandler(){const t=ft.getItemInfo(this.itemId);this.resourceFilePaths=t.resourceFilePaths,this.resources=t.resources.map((t=>t.substring(t.lastIndexOf("/")+1)))}componentWillLoad(){return this._getTranslations()}render(){const t=this._hasValidResources();return i(o,{key:"c36fddfce9c4c97b281281ec11dfa017d496141e"},i("div",{key:"e1166173669689e9acee92cc7e53747ebcec0c09",class:"resource-item"},i("div",{key:"86c8e1d498d7b84e9587cdcf4a3bb971fc1ecaad",class:"margin-bottom-1"},i("calcite-button",{key:"f382275e75efeb5beadef582ddd343a283f014e2",appearance:"solid",class:"resource-button",color:"blue",onClick:()=>this._addNewResource()},this._translations.addResource),i("calcite-button",{key:"c487e618472b047f8db71e8989f849c844682080",appearance:"solid",color:"blue",disabled:!t,onClick:()=>this._downloadAll()},this._translations.downloadAll)),i("div",{key:"08733ba234cba9b5ea19455256fa961d23ae933b",class:"resources-container",style:{display:t?"inherit":"none"}},this._renderResourceList())))}_renderResourceList(){return i("calcite-value-list",{multiple:!0},this.resourceFilePaths.reduce(((t,e)=>(e.type!==mt.Thumbnail&&t.push(this._renderResource(e)),t)),[]))}_renderResource(t){const e=t.updateType===vt.Remove;return i("calcite-value-list-item",{class:e?"disabled":"",label:t.folder?t.folder+"/"+t.filename:t.filename,nonInteractive:!0,value:t.url},i("calcite-action-group",{"expand-disabled":"true",layout:"horizontal",slot:"actions-end"},i("calcite-action",{disabled:e,icon:"download",label:this._translations.download,onClick:()=>this._download(t.url,t.filename),scale:"m",text:this._translations.download,title:this._translations.download}),i("calcite-action",{disabled:e,icon:"upload-to",label:this._translations.update,onClick:()=>this._upload(t),scale:"m",text:this._translations.update,title:this._translations.update}),i("calcite-action",{disabled:e,icon:"trash",label:this._translations.delete,onClick:()=>this._delete(t),scale:"m",text:this._translations.delete,title:this._translations.delete}),e?i("calcite-action",{icon:"reset",label:this._translations.reset,onClick:()=>this._reset(t.filename),scale:"m",text:this._translations.reset,title:this._translations.reset}):i("div",{class:"display-none"})))}_delete(t){t.updateType=vt.Remove,this.resourceFilePaths=[...this.resourceFilePaths],this._updateStore()}_reset(t){this.resourceFilePaths=this.resources.some((e=>e===t))?this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=vt.None),e))):this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=vt.Add),e))),this._updateStore()}_downloadAll(){this.resourceFilePaths.forEach((t=>{this._download(t.url,t.filename)}))}_download(t,e){t.startsWith("blob")?this.downloadFile(t,e):this.fetchAndDownload(`${t}?token=${this.authentication.token}`,e)}downloadFile(t,e){const i=document.createElement("a");i.href=t,i.download=e,i.target="_blank",i.click()}_hasValidResources(){return this.resourceFilePaths.some((t=>t.url.indexOf("_info_thumbnail")<0))}async fetchAndDownload(t,e){const i=await fetch(t),a=await i.blob(),s=URL.createObjectURL(a);this.downloadFile(s,e)}_upload(t){const e=document.createElement("input");e.classList.add("display-none"),e.onchange=this._updateResource.bind(this,t),e.type="file",e.click()}_addNewResource(){const t=document.createElement("input");t.classList.add("display-none"),t.onchange=this._add.bind(this),t.type="file",t.click()}_updateResource(t,e){const i=e.target.files;i&&i[0]&&(t.blob=i[0],t.updateType=vt.Update,this._updateStore())}_add(t){const e=t.target.files;if(e&&e[0]){const t=URL.createObjectURL(e[0]),i=e[0].name;this.resourceFilePaths.some((e=>e.filename===i&&e.url===t))||(this.resourceFilePaths=[...this.resourceFilePaths,{url:t,type:mt.Data,folder:void 0,filename:i,blob:e[0],updateType:vt.Add}],this._updateStore())}}_updateStore(){const t=ft.getItemInfo(this.itemId);t.resourceFilePaths=this.resourceFilePaths,ft.setItemInfo(t)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};te.style=":host{display:block}.resource-item{padding:1rem}.resource-button{margin-inline-end:1rem}.resource-progress{padding-top:1rem}.resources-container{border:1px #808080 solid}.margin-bottom-1{margin-bottom:1rem}";const ee=class{itemIdWatchHandler(){this._initializing=!0,this.value=JSON.stringify("data"===this.instanceid?ft.getItemInfo(this.itemId).data:ft.getItemInfo(this.itemId).properties,null,2)}constructor(e){t(this,e),this._initializing=!1,this.instanceid="",this.itemId="",this.organizationVariables="",this.solutionVariables="",this.varsOpen=!0,this._translations=void 0,this.value="",window.addEventListener("solutionEditorContentChanged",(t=>{if(this.itemId){const{id:e,contents:i}=t.detail,[a,s]=e.split("|");if(a==this.itemId&&s===this.instanceid){if(!this._initializing&&i.length>0){const t=ft.getItemInfo(a);"data"===s?t.data=JSON.parse(i):t.properties=JSON.parse(i),ft.setItemInfo(t)}this._initializing=!1}}}))}componentWillLoad(){return this._getTranslations()}render(){return i(o,{key:"f6c478a45be7ba02a79446dca5a12ecb7cfaf817"},i("div",{key:"d268f063606f2d0a0dfbe76f0ea907074ac91c60",class:"solution-data-container"},i("calcite-shell",{key:"170f35aa82ad4e4fbd7e111b558417712396a44d",class:"light var-container",dir:"ltr"},i("calcite-panel",{key:"ada2da8d5240d9904cd9021c9573eee5bd8fe6a4",class:"json-editor"},i("div",{key:"51001e6bcf73ed23d6c76f5d9c17a66b5cbd1d05",class:"solution-data-child-container calcite-match-height"},i("json-editor",{key:"4390b6ff57b3d6341a8c984e8393badf4122df2a",class:"solution-data-editor-container",instanceid:this.itemId+"|"+this.instanceid,value:this.value}))),i("calcite-shell-panel",{key:"866f4349e9ca6f5e8120479997248c2962c18b90","height-scale":"l",position:"end",slot:"contextual-panel","width-scale":"xs"},i("div",{key:"adb11719b67d10a9a4da50d79ac23eadc68544a7",class:this.varsOpen?"solution-data-child-container":"solution-data-child-container-collapsed"},i("calcite-button",{key:"c6a7365e101045ad0f30700e6ba296ff62f0942d",appearance:"transparent",class:"collapse-btn","icon-start":this.varsOpen?"chevrons-right":"chevrons-left",id:"collapse-vars",onClick:()=>this._toggleVars(),scale:"s",title:this.varsOpen?this._translations.collapse:this._translations.expand}),i("div",{key:"76b05d456a9cafd25af16e3848e453ccfda5f1bc",class:this.varsOpen?"org-vars":"org-vars display-none",id:"orgVars"},i("solution-organization-variables",{key:"4b2df6867414d5a6e4e9423b2133196dfd85b3bd",value:this.organizationVariables})),i("div",{key:"eb5201a82e27a52e0a4f9c38cdc9db3f0c1173d8",class:this.varsOpen?"sol-vars":"sol-vars display-none",id:"solVars"},i("solution-variables",{key:"00dda00409364b66e092e9ec304524c35f7d0704",value:this.solutionVariables})))))))}_toggleVars(){this.varsOpen=!this.varsOpen}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};ee.style=":host{display:flexbox}.solution-data-container{position:absolute;height:-moz-available;height:calc(100% - 48px);height:-webkit-fill-available;height:stretch;width:-moz-available;width:100%;width:-webkit-fill-available;width:stretch}.solution-data-child-container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.solution-data-editor-container{height:100%}.solution-data-child-container-collapsed{display:flex;height:100%;flex-direction:column;overflow:auto;width:50px}.inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.json-editor{margin:1rem;width:auto;width:-webkit-fill-available -moz-available}.collapse-btn{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.org-vars{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.sol-vars{padding-top:0px;padding-bottom:0px;padding-left:1rem;padding-right:1rem;min-height:45%}.padding-1{padding:1rem}.light{background-color:#F4F4F4}";const ie=class{constructor(i){t(this,i),this.solutionVariableSelected=e(this,"solutionVariableSelected",7),this.value="",this._solutionVariables=[],this._translations=void 0}valueWatchHandler(){this._solutionVariables=JSON.parse(this.value)}componentWillLoad(){return this._getTranslations()}render(){return i(o,{key:"6673253cf19a8d760dc1444feef39a74258d01ed"},i("div",{key:"44e5a11c8f31558baf8458cc883e579f2f23ff47"},i("h4",{key:"f8b7a19e4a9eb4860015cfdb6c55c2b94d66a222",class:"org-var-header"},this._translations.solVariables)),i("div",{key:"ffb70400c5fd22a944328672e7eaefa5918fce5c",class:"container-border"},i("calcite-tree",{key:"de81612c2a603f17b1bcb58f0b750401db0d4f20",id:"variable-label"},this._renderHierarchy(this._solutionVariables))))}_renderHierarchy(t){return t.map((t=>t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:t=>this._toggleExpand(t)},i("solution-item-icon",{type:t.type}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this._renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.solutionVariableSelected.emit({itemId:t,value:e})}_toggleExpand(t){var e;const i=null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.closest("calcite-tree-item");i&&(i.expanded=!i.expanded)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{value:["valueWatchHandler"]}}};ie.style=":host{display:block}.container-border{overflow-y:hidden}.org-var-header{margin-top:1rem;margin-bottom:1rem;margin-left:0px;margin-right:0px}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";export{kt as calcite_shell_panel,Ct as calcite_tab,Wt as calcite_tab_nav,Ot as calcite_tab_title,Pt as calcite_tabs,Jt as calcite_value_list,Kt as calcite_value_list_item,Xt as json_editor,Yt as solution_item_details,Qt as solution_item_sharing,Zt as solution_organization_variables,te as solution_resource_item,ee as solution_template_data,ie as solution_variables}
|
47
|
+
const qt="actions-end",Gt="actions-start",Kt=class{constructor(i){t(this,i),this.calciteListItemChange=e(this,"calciteListItemChange",6),this.calciteListItemRemove=e(this,"calciteListItemRemove",7),this.calciteValueListItemDragHandleBlur=e(this,"calciteValueListItemDragHandleBlur",6),this.pickListItem=null,this.guid=`calcite-value-list-item-${L()}`,this.getPickListRef=t=>this.pickListItem=t,this.handleKeyDown=t=>{" "===t.key&&(this.handleActivated=!this.handleActivated)},this.handleBlur=()=>{this.handleActivated=!1,this.calciteValueListItemDragHandleBlur.emit({item:this.el,handle:this.handleEl})},this.handleSelectChange=t=>{this.selected=t.detail.selected},this.description=void 0,this.disabled=!1,this.deselectDisabled=!1,this.nonInteractive=!1,this.handleActivated=!1,this.icon=null,this.iconFlipRtl=!1,this.label=void 0,this.metadata=void 0,this.removable=!1,this.selected=!1,this.value=void 0}connectedCallback(){c(this),D(this)}disconnectedCallback(){r(this),W(this)}componentWillLoad(){$(this)}componentDidLoad(){M(this)}componentDidRender(){F(this)}async toggleSelected(t){this.pickListItem.toggleSelected(t)}async setFocus(){var t;return await N(this),null===(t=this.pickListItem)||void 0===t?void 0:t.setFocus()}calciteListItemChangeHandler(t){t.detail.item=this.el}renderActionsEnd(){const{el:t}=this;return w(t,qt)?i("slot",{name:qt,slot:bt.actionsEnd}):null}renderActionsStart(){const{el:t}=this;return w(t,Gt)?i("slot",{name:Gt,slot:bt.actionsStart}):null}renderHandle(){const{icon:t,iconFlipRtl:e}=this;if(t===pt.grip)return i("span",{class:{[ht.handle]:!0,[ht.handleActivated]:this.handleActivated},"data-js-handle":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,role:"button",tabindex:"0",ref:t=>this.handleEl=t},i("calcite-icon",{flipRtl:e,icon:"drag",scale:"s"}))}render(){return i(o,{key:"14e426411cb528504d9b0e89d4378b6c22664878",id:this.el.id||this.guid},i(E,{key:"75e7cf666c5aae3e62c21d9160083ca17c926c15",disabled:this.disabled},this.renderHandle(),i("calcite-pick-list-item",{key:"9e82a64e2022bfb5c052112e9e804f98db8c45bb",description:this.description,deselectDisabled:this.deselectDisabled,disabled:this.disabled,label:this.label,metadata:this.metadata,nonInteractive:this.nonInteractive,onCalciteListItemChange:this.handleSelectChange,removable:this.removable,selected:this.selected,value:this.value,ref:this.getPickListRef},this.renderActionsStart(),this.renderActionsEnd())))}get el(){return s(this)}};Kt.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{margin-block-end:1px;box-sizing:border-box;display:flex;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-2);--tw-shadow:0 1px 0 var(--calcite-color-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition:background-color var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}:host *{box-sizing:border-box}calcite-pick-list-item{position:relative;margin:0px;flex-grow:1;--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([active]),:host([selected]){--tw-shadow:0 0 0 1px var(--calcite-color-brand);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.handle{display:flex;cursor:move;align-items:center;justify-content:center;border-style:none;background-color:transparent;padding-block:0px;padding-inline:0.25rem;color:var(--calcite-color-border-input);outline-color:transparent}.handle:hover{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.handle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.handle--activated{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}.handle calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}";const Xt=class{constructor(e){t(this,e),this._loaded=!1,this._useDiffEditor=!1,this.hasChanges=!1,this.hasErrors=!1,this.instanceid="",this.value=""}componentDidLoad(){const t=document.getElementById(`${this.instanceid}-container`);if(t){this._editor=monaco.editor.create(t,{value:this.value,language:"json",theme:"vs",minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1}),this._currentModel=this._editor.getModel(),this._contentChanged=this._currentModel.onDidChangeContent(this._onEditorChange.bind(this));const e=monaco.editor.setModelMarkers,i=this;monaco.editor.setModelMarkers=function(t,a,s){var o,n;t.id===i._currentModel.id&&(i._flagEditorHasErrors(s.length>0),i.hasErrors||(i._flagEditorHasChanges(null===(o=i._currentModel)||void 0===o?void 0:o.canUndo()),(null===(n=i._currentModel)||void 0===n?void 0:n.canUndo())&&i._flagEditorContentChanged()),document.getElementById(`${i.instanceid}-errorFlag`).style.visibility=i.hasErrors?"visible":"hidden"),e.call(monaco.editor,t,a,s)},this._diffEditor=monaco.editor.createDiffEditor(document.getElementById(`${this.instanceid}-diff-container`),{automaticLayout:!0}),this._setDiffModel(),this._loaded=!0,this._toggleUndoRedo()}}async componentWillLoad(){this._initValueObserver(),await this._getTranslations()}render(){return i(o,{key:"160ba6c2961d67add84b4f23b4aacd2213d064b2"},i("div",{key:"bf0a77eed1d206376244526db6a261cce163ca69",id:`${this.instanceid}-editor-container`,class:"editor-container padding-right"},i("div",{key:"65a0f2f69d4b7f9694a6617755c638d9ad19e168",class:"editor-controls"},i("div",{key:"3fccc399a3e2a45fe55a374c869a7a7c7533eafc",class:"editor-buttons"},i("calcite-icon",{key:"5007e48c8ecf9d5a037e062bbb3b5ee3710b18eb",id:`${this.instanceid}-errorFlag`,icon:"exclamation-mark-triangle",title:this._translations.errorFlag,scale:"s",class:"edit-error-flag"}),i("calcite-button",{key:"37f8abf8027e0743e373de473421d06884f61d0b",id:`${this.instanceid}-undo`,color:"blue",appearance:"solid",title:this._translations.undo,onClick:()=>this._undo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"31c88e27793f4e07ccc20df6d6c88fa0d6661977",icon:"undo",scale:"s"})),i("calcite-button",{key:"56a5945e706a5c66044678f768d567286893c7b1",id:`${this.instanceid}-redo`,color:"blue",appearance:"solid",title:this._translations.redo,onClick:()=>this._redo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"b2a2d56e6818ee09be15114fcab357732f9f0c99",icon:"redo",scale:"s"})),i("calcite-button",{key:"63acf48f78d1f9cdcd86c5862e399be2217a16c1",id:`${this.instanceid}-diff`,color:"blue",appearance:"solid",title:this._translations.diff,onClick:()=>this._toggleEditor(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"677f9c42bbb449fb51325a9dd4b60affd8a73cd7",icon:"compare",scale:"s"})),i("calcite-button",{key:"7cf8fac59ad4096ed541bfd1e6454cec70890c72",id:`${this.instanceid}-search`,appearance:"outline",color:"blue",title:this._translations.search,onClick:()=>this._search(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"1e2e4290e7b7254a533a99d85ea2745050b22e55",icon:"search",scale:"s"})),i("calcite-button",{key:"ec656bcb0a64a6ff6a42760710f8067eae18b9a5",id:`${this.instanceid}-reset`,color:"blue",appearance:"solid",disabled:!0,title:this._translations.cancelEdits,onClick:()=>this._reset(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"0210b400f5934c68c45fe61f4bf11d3efca97333",icon:"reset",scale:"s"})))),i("div",{key:"d14efe742fe79b18a436bf522e33924c2a7e72d5",class:"edit-parent"},i("div",{key:"e550bbc5968b71701220a44cba17afa9f5f61c48",id:`${this.instanceid}-container`,class:"json-edit-container"}),i("div",{key:"9778b7229d2f3ec994c8a8d707a7f7b394697823",id:`${this.instanceid}-diff-container`,class:"json-edit-container display-none"}))))}async getEditorContents(){return new Promise(((t,e)=>{try{t(this._currentModel.getValue())}catch(t){e(t)}}))}async prepareForDeletion(){var t,e,i,a,s;null===(t=this._searchBtnHandler)||void 0===t||t.removeEventListener("click",this._search),null===(e=this._cancelEditsBtnHandler)||void 0===e||e.removeEventListener("click",this._reset),null===(i=this._valueObserver)||void 0===i||i.disconnect(),null===(a=this._contentChanged)||void 0===a||a.dispose(),null===(s=this._editor)||void 0===s||s.dispose()}async replaceCurrentSelection(t){const e=this._editor.getSelection();this._editor.executeEdits("",[{range:e,text:t}])}async reset(){return new Promise(((t,e)=>{try{this._reset(),t({success:!0})}catch(t){e(t)}}))}_disableButton(t){var e;null===(e=document.getElementById(t))||void 0===e||e.setAttribute("disabled","")}_enableButton(t){var e;null===(e=document.getElementById(t))||void 0===e||e.removeAttribute("disabled")}_flagEditorContentChanged(){window.dispatchEvent(new CustomEvent("solutionEditorContentChanged",{detail:{id:this.instanceid,contents:this._currentModel.getValue()},bubbles:!0,cancelable:!1,composed:!0}))}_flagEditorHasChanges(t){this.hasChanges!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasChanges",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasChanges=t)}_flagEditorHasErrors(t){this.hasErrors!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasErrors",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasErrors=t)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}_initValueObserver(){this._valueObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"value"===t.attributeName&&t.target[t.attributeName]!==t.oldValue&&this._loaded&&this._currentModel.setValue(this.value)}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}_onEditorChange(){this._toggleUndoRedo()}_redo(){var t;(null===(t=this._currentModel)||void 0===t?void 0:t.canRedo())&&(this._currentModel.redo(),this._toggleUndoRedo())}_reset(){this._currentModel.setValue(this.value),this._toggleUndoRedo()}_search(){this._editor.trigger("toggleFind","actions.find")}_setDiffModel(){this._diffEditor&&this._diffEditor.setModel({original:monaco.editor.createModel(this.value,"json"),modified:this._editor.getModel()})}_toggleEditor(){this._useDiffEditor=!this._useDiffEditor;let t=document.getElementById(`${this.instanceid}-diff-container`),e=document.getElementById(`${this.instanceid}-container`);this._useDiffEditor?(this._setDiffModel(),t.classList.remove("display-none"),e.classList.add("display-none")):(t.classList.add("display-none"),e.classList.remove("display-none"))}_toggleUndoRedo(){var t,e,i,a;(null===(t=this._currentModel)||void 0===t?void 0:t.canUndo())?this._enableButton(`${this.instanceid}-undo`):this._disableButton(`${this.instanceid}-undo`),(null===(e=this._currentModel)||void 0===e?void 0:e.canRedo())?this._enableButton(`${this.instanceid}-redo`):this._disableButton(`${this.instanceid}-redo`),(null===(i=this._currentModel)||void 0===i?void 0:i.canUndo())||(null===(a=this._currentModel)||void 0===a?void 0:a.canRedo())?this._enableButton(`${this.instanceid}-reset`):this._disableButton(`${this.instanceid}-reset`)}_undo(){var t;(null===(t=this._currentModel)||void 0===t?void 0:t.canUndo())&&(this._currentModel.undo(),this._toggleUndoRedo())}static get assetsDirs(){return["assets"]}get el(){return s(this)}};Xt.style=":host{display:block}.editor-container{position:relative;height:100%}.editor-controls{height:2.75rem;padding-right:0.5rem;background-color:#F4F4F4}.editor-buttons{float:right}html[dir=rtl] .editor-buttons{float:left}.edit-error-flag{padding-top:0.5rem;color:red;visibility:hidden}.edit-button{padding-inline-start:0.5rem}.editor-text{width:100%;overflow-y:auto;background-color:#FFFFFF}.edit-width{width:100%}.edit-parent{box-sizing:border-box;width:100%;height:calc(100% - 46px)}.json-edit-container{height:100%;width:100%;border:1px #808080 solid}.padding-right{padding-inline-end:0.125rem}.btn{margin-bottom:1rem;display:flex;align-content:center;height:25px;width:120px}.select-ctrl{margin-bottom:1rem}.all-edits{margin-top:4rem}.floating-title{font-size:2rem;z-index:100;position:absolute;left:0.5rem;pointer-events:none}.floating-title-button{pointer-events:auto}.json-editor-position1{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:100%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2a{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2b{position:absolute;right:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}";const Yt=class{constructor(e){t(this,e),this.itemId="",this.itemDetails={accessInformation:"",description:"",licenseInfo:"",snippet:"",tags:[],title:""},this.itemEdit=void 0,this._translations=void 0,this.thumbnail=void 0,this.thumbnailContainer=void 0}async componentWillLoad(){return this._getTranslations()}async componentWillRender(){return this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit&&(this.itemDetails=this.itemEdit.item,this.itemType=this.itemDetails.type),Promise.resolve()}render(){return i(o,{key:"d4443b28db9314e9c6976d97af02e7af14d2a5ff"},i("div",{key:"bd2969f299df5fab6bab10a6cd6dbe7c7213aba4",class:"parent-container"},i("div",{key:"d7226027bddc89eb4ff89899ee45728534331a5d",class:"inputBottomSeparation"},i("calcite-input",{key:"9fcd5e9c9d5fe7ac652fff4fa06801fec240380f",id:"item-title",value:this.itemDetails.title})),i("div",{key:"9542faf04236ec293eff1f1abf0667ee4d26ab45",class:"inputBottomSeparation"},i("input",{key:"9a431fef50c9be4f084b33003c6be4cab65a7da0",accept:".jpg,.gif,.png,image/jpg,image/gif,image/png",class:"display-none",onChange:t=>this._updateThumbnail(t),ref:t=>this.browseForThumbnail=t,type:"file"}),i("button",{key:"9ed82a0e807acd0344bd52bcef653728419d3fc1",class:"font-size--3 btn-link inline-block trailer-quarter",onClick:()=>this._getThumbnail()},i("svg",{key:"230d6a270cd61f4785b7f39e951e996a7b37a1ca",class:"icon-inline icon-inline--on-left",height:"16",viewBox:"0 0 16 16",width:"16"},i("path",{key:"96a6c77691e152072aa0de03f63d8ec82f1ca051",d:"M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"})),this._translations.editThumbnail),i("div",{key:"de04396607c0a61eb1e13bb56581aae9e939b286",class:"flex"},i("div",{key:"3df8a6cde94bc275b85db55375aaa351453c46fb",class:"img-container",ref:t=>this.thumbnailContainer=t},i("img",{key:"a5084eff2ebee0514c5cac6acf4e1b8dcaaf47d5",class:"scale-down",height:"133",id:"item-thumbnail",ref:t=>this.thumbnail=t,width:"200"})),i("div",{key:"73199d7582082575282f36ecb6afed3ee6bd900e",class:"snippet-count-container"},i("calcite-input",{key:"7aa7c61d42be36c237c6bd9b72e4ec24ef6dc07d",id:"item-snippet",maxLength:250,type:"textarea",value:this.itemDetails.snippet}),i("label",{key:"9ae2f293b2cb64a475a0969b7e00951a1b55e251",class:"font-size--3",id:"item-snippet-count",ref:t=>this.itemSnippetCount=t})))),i("calcite-label",{key:"98cf6dd0f1f53e15c857baeb4f3a580586935762"},this._translations.description,i("label",{key:"2f54c0fd6d75e4b08e74cf5b30d9794d0375a267",id:"item-description-label"},i("calcite-input",{key:"91cf40b10f1bed0cd4bc83a988d9a4151ddec2e6",id:"item-description",type:"textarea",value:this.itemDetails.description}))),i("calcite-label",{key:"4261ff6e21385fb681cb6a52dbaa8e3d75973d8b"},this._translations.tags,i("label",{key:"cde48f34fd18fe530dea6be06c8fb5e602048266",id:"item-tags-label"},i("calcite-input",{key:"e11931c90df113bd512bab39be092257ffd92e42",id:"item-tags",value:(this.itemDetails.tags&&Array.isArray(this.itemDetails.tags)?this.itemDetails.tags:[this.itemDetails.tags]).join(",")}))),"Group"!==this.itemType?i("calcite-label",null,this._translations.credits,i("label",{id:"item-credits-label"},i("calcite-input",{id:"item-credits",value:this.itemDetails.accessInformation}))):null,"Group"!==this.itemType?i("calcite-label",null,i("label",{id:"item-terms-label"},this._translations.termsOfUse,i("calcite-input",{id:"item-terms",type:"textarea",value:this.itemDetails.licenseInfo}))):null))}componentDidRender(){this._loadThumb()}inputReceivedHandler(t){switch(t.target.id){case"item-title":this.itemDetails.title=t.target.value,this._updateStore();break;case"item-snippet":t.target.value.length>250&&(t.target.value=t.target.value.substring(0,250)),this.itemDetails.snippet=t.target.value,this._updateLengthLabel(this.itemDetails.snippet),this._updateStore();break;case"item-description":this.itemDetails.description=t.target.value,this._updateStore();break;case"item-tags":this.itemDetails.tags=t.target.value,this._updateStore();break;case"item-credits":this.itemDetails.accessInformation=t.target.value,this._updateStore();break;case"item-terms":this.itemDetails.licenseInfo=t.target.value,this._updateStore()}}_getThumbnail(){this.browseForThumbnail.click()}_loadThumb(){var t;this.thumbnail&&(null===(t=this.itemEdit)||void 0===t?void 0:t.thumbnail)?(this.thumbnail.src=URL.createObjectURL(this.itemEdit.thumbnail),this.thumbnailContainer.classList.remove("empty-box"),this.thumbnail.classList.remove("display-none")):(this.thumbnailContainer.classList.add("empty-box"),this.thumbnail.classList.add("display-none"))}_updateLengthLabel(t){this.itemSnippetCount.innerText=this._translations.snippetCountPattern.replace("{{n}}",t.length.toString())}_updateStore(){this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit.item=this.itemDetails,ft.setItemInfo(this.itemEdit)}_updateThumbnail(t){const e=t.target.files;e&&e[0]&&this.thumbnail&&(this.thumbnail.src=URL.createObjectURL(e[0]),this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit.thumbnail=e[0],ft.replaceItemThumbnail(this.itemEdit))}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}};Yt.style=".inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.icon-inline--on-left,.icon-inline--on-right{display:inline;vertical-align:middle;margin-inline-end:0.375rem;fill:#0079c1}.scale-down{-o-object-fit:scale-down;object-fit:scale-down}.img-container{display:inline;margin-inline-end:1rem;max-width:363px}.summary-count-container{display:inline;flex-grow:1;margin-inline-start:0.75rem}.snippet-count-container{width:calc(100vw - 363px)}.parent-container{max-width:100%;padding:1rem}label{position:relative;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem;display:block;min-width:-moz-min-content;min-width:min-content}";const Qt=class{constructor(e){t(this,e),this.groupId="",this._translations=void 0,this.sharing=[]}itemIdWatchHandler(){const t=ft.getItemInfo(this.groupId);this.sharing=t.groupDetails}async componentWillLoad(){return this._getTranslations()}render(){return i(o,{key:"7042ab9382712488f9184b305e417dd93379422f"},i("div",{key:"00baf7fac31f03b249592eb8603a74d6f93f2615",class:"container-border"},i("calcite-label",{key:"5328280b6ee86819366800e43eda0c44b55ca277"},this._translations.groupInfo),this._renderItems(this.sharing)))}async getShareInfo(){return this.sharing}_renderItems(t){return t&&t.length>0?t.map((t=>i("calcite-label",{layout:"inline"},i("calcite-switch",{checked:t.shareItem,id:t.id,name:"setting",onCalciteSwitchChange:t=>this._updateItem(t),scale:"m",value:"enabled"}),i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title)))):null}_updateItem(t){const e=t.target.id;this.sharing=this.sharing.map((i=>{if(i.id===e){i.shareItem=t.target.checked;const a=ft.getItemInfo(e);if(i.shareItem)a.groups?a.groups.indexOf(this.groupId)<0&&a.groups.push(this.groupId):a.groups=[this.groupId];else if(a.groups){const t=a.groups.indexOf(this.groupId);t>-1&&a.groups.splice(t,1)}ft.setItemInfo(a)}return i}))}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{groupId:["itemIdWatchHandler"]}}};Qt.style=":host{display:block}.container-border{padding:1rem}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const Zt=class{constructor(i){t(this,i),this.organizationVariableSelected=e(this,"organizationVariableSelected",7),this.value="",this._organizationVariables=[],this._translations=void 0}valueWatchHandler(){this._organizationVariables=JSON.parse(this.value)}async componentWillLoad(){return this._getTranslations()}render(){return i(o,{key:"a4456905e1abde8eca22dfb6f3da81959d509b75"},i("div",{key:"8fc37e2a59237ed0cca05b096f901a82da696151"},i("h4",{key:"7bdd9e95f37297c51778a866542517048622e5ca",class:"org-var-header"},this._translations.orgVariables)),i("div",{key:"10bfcebd83ddc363f04149a03298b0c5247fd265",class:"container-border"},i("calcite-tree",{key:"1d168ebbceaf566fb8f4ddea85acba39c08bbd53",id:"variable-label"},this._renderHierarchy(this._organizationVariables))))}_renderHierarchy(t){return t.map((t=>i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.organizationVariableSelected.emit({itemId:t,value:e})}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{value:["valueWatchHandler"]}}};Zt.style=":host{display:block}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";const te=class{constructor(e){t(this,e),this._removedResources={},this.authentication=void 0,this.itemId="",this.resourceFilePaths=[],this.resources=[],this._translations=void 0}itemIdWatchHandler(){const t=ft.getItemInfo(this.itemId);this.resourceFilePaths=t.resourceFilePaths,this.resources=t.resources.map((t=>t.substring(t.lastIndexOf("/")+1)))}componentWillLoad(){return this._getTranslations()}render(){const t=this._hasValidResources();return i(o,{key:"c36fddfce9c4c97b281281ec11dfa017d496141e"},i("div",{key:"e1166173669689e9acee92cc7e53747ebcec0c09",class:"resource-item"},i("div",{key:"86c8e1d498d7b84e9587cdcf4a3bb971fc1ecaad",class:"margin-bottom-1"},i("calcite-button",{key:"f382275e75efeb5beadef582ddd343a283f014e2",appearance:"solid",class:"resource-button",color:"blue",onClick:()=>this._addNewResource()},this._translations.addResource),i("calcite-button",{key:"c487e618472b047f8db71e8989f849c844682080",appearance:"solid",color:"blue",disabled:!t,onClick:()=>this._downloadAll()},this._translations.downloadAll)),i("div",{key:"08733ba234cba9b5ea19455256fa961d23ae933b",class:"resources-container",style:{display:t?"inherit":"none"}},this._renderResourceList())))}_renderResourceList(){return i("calcite-value-list",{multiple:!0},this.resourceFilePaths.reduce(((t,e)=>(e.type!==mt.Thumbnail&&t.push(this._renderResource(e)),t)),[]))}_renderResource(t){const e=t.updateType===vt.Remove;return i("calcite-value-list-item",{class:e?"disabled":"",label:t.folder?t.folder+"/"+t.filename:t.filename,nonInteractive:!0,value:t.url},i("calcite-action-group",{"expand-disabled":"true",layout:"horizontal",slot:"actions-end"},i("calcite-action",{disabled:e,icon:"download",label:this._translations.download,onClick:()=>this._download(t.url,t.filename),scale:"m",text:this._translations.download,title:this._translations.download}),i("calcite-action",{disabled:e,icon:"upload-to",label:this._translations.update,onClick:()=>this._upload(t),scale:"m",text:this._translations.update,title:this._translations.update}),i("calcite-action",{disabled:e,icon:"trash",label:this._translations.delete,onClick:()=>this._delete(t),scale:"m",text:this._translations.delete,title:this._translations.delete}),e?i("calcite-action",{icon:"reset",label:this._translations.reset,onClick:()=>this._reset(t.filename),scale:"m",text:this._translations.reset,title:this._translations.reset}):i("div",{class:"display-none"})))}_delete(t){t.updateType=vt.Remove,this.resourceFilePaths=[...this.resourceFilePaths],this._updateStore()}_reset(t){this.resourceFilePaths=this.resources.some((e=>e===t))?this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=vt.None),e))):this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=vt.Add),e))),this._updateStore()}_downloadAll(){this.resourceFilePaths.forEach((t=>{this._download(t.url,t.filename)}))}_download(t,e){t.startsWith("blob")?this.downloadFile(t,e):this.fetchAndDownload(`${t}?token=${this.authentication.token}`,e)}downloadFile(t,e){const i=document.createElement("a");i.href=t,i.download=e,i.target="_blank",i.click()}_hasValidResources(){return this.resourceFilePaths.some((t=>t.url.indexOf("_info_thumbnail")<0))}async fetchAndDownload(t,e){const i=await fetch(t),a=await i.blob(),s=URL.createObjectURL(a);this.downloadFile(s,e)}_upload(t){const e=document.createElement("input");e.classList.add("display-none"),e.onchange=this._updateResource.bind(this,t),e.type="file",e.click()}_addNewResource(){const t=document.createElement("input");t.classList.add("display-none"),t.onchange=this._add.bind(this),t.type="file",t.click()}_updateResource(t,e){const i=e.target.files;i&&i[0]&&(t.blob=i[0],t.updateType=vt.Update,this._updateStore())}_add(t){const e=t.target.files;if(e&&e[0]){const t=URL.createObjectURL(e[0]),i=e[0].name;this.resourceFilePaths.some((e=>e.filename===i&&e.url===t))||(this.resourceFilePaths=[...this.resourceFilePaths,{url:t,type:mt.Data,folder:void 0,filename:i,blob:e[0],updateType:vt.Add}],this._updateStore())}}_updateStore(){const t=ft.getItemInfo(this.itemId);t.resourceFilePaths=this.resourceFilePaths,ft.setItemInfo(t)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};te.style=":host{display:block}.resource-item{padding:1rem}.resource-button{margin-inline-end:1rem}.resource-progress{padding-top:1rem}.resources-container{border:1px #808080 solid}.margin-bottom-1{margin-bottom:1rem}";const ee=class{itemIdWatchHandler(){this._initializing=!0,this.value=JSON.stringify("data"===this.instanceid?ft.getItemInfo(this.itemId).data:ft.getItemInfo(this.itemId).properties,null,2)}constructor(e){t(this,e),this._initializing=!1,this.instanceid="",this.itemId="",this.organizationVariables="",this.solutionVariables="",this.varsOpen=!0,this._translations=void 0,this.value="",window.addEventListener("solutionEditorContentChanged",(t=>{if(this.itemId){const{id:e,contents:i}=t.detail,[a,s]=e.split("|");if(a==this.itemId&&s===this.instanceid){if(!this._initializing&&i.length>0){const t=ft.getItemInfo(a);"data"===s?t.data=JSON.parse(i):t.properties=JSON.parse(i),ft.setItemInfo(t)}this._initializing=!1}}}))}componentWillLoad(){return this._getTranslations()}render(){return i(o,{key:"5a417f81d9b0d98ad28f9139406fee4b37204169"},i("div",{key:"0dd5d77a961473bf45f7654ccb2e0507b492a6c7",class:"solution-data-container"},i("calcite-shell",{key:"3b839b36a89f1a9db10a6ad8b3f7d088248770bc",class:"light var-container",dir:"ltr"},i("calcite-panel",{key:"9f6ce42fdad56cf7a9f6b2f9ccac707eb655f4f1",class:"json-editor"},i("div",{key:"a1ba50c8fd13cf6d4934aa72083c0519c317721d",class:"solution-data-child-container calcite-match-height"},i("json-editor",{key:"8f832aecde35b6b82e16b3d201b738fe202e86a3",class:"solution-data-editor-container",instanceid:this.itemId+"|"+this.instanceid,value:this.value}))),i("calcite-shell-panel",{key:"c24f19fcc440884123f59842b392063925b5cbf6","height-scale":"l",position:"end",slot:"contextual-panel","width-scale":"xs"},i("div",{key:"8d9c25baada3e2ca03ee192f44121d7bdab85432",class:this.varsOpen?"solution-data-child-container":"solution-data-child-container-collapsed"},i("calcite-button",{key:"247b542336578c5404c7246552424c16030d90a7",appearance:"transparent",class:"collapse-btn","icon-start":this.varsOpen?"chevrons-right":"chevrons-left",id:"collapse-vars",onClick:()=>this._toggleVars(),scale:"s",title:this.varsOpen?this._translations.collapse:this._translations.expand}),i("div",{key:"963c1802c7828557cec5493602c3a1669e21683c",class:this.varsOpen?"org-vars":"org-vars display-none",id:"orgVars"},i("solution-organization-variables",{key:"566f672a97401d77ed7180d5fc7b2367027fcc57",value:this.organizationVariables})),i("div",{key:"79508bfcde2ac8507acd40bbc3edceb944c3e717",class:this.varsOpen?"sol-vars":"sol-vars display-none",id:"solVars"},i("solution-variables",{key:"51756082f8d13c73d7ae1349fc5625994a3354bb",value:this.solutionVariables})))))))}_toggleVars(){this.varsOpen=!this.varsOpen}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};ee.style=":host{display:flexbox}.solution-data-container{position:absolute;height:-moz-available;height:calc(100% - 48px);height:-webkit-fill-available;height:stretch;width:-moz-available;width:100%;width:-webkit-fill-available;width:stretch}.solution-data-child-container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.solution-data-editor-container{height:100%}.solution-data-child-container-collapsed{display:flex;height:100%;flex-direction:column;overflow:auto;width:50px}.inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.json-editor{margin:1rem;width:auto;width:-webkit-fill-available -moz-available}.collapse-btn{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.org-vars{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.sol-vars{padding-top:0px;padding-bottom:0px;padding-left:1rem;padding-right:1rem;min-height:45%}.padding-1{padding:1rem}.light{background-color:#F4F4F4}";const ie=class{constructor(i){t(this,i),this.solutionVariableSelected=e(this,"solutionVariableSelected",7),this.value="",this._solutionVariables=[],this._translations=void 0}valueWatchHandler(){this._solutionVariables=JSON.parse(this.value)}componentWillLoad(){return this._getTranslations()}render(){return i(o,{key:"4367694cf20a2063b57679f1a955ef827eea1c05"},i("div",{key:"875e6e1532e7406ddf6cca804e421980aa23b7cd"},i("h4",{key:"b6798506cf71d3c84e2c33a3d12a0729591a73a7",class:"org-var-header"},this._translations.solVariables)),i("div",{key:"413d3c7ebae5afa05a8cb5c87f766db64f43e106",class:"container-border"},i("calcite-tree",{key:"ba5bf27e005ce7536cdfe0c8022c96cd0b4ad920",id:"variable-label"},this._renderHierarchy(this._solutionVariables))))}_renderHierarchy(t){return t.map((t=>t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:t=>this._toggleExpand(t)},i("solution-item-icon",{type:t.type}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this._renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.solutionVariableSelected.emit({itemId:t,value:e})}_toggleExpand(t){var e;const i=null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.closest("calcite-tree-item");i&&(i.expanded=!i.expanded)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{value:["valueWatchHandler"]}}};ie.style=":host{display:block}.container-border{overflow-y:hidden}.org-var-header{margin-top:1rem;margin-bottom:1rem;margin-left:0px;margin-right:0px}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";export{kt as calcite_shell_panel,Ct as calcite_tab,Wt as calcite_tab_nav,Ot as calcite_tab_title,Pt as calcite_tabs,Jt as calcite_value_list,Kt as calcite_value_list_item,Xt as json_editor,Yt as solution_item_details,Qt as solution_item_sharing,Zt as solution_organization_variables,te as solution_resource_item,ee as solution_template_data,ie as solution_variables}
|
@@ -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 s,g as e}from"./p-fa1ceaf9.js";import{s as r}from"./p-2afdcdfc.js";import{c as a,d as i}from"./p-fdd93685.js";import"./p-8c6d9b5a.js";import"./p-c1cf3ebc.js";import"./p-3d7cff5e.js";import"./p-d4056c1c.js";import"./p-a230b270.js";import"./p-a0300d31.js";const o=class{constructor(e){t(this,e),this.stateLoaded=s(this,"stateLoaded",7),this.value="",this.templates=[],this.authentication=void 0}connectedCallback(){this._initValueObserver()}render(){return null}_initValueObserver(){const t=this;this._valueObserver=new MutationObserver((s=>{s.some((s=>{const e=s.target[s.attributeName];if("attributes"===s.type&&"value"===s.attributeName&&e!==s.oldValue&&""!==e){const s=JSON.parse(e);r.setStoreInfo("solutionData",s);const o=a(s.templates);return r.setStoreInfo("featureServices",o),r.setStoreInfo("spatialReferenceInfo",i(o,s)),t.stateLoaded.emit(r),!0}}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}get el(){return e(this)}};export{o as store_manager}
|