@eodash/eodash 5.0.0-rc.2.5 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/core/client/composables/DefineWidgets.js +8 -1
  2. package/core/client/eodash.js +9 -9
  3. package/core/client/eodashSTAC/createLayers.js +4 -18
  4. package/core/client/eodashSTAC/helpers.js +23 -0
  5. package/core/client/store/stac.js +3 -1
  6. package/core/client/types.ts +125 -19
  7. package/core/client/utils/states.js +9 -0
  8. package/dist/client/{DashboardLayout-BX3Sm_Vx.js → DashboardLayout-CkWvOMOW.js} +2 -2
  9. package/dist/client/{DynamicWebComponent-BqoHM1np.js → DynamicWebComponent-DYBbpvUK.js} +1 -1
  10. package/dist/client/{EodashDatePicker-BoWV2vc8.js → EodashDatePicker-CALmW3SI.js} +3 -83
  11. package/dist/client/{EodashItemFilter-127fZLyK.js → EodashItemFilter-DlQiE713.js} +1 -1
  12. package/dist/client/{EodashLayerControl-B-pZaizw.js → EodashLayerControl-DEzEbft7.js} +8 -2
  13. package/dist/client/{EodashLayoutSwitcher-DwexHfOD.js → EodashLayoutSwitcher-CDeCV8F-.js} +2 -2
  14. package/dist/client/{EodashMapBtns-Jfn3bpWD.js → EodashMapBtns-CktQCfa-.js} +36 -12
  15. package/dist/client/{EodashStacInfo-STq_bW7S.js → EodashStacInfo-DPPxDkF6.js} +7 -1
  16. package/dist/client/{EodashTools-uxSuJhVJ.js → EodashTools-CUaL9s4H.js} +5 -4
  17. package/dist/client/{ExportState-Ckcb6u01.js → ExportState-DjyIZVhl.js} +27 -12
  18. package/dist/client/{Footer-C8JP-coH.js → Footer-DyL0JoWt.js} +1 -1
  19. package/dist/client/{Header-Dxx7q9FW.js → Header-B5Dgty9l.js} +3 -3
  20. package/dist/client/{MobileLayout-BE19Peep.js → MobileLayout-CRsg_5Q4.js} +5 -5
  21. package/dist/client/{PopUp-D3IyjsN4.js → PopUp-BfB8s_ki.js} +3 -3
  22. package/dist/client/ProcessList-DTefwQZx.js +484 -0
  23. package/dist/client/{VImg-BmCNSu3X.js → VImg-FD1WVphJ.js} +2 -2
  24. package/dist/client/{VMain-eZDKIfmJ.js → VMain-DJKG4SvM.js} +1 -1
  25. package/dist/client/{VOverlay-BS-E4Z6g.js → VOverlay-BzOdRu9h.js} +15 -6
  26. package/dist/client/{VTooltip-BMsliOuh.js → VTooltip-CfeefrXI.js} +3 -3
  27. package/dist/client/{WidgetsContainer-Cl6M5R5c.js → WidgetsContainer-C2TaTdb6.js} +1 -1
  28. package/dist/client/{asWebComponent-Df8nUiLs.js → asWebComponent-CLhcT715.js} +100 -96
  29. package/dist/client/eo-dash.css +2 -2
  30. package/dist/client/eo-dash.js +1 -1
  31. package/dist/client/{forwardRefs-lhDuXD-N.js → forwardRefs-Bon_Kku1.js} +9 -9
  32. package/dist/client/index-4CT7Tz83.js +85 -0
  33. package/dist/client/{index-Bt5GEGxl.js → index-Bm9cbtx5.js} +1 -1
  34. package/dist/client/{EodashMap-BSR7_wRA.js → index-CIHH_3dW.js} +101 -80
  35. package/dist/client/{EodashProcess-CpbZPYBp.js → index-DiGDvTQU.js} +346 -468
  36. package/dist/client/{transition-DHEuQX4I.js → transition-C5I57hn6.js} +1 -1
  37. package/dist/types/core/client/components/MobileLayout.vue.d.ts +9 -9
  38. package/dist/types/core/client/eodashSTAC/helpers.d.ts +3 -2
  39. package/dist/types/core/client/types.d.ts +83 -17
  40. package/dist/types/core/client/utils/states.d.ts +7 -0
  41. package/dist/types/widgets/EodashDatePicker.vue.d.ts +4 -4
  42. package/dist/types/widgets/EodashItemFilter.vue.d.ts +18 -18
  43. package/dist/types/widgets/EodashLayerControl.vue.d.ts +2 -2
  44. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +2 -2
  45. package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +9 -0
  46. package/dist/types/widgets/EodashMap/methods/index.d.ts +5 -0
  47. package/dist/types/widgets/EodashMapBtns.vue.d.ts +8 -2
  48. package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +2 -0
  49. package/dist/types/widgets/EodashProcess/methods/async.d.ts +45 -0
  50. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +19 -0
  51. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +78 -0
  52. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +54 -0
  53. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +42 -0
  54. package/dist/types/widgets/EodashStacInfo.vue.d.ts +12 -12
  55. package/dist/types/widgets/EodashTools.vue.d.ts +44 -6
  56. package/dist/types/widgets/PopUp.vue.d.ts +4 -4
  57. package/package.json +27 -27
  58. package/widgets/EodashLayerControl.vue +8 -1
  59. package/widgets/{EodashMap.vue → EodashMap/index.vue} +51 -31
  60. package/widgets/EodashMap/methods/create-layers-config.js +151 -0
  61. package/{core/client/composables/EodashMap.js → widgets/EodashMap/methods/index.js} +4 -153
  62. package/widgets/EodashMapBtns.vue +33 -7
  63. package/widgets/EodashProcess/ProcessList.vue +82 -0
  64. package/widgets/EodashProcess/index.vue +186 -0
  65. package/widgets/EodashProcess/methods/async.js +209 -0
  66. package/widgets/EodashProcess/methods/composables.js +129 -0
  67. package/widgets/EodashProcess/methods/handling.js +254 -0
  68. package/widgets/EodashProcess/methods/outputs.js +216 -0
  69. package/widgets/EodashProcess/methods/utils.js +138 -0
  70. package/widgets/EodashStacInfo.vue +6 -0
  71. package/widgets/EodashTools.vue +1 -0
  72. package/core/client/composables/EodashProcess.js +0 -654
  73. package/dist/types/core/client/composables/EodashMap.d.ts +0 -6
  74. package/dist/types/core/client/composables/EodashProcess.d.ts +0 -162
  75. package/widgets/EodashProcess.vue +0 -206
  76. /package/dist/types/widgets/{EodashMap.vue.d.ts → EodashMap/index.vue.d.ts} +0 -0
  77. /package/dist/types/widgets/{EodashProcess.vue.d.ts → EodashProcess/index.vue.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { createElementBlock, openBlock, createElementVNode, unref } from 'vue';
2
2
  import '@eox/stacinfo';
3
- import { ak as currentUrl } from './asWebComponent-Df8nUiLs.js';
3
+ import { ao as currentUrl } from './asWebComponent-CLhcT715.js';
4
4
 
5
5
  const _hoisted_1 = { class: "flex-grow-1 fill-height overflow-auto" };
6
6
  const _hoisted_2 = [".for", ".allowHtml", ".body", ".featured", ".footer", ".styleOverride", ".header", ".subheader", ".tags"];
@@ -34,26 +34,32 @@ main {padding-bottom: 10px;}
34
34
  .footer-container small {font-size:10px;line-height:1;}`,
35
35
  },
36
36
  header: {
37
+ /** @type {import("vue").PropType<string[]>} */
37
38
  type: Array,
38
39
  default: () => ["title"],
39
40
  },
40
41
  tags: {
42
+ /** @type {import("vue").PropType<string[]>} */
41
43
  type: Array,
42
44
  default: () => ["themes"],
43
45
  },
44
46
  subheader: {
47
+ /** @type {import("vue").PropType<string[]>} */
45
48
  type: Array,
46
49
  default: () => [],
47
50
  },
48
51
  body: {
52
+ /** @type {import("vue").PropType<string[]>} */
49
53
  type: Array,
50
54
  default: () => ["satellite", "sensor", "agency", "extent"],
51
55
  },
52
56
  featured: {
57
+ /** @type {import("vue").PropType<string[]>} */
53
58
  type: Array,
54
59
  default: () => ["description", "providers", "assets", "links"],
55
60
  },
56
61
  footer: {
62
+ /** @type {import("vue").PropType<string[]>} */
57
63
  type: Array,
58
64
  default: () => ["sci:citation"],
59
65
  },
@@ -1,9 +1,9 @@
1
1
  import { ref, computed, createElementBlock, openBlock, createElementVNode, createVNode, createBlock, createCommentVNode, unref, withCtx, mergeProps } from 'vue';
2
- import _sfc_main$2 from './PopUp-D3IyjsN4.js';
3
- import _sfc_main$3 from './EodashItemFilter-127fZLyK.js';
4
- import _sfc_main$1 from './EodashLayoutSwitcher-DwexHfOD.js';
2
+ import _sfc_main$2 from './PopUp-BfB8s_ki.js';
3
+ import _sfc_main$3 from './EodashItemFilter-DlQiE713.js';
4
+ import _sfc_main$1 from './EodashLayoutSwitcher-CDeCV8F-.js';
5
5
  import { mdiViewDashboard, mdiPlus } from '@mdi/js';
6
- import { r as useDisplay, a2 as makePanelTransparent, V as VBtn } from './asWebComponent-Df8nUiLs.js';
6
+ import { r as useDisplay, a1 as makePanelTransparent, V as VBtn } from './asWebComponent-CLhcT715.js';
7
7
 
8
8
  const _hoisted_1 = { class: "d-flex flex-row justify-space-between pa-4 align-center" };
9
9
 
@@ -33,6 +33,7 @@ const _sfc_main = {
33
33
  default: "Select indicator",
34
34
  },
35
35
  itemFilterConfig: {
36
+ /** @type {import("vue").PropType<InstanceType<import("./EodashItemFilter.vue").default>["$props"]>} */
36
37
  type: Object,
37
38
  default: () => {},
38
39
  },
@@ -1,9 +1,9 @@
1
- import { createVNode, Fragment, computed, withDirectives, mergeProps, resolveDirective, toRef, mergeModels, useModel, ref, createBlock, openBlock, withCtx, createElementVNode, createTextVNode, toDisplayString, unref, createElementBlock, createCommentVNode, renderList } from 'vue';
1
+ import { createVNode, Fragment, toDisplayString, computed, withDirectives, mergeProps, resolveDirective, toRef, mergeModels, useModel, ref, createBlock, openBlock, withCtx, createElementVNode, createTextVNode, unref, createElementBlock, createCommentVNode, renderList } from 'vue';
2
2
  import { mdiClipboardCheckOutline, mdiContentCopy } from '@mdi/js';
3
- import _sfc_main$1 from './PopUp-D3IyjsN4.js';
4
- import { an as createSimpleFunctional, g as genericComponent, i as makeComponentProps, C as provideDefaults, a as useRender, p as propsFactory, h as makeTagProps, b as provideTheme, K as useBorder, ao as useVariant, A as useDensity, M as useRounded, ap as useSize, aq as genOverlays, v as VIcon, N as VDefaultsProvider, ar as makeVariantProps, f as makeThemeProps, as as makeSizeProps, O as makeRoundedProps, D as makeDensityProps, Q as makeBorderProps, y as IconValue, at as Ripple, H as useDimension, L as useElevation, au as useLoader, av as useLocation, aw as usePosition, ax as useLink, ay as makeRouterProps, az as makePositionProps, aA as makeLocationProps, aB as makeLoaderProps, P as makeElevationProps, J as makeDimensionProps, aC as LoaderSlot, u as useTextColor, q as convertToUnit, _ as _export_sfc, aD as removeUnneededProperties, aE as VRow, aF as VCol, aG as copyToClipBoard, V as VBtn, ai as getLayers, ad as mapPosition, ae as availableMapProjection } from './asWebComponent-Df8nUiLs.js';
5
- import { a as VExpandTransition } from './index-Bt5GEGxl.js';
6
- import { V as VImg } from './VImg-BmCNSu3X.js';
3
+ import _sfc_main$1 from './PopUp-BfB8s_ki.js';
4
+ import { ar as createSimpleFunctional, g as genericComponent, i as makeComponentProps, C as provideDefaults, a as useRender, p as propsFactory, h as makeTagProps, b as provideTheme, K as useBorder, as as useVariant, A as useDensity, M as useRounded, at as useSize, au as genOverlays, v as VIcon, N as VDefaultsProvider, av as makeVariantProps, f as makeThemeProps, aw as makeSizeProps, O as makeRoundedProps, D as makeDensityProps, Q as makeBorderProps, y as IconValue, ax as Ripple, H as useDimension, L as useElevation, ay as useLoader, az as useLocation, aA as usePosition, aB as useLink, aC as makeRouterProps, aD as makePositionProps, aE as makeLocationProps, aF as makeLoaderProps, P as makeElevationProps, J as makeDimensionProps, aG as LoaderSlot, u as useTextColor, q as convertToUnit, _ as _export_sfc, aH as removeUnneededProperties, aI as VRow, aJ as VCol, aK as copyToClipBoard, V as VBtn, al as getLayers, ad as mapPosition, af as availableMapProjection } from './asWebComponent-CLhcT715.js';
5
+ import { a as VExpandTransition } from './index-Bm9cbtx5.js';
6
+ import { V as VImg } from './VImg-FD1WVphJ.js';
7
7
 
8
8
  // Styles
9
9
  const VSpacer = createSimpleFunctional('v-spacer', 'div', 'VSpacer');
@@ -138,8 +138,14 @@ const makeCardItemProps = propsFactory({
138
138
  appendIcon: IconValue,
139
139
  prependAvatar: String,
140
140
  prependIcon: IconValue,
141
- subtitle: [String, Number],
142
- title: [String, Number],
141
+ subtitle: {
142
+ type: [String, Number, Boolean],
143
+ default: undefined
144
+ },
145
+ title: {
146
+ type: [String, Number, Boolean],
147
+ default: undefined
148
+ },
143
149
  ...makeComponentProps(),
144
150
  ...makeDensityProps()
145
151
  }, 'VCardItem');
@@ -189,11 +195,11 @@ const VCardItem = genericComponent()({
189
195
  }, [hasTitle && createVNode(VCardTitle, {
190
196
  "key": "title"
191
197
  }, {
192
- default: () => [slots.title?.() ?? props.title]
198
+ default: () => [slots.title?.() ?? toDisplayString(props.title)]
193
199
  }), hasSubtitle && createVNode(VCardSubtitle, {
194
200
  "key": "subtitle"
195
201
  }, {
196
- default: () => [slots.subtitle?.() ?? props.subtitle]
202
+ default: () => [slots.subtitle?.() ?? toDisplayString(props.subtitle)]
197
203
  }), slots.default?.()]), hasAppend && createVNode("div", {
198
204
  "key": "append",
199
205
  "class": "v-card-item__append"
@@ -263,9 +269,18 @@ const makeVCardProps = propsFactory({
263
269
  type: [Boolean, Object],
264
270
  default: true
265
271
  },
266
- subtitle: [String, Number],
267
- text: [String, Number],
268
- title: [String, Number],
272
+ subtitle: {
273
+ type: [String, Number, Boolean],
274
+ default: undefined
275
+ },
276
+ text: {
277
+ type: [String, Number, Boolean],
278
+ default: undefined
279
+ },
280
+ title: {
281
+ type: [String, Number, Boolean],
282
+ default: undefined
283
+ },
269
284
  ...makeBorderProps(),
270
285
  ...makeComponentProps(),
271
286
  ...makeDensityProps(),
@@ -1,5 +1,5 @@
1
1
  import { ref, toRef, shallowRef, computed, watchEffect, createVNode, inject, createBlock, openBlock, unref, withCtx, createElementVNode, toDisplayString } from 'vue';
2
- import { g as genericComponent, p as propsFactory, b as provideTheme, B as useBackgroundColor, K as useBorder, L as useElevation, M as useRounded, s as useResizeObserver, T as useToggleScope, U as useLayoutItem, a as useRender, q as convertToUnit, f as makeThemeProps, h as makeTagProps, O as makeRoundedProps, W as makeLayoutItemProps, P as makeElevationProps, i as makeComponentProps, Q as makeBorderProps, _ as _export_sfc, X as eodashKey, r as useDisplay } from './asWebComponent-Df8nUiLs.js';
2
+ import { g as genericComponent, p as propsFactory, b as provideTheme, B as useBackgroundColor, K as useBorder, L as useElevation, M as useRounded, s as useResizeObserver, T as useToggleScope, U as useLayoutItem, a as useRender, q as convertToUnit, f as makeThemeProps, h as makeTagProps, O as makeRoundedProps, W as makeLayoutItemProps, P as makeElevationProps, i as makeComponentProps, Q as makeBorderProps, _ as _export_sfc, X as eodashKey, r as useDisplay } from './asWebComponent-CLhcT715.js';
3
3
 
4
4
  const makeVFooterProps = propsFactory({
5
5
  app: Boolean,
@@ -1,7 +1,7 @@
1
1
  import { createVNode, toRef, shallowRef, computed, ref, watch, onMounted, onBeforeUnmount, watchEffect, mergeProps, inject, createBlock, openBlock, withCtx, createTextVNode, toDisplayString, unref } from 'vue';
2
- import { p as propsFactory, g as genericComponent, h as makeTagProps, i as makeComponentProps, a as useRender, B as useBackgroundColor, K as useBorder, L as useElevation, M as useRounded, b as provideTheme, c as useRtl, C as provideDefaults, N as VDefaultsProvider, q as convertToUnit, f as makeThemeProps, O as makeRoundedProps, P as makeElevationProps, Q as makeBorderProps, R as clamp, S as consoleWarn, j as useProxiedModel, T as useToggleScope, U as useLayoutItem, W as makeLayoutItemProps, _ as _export_sfc, X as eodashKey } from './asWebComponent-Df8nUiLs.js';
3
- import { a as VExpandTransition } from './index-Bt5GEGxl.js';
4
- import { V as VImg } from './VImg-BmCNSu3X.js';
2
+ import { p as propsFactory, g as genericComponent, h as makeTagProps, i as makeComponentProps, a as useRender, B as useBackgroundColor, K as useBorder, L as useElevation, M as useRounded, b as provideTheme, c as useRtl, C as provideDefaults, N as VDefaultsProvider, q as convertToUnit, f as makeThemeProps, O as makeRoundedProps, P as makeElevationProps, Q as makeBorderProps, R as clamp, S as consoleWarn, j as useProxiedModel, T as useToggleScope, U as useLayoutItem, W as makeLayoutItemProps, _ as _export_sfc, X as eodashKey } from './asWebComponent-CLhcT715.js';
3
+ import { a as VExpandTransition } from './index-Bm9cbtx5.js';
4
+ import { V as VImg } from './VImg-FD1WVphJ.js';
5
5
  import { u as useSsrBoot } from './ssrBoot-BP7SYRyC.js';
6
6
 
7
7
  const makeVToolbarTitleProps = propsFactory({
@@ -1,10 +1,10 @@
1
1
  import { ref, computed, createVNode, mergeProps, Fragment, shallowRef, watch, provide, withDirectives, resolveDirective, inject, vShow, nextTick, toRef, useCssVars, onMounted, createBlock, openBlock, withCtx, createElementBlock, Suspense, createCommentVNode, unref, resolveDynamicComponent, renderList, createElementVNode, createTextVNode, toDisplayString } from 'vue';
2
- import { k as keys, g as genericComponent, p as propsFactory, u as useTextColor, a as useRender, V as VBtn, o as omit, m as makeVBtnProps, b as provideTheme, c as useRtl, d as useLocale, e as useGroup, f as makeThemeProps, h as makeTagProps, i as makeComponentProps, j as useProxiedModel, l as useGroupItem, n as makeGroupItemProps, q as convertToUnit, r as useDisplay, s as useResizeObserver, t as useGoTo, I as IN_BROWSER, v as VIcon, w as makeGroupProps, x as makeDisplayProps, y as IconValue, z as focusableChildren, A as useDensity, B as useBackgroundColor, C as provideDefaults, D as makeDensityProps, E as isObject, _ as _export_sfc, F as useDefineTemplate, G as useLayout } from './asWebComponent-Df8nUiLs.js';
3
- import { V as VMain } from './VMain-eZDKIfmJ.js';
4
- import { f as forwardRefs, a as animate, s as standardEasing, u as useLazy, m as makeLazyProps, b as useScopeId } from './forwardRefs-lhDuXD-N.js';
2
+ import { k as keys, g as genericComponent, p as propsFactory, u as useTextColor, a as useRender, V as VBtn, o as omit, m as makeVBtnProps, b as provideTheme, c as useRtl, d as useLocale, e as useGroup, f as makeThemeProps, h as makeTagProps, i as makeComponentProps, j as useProxiedModel, l as useGroupItem, n as makeGroupItemProps, q as convertToUnit, r as useDisplay, s as useResizeObserver, t as useGoTo, I as IN_BROWSER, v as VIcon, w as makeGroupProps, x as makeDisplayProps, y as IconValue, z as focusableChildren, A as useDensity, B as useBackgroundColor, C as provideDefaults, D as makeDensityProps, E as isObject, _ as _export_sfc, F as useDefineTemplate, G as useLayout } from './asWebComponent-CLhcT715.js';
3
+ import { V as VMain } from './VMain-DJKG4SvM.js';
4
+ import { f as forwardRefs, a as animate, s as standardEasing, u as useLazy, m as makeLazyProps, b as useScopeId } from './forwardRefs-Bon_Kku1.js';
5
5
  import { u as useSsrBoot } from './ssrBoot-BP7SYRyC.js';
6
- import { M as MaybeTransition } from './transition-DHEuQX4I.js';
7
- import { V as VFadeTransition } from './index-Bt5GEGxl.js';
6
+ import { M as MaybeTransition } from './transition-C5I57hn6.js';
7
+ import { V as VFadeTransition } from './index-Bm9cbtx5.js';
8
8
 
9
9
  // Utilities
10
10
  const handleGesture = wrapper => {
@@ -1,7 +1,7 @@
1
1
  import { createVNode, Transition, mergeProps, ref, onBeforeUnmount, watch, nextTick, toRef, mergeModels, useModel, createElementBlock, openBlock, withCtx, createBlock, createCommentVNode, resolveDynamicComponent, unref, renderSlot } from 'vue';
2
- import { g as genericComponent, p as propsFactory, j as useProxiedModel, I as IN_BROWSER, a as useRender, z as focusableChildren, N as VDefaultsProvider, b as provideTheme, B as useBackgroundColor, K as useBorder, H as useDimension, L as useElevation, av as useLocation, aw as usePosition, M as useRounded, f as makeThemeProps, h as makeTagProps, O as makeRoundedProps, az as makePositionProps, aA as makeLocationProps, P as makeElevationProps, J as makeDimensionProps, i as makeComponentProps, Q as makeBorderProps, aJ as useDefineWidgets } from './asWebComponent-Df8nUiLs.js';
3
- import { m as makeVOverlayProps, V as VOverlay } from './VOverlay-BS-E4Z6g.js';
4
- import { a as animate, g as getTargetBox, n as nullifyTransforms, c as acceleratedEasing, d as deceleratedEasing, s as standardEasing, b as useScopeId, f as forwardRefs } from './forwardRefs-lhDuXD-N.js';
2
+ import { g as genericComponent, p as propsFactory, j as useProxiedModel, I as IN_BROWSER, a as useRender, z as focusableChildren, N as VDefaultsProvider, b as provideTheme, B as useBackgroundColor, K as useBorder, H as useDimension, L as useElevation, az as useLocation, aA as usePosition, M as useRounded, f as makeThemeProps, h as makeTagProps, O as makeRoundedProps, aD as makePositionProps, aE as makeLocationProps, P as makeElevationProps, J as makeDimensionProps, i as makeComponentProps, Q as makeBorderProps, aN as useDefineWidgets } from './asWebComponent-CLhcT715.js';
3
+ import { m as makeVOverlayProps, V as VOverlay } from './VOverlay-BzOdRu9h.js';
4
+ import { a as animate, g as getTargetBox, n as nullifyTransforms, c as acceleratedEasing, d as deceleratedEasing, s as standardEasing, b as useScopeId, f as forwardRefs } from './forwardRefs-Bon_Kku1.js';
5
5
 
6
6
  // Utilities
7
7
  const makeVDialogTransitionProps = propsFactory({
@@ -0,0 +1,484 @@
1
+ import { ref, createVNode, toRefs, onMounted, createElementBlock, openBlock, createBlock, createCommentVNode, unref, withCtx, createElementVNode, Fragment, renderList, toDisplayString, withDirectives } from 'vue';
2
+ import { mdiUploadBox, mdiDownloadBox, mdiTrashCanOutline } from '@mdi/js';
3
+ import { ai as axios, ak as extractLayerConfig, am as axios$1, aj as indicator, al as getLayers, a3 as mapEl, g as genericComponent, p as propsFactory, b as provideTheme, A as useDensity, a as useRender, f as makeThemeProps, h as makeTagProps, D as makeDensityProps, i as makeComponentProps, q as convertToUnit, Z as useSTAcStore, V as VBtn } from './asWebComponent-CLhcT715.js';
4
+ import { isMulti } from '@eox/jsonform/src/custom-inputs/spatial/utils';
5
+ import log from 'loglevel';
6
+ import { T as Tooltip } from './index-4CT7Tz83.js';
7
+
8
+ /**
9
+ * @param {Record<string,any> |null} [jsonformSchema]
10
+ **/
11
+ function getBboxProperty(jsonformSchema) {
12
+ return /** @type {string} */ (
13
+ Object.keys(jsonformSchema?.properties ?? {}).find(
14
+ (key) => jsonformSchema?.properties[key].format === "bounding-box",
15
+ )
16
+ );
17
+ }
18
+
19
+ /**
20
+ * Extracts the keys of type "geojson" from the jsonform schema
21
+ * @param {Record<string,any> |null} [jsonformSchema]
22
+ **/
23
+ function getGeoJsonProperties(jsonformSchema) {
24
+ return /** @type {string[]} */ (
25
+ Object.keys(jsonformSchema?.properties ?? {}).filter(
26
+ (key) => jsonformSchema?.properties[key].type === "geojson",
27
+ )
28
+ );
29
+ }
30
+
31
+ /**
32
+ * Converts jsonform geojson values to stringified geometries
33
+ * @param {Record<string,any> |null} [jsonformSchema]
34
+ * @param {Record<string,any>} jsonformValue
35
+ **/
36
+ function extractGeometries(jsonformValue, jsonformSchema) {
37
+ const geojsonKeys = getGeoJsonProperties(jsonformSchema);
38
+
39
+ for (const key of geojsonKeys) {
40
+ if (!jsonformValue[key]) {
41
+ continue;
42
+ }
43
+
44
+ if (isMulti(jsonformSchema?.properties[key])) {
45
+ // jsonformValue[key] is a feature collection
46
+ jsonformValue[key] =
47
+ /** @type {import("ol/format/GeoJSON").GeoJSONFeatureCollection} */ (
48
+ jsonformValue[key]
49
+ ).features.map((feature) => JSON.stringify(feature.geometry));
50
+ } else {
51
+ // jsonformValue[key] is a single feature
52
+ jsonformValue[key] = JSON.stringify(jsonformValue[key].geometry);
53
+ }
54
+ }
55
+ }
56
+
57
+ /**
58
+ *
59
+ * @param {*} link
60
+ * @param {*} layerId
61
+ * @param {string[]} urls
62
+ * @param {*} projection
63
+ * @param {*} processId
64
+ * @returns
65
+ */
66
+ async function createLayerDefinition(
67
+ link,
68
+ layerId,
69
+ urls,
70
+ projection,
71
+ processId,
72
+ ) {
73
+ let flatStyleJSON = null;
74
+ if ("eox:flatstyle" in (link ?? {})) {
75
+ flatStyleJSON = await axios
76
+ .get(/** @type {string} */ (link["eox:flatstyle"]))
77
+ .then((resp) => resp.data);
78
+ }
79
+
80
+ /** @type {Record<string,any>|undefined} */
81
+ let layerConfig;
82
+ /** @type {Record<string,any>|undefined} */
83
+ let style;
84
+ if (flatStyleJSON) {
85
+ const extracted = extractLayerConfig(layerId ?? "", flatStyleJSON);
86
+ layerConfig = extracted.layerConfig;
87
+ style = extracted.style;
88
+ }
89
+ // We want to make sure the urls are alphabetically sorted
90
+ urls = urls.sort();
91
+ const layerdef =
92
+ urls.length > 0
93
+ ? {
94
+ type: "WebGLTile",
95
+ source: {
96
+ type: "GeoTIFF",
97
+ normalize: !style,
98
+ sources: urls.map((url) => ({ url })),
99
+ },
100
+ properties: {
101
+ id: layerId + "_geotiff_process" + processId,
102
+ title: "Results " + layerId,
103
+ ...(layerConfig && { layerConfig: layerConfig }),
104
+ layerControlToolsExpand: true,
105
+ },
106
+ ...(style && { style: style }),
107
+ }
108
+ : undefined;
109
+
110
+ // We want to see if the currently selected indicator uses a
111
+ // specific map projection if it does we want to apply it
112
+ if (projection && layerdef) {
113
+ //@ts-expect-error TODO
114
+ layerdef.source.projection = projection;
115
+ }
116
+ return layerdef;
117
+ }
118
+ /**
119
+ * @param {string} fileName
120
+ * @param {string|Record<string,any>} content
121
+ * @returns
122
+ */
123
+ const download = (fileName, content) => {
124
+ if (!content) {
125
+ return;
126
+ }
127
+ let url = /** @type string */ (content);
128
+ if (typeof content === "object") {
129
+ content = JSON.stringify(content);
130
+ const blob = new Blob([content], { type: "text" });
131
+ url = URL.createObjectURL(blob);
132
+ }
133
+ const link = document.createElement("a");
134
+ if (confirm(`Would you like to download ${fileName}?`)) {
135
+ link.href = url;
136
+ link.download = fileName;
137
+ link.click();
138
+ }
139
+ URL.revokeObjectURL(url);
140
+ link.remove();
141
+ };
142
+
143
+ /**
144
+ * The list of job result from the server
145
+ * {job_start_datetime: string, job_end_datetime: string,status: string}
146
+ * @type {import("vue").Ref<any[]>}
147
+ **/
148
+ const jobs = ref([]);
149
+
150
+ /**
151
+ * Polls the process status and fetches a result item when the process is successful.
152
+ *
153
+ * @param {Object} params - Parameters for polling the process status.
154
+ * @param {string} params.processUrl - The URL of the process JSON report.
155
+ * @param {import("vue").Ref<boolean>} params.isPolling - checks wether the polling should continue
156
+ * @param {number} [params.pollInterval=5000] - The interval (in milliseconds) between polling attempts.
157
+ * @param {number} [params.maxRetries=60] - The maximum number of polling attempts.
158
+ * @returns {Promise<JSON>} The fetched results JSON.
159
+ * @throws {Error} If the process does not complete successfully within the maximum retries.
160
+ */
161
+ async function pollProcessStatus({
162
+ processUrl,
163
+ isPolling,
164
+ pollInterval = 10000,
165
+ maxRetries = 560,
166
+ }) {
167
+ let retries = 0;
168
+ isPolling.value = true;
169
+ setTimeout(() => {
170
+ updateJobsStatus(jobs, indicator);
171
+ }, 500);
172
+ while (retries < maxRetries && isPolling.value) {
173
+ try {
174
+ // Fetch the process JSON report
175
+ const cacheBuster = new Date().getTime(); // Add a timestamp for cache busting
176
+ const response = await axios$1.get(`${processUrl}?t=${cacheBuster}`);
177
+ const processReport = response.data;
178
+
179
+ // Check if the status is "successful"
180
+ if (processReport.status === "successful") {
181
+ console.log("Process completed successfully. Fetching result item...");
182
+
183
+ // Extract the result item URL
184
+ const resultsUrl = processReport.links[1].href;
185
+ if (!resultsUrl) {
186
+ throw new Error(`Result links not found in the process report.`);
187
+ }
188
+
189
+ // Fetch the result item
190
+ const resultResponse = await axios$1.get(resultsUrl);
191
+ console.log("Result file fetched successfully:", resultResponse.data);
192
+ return resultResponse.data; // Return the json result list
193
+ }
194
+ if (processReport.status === "failed") {
195
+ isPolling.value = false;
196
+ throw new Error("Process failed.", processReport);
197
+ }
198
+
199
+ // Log the current status if not successful
200
+ console.log(
201
+ `Status: ${processReport.status}. Retrying in ${pollInterval / 1000} seconds...`,
202
+ );
203
+ } catch (error) {
204
+ if (error instanceof Error) {
205
+ console.error("Error while polling process status:", error.message);
206
+ } else {
207
+ console.error("Unknown error occurred:", error);
208
+ }
209
+ }
210
+
211
+ // Wait for the next poll
212
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
213
+ retries++;
214
+ }
215
+ if (!isPolling.value) {
216
+ console.warn("Polling was stopped before the process was completed.");
217
+ return JSON.parse("{}");
218
+ }
219
+
220
+ throw new Error(
221
+ "Max retries reached. Process did not complete successfully.",
222
+ );
223
+ }
224
+
225
+ /**
226
+ *
227
+ * @param {*} jobs
228
+ * @param {*} indicator
229
+ */
230
+ async function updateJobsStatus(jobs, indicator) {
231
+ /** @type {string[]} */
232
+ const jobsUrls = JSON.parse(localStorage.getItem(indicator.value) || "[]");
233
+ const jobResults = await Promise.all(
234
+ jobsUrls.map((url) => fetch(url).then((response) => response.json())),
235
+ );
236
+ jobResults.sort((a, b) => {
237
+ return (
238
+ new Date(b.job_start_datetime).getTime() -
239
+ new Date(a.job_start_datetime).getTime()
240
+ );
241
+ });
242
+ jobs.value = jobResults;
243
+ }
244
+
245
+ /**
246
+ * Removes a job from the local storage and updates the job status
247
+ * @param {*} jobObject
248
+ */
249
+ const deleteJob = async (jobObject) => {
250
+ /** @type {string[]} */
251
+ const jobsUrls = JSON.parse(localStorage.getItem(indicator.value) || "[]");
252
+ const newJobs = jobsUrls.filter((url) => !url.includes(jobObject.jobID));
253
+ localStorage.setItem(indicator.value, JSON.stringify(newJobs));
254
+ updateJobsStatus(jobs, indicator);
255
+ };
256
+
257
+ /**
258
+ * Downloads an existing process results
259
+ * @param {*} jobObject
260
+ * @param {*} selectedStac
261
+ */
262
+ const downloadPreviousResults = async (jobObject, selectedStac) => {
263
+ /** @type {any[]} */
264
+ const results = [];
265
+ await fetch(jobObject.links[1].href)
266
+ .then((response) => response.json())
267
+ .then((data) => {
268
+ results.push(...data.urls);
269
+ });
270
+ results.forEach((result) => {
271
+ if (!result) {
272
+ return;
273
+ }
274
+ let fileName = "";
275
+ if (typeof result === "string") {
276
+ fileName = result.includes("/")
277
+ ? (result.split("/").pop() ?? "")
278
+ : result;
279
+ fileName = fileName.includes("?") ? fileName.split("?")[0] : fileName;
280
+ } else {
281
+ fileName = selectedStac?.id + "_process_results.json";
282
+ }
283
+ download(fileName, result);
284
+ });
285
+ };
286
+
287
+ /**
288
+ * Load the process results and update the map layers.
289
+ *
290
+ * @async
291
+ * @param {*} jobObject
292
+ * @param {*} selectedStac
293
+ */
294
+ const loadProcess = async (jobObject, selectedStac) => {
295
+ /** @type {any[]} */
296
+ const results = [];
297
+ await axios$1
298
+ .get(jobObject.links[1].href)
299
+ .then((response) => results.push(response.data));
300
+
301
+ await loadPreviousProcess({
302
+ selectedStac,
303
+ results,
304
+ jobId: jobObject.jobID,
305
+ });
306
+ };
307
+
308
+ /**
309
+ * load a geotiff to the map from an existing process
310
+ *
311
+ * @param {Object} params
312
+ * @param {import("stac-ts").StacCollection | null} params.selectedStac
313
+ * @param {any[]} params.results
314
+ * @param {string} params.jobId
315
+ */
316
+ async function loadPreviousProcess({ selectedStac, results, jobId }) {
317
+ const geotiffLinks = selectedStac?.links.filter(
318
+ (link) => link.rel === "service" && link.type === "image/tiff",
319
+ );
320
+ // const stacProjection = selectedStac
321
+ const geotiffLayer = await createLayerDefinition(
322
+ geotiffLinks?.[0],
323
+ selectedStac?.id ?? "",
324
+ results?.[0].urls,
325
+ //@ts-expect-error TODO
326
+ selectedStac?.["eodash:mapProjection"]?.["name"] ?? null,
327
+ jobId,
328
+ );
329
+
330
+ log.debug("rendered layers after loading previous process:", geotiffLayer);
331
+
332
+ if (geotiffLayer) {
333
+ const layers = [...(geotiffLayer ? [geotiffLayer] : [])];
334
+ let currentLayers = [...getLayers()];
335
+ let analysisGroup = currentLayers.find((l) =>
336
+ l.properties.id.includes("AnalysisGroup"),
337
+ );
338
+ analysisGroup?.layers.push(...layers);
339
+
340
+ if (mapEl.value) {
341
+ mapEl.value.layers = [...currentLayers];
342
+ }
343
+ }
344
+ }
345
+
346
+ const makeVTableProps = propsFactory({
347
+ fixedHeader: Boolean,
348
+ fixedFooter: Boolean,
349
+ height: [Number, String],
350
+ hover: Boolean,
351
+ ...makeComponentProps(),
352
+ ...makeDensityProps(),
353
+ ...makeTagProps(),
354
+ ...makeThemeProps()
355
+ }, 'VTable');
356
+ const VTable = genericComponent()({
357
+ name: 'VTable',
358
+ props: makeVTableProps(),
359
+ setup(props, _ref) {
360
+ let {
361
+ slots,
362
+ emit
363
+ } = _ref;
364
+ const {
365
+ themeClasses
366
+ } = provideTheme(props);
367
+ const {
368
+ densityClasses
369
+ } = useDensity(props);
370
+ useRender(() => createVNode(props.tag, {
371
+ "class": ['v-table', {
372
+ 'v-table--fixed-height': !!props.height,
373
+ 'v-table--fixed-header': props.fixedHeader,
374
+ 'v-table--fixed-footer': props.fixedFooter,
375
+ 'v-table--has-top': !!slots.top,
376
+ 'v-table--has-bottom': !!slots.bottom,
377
+ 'v-table--hover': props.hover
378
+ }, themeClasses.value, densityClasses.value, props.class],
379
+ "style": props.style
380
+ }, {
381
+ default: () => [slots.top?.(), slots.default ? createVNode("div", {
382
+ "class": "v-table__wrapper",
383
+ "style": {
384
+ height: convertToUnit(props.height)
385
+ }
386
+ }, [createVNode("table", null, [slots.default()])]) : slots.wrapper?.(), slots.bottom?.()]
387
+ }));
388
+ return {};
389
+ }
390
+ });
391
+
392
+ const _hoisted_1 = { style: {"padding":"0px"} };
393
+ const _hoisted_2 = { style: {"padding":"0px"} };
394
+ const _hoisted_3 = { style: {"padding":"0px"} };
395
+
396
+
397
+ const _sfc_main = {
398
+ __name: 'ProcessList',
399
+ setup(__props) {
400
+
401
+ const { selectedStac } = toRefs(useSTAcStore());
402
+
403
+ onMounted(() => updateJobsStatus(jobs, indicator));
404
+
405
+ return (_ctx, _cache) => {
406
+
407
+
408
+
409
+
410
+ return (openBlock(), createElementBlock("div", null, [
411
+ (unref(jobs).length)
412
+ ? (openBlock(), createBlock(VTable, {
413
+ key: 0,
414
+ density: "compact",
415
+ style: {"background-color":"transparent"}
416
+ }, {
417
+ default: withCtx(() => [
418
+ _cache[0] || (_cache[0] = createElementVNode("thead", null, [
419
+ createElementVNode("tr", null, [
420
+ createElementVNode("th", { class: "text-left" }, "Executed on"),
421
+ createElementVNode("th", { class: "text-left" }, "Status"),
422
+ createElementVNode("th", { class: "text-left" }),
423
+ createElementVNode("th", { class: "text-left" }),
424
+ createElementVNode("th", { class: "text-left" })
425
+ ])
426
+ ], -1 /* HOISTED */)),
427
+ createElementVNode("tbody", null, [
428
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(jobs), (item) => {
429
+ return (openBlock(), createElementBlock("tr", {
430
+ key: item.date
431
+ }, [
432
+ createElementVNode("td", null, toDisplayString(new Date(item.job_start_datetime).toISOString().slice(0, 16)), 1 /* TEXT */),
433
+ createElementVNode("td", null, toDisplayString(item.status), 1 /* TEXT */),
434
+ createElementVNode("td", _hoisted_1, [
435
+ withDirectives(createVNode(VBtn, {
436
+ disabled: item.status !== 'successful',
437
+ color: "primary",
438
+ onClick: $event => (unref(loadProcess)(item, unref(selectedStac))),
439
+ icon: [unref(mdiUploadBox)],
440
+ variant: "text"
441
+ }, null, 8 /* PROPS */, ["disabled", "onClick", "icon"]), [
442
+ [Tooltip, 'Load results to map']
443
+ ])
444
+ ]),
445
+ createElementVNode("td", _hoisted_2, [
446
+ withDirectives(createVNode(VBtn, {
447
+ disabled: item.status !== 'successful',
448
+ color: "primary",
449
+ onClick: $event => (unref(downloadPreviousResults)(item, unref(selectedStac))),
450
+ icon: [unref(mdiDownloadBox)],
451
+ variant: "text"
452
+ }, null, 8 /* PROPS */, ["disabled", "onClick", "icon"]), [
453
+ [Tooltip, 'Download results']
454
+ ])
455
+ ]),
456
+ createElementVNode("td", _hoisted_3, [
457
+ withDirectives(createVNode(VBtn, {
458
+ color: "#ff5252",
459
+ onClick: $event => (unref(deleteJob)(item)),
460
+ icon: [unref(mdiTrashCanOutline)],
461
+ variant: "text"
462
+ }, null, 8 /* PROPS */, ["onClick", "icon"]), [
463
+ [Tooltip, 'Remove job']
464
+ ])
465
+ ])
466
+ ]))
467
+ }), 128 /* KEYED_FRAGMENT */))
468
+ ])
469
+ ]),
470
+ _: 1 /* STABLE */
471
+ }))
472
+ : createCommentVNode("v-if", true)
473
+ ]))
474
+ }
475
+ }
476
+
477
+ };
478
+
479
+ const ProcessList = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
480
+ __proto__: null,
481
+ default: _sfc_main
482
+ }, Symbol.toStringTag, { value: 'Module' }));
483
+
484
+ export { ProcessList as P, _sfc_main as _, createLayerDefinition as c, download as d, extractGeometries as e, getBboxProperty as g, jobs as j, pollProcessStatus as p, updateJobsStatus as u };