@eodash/eodash 5.0.0-alpha.2.9 → 5.0.0-processing

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 (137) hide show
  1. package/README.md +1 -1
  2. package/core/client/App.vue +13 -1
  3. package/core/client/asWebComponent.js +13 -3
  4. package/core/client/components/DashboardLayout.vue +6 -2
  5. package/core/client/composables/DefineEodash.js +1 -1
  6. package/core/client/composables/EodashMap.js +349 -0
  7. package/core/client/composables/EodashProcess.js +575 -0
  8. package/core/client/composables/index.js +107 -24
  9. package/core/client/eodash.js +83 -10
  10. package/core/client/plugins/axios.js +8 -0
  11. package/core/client/plugins/index.js +2 -1
  12. package/core/client/store/Actions.js +63 -12
  13. package/core/client/store/States.js +19 -0
  14. package/core/client/store/stac.js +98 -8
  15. package/core/client/types.d.ts +25 -18
  16. package/core/client/utils/createLayers.js +313 -0
  17. package/core/client/utils/eodashSTAC.js +320 -170
  18. package/core/client/utils/helpers.js +369 -9
  19. package/core/client/utils/keys.js +2 -0
  20. package/core/client/utils/states.js +17 -0
  21. package/core/client/views/Dashboard.vue +17 -46
  22. package/core/client/vite-env.d.ts +1 -9
  23. package/dist/client/DashboardLayout-CVMJ4l8M.js +87 -0
  24. package/dist/client/DynamicWebComponent-Cv8n457T.js +88 -0
  25. package/dist/client/EodashDatePicker-VVkiPmpc.js +394 -0
  26. package/dist/client/EodashItemFilter-CugWNQ86.js +194 -0
  27. package/dist/client/EodashLayerControl-53WghA8G.js +110 -0
  28. package/dist/client/EodashMap-CQnOePpy.js +486 -0
  29. package/dist/client/EodashMapBtns-uaRwFtfB.js +66 -0
  30. package/dist/client/EodashProcess-cF0unIy8.js +1477 -0
  31. package/dist/client/ExportState-BT8MLAW7.js +644 -0
  32. package/dist/client/Footer-C6GUG84G.js +141 -0
  33. package/dist/client/Header-D2dtCWp8.js +437 -0
  34. package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
  35. package/dist/client/MobileLayout-BAo8Wr8T.js +1210 -0
  36. package/dist/client/PopUp-Bm01q7Ko.js +389 -0
  37. package/dist/client/VImg-B8AbetCE.js +384 -0
  38. package/dist/client/VMain-DnGlQUyr.js +43 -0
  39. package/dist/client/VOverlay-B8Qj7LRG.js +1453 -0
  40. package/dist/client/WidgetsContainer-CwXRRLS1.js +83 -0
  41. package/dist/client/asWebComponent-DUUoR7MZ.js +11621 -0
  42. package/dist/client/eo-dash.js +2 -6
  43. package/dist/client/forwardRefs-CZJhEAKW.js +245 -0
  44. package/dist/client/index-DlIO7sJ3.js +199 -0
  45. package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
  46. package/dist/client/style.css +2 -2
  47. package/dist/client/transition-BiR8wMn1.js +37 -0
  48. package/dist/node/cli.js +4 -4
  49. package/dist/node/types.d.ts +2 -0
  50. package/dist/types/core/client/App.vue.d.ts +7 -0
  51. package/dist/types/core/client/asWebComponent.d.ts +9 -0
  52. package/dist/types/core/client/components/DashboardLayout.vue.d.ts +2 -0
  53. package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +18 -0
  54. package/dist/types/core/client/components/ErrorAlert.vue.d.ts +2 -0
  55. package/dist/types/core/client/components/Footer.vue.d.ts +2 -0
  56. package/dist/types/core/client/components/Header.vue.d.ts +2 -0
  57. package/dist/types/core/client/components/IframeWrapper.vue.d.ts +7 -0
  58. package/dist/types/core/client/components/Loading.vue.d.ts +2 -0
  59. package/dist/types/core/client/components/MobileLayout.vue.d.ts +2 -0
  60. package/dist/types/core/client/composables/DefineEodash.d.ts +2 -0
  61. package/dist/types/core/client/composables/DefineTemplate.d.ts +15 -0
  62. package/dist/types/core/client/composables/DefineWidgets.d.ts +14 -0
  63. package/dist/types/core/client/composables/EodashMap.d.ts +5 -0
  64. package/dist/types/core/client/composables/index.d.ts +30 -0
  65. package/dist/types/core/client/eodash.d.ts +8 -0
  66. package/dist/types/core/client/main.d.ts +2 -0
  67. package/dist/types/core/client/plugins/axios.d.ts +2 -0
  68. package/dist/types/core/client/plugins/index.d.ts +3 -0
  69. package/dist/types/core/client/plugins/vuetify.d.ts +82 -0
  70. package/dist/types/core/client/render.d.ts +1 -0
  71. package/dist/types/core/client/store/Actions.d.ts +12 -0
  72. package/dist/types/core/client/store/States.d.ts +22 -0
  73. package/dist/types/core/client/store/index.d.ts +2 -0
  74. package/dist/types/core/client/store/stac.d.ts +25 -0
  75. package/dist/types/core/client/types.d.ts +279 -0
  76. package/dist/types/core/client/utils/createLayers.d.ts +45 -0
  77. package/dist/types/core/client/utils/eodashSTAC.d.ts +82 -0
  78. package/dist/types/core/client/utils/helpers.d.ts +84 -0
  79. package/dist/types/core/client/utils/index.d.ts +2 -0
  80. package/dist/types/core/client/utils/keys.d.ts +6 -0
  81. package/dist/types/core/client/utils/states.d.ts +14 -0
  82. package/dist/types/core/client/views/Dashboard.vue.d.ts +9 -0
  83. package/dist/types/widgets/EodashDatePicker.vue.d.ts +7 -0
  84. package/dist/types/widgets/EodashItemFilter.vue.d.ts +42 -0
  85. package/dist/types/widgets/EodashLayerControl.vue.d.ts +11 -0
  86. package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +9 -0
  87. package/dist/types/widgets/EodashMap.vue.d.ts +7 -0
  88. package/dist/types/widgets/EodashMapBtns.vue.d.ts +11 -0
  89. package/dist/types/widgets/EodashStacInfo.vue.d.ts +21 -0
  90. package/dist/types/widgets/EodashTools.vue.d.ts +15 -0
  91. package/dist/types/widgets/ExportState.vue.d.ts +7 -0
  92. package/dist/types/widgets/PopUp.vue.d.ts +22 -0
  93. package/dist/types/widgets/WidgetsContainer.vue.d.ts +7 -0
  94. package/package.json +58 -37
  95. package/widgets/EodashDatePicker.vue +128 -100
  96. package/widgets/EodashItemFilter.vue +100 -14
  97. package/widgets/EodashLayerControl.vue +98 -0
  98. package/widgets/EodashMap.vue +98 -122
  99. package/widgets/EodashMapBtns.vue +24 -7
  100. package/widgets/EodashProcess.vue +151 -0
  101. package/widgets/ExportState.vue +15 -11
  102. package/core/client/SuspensedDashboard.ce.vue +0 -105
  103. package/dist/client/DashboardLayout-D0ZF6V2S.js +0 -156
  104. package/dist/client/DynamicWebComponent-CPsMSBHi.js +0 -57
  105. package/dist/client/EodashDatePicker-CBQP7u2X.js +0 -252
  106. package/dist/client/EodashItemFilter-DL2ScI-5.js +0 -7671
  107. package/dist/client/EodashMap-CkKoQlmR.js +0 -86917
  108. package/dist/client/EodashMapBtns-yuO2QmiR.js +0 -36
  109. package/dist/client/ExportState-CCzOhppU.js +0 -558
  110. package/dist/client/Footer-BPAND0yG.js +0 -115
  111. package/dist/client/Header-DLhebNvG.js +0 -350
  112. package/dist/client/IframeWrapper-1GEMHlsW.js +0 -19
  113. package/dist/client/MobileLayout-mGkOYRhu.js +0 -945
  114. package/dist/client/PopUp-1d2bBFjw.js +0 -300
  115. package/dist/client/VImg-DxHcztfM.js +0 -291
  116. package/dist/client/VMain-BLX5vRRn.js +0 -39
  117. package/dist/client/VOverlay-CvrYEmLu.js +0 -967
  118. package/dist/client/WidgetsContainer-CmYjvGm7.js +0 -129
  119. package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
  120. package/dist/client/asWebComponent-B91uK0U7.js +0 -20361
  121. package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
  122. package/dist/client/decoder-CP4lv0Kb-B6yqkcfC.js +0 -10
  123. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
  124. package/dist/client/eodashSTAC-DBjqe_Ho.js +0 -2788
  125. package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
  126. package/dist/client/forwardRefs-BJJiadQP.js +0 -185
  127. package/dist/client/index-Q-bHLjxx.js +0 -153
  128. package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
  129. package/dist/client/lerc-DzVumYtB-P-KXC0TO.js +0 -1027
  130. package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
  131. package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
  132. package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
  133. package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
  134. package/dist/client/ssrBoot-yo11mybw.js +0 -17
  135. package/dist/client/transition-CSJhuYGK.js +0 -34
  136. package/dist/client/webfontloader-qotgY98I.js +0 -435
  137. package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
@@ -1,105 +0,0 @@
1
- <template>
2
- <v-app ref="vAppRef">
3
- <Suspense>
4
- <Dashboard :on-template-mount="setStylesFromHead" :config="config" />
5
-
6
- <template #fallback>
7
- <ErrorAlert @vue:mounted="setStylesFromHead()" v-model="error" />
8
- </template>
9
- </Suspense>
10
- </v-app>
11
- </template>
12
- <script setup>
13
- import Dashboard from "@/views/Dashboard.vue";
14
- import { createApp, getCurrentInstance, onErrorCaptured, ref } from "vue";
15
- import { registerPlugins } from "@/plugins";
16
- import { eodashKey } from "@/utils/keys";
17
- import ErrorAlert from "@/components/ErrorAlert.vue";
18
-
19
- defineProps({
20
- config: {
21
- type: String,
22
- },
23
- });
24
-
25
- /** @type {import("vue").Ref<import("vuetify/components").VApp | null>} */
26
- const vAppRef = ref(null);
27
- const app = createApp({});
28
- registerPlugins(app);
29
-
30
- const inst = getCurrentInstance();
31
-
32
- Object.assign(inst?.appContext ?? {}, app._context);
33
-
34
- //@ts-expect-error Property 'provides' does not exist on type 'ComponentInternalInstance'
35
- Object.assign(inst?.provides ?? {}, app._context.provides);
36
-
37
- /**
38
- * @param {import("vue").Ref<
39
- * HTMLElement | import("vue").ComponentPublicInstance
40
- * >[]} [hiddenElements]
41
- */
42
- function setStylesFromHead(hiddenElements) {
43
- const eodashShadowRoot = vAppRef.value?.$el.getRootNode();
44
- const styleSheet = new CSSStyleSheet();
45
- const head = document.querySelector("head");
46
- let stylesStr = "";
47
-
48
- Array.from(head?.children ?? []).forEach((child) => {
49
- if (child.getAttribute("type") === "text/css") {
50
- stylesStr += `\n ${child.innerHTML}`;
51
- return;
52
- }
53
-
54
- if (
55
- child.tagName == "LINK" &&
56
- child.getAttribute("rel")?.includes("stylesheet")
57
- ) {
58
- eodashShadowRoot?.appendChild(child.cloneNode(true));
59
- }
60
- });
61
-
62
- stylesStr += `\n
63
- ${
64
- //@ts-expect-error Property 'provides' does not exist on type 'ComponentInternalInstance'
65
- /** @type {import("@/types").Eodash} */ (inst?.provides[eodashKey])
66
- ?.brand.noLayout
67
- ? `div.v-application__wrap {
68
- min-height: fit-content;
69
- }`
70
- : ""
71
- }
72
- `;
73
- styleSheet.replaceSync(stylesStr.replaceAll(":root", ":host"));
74
- eodashShadowRoot?.adoptedStyleSheets.push(styleSheet);
75
-
76
- if (
77
- hiddenElements &&
78
- !(
79
- //@ts-expect-error Property 'provides' does not exist on type 'ComponentInternalInstance'
80
- /** @type {import("@/types").Eodash} */ (inst.provides[eodashKey])?.brand
81
- .noLayout
82
- )
83
- ) {
84
- hiddenElements.forEach((element) => {
85
- if (element.value) {
86
- if (element.value instanceof HTMLElement) {
87
- element.value.style.opacity = "1";
88
- } else {
89
- /** @type {HTMLElement} */
90
- (element.value.$el).style.opacity = "1";
91
- }
92
- }
93
- });
94
- }
95
- }
96
-
97
- const error = ref("");
98
- onErrorCaptured((e, comp, info) => {
99
- error.value = `
100
- ${e}.
101
- component: ${comp?.$.type.name}.
102
- info: ${info}.
103
- `;
104
- });
105
- </script>
@@ -1,156 +0,0 @@
1
- import { _ as y, x as m, W as x, X as d, $ as t, a0 as r, a1 as l, a9 as _, a3 as n, a6 as u, a2 as c, a4 as p, d as h, a5 as g, F as f, a7 as v, ab as w } from "./asWebComponent-B91uK0U7.js";
2
- import { V as k } from "./VMain-BLX5vRRn.js";
3
- class A extends HTMLElement {
4
- static get observedAttributes() {
5
- return ["gap"];
6
- }
7
- constructor() {
8
- super(), this.attachShadow({ mode: "open" }), this.render();
9
- }
10
- render() {
11
- this.shadowRoot.innerHTML = `
12
- <style>
13
- :host {
14
- display: grid;
15
- padding: ${this.getAttribute("gap") || 0}px;
16
- height: 100%;
17
- box-sizing: border-box;
18
- gap: ${this.getAttribute("gap") || "0"}px;
19
- grid-template-columns: repeat(12, 1fr);
20
- grid-template-rows: repeat(12, 1fr);
21
- }
22
- </style>
23
- <slot></slot>
24
- `;
25
- }
26
- attributeChangedCallback(a, s, o) {
27
- s !== o && (this[a] = o), this.render();
28
- }
29
- }
30
- class C extends HTMLElement {
31
- static get observedAttributes() {
32
- return ["x", "y", "w", "h"];
33
- }
34
- constructor() {
35
- super(), this.attachShadow({ mode: "open" }), this.render();
36
- }
37
- render() {
38
- this.shadowRoot.innerHTML = `
39
- <style>
40
- :host {
41
- background: lightgrey;
42
- border: 1px solid darkgrey;
43
- border-radius: 4px;
44
- padding: 4px 8px;
45
- overflow: hidden;
46
-
47
-
48
- grid-column: ${parseInt(this.getAttribute("x")) + 1} / span ${this.getAttribute("w")};
49
- grid-row: ${parseInt(this.getAttribute("y")) + 1} / span ${this.getAttribute("h")};
50
- }
51
- </style>
52
- <slot></slot>
53
- `;
54
- }
55
- attributeChangedCallback(a, s, o) {
56
- s !== o && (this[a] = o), this.render();
57
- }
58
- }
59
- customElements.define("eox-layout", A);
60
- customElements.define("eox-layout-item", C);
61
- const L = ["gap"], $ = {
62
- key: 0,
63
- class: "bg-panel",
64
- x: "0",
65
- y: "0",
66
- h: "12",
67
- w: "12"
68
- }, E = ["h", "w", "x", "y"], M = {
69
- __name: "DashboardLayout",
70
- setup(i) {
71
- const a = (
72
- /** @type {import("@/types").Eodash} */
73
- m(x)
74
- ), [s] = d([a.template?.background]), o = d(a.template?.widgets);
75
- return (T, B) => (t(), r(k, null, {
76
- default: l(() => [
77
- _("eox-layout", {
78
- gap: n(a).template.gap ?? 2
79
- }, [
80
- n(s).component ? (t(), u("eox-layout-item", $, [
81
- (t(), r(c, { suspensible: "" }, {
82
- default: l(() => [
83
- (t(), r(
84
- p(n(s).component),
85
- h({ id: "bg-widget" }, n(s).props),
86
- null,
87
- 16
88
- /* FULL_PROPS */
89
- ))
90
- ]),
91
- _: 1
92
- /* STABLE */
93
- }))
94
- ])) : g("v-if", !0),
95
- (t(!0), u(
96
- f,
97
- null,
98
- v(n(o), (e, b) => (t(), r(
99
- w,
100
- {
101
- key: b,
102
- name: "fade"
103
- },
104
- {
105
- default: l(() => [
106
- e.value.component ? (t(), u("eox-layout-item", {
107
- key: e.value.id,
108
- class: "panel bg-surface",
109
- h: e.value.layout.h,
110
- w: e.value.layout.w,
111
- x: e.value.layout.x,
112
- y: e.value.layout.y
113
- }, [
114
- (t(), r(
115
- c,
116
- { suspensible: "" },
117
- {
118
- default: l(() => [
119
- (t(), r(
120
- p(e.value.component),
121
- h({
122
- key: e.value.id,
123
- ref_for: !0
124
- }, e.value.props),
125
- null,
126
- 16
127
- /* FULL_PROPS */
128
- ))
129
- ]),
130
- _: 2
131
- /* DYNAMIC */
132
- },
133
- 1024
134
- /* DYNAMIC_SLOTS */
135
- ))
136
- ], 8, E)) : g("v-if", !0)
137
- ]),
138
- _: 2
139
- /* DYNAMIC */
140
- },
141
- 1024
142
- /* DYNAMIC_SLOTS */
143
- ))),
144
- 128
145
- /* KEYED_FRAGMENT */
146
- ))
147
- ], 8, L)
148
- ]),
149
- _: 1
150
- /* STABLE */
151
- }));
152
- }
153
- }, V = /* @__PURE__ */ y(M, [["__scopeId", "data-v-a859692c"]]);
154
- export {
155
- V as default
156
- };
@@ -1,57 +0,0 @@
1
- import { by as i, aA as m, r as p, Z as d, aJ as f, $ as c, a6 as g, a0 as y, d as _, a4 as k } from "./asWebComponent-B91uK0U7.js";
2
- const h = { class: "d-flex flex-column fill-height overflow-auto" }, N = {
3
- __name: "DynamicWebComponent",
4
- props: {
5
- link: {
6
- type: [String, Function],
7
- required: !0
8
- },
9
- constructorProp: String,
10
- tagName: {
11
- type: String,
12
- required: !0
13
- },
14
- properties: {
15
- type: Object,
16
- default: () => ({})
17
- },
18
- onMounted: Function,
19
- onUnmounted: Function
20
- },
21
- async setup(o) {
22
- let t, a;
23
- const e = (
24
- /** @type {import("@/types").WebComponentProps} */
25
- o
26
- ), u = async () => typeof e.link == "string" ? await import(
27
- /* @vite-ignore */
28
- e.link
29
- ) : await e.link(), l = customElements.get(e.tagName) ? null : ([t, a] = i(() => u().catch((n) => {
30
- console.error(n);
31
- })), t = await t, a(), t);
32
- if (!customElements.get(e.tagName) && e.constructorProp) {
33
- const n = l[e.constructorProp];
34
- customElements.define(e.tagName, n);
35
- }
36
- const s = m(), r = p(null);
37
- return d(() => {
38
- e.onMounted?.(r.value, s);
39
- }), f(() => {
40
- e.onUnmounted?.(r.value, s);
41
- }), (n, x) => (c(), g("span", h, [
42
- (c(), y(
43
- k(o.tagName),
44
- _(o.properties, {
45
- ref_key: "elementRef",
46
- ref: r
47
- }),
48
- null,
49
- 16
50
- /* FULL_PROPS */
51
- ))
52
- ]));
53
- }
54
- };
55
- export {
56
- N as default
57
- };
@@ -1,252 +0,0 @@
1
- import { p as B, o as $, g as j, y as _, av as I, c as v, r as V, d as w, a as M, b as p, aw as R, ax as O, T as U, ay as F, x as N, Z as Y, az as H, aA as z, w as G, $ as h, a6 as W, a1 as y, a3 as C, aB as K, F as L, W as Z, a9 as k, aC as q, aD as J, t as S, a0 as T, M as D, aE as Q, V as P, aF as X, aG as x } from "./asWebComponent-B91uK0U7.js";
2
- import { t as tt, e as et } from "./eodashSTAC-DBjqe_Ho.js";
3
- import { m as at, V as E } from "./VOverlay-CvrYEmLu.js";
4
- import { b as ot, f as nt } from "./forwardRefs-BJJiadQP.js";
5
- const st = B({
6
- id: String,
7
- text: String,
8
- ...$(at({
9
- closeOnBack: !1,
10
- location: "end",
11
- locationStrategy: "connected",
12
- eager: !0,
13
- minWidth: 0,
14
- offset: 10,
15
- openOnClick: !1,
16
- openOnHover: !0,
17
- origin: "auto",
18
- scrim: !1,
19
- scrollStrategy: "reposition",
20
- transition: !1
21
- }), ["absolute", "persistent"])
22
- }, "VTooltip"), rt = j()({
23
- name: "VTooltip",
24
- props: st(),
25
- emits: {
26
- "update:modelValue": (t) => !0
27
- },
28
- setup(t, r) {
29
- let {
30
- slots: i
31
- } = r;
32
- const o = _(t, "modelValue"), {
33
- scopeId: n
34
- } = ot(), l = I(), e = v(() => t.id || `v-tooltip-${l}`), a = V(), s = v(() => t.location.split(" ").length > 1 ? t.location : t.location + " center"), c = v(() => t.origin === "auto" || t.origin === "overlap" || t.origin.split(" ").length > 1 || t.location.split(" ").length > 1 ? t.origin : t.origin + " center"), u = v(() => t.transition ? t.transition : o.value ? "scale-transition" : "fade-transition"), f = v(() => w({
35
- "aria-describedby": e.value
36
- }, t.activatorProps));
37
- return M(() => {
38
- const b = E.filterProps(t);
39
- return p(E, w({
40
- ref: a,
41
- class: ["v-tooltip", t.class],
42
- style: t.style,
43
- id: e.value
44
- }, b, {
45
- modelValue: o.value,
46
- "onUpdate:modelValue": (m) => o.value = m,
47
- transition: u.value,
48
- absolute: !0,
49
- location: s.value,
50
- origin: c.value,
51
- persistent: !0,
52
- role: "tooltip",
53
- activatorProps: f.value,
54
- _disableGlobalStack: !0
55
- }, n), {
56
- activator: i.activator,
57
- default: function() {
58
- for (var m = arguments.length, d = new Array(m), g = 0; g < m; g++)
59
- d[g] = arguments[g];
60
- return i.default?.(...d) ?? t.text;
61
- }
62
- });
63
- }), nt({}, a);
64
- }
65
- });
66
- function it(t, r) {
67
- const i = typeof t == "string" ? R(t) : t, o = lt(i, r);
68
- return {
69
- mounted: o,
70
- updated: o,
71
- unmounted(n) {
72
- O(null, n);
73
- }
74
- };
75
- }
76
- function lt(t, r) {
77
- return function(i, o, n) {
78
- const l = typeof r == "function" ? r(o) : r, e = o.value?.text ?? o.value ?? l?.text, a = U(o.value) ? o.value : {}, s = () => e ?? i.innerHTML, c = (n.ctx === o.instance.$ ? ct(n, o.instance.$)?.provides : n.ctx?.provides) ?? o.instance.$.provides, u = F(t, w(l, a), s);
79
- u.appContext = Object.assign(/* @__PURE__ */ Object.create(null), o.instance.$.appContext, {
80
- provides: c
81
- }), O(u, i);
82
- };
83
- }
84
- function ct(t, r) {
85
- const i = /* @__PURE__ */ new Set(), o = (l) => {
86
- for (const e of l) {
87
- if (!e) continue;
88
- if (e === t)
89
- return !0;
90
- i.add(e);
91
- let a;
92
- if (e.suspense ? a = o([e.ssContent]) : Array.isArray(e.children) ? a = o(e.children) : e.component?.vnode && (a = o([e.component?.subTree])), a)
93
- return a;
94
- i.delete(e);
95
- }
96
- return !1;
97
- };
98
- if (!o([r.subTree]))
99
- throw new Error("Could not find original vnode");
100
- const n = Array.from(i).reverse();
101
- for (const l of n)
102
- if (l.component)
103
- return l.component;
104
- return r;
105
- }
106
- const A = it(rt, (t) => ({
107
- activator: "parent",
108
- location: t.arg?.replace("-", " ") ?? "top",
109
- text: typeof t.value == "boolean" ? void 0 : t.value
110
- })), ut = {
111
- class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
112
- style: { margin: "2px" }
113
- }, dt = ["value"], gt = {
114
- __name: "EodashDatePicker",
115
- setup(t) {
116
- function r(e) {
117
- if (n.value && n.value.length > 0) {
118
- let a = e ? 1 / 0 : -1 / 0;
119
- n.value.forEach((s) => {
120
- s?.dates && s.dates.forEach((c) => {
121
- c instanceof Date && (!e && c.getTime() > a || e && c.getTime() < a) && (a = c.getTime());
122
- });
123
- }), a !== 0 && (l.value = new Date(a));
124
- }
125
- }
126
- const i = (
127
- /** @type {import("@/types").Eodash} */
128
- N(Z)
129
- ), o = V({
130
- input: "YYYY-MM-DD"
131
- }), n = V([]), l = v({
132
- get() {
133
- return x.value ? new Date(x.value) : /* @__PURE__ */ new Date();
134
- },
135
- /** @param {Date | string} updatedDate */
136
- set(e) {
137
- e instanceof Date && !isNaN(e.getTime()) ? x.value = new Date(
138
- e.getTime() - e.getTimezoneOffset() * 6e4
139
- ).toISOString() : x.value = (/* @__PURE__ */ new Date()).toISOString();
140
- }
141
- });
142
- return Y(() => {
143
- const { selectedStac: e } = H(z());
144
- G(
145
- [e],
146
- async ([a]) => {
147
- if (a) {
148
- const s = tt(
149
- `./${a.id}/collection.json`,
150
- i.stacEndpoint
151
- ), c = et(
152
- e.value,
153
- s
154
- ), u = [
155
- "#009E73",
156
- "#0072B2",
157
- "#E69F00",
158
- "#CC79A7",
159
- "#56B4E9",
160
- "#D55E00"
161
- ];
162
- for (let f = 0; f < c.length; f++) {
163
- const m = (await (await fetch(c[f])).json()).links.filter(
164
- (d) => d.rel === "item" && "datetime" in d
165
- ).map(
166
- (d) => new Date(d.datetime)
167
- );
168
- n.value = [
169
- {
170
- bar: {
171
- style: {
172
- backgroundColor: u[f % u.length]
173
- }
174
- },
175
- dates: m
176
- }
177
- ];
178
- }
179
- }
180
- },
181
- { immediate: !0 }
182
- );
183
- }), (e, a) => (h(), W(
184
- L,
185
- null,
186
- [
187
- p(C(J), {
188
- modelValue: l.value,
189
- "onUpdate:modelValue": a[0] || (a[0] = (s) => l.value = s),
190
- masks: o.value,
191
- attributes: n.value
192
- }, {
193
- default: y(({ inputValue: s, inputEvents: c }) => [
194
- k("div", ut, [
195
- k("input", w({ value: s }, q(c, !0), {
196
- style: { margin: "1px" },
197
- class: "flex-grow px-1 py-1 bg-white dark:bg-gray-700"
198
- }), null, 16, dt)
199
- ])
200
- ]),
201
- _: 1
202
- /* STABLE */
203
- }, 8, ["modelValue", "masks", "attributes"]),
204
- p(K, {
205
- align: "center",
206
- justify: "center",
207
- style: { "margin-top": "6px" }
208
- }, {
209
- default: y(() => [
210
- S((h(), T(P, {
211
- style: { padding: "0px", "margin-right": "4px" },
212
- density: "compact",
213
- onClick: a[1] || (a[1] = (s) => r(!0))
214
- }, {
215
- default: y(() => [
216
- p(D, {
217
- icon: [C(Q)]
218
- }, null, 8, ["icon"])
219
- ]),
220
- _: 1
221
- /* STABLE */
222
- })), [
223
- [A, "Set date to oldest available dataset", "bottom"]
224
- ]),
225
- S((h(), T(P, {
226
- style: { padding: "0px", "margin-left": "4px" },
227
- density: "compact",
228
- onClick: a[2] || (a[2] = (s) => r(!1))
229
- }, {
230
- default: y(() => [
231
- p(D, {
232
- icon: [C(X)]
233
- }, null, 8, ["icon"])
234
- ]),
235
- _: 1
236
- /* STABLE */
237
- })), [
238
- [A, "Set date to latest available dataset", "bottom"]
239
- ])
240
- ]),
241
- _: 1
242
- /* STABLE */
243
- })
244
- ],
245
- 64
246
- /* STABLE_FRAGMENT */
247
- ));
248
- }
249
- };
250
- export {
251
- gt as default
252
- };