@tmf_ciclica/ciclicastorybook 1.1.21 → 1.1.23

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.
package/dist/index.es.js DELETED
@@ -1,2474 +0,0 @@
1
- import { jsxs as m, jsx as r, Fragment as qe } from "react/jsx-runtime";
2
- import U, { useState as B, useMemo as te, useEffect as L, useLayoutEffect as Ee, useRef as he } from "react";
3
- import e from "prop-types";
4
- import { useTranslation as w, Trans as me } from "react-i18next";
5
- import { motion as ge } from "framer-motion";
6
- import { create as Ke } from "zustand";
7
- import * as ye from "d3";
8
- import Ue from "mapbox-gl";
9
- import { useSelector as ce, useDispatch as Te } from "react-redux";
10
- import Ze, { Source as He, Layer as Ge, NavigationControl as Ye, Popup as We } from "react-map-gl/mapbox";
11
- import ie from "maplibre-gl";
12
- import { Protocol as Xe } from "pmtiles";
13
- import Je, { Source as Qe, Layer as et, NavigationControl as tt, Popup as nt } from "react-map-gl/maplibre";
14
- import { createSlice as Me } from "@reduxjs/toolkit";
15
- import it from "@mui/material/Slider";
16
- import { createTheme as st, Box as ot } from "@mui/material";
17
- import { ThemeProvider as rt } from "@emotion/react";
18
- import { NavLink as at } from "react-router-dom";
19
- const lt = "_ambitSelector_f07c1_2", ct = "_header_f07c1_13", dt = "_nameDateContainer_f07c1_23", pt = "_ambitName_f07c1_39", ut = "_ambitDate_f07c1_48", ht = "_buttonsContainer_f07c1_51", q = {
20
- ambitSelector: lt,
21
- header: ct,
22
- nameDateContainer: dt,
23
- ambitName: pt,
24
- ambitDate: ut,
25
- buttonsContainer: ht
26
- }, mt = "_ambitItem_1ueih_2", gt = "_ambitNameDate_1ueih_16", bt = "_ambitName_1ueih_16", ft = "_ambitDate_1ueih_35", yt = "_ambitButtons_1ueih_38", H = {
27
- ambitItem: mt,
28
- ambitNameDate: gt,
29
- ambitName: bt,
30
- ambitDate: ft,
31
- ambitButtons: yt
32
- }, Ct = "data:image/svg+xml,%3csvg%20width='31'%20height='31'%20viewBox='0%200%2031%2031'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Eliminar'%3e%3ccircle%20id='Ellipse%20220'%20cx='15.5106'%20cy='15.8063'%20r='14.3521'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3cpath%20id='Vector'%20d='M20.8581%2010.5548H17.5491V10.4015C17.5491%209.17493%2016.6257%208.255%2015.4714%208.255C14.3171%208.255%2013.3167%209.17493%2013.3167%2010.4015V10.5548H10.0846C9.69985%2010.5548%209.46899%2010.7848%209.46899%2011.1681C9.46899%2011.5514%209.69985%2011.7814%2010.0846%2011.7814H10.2385V21.2106C10.2385%2022.3605%2011.162%2023.3571%2012.3932%2023.3571H18.5495C19.7038%2023.3571%2020.7042%2022.4372%2020.7042%2021.2106V11.7047H20.9351C21.2429%2011.7047%2021.5507%2011.4747%2021.5507%2011.0914C21.5507%2010.7081%2021.1659%2010.5548%2020.8581%2010.5548ZM14.471%2010.4015C14.471%209.86488%2014.9327%209.40491%2015.4714%209.40491C16.01%209.40491%2016.3948%209.86488%2016.3948%2010.4015V10.5548H14.471V10.4015ZM16.3948%2018.8342V15.0011C16.3948%2014.6178%2016.6257%2014.3878%2017.0104%2014.3878C17.3952%2014.3878%2017.6261%2014.6178%2017.6261%2015.0011V18.8342C17.6261%2019.1408%2017.3952%2019.4474%2017.0104%2019.4474C16.6257%2019.4474%2016.3948%2019.1408%2016.3948%2018.8342ZM13.3167%2018.8342V15.0011C13.3167%2014.6178%2013.5475%2014.3878%2013.9323%2014.3878C14.3171%2014.3878%2014.5479%2014.6178%2014.5479%2015.0011V18.8342C14.5479%2019.1408%2014.3171%2019.4474%2013.9323%2019.4474C13.5475%2019.4474%2013.3167%2019.1408%2013.3167%2018.8342Z'%20fill='%23605B56'/%3e%3c/g%3e%3c/svg%3e", vt = "data:image/svg+xml,%3csvg%20width='31'%20height='31'%20viewBox='0%200%2031%2031'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%209259'%3e%3ccircle%20id='Ellipse%20219'%20cx='15.3062'%20cy='15.8063'%20r='14.3521'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3cg%20id='Group%203973'%3e%3cg%20id='Rectangle%20495'%3e%3cmask%20id='path-2-inside-1_4451_10560'%20fill='white'%3e%3crect%20x='10.4033'%20y='7.70422'%20width='12.8'%20height='12.8'%20rx='1'/%3e%3c/mask%3e%3crect%20x='10.4033'%20y='7.70422'%20width='12.8'%20height='12.8'%20rx='1'%20stroke='%23605B56'%20stroke-width='3'%20mask='url(%23path-2-inside-1_4451_10560)'/%3e%3c/g%3e%3cg%20id='Group%203972'%3e%3crect%20id='Rectangle%20496'%20x='7.2041'%20y='10.9042'%20width='12.8'%20height='12.8'%20rx='1'%20fill='%23605B56'/%3e%3cpath%20id='+'%20d='M16.3785%2018.0509H14.3838V20.0776H12.9331V18.0509H10.9385V16.6749H12.9331V14.6376H14.3838V16.6749H16.3785V18.0509Z'%20fill='%23FDFDFD'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Ce = "data:image/svg+xml,%3csvg%20width='31'%20height='31'%20viewBox='0%200%2031%2031'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%209260'%3e%3ccircle%20id='Ellipse%20219'%20cx='15.1021'%20cy='15.8063'%20r='14.3521'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3cpath%20id='Vector'%20d='M8.20744%208.70422C7.34769%208.70422%206.88873%209.71735%207.45568%2010.3637L13.3518%2017.085C13.5118%2017.2675%2013.6%2017.5018%2013.6%2017.7445V23.2443C13.6%2023.6283%2013.8199%2023.9783%2014.1658%2024.1451L15.9658%2025.0128C16.6297%2025.3329%2017.4%2024.8491%2017.4%2024.112V17.7445C17.4%2017.5018%2017.4882%2017.2675%2017.6482%2017.085L23.5443%2010.3637C24.1113%209.71735%2023.6523%208.70422%2022.7926%208.70422H8.20744Z'%20fill='%23605B56'/%3e%3c/g%3e%3c/svg%3e", _t = "data:image/svg+xml,%3csvg%20width='26'%20height='14'%20viewBox='0%200%2026%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%205138'%3e%3cpath%20id='Vector'%20d='M12.95%200.408447C7.659%200.408447%202.84899%202.77185%200.0832465%206.72621C-0.0277488%206.88808%20-0.0277488%207.09621%200.0832465%207.25807C2.84439%2011.2125%207.65437%2013.5712%2012.95%2013.5712C18.2456%2013.5712%2023.0556%2011.2125%2025.8168%207.25807C25.9278%207.0962%2025.9278%206.88807%2025.8168%206.72621C23.051%202.77184%2018.241%200.408447%2012.95%200.408447ZM12.95%2011.2217C10.619%2011.2217%208.71812%209.32083%208.71812%206.98984C8.71812%204.65885%2010.619%202.75796%2012.95%202.75796C15.281%202.75796%2017.1819%204.65883%2017.1819%206.98984C17.1819%209.32085%2015.281%2011.2217%2012.95%2011.2217Z'%20fill='%23B32F5D'/%3e%3cpath%20id='Vector_2'%20d='M12.9514%2010.2966C14.7777%2010.2966%2016.2583%208.81607%2016.2583%206.98974C16.2583%205.1634%2014.7777%203.68286%2012.9514%203.68286C11.1251%203.68286%209.64453%205.1634%209.64453%206.98974C9.64453%208.81607%2011.1251%2010.2966%2012.9514%2010.2966Z'%20fill='%23B32F5D'/%3e%3c/g%3e%3c/svg%3e", xt = "data:image/svg+xml,%3csvg%20width='26'%20height='18'%20viewBox='0%200%2026%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%205207'%3e%3cpath%20id='Vector'%20d='M12.9837%206.40625C11.1707%206.40625%209.69531%207.88162%209.69531%209.69462C9.69531%2010.0276%209.74618%2010.3514%209.83869%2010.652C9.93579%2010.9711%2010.0792%2011.2718%2010.2642%2011.54L14.8291%206.97512C14.5562%206.79013%2014.2602%206.64676%2013.9411%206.54962C13.6404%206.45712%2013.3167%206.40625%2012.9837%206.40625Z'%20fill='%23605B56'%20fill-opacity='0.5'/%3e%3cpath%20id='Vector_2'%20d='M19.4938%204.44079C19.318%204.36678%2019.1191%204.40841%2018.985%204.53792L16.3534%207.16955V7.17415C16.543%207.42855%2016.7049%207.70604%2016.8344%208.00204C17.0656%208.52004%2017.1905%209.09354%2017.1905%209.69478C17.1905%2012.0165%2015.3035%2013.9035%2012.9818%2013.9035C12.3805%2013.9035%2011.807%2013.7787%2011.289%2013.5474C10.993%2013.4179%2010.7155%2013.256%2010.4611%2013.0664H10.4565L8.52788%2014.995C8.41225%2015.1153%208.36601%2015.2864%208.41225%2015.4437C8.45389%2015.6055%208.57875%2015.7304%208.74063%2015.772C10.0958%2016.1189%2011.511%2016.2947%2012.9494%2016.2947C18.245%2016.2947%2023.055%2013.9359%2025.8161%209.98153C25.9271%209.82429%2025.9271%209.61153%2025.8161%209.45427C24.2991%207.27591%2022.1115%205.54154%2019.4938%204.44079Z'%20fill='%23605B56'%20fill-opacity='0.5'/%3e%3cpath%20id='Vector_3'%20d='M12.9843%2012.979C14.7973%2012.979%2016.268%2011.5082%2016.268%209.6952C16.268%209.35295%2016.2171%209.0292%2016.12%208.71933C16.0229%208.4002%2015.8749%208.10419%2015.6899%207.83594L11.125%2012.4008C11.3933%2012.5858%2011.6893%2012.7338%2012.0084%2012.831C12.3183%2012.9281%2012.6466%2012.979%2012.9843%2012.979Z'%20fill='%23605B56'%20fill-opacity='0.5'/%3e%3cpath%20id='Vector_4'%20d='M9.12048%2011.3694C8.89386%2010.856%208.769%2010.2918%208.769%209.69516C8.769%207.3734%2010.656%205.48178%2012.9824%205.48178C13.579%205.48178%2014.1433%205.60667%2014.6566%205.83329C14.9526%205.95815%2015.2347%206.12004%2015.4891%206.31428L17.3808%204.42267L21.0114%200.792026C21.1918%200.611646%2021.1918%200.315664%2021.0114%200.135285C20.831%20-0.0450949%2020.535%20-0.0450949%2020.3546%200.135285L16.8951%203.59478C15.6186%203.28491%2014.2959%203.13228%2012.95%203.13228C7.65437%203.13228%202.84439%205.49565%200.0832465%209.45464C-0.0277488%209.61191%20-0.0277488%209.82467%200.0832465%209.9819C1.48001%2011.9845%203.44563%2013.6079%205.78125%2014.7087L3.37162%2017.1183C3.19127%2017.2986%203.19127%2017.5947%203.37162%2017.775C3.46412%2017.8629%203.57975%2017.9091%203.7%2017.9091C3.82026%2017.9091%203.93588%2017.8629%204.02839%2017.775L9.60151%2012.2019C9.40727%2011.9429%209.24536%2011.6654%209.12048%2011.3694Z'%20fill='%23605B56'%20fill-opacity='0.5'/%3e%3c/g%3e%3c/svg%3e", $e = ({
33
- ambit: i,
34
- onClickCopy: d,
35
- onClickDelete: o,
36
- onClickFilters: n,
37
- onClickAmbit: t,
38
- isBeingProcessed: s,
39
- isActive: l,
40
- activeColor: a,
41
- fontColor: c,
42
- moreInfo: p
43
- }) => {
44
- const { name: u, date: h, id: g } = i;
45
- return /* @__PURE__ */ m(
46
- "div",
47
- {
48
- className: H.ambitItem,
49
- style: { borderBottom: `1px solid ${c}` },
50
- children: [
51
- /* @__PURE__ */ m("div", { className: H.ambitNameDate, onClick: () => t(g), children: [
52
- /* @__PURE__ */ m("div", { className: H.ambitName, children: [
53
- /* @__PURE__ */ r(
54
- "img",
55
- {
56
- src: l ? _t : xt
57
- }
58
- ),
59
- /* @__PURE__ */ r("span", { style: { color: l ? a : c }, children: u })
60
- ] }),
61
- /* @__PURE__ */ r("div", { className: H.ambitDate, children: new Date(h).toLocaleDateString() })
62
- ] }),
63
- /* @__PURE__ */ m("div", { className: H.ambitButtons, children: [
64
- s && /* @__PURE__ */ r("img", { src: Ce }),
65
- /* @__PURE__ */ r("button", { onClick: () => n(g), children: /* @__PURE__ */ r("img", { src: Ce }) }),
66
- /* @__PURE__ */ r("button", { onClick: () => d(g), children: /* @__PURE__ */ r("img", { src: vt }) }),
67
- /* @__PURE__ */ r("button", { onClick: () => o(g), children: /* @__PURE__ */ r("img", { src: Ct }) })
68
- ] })
69
- ]
70
- }
71
- );
72
- };
73
- $e.propTypes = {
74
- ambit: e.shape({
75
- name: e.string.isRequired,
76
- date: e.string.isRequired,
77
- id: e.string.isRequired
78
- }).isRequired,
79
- onClickCopy: e.func.isRequired,
80
- onClickDelete: e.func.isRequired,
81
- onClickFilters: e.func.isRequired,
82
- onClickAmbit: e.func.isRequired,
83
- isBeingProcessed: e.bool,
84
- isActive: e.bool,
85
- activeColor: e.string,
86
- fontColor: e.string,
87
- moreInfo: e.object
88
- // Optional, can be used for additional info
89
- };
90
- const kt = "data:image/svg+xml,%3csvg%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1%201L13.9996%2013.9996'%20stroke='%23FDFDFD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M14%201L1.00044%2013.9996'%20stroke='%23FDFDFD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e", wt = ({
91
- ambitList: i,
92
- activeAmbitId: d,
93
- fontColor: o = "#605B56",
94
- activeColor: n,
95
- nameLabel: t,
96
- dateLabel: s,
97
- onClickCopy: l = (u) => console.log(`Copy ambit: ${u}`),
98
- onCLickDelete: a = (u) => console.log(`Delete ambit: ${u}`),
99
- onClickFilters: c = (u) => console.log(`Filters clicked: ${u}`),
100
- onClickAmbit: p = (u) => console.log(`OnCLickAmbit: ${u}`)
101
- }) => {
102
- const { t: u } = w();
103
- return /* @__PURE__ */ m("div", { className: q.ambitSelector, style: { color: o }, children: [
104
- /* @__PURE__ */ m(
105
- "div",
106
- {
107
- className: q.header,
108
- style: { borderBottom: `1px solid ${o}` },
109
- children: [
110
- /* @__PURE__ */ m("div", { className: q.nameDateContainer, children: [
111
- /* @__PURE__ */ r("div", { className: q.ambitName, children: /* @__PURE__ */ r("span", { children: u(t) }) }),
112
- /* @__PURE__ */ r("div", { className: q.ambitDate, children: /* @__PURE__ */ r("span", { children: u(s) }) })
113
- ] }),
114
- /* @__PURE__ */ r("div", { className: q.buttonsContainer })
115
- ]
116
- }
117
- ),
118
- i && i.length > 0 && i.map((h) => /* @__PURE__ */ r(
119
- $e,
120
- {
121
- isActive: d == h.id,
122
- ambit: h,
123
- fontColor: o,
124
- activeColor: n,
125
- onClickCopy: l,
126
- onClickDelete: a,
127
- onClickFilters: c,
128
- onClickAmbit: p
129
- },
130
- `ambitKey${h.id}`
131
- ))
132
- ] });
133
- };
134
- wt.propTypes = {
135
- ambitList: e.arrayOf(
136
- e.shape({
137
- name: e.string.isRequired,
138
- date: e.string.isRequired,
139
- id: e.string.isRequired
140
- })
141
- ).isRequired,
142
- activeAmbitId: e.string,
143
- fontColor: e.string,
144
- activeColor: e.string,
145
- onClickCopy: e.func.isRequired,
146
- onCLickDelete: e.func.isRequired,
147
- onClickFilters: e.func.isRequired,
148
- onClickAmbit: e.func.isRequired
149
- };
150
- const Nt = "_buttonsContainer_1audx_2", St = "_vertical_1audx_6", Tt = "_horizontal_1audx_9", Mt = "_button_1audx_2", $t = "_active_1audx_25", Lt = "_buttonName_1audx_28", I = {
151
- buttonsContainer: Nt,
152
- vertical: St,
153
- horizontal: Tt,
154
- button: Mt,
155
- active: $t,
156
- buttonName: Lt
157
- }, Ft = "_left_19lnt_3", Bt = "_top_19lnt_33", Dt = "_bottom_19lnt_66", At = "_right_19lnt_97", Ot = {
158
- left: Ft,
159
- top: Bt,
160
- bottom: Dt,
161
- right: At
162
- }, Le = ({ text: i, position: d, styleCustom: o = null }) => {
163
- const { t: n } = w();
164
- return /* @__PURE__ */ r("div", { className: `tooltip ${Ot[d]}`, style: o, children: n(i) });
165
- };
166
- Le.propTypes = {
167
- text: e.string.isRequired,
168
- position: e.oneOf(["top", "bottom", "left", "right"]).isRequired,
169
- styleCustom: e.object
170
- };
171
- const Rt = ({
172
- buttons: i = [],
173
- orientation: d = "horizontal",
174
- showName: o = !0,
175
- namePosition: n = "right",
176
- useTooltip: t = !1,
177
- tooltipPosition: s = "top"
178
- }) => {
179
- const { t: l } = w();
180
- return /* @__PURE__ */ r(
181
- "div",
182
- {
183
- className: `${I.buttonsContainer} ${d === "vertical" && I.vertical}
184
- ${d === "horizontal" && I.horizontal}`,
185
- children: i.map((a, c) => {
186
- const {
187
- icon: p,
188
- activeIcon: u,
189
- isActive: h,
190
- name: g,
191
- onClick: b
192
- } = a, C = /* @__PURE__ */ m(qe, { children: [
193
- o && n === "left" && /* @__PURE__ */ r("span", { className: I.buttonName, children: l(g) }),
194
- /* @__PURE__ */ r("img", { src: h ? u : p, alt: l(g) }),
195
- o && n === "right" && /* @__PURE__ */ r("span", { className: I.buttonName, children: l(g) })
196
- ] });
197
- return /* @__PURE__ */ m("div", { className: "tooltip-parent", children: [
198
- /* @__PURE__ */ r(
199
- "button",
200
- {
201
- onClick: b,
202
- className: `${I.button}
203
- ${h && I.active}`,
204
- children: C
205
- }
206
- ),
207
- t && /* @__PURE__ */ r(Le, { text: g, position: s })
208
- ] }, c);
209
- })
210
- }
211
- );
212
- };
213
- Rt.propTypes = {
214
- buttons: e.arrayOf(
215
- e.shape({
216
- icon: e.node.isRequired,
217
- activeIcon: e.node,
218
- isActive: e.bool,
219
- name: e.string,
220
- // key de i18n
221
- onClick: e.func
222
- })
223
- ).isRequired,
224
- orientation: e.oneOf(["horizontal", "vertical"]),
225
- showName: e.bool,
226
- namePosition: e.oneOf(["left", "right"]),
227
- useTooltip: e.bool,
228
- tooltipPosition: e.oneOf(["top", "bottom", "left", "right"])
229
- };
230
- const It = "_indicatorsCategory_1cu33_2", zt = "_title_1cu33_5", se = {
231
- indicatorsCategory: It,
232
- title: zt
233
- }, j = ({
234
- isOpen: i,
235
- onClick: d,
236
- children: o,
237
- color: n,
238
- activeColor: t = "#F8A925",
239
- title: s = "Title",
240
- //Change the height only if the title is more than one line or you change title fontSize, otherwise should be 53px
241
- height: l = 53,
242
- //Adjust height if you change fontSize
243
- titleFontStyles: a,
244
- showBottomBar: c = !0,
245
- titleMarginChildren: p = 25
246
- }) => {
247
- const { t: u } = w();
248
- return /* @__PURE__ */ m(
249
- ge.div,
250
- {
251
- className: se.indicatorsCategory,
252
- initial: { height: `${l}px` },
253
- animate: { height: i ? "auto" : `${l}px` },
254
- transition: { duration: 0.4 },
255
- style: {
256
- backgroundColor: "white",
257
- borderBottom: i && c ? `1px solid ${t}` : "0px",
258
- marginBottom: i ? "20px" : "0px"
259
- },
260
- children: [
261
- /* @__PURE__ */ m(
262
- "h2",
263
- {
264
- style: {
265
- ...a,
266
- marginBottom: p || "auto"
267
- },
268
- className: `${se.title}`,
269
- onClick: d,
270
- children: [
271
- /* @__PURE__ */ r("span", { style: { color: i ? t : n }, children: i ? "-" : "+" }),
272
- /* @__PURE__ */ r("span", { style: { marginLeft: 12, color: i ? t : n }, children: u(s) })
273
- ]
274
- }
275
- ),
276
- /* @__PURE__ */ r("div", { className: se.content, children: o })
277
- ]
278
- }
279
- );
280
- };
281
- j.propTypes = {
282
- isOpen: e.bool,
283
- onClick: e.func,
284
- children: e.node,
285
- color: e.string,
286
- activeColor: e.string,
287
- title: e.string,
288
- height: e.number,
289
- showBottomBar: e.bool,
290
- titleFontStyles: e.object
291
- };
292
- const os = () => /* @__PURE__ */ r("div", { children: "EditAmbit" }), Vt = "_AppliedFiltersContainer_s8ooe_2", jt = "_AppliedFilterContent_s8ooe_10", ve = {
293
- AppliedFiltersContainer: Vt,
294
- AppliedFilterContent: jt
295
- }, T = Ke((i) => ({
296
- activeCategory: "",
297
- activeSubCategory: "",
298
- selectedIndicator: "",
299
- tematicalFiltersSelected: [],
300
- fontColor: "#605B56",
301
- inputsColor: "#605B56"
302
- })), Fe = ({ title: i, onClick: d, isOpen: o = !0, textColor: n = "#ffffff", backgroundColor: t = "#605B5680", activeColor: s }) => {
303
- const { t: l } = w(), { tematicalFiltersSelected: a } = T((p) => p), c = (p) => {
304
- T.setState((u) => ({
305
- tematicalFiltersSelected: u.tematicalFiltersSelected.filter(
306
- (h) => h.code !== p
307
- )
308
- }));
309
- };
310
- return /* @__PURE__ */ r(
311
- j,
312
- {
313
- isOpen: o,
314
- onClick: d,
315
- title: i ? l(i) : "Applied Filters",
316
- activeColor: s,
317
- children: /* @__PURE__ */ r("div", { className: ve.AppliedFiltersContainer, children: a == null ? void 0 : a.map((p, u) => /* @__PURE__ */ m("div", { className: ve.AppliedFilterContent, style: { color: n, background: t }, children: [
318
- l(p.name),
319
- /* @__PURE__ */ r("img", { src: kt, alt: "CloseIcon", onClick: () => c(p.code), style: { cursor: "pointer" } })
320
- ] }, u)) })
321
- }
322
- );
323
- };
324
- Fe.propTypes = {
325
- isOpen: e.bool,
326
- onClick: e.func,
327
- title: e.string,
328
- textColor: e.string,
329
- backgroundColor: e.string,
330
- indicators: e.arrayOf(
331
- e.shape({
332
- title: e.string.isRequired,
333
- Codename: e.string.isRequired
334
- })
335
- ),
336
- activeColor: e.string
337
- };
338
- const Be = ({ title: i, onClick: d, isOpen: o = !0, textColor: n = "#ffffff", backgroundColor: t = "#605B5680", activeColor: s }) => {
339
- const { t: l } = w(), { tematicalFiltersSelected: a } = T((c) => c);
340
- return /* @__PURE__ */ r(
341
- j,
342
- {
343
- isOpen: o,
344
- onClick: d,
345
- title: i ? l(i) : "Geographical Filters",
346
- activeColor: s,
347
- children: "A"
348
- }
349
- );
350
- };
351
- Be.propTypes = {
352
- isOpen: e.bool,
353
- onClick: e.func,
354
- title: e.string,
355
- textColor: e.string,
356
- backgroundColor: e.string,
357
- activeColor: e.string
358
- };
359
- const Pt = "_checkboxContainer_zld97_2", qt = {
360
- checkboxContainer: Pt
361
- }, De = ({
362
- onClick: i,
363
- containerStyles: d,
364
- color: o = "#605B56",
365
- indicator: n,
366
- value: t
367
- }) => {
368
- const { t: s } = w(), { title: l } = n || {}, { fontColor: a, inputsColor: c } = T((p) => p);
369
- return /* @__PURE__ */ m(
370
- "div",
371
- {
372
- style: { ...d, color: o },
373
- role: "checkbox",
374
- className: qt.checkboxContainer,
375
- onClick: i,
376
- children: [
377
- /* @__PURE__ */ r(
378
- "input",
379
- {
380
- type: "checkbox",
381
- checked: typeof t == "boolean" ? t : !0,
382
- value: t,
383
- readOnly: !0,
384
- style: {
385
- border: `1.5px solid ${t ? c : a}`,
386
- backgroundColor: t ? c : "white"
387
- }
388
- }
389
- ),
390
- /* @__PURE__ */ r("span", { className: "checkmark", children: s(l) })
391
- ]
392
- }
393
- );
394
- };
395
- De.propTypes = {
396
- onClick: e.func,
397
- value: e.bool,
398
- containerStyles: e.object,
399
- color: e.string,
400
- indicator: e.shape({
401
- title: e.string,
402
- codename: e.array
403
- }),
404
- checkedColor: e.string
405
- };
406
- function de(i, d) {
407
- return de = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, n) {
408
- return o.__proto__ = n, o;
409
- }, de(i, d);
410
- }
411
- function Et(i, d) {
412
- i.prototype = Object.create(d.prototype), i.prototype.constructor = i, de(i, d);
413
- }
414
- function oe(i) {
415
- return i && i.stopPropagation && i.stopPropagation(), i && i.preventDefault && i.preventDefault(), !1;
416
- }
417
- function re(i) {
418
- return i == null ? [] : Array.isArray(i) ? i.slice() : [i];
419
- }
420
- function W(i) {
421
- return i !== null && i.length === 1 ? i[0] : i.slice();
422
- }
423
- function X(i) {
424
- Object.keys(i).forEach((d) => {
425
- typeof document < "u" && document.addEventListener(d, i[d], !1);
426
- });
427
- }
428
- function z(i, d) {
429
- return pe(function(o, n) {
430
- let t = o;
431
- return t <= n.min && (t = n.min), t >= n.max && (t = n.max), t;
432
- }(i, d), d);
433
- }
434
- function pe(i, d) {
435
- const o = (i - d.min) % d.step;
436
- let n = i - o;
437
- return 2 * Math.abs(o) >= d.step && (n += o > 0 ? d.step : -d.step), parseFloat(n.toFixed(5));
438
- }
439
- let ue = function(i) {
440
- function d(n) {
441
- var t;
442
- (t = i.call(this, n) || this).onKeyUp = () => {
443
- t.onEnd();
444
- }, t.onMouseUp = () => {
445
- t.onEnd(t.getMouseEventMap());
446
- }, t.onTouchEnd = (a) => {
447
- a.preventDefault(), t.onEnd(t.getTouchEventMap());
448
- }, t.onBlur = () => {
449
- t.setState({ index: -1 }, t.onEnd(t.getKeyDownEventMap()));
450
- }, t.onMouseMove = (a) => {
451
- t.setState({ pending: !0 });
452
- const c = t.getMousePosition(a), p = t.getDiffPosition(c[0]), u = t.getValueFromPosition(p);
453
- t.move(u);
454
- }, t.onTouchMove = (a) => {
455
- if (a.touches.length > 1) return;
456
- t.setState({ pending: !0 });
457
- const c = t.getTouchPosition(a);
458
- if (t.isScrolling === void 0) {
459
- const h = c[0] - t.startPosition[0], g = c[1] - t.startPosition[1];
460
- t.isScrolling = Math.abs(g) > Math.abs(h);
461
- }
462
- if (t.isScrolling) return void t.setState({ index: -1 });
463
- const p = t.getDiffPosition(c[0]), u = t.getValueFromPosition(p);
464
- t.move(u);
465
- }, t.onKeyDown = (a) => {
466
- if (!(a.ctrlKey || a.shiftKey || a.altKey || a.metaKey)) switch (t.setState({ pending: !0 }), a.key) {
467
- case "ArrowLeft":
468
- case "ArrowDown":
469
- case "Left":
470
- case "Down":
471
- a.preventDefault(), t.moveDownByStep();
472
- break;
473
- case "ArrowRight":
474
- case "ArrowUp":
475
- case "Right":
476
- case "Up":
477
- a.preventDefault(), t.moveUpByStep();
478
- break;
479
- case "Home":
480
- a.preventDefault(), t.move(t.props.min);
481
- break;
482
- case "End":
483
- a.preventDefault(), t.move(t.props.max);
484
- break;
485
- case "PageDown":
486
- a.preventDefault(), t.moveDownByStep(t.props.pageFn(t.props.step));
487
- break;
488
- case "PageUp":
489
- a.preventDefault(), t.moveUpByStep(t.props.pageFn(t.props.step));
490
- }
491
- }, t.onSliderMouseDown = (a) => {
492
- if (!t.props.disabled && a.button !== 2) {
493
- if (t.setState({ pending: !0 }), !t.props.snapDragDisabled) {
494
- const c = t.getMousePosition(a);
495
- t.forceValueFromPosition(c[0], (p) => {
496
- t.start(p, c[0]), X(t.getMouseEventMap());
497
- });
498
- }
499
- oe(a);
500
- }
501
- }, t.onSliderClick = (a) => {
502
- if (!t.props.disabled && t.props.onSliderClick && !t.hasMoved) {
503
- const c = t.getMousePosition(a), p = z(t.calcValue(t.calcOffsetFromPosition(c[0])), t.props);
504
- t.props.onSliderClick(p);
505
- }
506
- }, t.createOnKeyDown = (a) => (c) => {
507
- t.props.disabled || (t.start(a), X(t.getKeyDownEventMap()), oe(c));
508
- }, t.createOnMouseDown = (a) => (c) => {
509
- if (t.props.disabled || c.button === 2) return;
510
- t.setState({ pending: !0 });
511
- const p = t.getMousePosition(c);
512
- t.start(a, p[0]), X(t.getMouseEventMap()), oe(c);
513
- }, t.createOnTouchStart = (a) => (c) => {
514
- if (t.props.disabled || c.touches.length > 1) return;
515
- t.setState({ pending: !0 });
516
- const p = t.getTouchPosition(c);
517
- t.startPosition = p, t.isScrolling = void 0, t.start(a, p[0]), X(t.getTouchEventMap()), function(u) {
518
- u.stopPropagation && u.stopPropagation();
519
- }(c);
520
- }, t.handleResize = () => {
521
- const a = window.setTimeout(() => {
522
- t.pendingResizeTimeouts.shift(), t.resize();
523
- }, 0);
524
- t.pendingResizeTimeouts.push(a);
525
- }, t.renderThumb = (a, c) => {
526
- const p = t.props.thumbClassName + " " + t.props.thumbClassName + "-" + c + " " + (t.state.index === c ? t.props.thumbActiveClassName : ""), u = { ref: (g) => {
527
- t["thumb" + c] = g;
528
- }, key: t.props.thumbClassName + "-" + c, className: p, style: a, onMouseDown: t.createOnMouseDown(c), onTouchStart: t.createOnTouchStart(c), onFocus: t.createOnKeyDown(c), tabIndex: 0, role: "slider", "aria-orientation": t.props.orientation, "aria-valuenow": t.state.value[c], "aria-valuemin": t.props.min, "aria-valuemax": t.props.max, "aria-label": Array.isArray(t.props.ariaLabel) ? t.props.ariaLabel[c] : t.props.ariaLabel, "aria-labelledby": Array.isArray(t.props.ariaLabelledby) ? t.props.ariaLabelledby[c] : t.props.ariaLabelledby, "aria-disabled": t.props.disabled }, h = { index: c, value: W(t.state.value), valueNow: t.state.value[c] };
529
- return t.props.ariaValuetext && (u["aria-valuetext"] = typeof t.props.ariaValuetext == "string" ? t.props.ariaValuetext : t.props.ariaValuetext(h)), t.props.renderThumb(u, h);
530
- }, t.renderTrack = (a, c, p) => {
531
- const u = { key: t.props.trackClassName + "-" + a, className: t.props.trackClassName + " " + t.props.trackClassName + "-" + a, style: t.buildTrackStyle(c, t.state.upperBound - p) }, h = { index: a, value: W(t.state.value) };
532
- return t.props.renderTrack(u, h);
533
- };
534
- let s = re(n.value);
535
- s.length || (s = re(n.defaultValue)), t.pendingResizeTimeouts = [];
536
- const l = [];
537
- for (let a = 0; a < s.length; a += 1) s[a] = z(s[a], n), l.push(a);
538
- return t.resizeObserver = null, t.resizeElementRef = U.createRef(), t.state = { index: -1, upperBound: 0, sliderLength: 0, value: s, zIndices: l }, t;
539
- }
540
- Et(d, i);
541
- var o = d.prototype;
542
- return o.componentDidMount = function() {
543
- typeof window < "u" && (this.resizeObserver = new ResizeObserver(this.handleResize), this.resizeObserver.observe(this.resizeElementRef.current), this.resize());
544
- }, d.getDerivedStateFromProps = function(n, t) {
545
- const s = re(n.value);
546
- return s.length ? t.pending ? null : { value: s.map((l) => z(l, n)) } : null;
547
- }, o.componentDidUpdate = function() {
548
- this.state.upperBound === 0 && this.resize();
549
- }, o.componentWillUnmount = function() {
550
- this.clearPendingResizeTimeouts(), this.resizeObserver && this.resizeObserver.disconnect();
551
- }, o.onEnd = function(n) {
552
- n && function(t) {
553
- Object.keys(t).forEach((s) => {
554
- typeof document < "u" && document.removeEventListener(s, t[s], !1);
555
- });
556
- }(n), this.hasMoved && this.fireChangeEvent("onAfterChange"), this.setState({ pending: !1 }), this.hasMoved = !1;
557
- }, o.getValue = function() {
558
- return W(this.state.value);
559
- }, o.getClosestIndex = function(n) {
560
- let t = Number.MAX_VALUE, s = -1;
561
- const { value: l } = this.state, a = l.length;
562
- for (let c = 0; c < a; c += 1) {
563
- const p = this.calcOffset(l[c]), u = Math.abs(n - p);
564
- u < t && (t = u, s = c);
565
- }
566
- return s;
567
- }, o.getMousePosition = function(n) {
568
- return [n["page" + this.axisKey()], n["page" + this.orthogonalAxisKey()]];
569
- }, o.getTouchPosition = function(n) {
570
- const t = n.touches[0];
571
- return [t["page" + this.axisKey()], t["page" + this.orthogonalAxisKey()]];
572
- }, o.getKeyDownEventMap = function() {
573
- return { keydown: this.onKeyDown, keyup: this.onKeyUp, focusout: this.onBlur };
574
- }, o.getMouseEventMap = function() {
575
- return { mousemove: this.onMouseMove, mouseup: this.onMouseUp };
576
- }, o.getTouchEventMap = function() {
577
- return { touchmove: this.onTouchMove, touchend: this.onTouchEnd };
578
- }, o.getValueFromPosition = function(n) {
579
- const t = n / (this.state.sliderLength - this.state.thumbSize) * (this.props.max - this.props.min);
580
- return z(this.state.startValue + t, this.props);
581
- }, o.getDiffPosition = function(n) {
582
- let t = n - this.state.startPosition;
583
- return this.props.invert && (t *= -1), t;
584
- }, o.resize = function() {
585
- const { slider: n, thumb0: t } = this;
586
- if (!n || !t) return;
587
- const s = this.sizeKey(), l = n.getBoundingClientRect(), a = n[s], c = l[this.posMaxKey()], p = l[this.posMinKey()], u = t.getBoundingClientRect()[s.replace("client", "").toLowerCase()], h = a - u, g = Math.abs(c - p);
588
- this.state.upperBound === h && this.state.sliderLength === g && this.state.thumbSize === u || this.setState({ upperBound: h, sliderLength: g, thumbSize: u });
589
- }, o.calcOffset = function(n) {
590
- const t = this.props.max - this.props.min;
591
- return t === 0 ? 0 : (n - this.props.min) / t * this.state.upperBound;
592
- }, o.calcValue = function(n) {
593
- return n / this.state.upperBound * (this.props.max - this.props.min) + this.props.min;
594
- }, o.calcOffsetFromPosition = function(n) {
595
- const { slider: t } = this, s = t.getBoundingClientRect(), l = s[this.posMaxKey()], a = s[this.posMinKey()];
596
- let c = n - (window["page" + this.axisKey() + "Offset"] + (this.props.invert ? l : a));
597
- return this.props.invert && (c = this.state.sliderLength - c), c -= this.state.thumbSize / 2, c;
598
- }, o.forceValueFromPosition = function(n, t) {
599
- const s = this.calcOffsetFromPosition(n), l = this.getClosestIndex(s), a = z(this.calcValue(s), this.props), c = this.state.value.slice();
600
- c[l] = a;
601
- for (let p = 0; p < c.length - 1; p += 1) if (c[p + 1] - c[p] < this.props.minDistance) return;
602
- this.fireChangeEvent("onBeforeChange"), this.hasMoved = !0, this.setState({ value: c }, () => {
603
- t(l), this.fireChangeEvent("onChange");
604
- });
605
- }, o.clearPendingResizeTimeouts = function() {
606
- do {
607
- const n = this.pendingResizeTimeouts.shift();
608
- clearTimeout(n);
609
- } while (this.pendingResizeTimeouts.length);
610
- }, o.start = function(n, t) {
611
- const s = this["thumb" + n];
612
- s && s.focus();
613
- const { zIndices: l } = this.state;
614
- l.splice(l.indexOf(n), 1), l.push(n), this.setState((a) => ({ startValue: a.value[n], startPosition: t !== void 0 ? t : a.startPosition, index: n, zIndices: l }));
615
- }, o.moveUpByStep = function(n) {
616
- n === void 0 && (n = this.props.step);
617
- const t = this.state.value[this.state.index], s = z(this.props.invert && this.props.orientation === "horizontal" ? t - n : t + n, this.props);
618
- this.move(Math.min(s, this.props.max));
619
- }, o.moveDownByStep = function(n) {
620
- n === void 0 && (n = this.props.step);
621
- const t = this.state.value[this.state.index], s = z(this.props.invert && this.props.orientation === "horizontal" ? t + n : t - n, this.props);
622
- this.move(Math.max(s, this.props.min));
623
- }, o.move = function(n) {
624
- const t = this.state.value.slice(), { index: s } = this.state, { length: l } = t, a = t[s];
625
- if (n === a) return;
626
- this.hasMoved || this.fireChangeEvent("onBeforeChange"), this.hasMoved = !0;
627
- const { pearling: c, max: p, min: u, minDistance: h } = this.props;
628
- if (!c) {
629
- if (s > 0) {
630
- const g = t[s - 1];
631
- n < g + h && (n = g + h);
632
- }
633
- if (s < l - 1) {
634
- const g = t[s + 1];
635
- n > g - h && (n = g - h);
636
- }
637
- }
638
- t[s] = n, c && l > 1 && (n > a ? (this.pushSucceeding(t, h, s), function(g, b, C, f) {
639
- for (let v = 0; v < g; v += 1) {
640
- const y = f - v * C;
641
- b[g - 1 - v] > y && (b[g - 1 - v] = y);
642
- }
643
- }(l, t, h, p)) : n < a && (this.pushPreceding(t, h, s), function(g, b, C, f) {
644
- for (let v = 0; v < g; v += 1) {
645
- const y = f + v * C;
646
- b[v] < y && (b[v] = y);
647
- }
648
- }(l, t, h, u))), this.setState({ value: t }, this.fireChangeEvent.bind(this, "onChange"));
649
- }, o.pushSucceeding = function(n, t, s) {
650
- let l, a;
651
- for (l = s, a = n[l] + t; n[l + 1] !== null && a > n[l + 1]; l += 1, a = n[l] + t) n[l + 1] = pe(a, this.props);
652
- }, o.pushPreceding = function(n, t, s) {
653
- for (let l = s, a = n[l] - t; n[l - 1] !== null && a < n[l - 1]; l -= 1, a = n[l] - t) n[l - 1] = pe(a, this.props);
654
- }, o.axisKey = function() {
655
- return this.props.orientation === "vertical" ? "Y" : "X";
656
- }, o.orthogonalAxisKey = function() {
657
- return this.props.orientation === "vertical" ? "X" : "Y";
658
- }, o.posMinKey = function() {
659
- return this.props.orientation === "vertical" ? this.props.invert ? "bottom" : "top" : this.props.invert ? "right" : "left";
660
- }, o.posMaxKey = function() {
661
- return this.props.orientation === "vertical" ? this.props.invert ? "top" : "bottom" : this.props.invert ? "left" : "right";
662
- }, o.sizeKey = function() {
663
- return this.props.orientation === "vertical" ? "clientHeight" : "clientWidth";
664
- }, o.fireChangeEvent = function(n) {
665
- this.props[n] && this.props[n](W(this.state.value), this.state.index);
666
- }, o.buildThumbStyle = function(n, t) {
667
- const s = { position: "absolute", touchAction: "none", willChange: this.state.index >= 0 ? this.posMinKey() : void 0, zIndex: this.state.zIndices.indexOf(t) + 1 };
668
- return s[this.posMinKey()] = n + "px", s;
669
- }, o.buildTrackStyle = function(n, t) {
670
- const s = { position: "absolute", willChange: this.state.index >= 0 ? this.posMinKey() + "," + this.posMaxKey() : void 0 };
671
- return s[this.posMinKey()] = n, s[this.posMaxKey()] = t, s;
672
- }, o.buildMarkStyle = function(n) {
673
- var t;
674
- return (t = { position: "absolute" })[this.posMinKey()] = n, t;
675
- }, o.renderThumbs = function(n) {
676
- const { length: t } = n, s = [];
677
- for (let a = 0; a < t; a += 1) s[a] = this.buildThumbStyle(n[a], a);
678
- const l = [];
679
- for (let a = 0; a < t; a += 1) l[a] = this.renderThumb(s[a], a);
680
- return l;
681
- }, o.renderTracks = function(n) {
682
- const t = [], s = n.length - 1;
683
- t.push(this.renderTrack(0, 0, n[0]));
684
- for (let l = 0; l < s; l += 1) t.push(this.renderTrack(l + 1, n[l], n[l + 1]));
685
- return t.push(this.renderTrack(s + 1, n[s], this.state.upperBound)), t;
686
- }, o.renderMarks = function() {
687
- let { marks: n } = this.props;
688
- const t = this.props.max - this.props.min + 1;
689
- return typeof n == "boolean" ? n = Array.from({ length: t }).map((s, l) => l) : typeof n == "number" && (n = Array.from({ length: t }).map((s, l) => l).filter((s) => s % n == 0)), n.map(parseFloat).sort((s, l) => s - l).map((s) => {
690
- const l = this.calcOffset(s), a = { key: s, className: this.props.markClassName, style: this.buildMarkStyle(l) };
691
- return this.props.renderMark(a);
692
- });
693
- }, o.render = function() {
694
- const n = [], { value: t } = this.state, s = t.length;
695
- for (let p = 0; p < s; p += 1) n[p] = this.calcOffset(t[p], p);
696
- const l = this.props.withTracks ? this.renderTracks(n) : null, a = this.renderThumbs(n), c = this.props.marks ? this.renderMarks() : null;
697
- return U.createElement("div", { ref: (p) => {
698
- this.slider = p, this.resizeElementRef.current = p;
699
- }, style: { position: "relative" }, className: this.props.className + (this.props.disabled ? " disabled" : ""), onMouseDown: this.onSliderMouseDown, onClick: this.onSliderClick }, l, a, c);
700
- }, d;
701
- }(U.Component);
702
- ue.displayName = "ReactSlider", ue.defaultProps = { min: 0, max: 100, step: 1, pageFn: (i) => 10 * i, minDistance: 0, defaultValue: 0, orientation: "horizontal", className: "slider", thumbClassName: "thumb", thumbActiveClassName: "active", trackClassName: "track", markClassName: "mark", withTracks: !0, pearling: !1, disabled: !1, snapDragDisabled: !1, invert: !1, marks: [], renderThumb: (i) => U.createElement("div", i), renderTrack: (i) => U.createElement("div", i), renderMark: (i) => U.createElement("span", i) };
703
- var Kt = ue;
704
- const Ut = "_container_15vgv_2", Zt = "_unitLabel_15vgv_9", Ht = "_slider_15vgv_12", Gt = "_thumb_15vgv_18", Yt = "_track_15vgv_27", Wt = "_labels_15vgv_33", E = {
705
- container: Ut,
706
- unitLabel: Zt,
707
- slider: Ht,
708
- thumb: Gt,
709
- track: Yt,
710
- labels: Wt
711
- }, Ae = ({
712
- min: i = 0,
713
- max: d = 100,
714
- step: o = 1,
715
- onChange: n,
716
- width: t = 300,
717
- unit: s,
718
- fontColor: l = "#605B56",
719
- value: a = [i, d]
720
- }) => {
721
- const { t: c } = w(), p = (u) => {
722
- n == null || n({ min: u[0], max: u[1] });
723
- };
724
- return /* @__PURE__ */ m(
725
- "div",
726
- {
727
- className: E.container,
728
- style: { width: `${t}px`, color: `${l}` },
729
- children: [
730
- /* @__PURE__ */ r("div", { className: E.unitLabel, children: /* @__PURE__ */ r("span", { children: c(s) }) }),
731
- /* @__PURE__ */ r(
732
- Kt,
733
- {
734
- className: E.slider,
735
- thumbClassName: E.thumb,
736
- trackClassName: E.track,
737
- min: i,
738
- max: d,
739
- step: o,
740
- value: a,
741
- onChange: p,
742
- withTracks: !0,
743
- pearling: !0,
744
- minDistance: 1
745
- }
746
- ),
747
- /* @__PURE__ */ m("div", { className: E.labels, children: [
748
- /* @__PURE__ */ r("span", { children: a[0] }),
749
- /* @__PURE__ */ r("span", { children: a[1] })
750
- ] })
751
- ]
752
- }
753
- );
754
- };
755
- Ae.propTypes = {
756
- min: e.number,
757
- max: e.number,
758
- step: e.number,
759
- initialMin: e.number,
760
- initialMax: e.number,
761
- onChange: e.func,
762
- width: e.number,
763
- unit: e.string,
764
- fontColor: e.string,
765
- value: e.arrayOf(e.number)
766
- };
767
- const Xt = "_tematicalFiltersInputContainer_1vm1r_2", Jt = "_inputTypeContainer_1vm1r_2", Qt = "_checkboxContainer_1vm1r_28", en = "_absoluteSliderContainer_1vm1r_37", J = {
768
- tematicalFiltersInputContainer: Xt,
769
- inputTypeContainer: Jt,
770
- checkboxContainer: Qt,
771
- absoluteSliderContainer: en
772
- }, be = ({
773
- indicator: i,
774
- //onChangeBothType
775
- activeColor: d
776
- }) => {
777
- const [o, n] = B(), {
778
- type: t,
779
- name: s,
780
- values: l,
781
- minValue: a,
782
- maxValue: c,
783
- unit: p
784
- } = i || {}, u = te(
785
- () => t == "cat" || o == "cat",
786
- [o, t]
787
- ), h = te(
788
- () => t == "abs" || o == "abs",
789
- [o, t]
790
- ), {
791
- tematicalFiltersSelected: g,
792
- selectedIndicator: b,
793
- fontColor: C,
794
- inputsColor: f
795
- } = T((x) => x), v = (x) => {
796
- if (x) {
797
- const { min: k, max: _, valueClicked: N, allValues: D } = x || {}, { code: A, type: ne } = i || {}, Z = h ? "abs" : u ? "cat" : "both";
798
- let O = A[0];
799
- ne == "both" && (O = Z == "cat" ? A[1] : A[0]), Z == "cat" ? T.setState((P) => {
800
- let R = P.tematicalFiltersSelected.find(
801
- ($) => $.code === O
802
- );
803
- if (R) {
804
- let $ = [R.values];
805
- if (R.values.includes(N)) {
806
- if ($ = R.values.filter(
807
- (F) => F !== N
808
- ), $.length < 1)
809
- return {
810
- tematicalFiltersSelected: P.tematicalFiltersSelected.filter(
811
- (F) => F.code !== O
812
- )
813
- };
814
- } else
815
- $ = [...R.values, N];
816
- return {
817
- tematicalFiltersSelected: P.tematicalFiltersSelected.map(
818
- (F) => F.code === O ? { ...F, values: $ } : F
819
- )
820
- };
821
- } else {
822
- console.log("entra aqui: ", D, " ", N);
823
- let $ = D.map((F, Pe) => Pe);
824
- return {
825
- tematicalFiltersSelected: [
826
- ...g,
827
- {
828
- type: "cat",
829
- code: O,
830
- values: $.filter((F) => F !== N),
831
- name: i.name
832
- }
833
- ]
834
- };
835
- }
836
- }) : Z == "abs" && T.setState((P) => {
837
- let R = P.tematicalFiltersSelected.find(
838
- ($) => $.code === O
839
- );
840
- if (R) {
841
- let $ = { ...R };
842
- return $.min = k, $.max = _, {
843
- tematicalFiltersSelected: P.tematicalFiltersSelected.map(
844
- (F) => F.code === O ? $ : F
845
- )
846
- };
847
- } else
848
- return {
849
- tematicalFiltersSelected: [
850
- ...g,
851
- { type: "abs", code: O, min: k, max: _ }
852
- ]
853
- };
854
- });
855
- }
856
- }, y = te(() => {
857
- const x = {};
858
- if ((g == null ? void 0 : g.length) > 0)
859
- for (const k of g)
860
- k.type === "cat" ? x[k.code] = new Set(k.values) : x[k.code] = [k.min, k.max];
861
- return x;
862
- }, [g]);
863
- return /* @__PURE__ */ r("div", { className: J.tematicalFiltersInputContainer, children: /* @__PURE__ */ m(
864
- j,
865
- {
866
- titleFontStyles: { fontSize: 16, fontWeight: 400 },
867
- title: s,
868
- isOpen: b == `id${s}`,
869
- onClick: () => T.setState(() => ({
870
- selectedIndicator: b == `id${s}` ? "" : `id${s}`
871
- })),
872
- showBottomBar: !1,
873
- height: 38,
874
- titleMarginChildren: 14,
875
- className: "tematicalFiltersInputContainer",
876
- color: C,
877
- activeColor: d,
878
- children: [
879
- t == "both" && /* @__PURE__ */ m(
880
- "div",
881
- {
882
- className: J.inputTypeContainer,
883
- style: { color: C },
884
- children: [
885
- /* @__PURE__ */ m("label", { children: [
886
- /* @__PURE__ */ r(
887
- "input",
888
- {
889
- type: "radio",
890
- name: "tipo",
891
- value: "abs",
892
- onChange: () => {
893
- n("abs");
894
- },
895
- style: {
896
- marginRight: 4,
897
- backgroundColor: o == "abs" ? f : "white",
898
- border: `1.5px solid ${o == "abs" ? f : C}`
899
- }
900
- }
901
- ),
902
- "Absoluto"
903
- ] }),
904
- /* @__PURE__ */ m("label", { children: [
905
- /* @__PURE__ */ r(
906
- "input",
907
- {
908
- type: "radio",
909
- name: "tipo",
910
- value: "cat",
911
- onChange: () => {
912
- n("cat");
913
- },
914
- style: {
915
- marginRight: 4,
916
- backgroundColor: o == "cat" ? f : "white",
917
- border: `1.5px solid ${o == "cat" ? f : C}`
918
- }
919
- }
920
- ),
921
- "Categórico"
922
- ] })
923
- ]
924
- }
925
- ),
926
- u && /* @__PURE__ */ r("div", { className: J.checkboxContainer, children: l.map((x, k) => {
927
- var _;
928
- return /* @__PURE__ */ r(
929
- De,
930
- {
931
- onClick: () => v({ valueClicked: k, allValues: l }),
932
- indicator: x,
933
- value: ((_ = y[i.code[t == "both" ? 1 : 0]]) == null ? void 0 : _.has(k)) || !y[i.code[t == "both" ? 1 : 0]]
934
- },
935
- `checkbox-${k}`
936
- );
937
- }) }),
938
- h && /* @__PURE__ */ r("div", { className: J.absoluteSliderContainer, children: /* @__PURE__ */ r(
939
- Ae,
940
- {
941
- onChange: v,
942
- min: a,
943
- max: c,
944
- unit: p,
945
- value: y[i.code[0]]
946
- }
947
- ) })
948
- ]
949
- }
950
- ) });
951
- };
952
- be.propTypes = {
953
- indicator: e.shape({
954
- name: e.string,
955
- type: e.string,
956
- code: e.arrayOf(e.string),
957
- values: e.arrayOf(
958
- e.shape({
959
- codename: e.oneOfType(e.array, e.string),
960
- title: e.string
961
- })
962
- )
963
- }),
964
- activeColor: e.string
965
- //onChangeBothType: PropTypes.func,
966
- };
967
- const Oe = ({
968
- subcategory: i,
969
- fontColor: d,
970
- activeColor: o
971
- //onChangeBothType,
972
- }) => {
973
- const { activeSubcategory: n } = T((l) => l), { name: t, indicators: s } = i || {};
974
- return /* @__PURE__ */ r(
975
- j,
976
- {
977
- title: t,
978
- isOpen: n == `id${t}`,
979
- onClick: () => {
980
- T.setState((l) => ({
981
- activeSubcategory: l.activeSubcategory === `id${t}` ? "" : `id${t}`
982
- }));
983
- },
984
- titleFontStyles: { fontSize: 16, fontWeight: 400 },
985
- showBottomBar: !1,
986
- titleMarginChildren: 20,
987
- height: 49,
988
- color: d,
989
- activeColor: o,
990
- children: s == null ? void 0 : s.map((l, a) => /* @__PURE__ */ r(
991
- be,
992
- {
993
- indicator: l,
994
- fontColor: d
995
- },
996
- `indicatorSub-${a}`
997
- ))
998
- }
999
- );
1000
- };
1001
- Oe.propTypes = {
1002
- subcategory: e.shape({
1003
- name: e.string,
1004
- indicators: e.arrayOf(
1005
- e.shape({
1006
- name: e.string,
1007
- value: e.string
1008
- })
1009
- )
1010
- }),
1011
- activeColor: e.string
1012
- //onChangeBothType: PropTypes.func,
1013
- };
1014
- const Re = ({
1015
- category: i,
1016
- // onChangeBothType,
1017
- activeColor: d
1018
- }) => {
1019
- const { name: o, subcategories: n, indicators: t } = i || {}, { activeCategory: s, fontColor: l } = T((a) => a);
1020
- return i && /* @__PURE__ */ r(
1021
- j,
1022
- {
1023
- onClick: () => {
1024
- T.setState((a) => ({
1025
- activeCategory: s === `id${o}` ? "" : `id${o}`
1026
- }));
1027
- },
1028
- title: o,
1029
- isOpen: s === `id${o}`,
1030
- titleFontStyles: { fontSize: 18, fontWeight: "bold" },
1031
- showBottomBar: !1,
1032
- color: l,
1033
- activeColor: d,
1034
- children: n ? n.map((a, c) => /* @__PURE__ */ r(
1035
- Oe,
1036
- {
1037
- subcategory: a,
1038
- fontColor: l,
1039
- activeColor: d
1040
- },
1041
- `subcategory-${c}`
1042
- )) : t && t.map((a, c) => /* @__PURE__ */ r(
1043
- be,
1044
- {
1045
- indicator: a,
1046
- fontColor: l,
1047
- activeColor: d
1048
- },
1049
- `indicator-${c}`
1050
- ))
1051
- }
1052
- );
1053
- };
1054
- Re.propTypes = {
1055
- category: e.shape({
1056
- name: e.string.isRequired,
1057
- subcategories: e.array,
1058
- indicators: e.array
1059
- }),
1060
- activeColor: e.string
1061
- //onChangeBothType: PropTypes.func,
1062
- };
1063
- const Ie = ({
1064
- indicators: i,
1065
- isOpen: d = !0,
1066
- title: o,
1067
- fontColor: n = "#605B56",
1068
- //The color of the slider and the checkbox when is checked
1069
- inputsColor: t = "#605B56",
1070
- activeColor: s
1071
- }) => {
1072
- const { tematicalFiltersSelected: l } = T((c) => c), { t: a } = w();
1073
- return L(() => {
1074
- console.log("filtersSelected changed: ", l);
1075
- }, [l]), L(() => {
1076
- n && T.setState(() => ({ fontColor: n }));
1077
- }, [n]), L(() => {
1078
- t && T.setState(() => ({ inputsColor: t }));
1079
- }, [t]), /* @__PURE__ */ r(
1080
- j,
1081
- {
1082
- isOpen: d,
1083
- title: o ? a(o) : "Tematical filters",
1084
- color: n,
1085
- activeColor: s,
1086
- children: i == null ? void 0 : i.map((c, p) => /* @__PURE__ */ r(
1087
- Re,
1088
- {
1089
- category: c,
1090
- fontColor: n,
1091
- activeColor: s
1092
- },
1093
- `category-${p}`
1094
- ))
1095
- }
1096
- );
1097
- };
1098
- Ie.propTypes = {
1099
- isOpen: e.bool,
1100
- title: e.string,
1101
- indicators: e.arrayOf(e.object),
1102
- fontColor: e.string,
1103
- onChangeTematicalFilters: e.func,
1104
- inputsColor: e.string,
1105
- activeColor: e.string
1106
- };
1107
- const tn = "_FiltersAmbitContainer_6o4gt_2", nn = "_FiltersAmbitHeader_6o4gt_7", sn = "_FiltersAmbitTitle_6o4gt_15", on = "_FiltersAmbitDescription_6o4gt_22", rn = "_FiltersAmbitDescriptionTitle_6o4gt_33", G = {
1108
- FiltersAmbitContainer: tn,
1109
- FiltersAmbitHeader: nn,
1110
- FiltersAmbitTitle: sn,
1111
- FiltersAmbitDescription: on,
1112
- FiltersAmbitDescriptionTitle: rn
1113
- }, an = ({
1114
- ambitName: i,
1115
- ambitDescription: d,
1116
- defaultFilters: o,
1117
- indicators: n,
1118
- activeColor: t,
1119
- textColor: s,
1120
- backgroundColor: l,
1121
- onChangeAppliedFilters: a,
1122
- saveAmbit: c
1123
- }) => {
1124
- const { t: p } = w(), { tematicalFiltersSelected: u } = T((h) => h);
1125
- return L(() => {
1126
- o && o.length > 0 && T.setState((h) => ({
1127
- tematicalFiltersSelected: o
1128
- }));
1129
- }, [o]), L(() => {
1130
- console.log("filtersSelected changed: ", u), a(u);
1131
- }, [u]), /* @__PURE__ */ m("div", { className: G.FiltersAmbitContainer, children: [
1132
- /* @__PURE__ */ m("div", { className: G.FiltersAmbitHeader, children: [
1133
- /* @__PURE__ */ r("div", { className: G.FiltersAmbitTitle, children: i }),
1134
- /* @__PURE__ */ m("div", { className: G.FiltersAmbitDescription, children: [
1135
- /* @__PURE__ */ r("div", { className: G.FiltersAmbitDescriptionTitle, children: p("description") }),
1136
- d
1137
- ] })
1138
- ] }),
1139
- /* @__PURE__ */ r(
1140
- Fe,
1141
- {
1142
- title: p("applied_filters"),
1143
- isOpen: !0,
1144
- textColor: s || "#fff",
1145
- backgroundColor: l || "#605B5680",
1146
- activeColor: t
1147
- }
1148
- ),
1149
- /* @__PURE__ */ r(Be, { activeColor: t }),
1150
- /* @__PURE__ */ r(
1151
- Ie,
1152
- {
1153
- indicators: n,
1154
- inputsColor: t,
1155
- textColor: s,
1156
- title: "tematical_filters",
1157
- activeColor: t
1158
- }
1159
- ),
1160
- /* @__PURE__ */ r("div", { className: "butonContainer", children: /* @__PURE__ */ r("button", { className: "mainButton", onClick: () => c, children: p("guardar_ambit") }) })
1161
- ] });
1162
- };
1163
- an.propTypes = {
1164
- indicators: e.arrayOf(e.object).isRequired,
1165
- ambitName: e.string,
1166
- ambitDescription: e.string,
1167
- defaultFilters: e.arrayOf(e.object),
1168
- activeColor: e.string,
1169
- backgroundColor: e.string,
1170
- textColor: e.string,
1171
- onChangeAppliedFilters: e.func,
1172
- saveAmbit: e.func
1173
- };
1174
- const ln = "_barChartContainer_d2f1z_2", cn = {
1175
- barChartContainer: ln
1176
- }, ze = ({
1177
- data: i,
1178
- width: d = 700,
1179
- barHeight: o = 25,
1180
- gap: n = 23,
1181
- fontColor: t = "#605B56",
1182
- verticalPaddign: s = 10,
1183
- horizontalPaddign: l = 20,
1184
- leftPadding: a = 200,
1185
- numberOfDivisions: c = 7,
1186
- maxValue: p = null
1187
- }) => {
1188
- const { t: u } = w(), { xScale: h, ticks: g, height: b } = te(() => {
1189
- if (i && i.length > 0) {
1190
- const C = (i == null ? void 0 : i.length) * (o + n) + s * 2, f = ye.max(i, (x) => x.value) || 1, v = ye.scaleLinear().domain([0, p || f]).range([0, d - a]), y = Array.from({ length: c + 1 }, (x, k) => p ? p / c * k : f / c * k);
1191
- return {
1192
- xScale: v,
1193
- ticks: y,
1194
- height: C,
1195
- width: d,
1196
- verticalPaddign: s,
1197
- horizontalPaddign: l
1198
- };
1199
- } else
1200
- return { xScale: null, ticks: [], height: 0 };
1201
- }, [
1202
- i,
1203
- d,
1204
- c,
1205
- o,
1206
- n,
1207
- l,
1208
- s,
1209
- p
1210
- ]);
1211
- return /* @__PURE__ */ r("div", { className: cn.barChartContainer, children: /* @__PURE__ */ r("svg", { width: d + l * 2, height: b, children: /* @__PURE__ */ m("g", { transform: `translate(0,${n})`, children: [
1212
- /* @__PURE__ */ r("g", { transform: `translate(${a + l}, 0)`, children: g.map((C, f) => {
1213
- const v = h(C);
1214
- return /* @__PURE__ */ m("g", { transform: `translate(${v}, 0)`, children: [
1215
- /* @__PURE__ */ r(
1216
- "line",
1217
- {
1218
- y1: 0,
1219
- y2: b - n * 2,
1220
- stroke: "#ccc"
1221
- }
1222
- ),
1223
- /* @__PURE__ */ r(
1224
- "text",
1225
- {
1226
- y: b - n,
1227
- textAnchor: "middle",
1228
- fontSize: 10,
1229
- fill: t,
1230
- children: parseInt(C)
1231
- }
1232
- )
1233
- ] }, f);
1234
- }) }),
1235
- i && i.length > 0 && (i == null ? void 0 : i.map((C, f) => {
1236
- const v = h(C.value), y = f * (o + n);
1237
- return /* @__PURE__ */ m(
1238
- "g",
1239
- {
1240
- transform: `translate(${a + l}, ${y})`,
1241
- children: [
1242
- /* @__PURE__ */ r(
1243
- "text",
1244
- {
1245
- x: -24,
1246
- y: o / 2 + 5,
1247
- textAnchor: "end",
1248
- fill: t,
1249
- children: u(C.title)
1250
- }
1251
- ),
1252
- /* @__PURE__ */ r(
1253
- "rect",
1254
- {
1255
- width: v,
1256
- height: o,
1257
- fill: C.color,
1258
- rx: 0
1259
- }
1260
- )
1261
- ]
1262
- },
1263
- f
1264
- );
1265
- }))
1266
- ] }) }) });
1267
- };
1268
- ze.propTypes = {
1269
- data: e.arrayOf(
1270
- e.shape({
1271
- title: e.string,
1272
- value: e.number,
1273
- color: e.string
1274
- })
1275
- ),
1276
- width: e.number,
1277
- barHeight: e.number,
1278
- gap: e.number,
1279
- verticalPaddign: e.number,
1280
- horizontalPaddign: e.number,
1281
- numberOfDivisions: e.number,
1282
- fontColor: e.string
1283
- };
1284
- const dn = "_graphicContainer_c9zrg_2", pn = "_titleContainer_c9zrg_14", _e = {
1285
- graphicContainer: dn,
1286
- titleContainer: pn
1287
- }, un = ({
1288
- data: i,
1289
- graphWidth: d = 700,
1290
- containerStyle: o,
1291
- borderColor: n = "#605B56",
1292
- title: t = "Graphic Title",
1293
- fontColor: s = "#605B56",
1294
- maxValue: l = null,
1295
- numberOfDivisions: a = 7,
1296
- leftPadding: c = 200
1297
- }) => {
1298
- const { t: p } = w();
1299
- return /* @__PURE__ */ m(
1300
- "div",
1301
- {
1302
- className: _e.graphicContainer,
1303
- style: {
1304
- ...o || {},
1305
- border: `1.5px solid ${n}`
1306
- },
1307
- children: [
1308
- /* @__PURE__ */ r("div", { className: _e.titleContainer, children: /* @__PURE__ */ r("h2", { children: p(t) }) }),
1309
- /* @__PURE__ */ r(
1310
- ze,
1311
- {
1312
- data: i,
1313
- width: d,
1314
- fontColor: s,
1315
- maxValue: l,
1316
- numberOfDivisions: a,
1317
- leftPadding: c
1318
- }
1319
- )
1320
- ]
1321
- }
1322
- );
1323
- };
1324
- un.propTypes = {
1325
- data: e.arrayOf(
1326
- e.shape({
1327
- color: e.string.isRequired,
1328
- value: e.number.isRequired,
1329
- title: e.string.isRequired
1330
- })
1331
- ),
1332
- borderColor: e.string,
1333
- title: e.string,
1334
- graphWidth: e.number,
1335
- containerStyle: e.object,
1336
- fontColor: e.string,
1337
- maxValue: e.number,
1338
- numberOfDivisions: e.number,
1339
- leftPadding: e.number
1340
- };
1341
- const hn = "_indicatorsCategory_1cu33_2", mn = "_title_1cu33_5", gn = "_list_1cu33_11", ae = {
1342
- indicatorsCategory: hn,
1343
- title: mn,
1344
- list: gn
1345
- }, bn = "_indicatorContainer_lw8gx_2", fn = "_indicatorNameContainer_lw8gx_11", yn = "_dot_lw8gx_20", Cn = "_indicatorName_lw8gx_11", vn = "_switchExternalContainer_lw8gx_31", _n = "_switchType_lw8gx_40", xn = "_switchTypeOptions_lw8gx_44", kn = "_optionContainer_lw8gx_55", wn = "_customRadious_lw8gx_65", Nn = "_optionText_lw8gx_72", S = {
1346
- indicatorContainer: bn,
1347
- indicatorNameContainer: fn,
1348
- dot: yn,
1349
- indicatorName: Cn,
1350
- switchExternalContainer: vn,
1351
- switchType: _n,
1352
- switchTypeOptions: xn,
1353
- optionContainer: kn,
1354
- customRadious: wn,
1355
- optionText: Nn
1356
- }, fe = ({
1357
- indicator: i,
1358
- values: d = [],
1359
- activeColor: o,
1360
- defaultColor: n = "#92898A",
1361
- activeIndicator: t,
1362
- activeIndicatorType: s,
1363
- onClickIndicator: l,
1364
- multiple: a = !1,
1365
- onChangeType: c
1366
- }) => {
1367
- const { t: p } = w(), { name: u, type: h } = i, [g, b] = B(!1);
1368
- L(() => {
1369
- t && b(
1370
- a ? t.some(
1371
- (v) => v.name == String(u)
1372
- ) : t.name == u
1373
- );
1374
- }, [t]);
1375
- const C = () => /* @__PURE__ */ r("div", { className: S.switchExternalContainer, children: /* @__PURE__ */ r("div", { className: S.switchType, children: /* @__PURE__ */ m("div", { className: S.switchTypeOptions, children: [
1376
- /* @__PURE__ */ m(
1377
- "div",
1378
- {
1379
- className: S.optionContainer,
1380
- onClick: () => c("cat"),
1381
- children: [
1382
- /* @__PURE__ */ r(
1383
- "span",
1384
- {
1385
- className: `${S.customRadious}`,
1386
- style: {
1387
- backgroundColor: s === "cat" ? o : "transparent",
1388
- borderColor: s === "cat" ? o : n
1389
- }
1390
- }
1391
- ),
1392
- /* @__PURE__ */ r(
1393
- "h4",
1394
- {
1395
- className: S.optionText,
1396
- style: {
1397
- color: s === "cat" ? o : n
1398
- },
1399
- children: p("indicators.cat")
1400
- }
1401
- )
1402
- ]
1403
- }
1404
- ),
1405
- /* @__PURE__ */ m(
1406
- "div",
1407
- {
1408
- className: S.optionContainer,
1409
- onClick: () => c("abs"),
1410
- children: [
1411
- /* @__PURE__ */ r(
1412
- "span",
1413
- {
1414
- className: `${S.customRadious}`,
1415
- style: {
1416
- backgroundColor: s === "abs" ? o : "transparent",
1417
- borderColor: s === "abs" ? o : n
1418
- }
1419
- }
1420
- ),
1421
- /* @__PURE__ */ r(
1422
- "h4",
1423
- {
1424
- className: S.optionText,
1425
- style: {
1426
- color: s === "abs" ? o : n
1427
- },
1428
- children: p("indicators.abs")
1429
- }
1430
- )
1431
- ]
1432
- }
1433
- )
1434
- ] }) }) }), f = () => /* @__PURE__ */ r("div", { className: S.switchExternalContainer, children: /* @__PURE__ */ r("div", { className: S.switchType, children: /* @__PURE__ */ r("div", { className: S.switchTypeOptions, children: d.map((v, y) => /* @__PURE__ */ m(
1435
- "div",
1436
- {
1437
- className: S.optionContainer,
1438
- children: [
1439
- /* @__PURE__ */ r(
1440
- "span",
1441
- {
1442
- className: S.customRadious
1443
- }
1444
- ),
1445
- /* @__PURE__ */ r("h4", { children: p(v.unit) })
1446
- ]
1447
- },
1448
- y
1449
- )) }) }) });
1450
- return /* @__PURE__ */ m(
1451
- "div",
1452
- {
1453
- className: S.indicatorContainer,
1454
- children: [
1455
- /* @__PURE__ */ m(
1456
- "div",
1457
- {
1458
- className: S.indicatorNameContainer,
1459
- onClick: () => l({ indicator: i }),
1460
- children: [
1461
- /* @__PURE__ */ r(
1462
- "div",
1463
- {
1464
- style: {
1465
- border: g ? `1px solid ${o}` : `1px solid ${n}`
1466
- },
1467
- className: S.dot
1468
- }
1469
- ),
1470
- /* @__PURE__ */ r(
1471
- "h4",
1472
- {
1473
- className: S.indicatorName,
1474
- style: { color: g ? o : n },
1475
- children: /* @__PURE__ */ r(me, { i18nKey: u, components: { sup: /* @__PURE__ */ r("sup", {}) } })
1476
- }
1477
- )
1478
- ]
1479
- }
1480
- ),
1481
- (t == null ? void 0 : t.name) === u && h === "both" && /* @__PURE__ */ r("div", { children: C() }),
1482
- (t == null ? void 0 : t.name) === u && h === "twoUnits" && /* @__PURE__ */ r("div", { children: f() })
1483
- ]
1484
- }
1485
- );
1486
- };
1487
- fe.propTypes = {
1488
- indicator: e.shape({
1489
- name: e.string,
1490
- type: e.string
1491
- }),
1492
- values: e.oneOfType([e.bool, e.array]),
1493
- activeColor: e.string,
1494
- defaultColor: e.string,
1495
- activeIndicator: e.oneOfType([e.object, e.array]),
1496
- multiple: e.bool,
1497
- onClickIndicator: e.func
1498
- };
1499
- const Sn = "_indicatorsSubCategory_1dzsi_2", Tn = "_list_1dzsi_8", xe = {
1500
- indicatorsSubCategory: Sn,
1501
- list: Tn
1502
- }, Ve = ({
1503
- subcName: i,
1504
- indicators: d,
1505
- defaultColor: o,
1506
- activeColor: n,
1507
- activeSubCategory: t,
1508
- onClickSubCategory: s,
1509
- id: l,
1510
- activeIndicator: a,
1511
- onClickIndicator: c,
1512
- multiple: p,
1513
- activeIndicatorType: u,
1514
- onChangeType: h
1515
- }) => {
1516
- const { t: g } = w(), [b, C] = B(!1);
1517
- return L(() => {
1518
- C(t == l);
1519
- }, [t, l]), /* @__PURE__ */ m(
1520
- ge.div,
1521
- {
1522
- className: xe.indicatorsSubCategory,
1523
- initial: { height: "43px" },
1524
- animate: { height: b ? "auto" : "43px" },
1525
- transition: { duration: 0.4 },
1526
- children: [
1527
- /* @__PURE__ */ r("button", { onClick: () => s(l), children: /* @__PURE__ */ m("h3", { style: { color: b ? n : o }, children: [
1528
- /* @__PURE__ */ r("span", { style: { color: b ? n : o }, children: b ? "-" : "+" }),
1529
- /* @__PURE__ */ r(
1530
- "span",
1531
- {
1532
- style: { marginLeft: 12, color: b ? n : o },
1533
- children: g(i)
1534
- }
1535
- )
1536
- ] }) }),
1537
- d && /* @__PURE__ */ r("div", { className: xe.list, children: d == null ? void 0 : d.map((f, v) => /* @__PURE__ */ r(
1538
- fe,
1539
- {
1540
- indicator: f,
1541
- defaultColor: o,
1542
- activeColor: n,
1543
- activeIndicator: a,
1544
- onClickIndicator: c,
1545
- multiple: p,
1546
- activeIndicatorType: u,
1547
- onChangeType: h
1548
- },
1549
- "indicator" + v
1550
- )) })
1551
- ]
1552
- }
1553
- );
1554
- };
1555
- Ve.propTypes = {
1556
- subcName: e.string,
1557
- indicators: e.array,
1558
- activeColor: e.string,
1559
- defaultColor: e.string,
1560
- activeSubCategory: e.string,
1561
- id: e.string,
1562
- activeIndicator: e.oneOfType([e.object, e.array]),
1563
- multiple: e.bool,
1564
- onClickSubCategory: e.func,
1565
- onClickIndicator: e.func
1566
- };
1567
- const je = ({
1568
- cat: i,
1569
- id: d,
1570
- activeColor: o,
1571
- defaultColor: n,
1572
- onClickCategory: t,
1573
- activeCategory: s,
1574
- activeSubCategory: l,
1575
- onClickSubCategory: a,
1576
- activeIndicator: c,
1577
- onClickIndicator: p,
1578
- multiple: u,
1579
- activeIndicatorType: h,
1580
- onChangeType: g
1581
- }) => {
1582
- var v;
1583
- const { t: b } = w(), [C, f] = B(!1);
1584
- return L(() => {
1585
- f(s === d);
1586
- }, [s, d]), /* @__PURE__ */ m(
1587
- ge.div,
1588
- {
1589
- className: ae.indicatorsCategory,
1590
- initial: { height: "53px" },
1591
- animate: { height: C ? "auto" : "53px" },
1592
- transition: { duration: 0.4 },
1593
- style: {
1594
- backgroundColor: "white",
1595
- borderBottom: C ? `1px solid ${o}` : "0px",
1596
- marginBottom: C ? "20px" : "0px"
1597
- },
1598
- children: [
1599
- /* @__PURE__ */ m("h2", { className: `${ae.title}`, onClick: () => t(d), children: [
1600
- /* @__PURE__ */ r("span", { style: { color: C ? o : n }, children: C ? "-" : "+" }),
1601
- /* @__PURE__ */ r(
1602
- "span",
1603
- {
1604
- style: { marginLeft: 12, color: C ? o : n },
1605
- children: b(i.name)
1606
- }
1607
- )
1608
- ] }),
1609
- i.subcategories ? i.subcategories.map(
1610
- ({ name: y, subcategory: x, indicators: k }, _) => /* @__PURE__ */ r(
1611
- Ve,
1612
- {
1613
- id: x,
1614
- activeSubCategory: l,
1615
- subcName: y,
1616
- onClickSubCategory: a,
1617
- activeIndicator: c,
1618
- onClickIndicator: p,
1619
- multiple: u,
1620
- activeColor: o,
1621
- defaultColor: n,
1622
- indicators: k,
1623
- activeIndicatorType: h,
1624
- onChangeType: g
1625
- },
1626
- `subcKey ${_}`
1627
- )
1628
- ) : /* @__PURE__ */ r("div", { className: ae.list, children: (v = i.indicators) == null ? void 0 : v.map((y, x) => /* @__PURE__ */ r(
1629
- fe,
1630
- {
1631
- indicator: y,
1632
- values: y.type == "twoUnits" && y.values,
1633
- activeColor: o,
1634
- defaultColor: n,
1635
- activeIndicator: c,
1636
- onClickIndicator: p,
1637
- multiple: u,
1638
- activeIndicatorType: h,
1639
- onChangeType: g
1640
- },
1641
- `indicator${x}`
1642
- )) })
1643
- ]
1644
- }
1645
- );
1646
- };
1647
- je.propTypes = {
1648
- cat: e.object,
1649
- id: e.string,
1650
- onChange: e.func,
1651
- onClickCategory: e.func,
1652
- activeCategory: e.string,
1653
- activeSubCategory: e.string,
1654
- onClickSubCategory: e.func,
1655
- onClickIndicator: e.func,
1656
- activeIndicator: e.oneOfType([e.object, e.array]),
1657
- multiple: e.bool,
1658
- activeColor: e.string,
1659
- defaultColor: e.string
1660
- };
1661
- const Mn = "_indicatorsList_fklyu_2", $n = "_title_fklyu_6", ke = {
1662
- indicatorsList: Mn,
1663
- title: $n
1664
- }, Ln = ({
1665
- indicators: i,
1666
- activeColor: d,
1667
- defaultColor: o = "#92898A",
1668
- // Función que se ejecuta al seleccionar un indicador, recibe el o los ikeys como parametro
1669
- onChange: n,
1670
- // Selección multiple
1671
- multiple: t = !1,
1672
- // Si multiple es true, debe ser un array de strings, sino un string
1673
- defaultValue: s = null,
1674
- //si el indicador es tipo "both" cuando se cambia el tipo
1675
- changeIndType: l,
1676
- activeIndicatorType: a
1677
- }) => {
1678
- const { t: c } = w(), [p, u] = B(), [h, g] = B(), [b, C] = B(), f = (_) => {
1679
- u(p == _ ? null : _);
1680
- }, v = (_) => {
1681
- g(h == _ ? null : _);
1682
- }, y = ({ indicator: _ }) => {
1683
- console.log("onClickIndicator: ", _), x(_);
1684
- }, x = (_) => {
1685
- if (!t)
1686
- C(
1687
- (b == null ? void 0 : b.name) == _.name ? null : _
1688
- );
1689
- else {
1690
- let N = b && b.length > 0 ? [...b] : [];
1691
- C(
1692
- N != null && N.some(
1693
- (D) => D.name == _.name
1694
- ) ? N.filter(
1695
- (D) => D.name != String(_.name)
1696
- ) : [...N, _]
1697
- ), _.type == "both" && l("cat");
1698
- }
1699
- };
1700
- L(() => {
1701
- console.log("activeindicator changed to: ", b), n && typeof n == "function" && b && n({ activeIndicator: b });
1702
- }, [b]), Ee(() => {
1703
- if (s && !b)
1704
- if (t && s && Array.isArray(s)) {
1705
- let _ = b && b.length > 0 ? [...b] : [];
1706
- C([..._, ...s]), k(s[0].name);
1707
- } else
1708
- x(s), k(s.name);
1709
- }, []);
1710
- const k = (_) => {
1711
- const N = i.find((D) => {
1712
- if (D.subcategories) {
1713
- let A = D.subcategories.find(
1714
- (ne) => ne.indicators.find((Z) => Z.name == _)
1715
- );
1716
- if (A)
1717
- return g(A.subcategory), A;
1718
- } else
1719
- return D.indicators.some((A) => A.name == _);
1720
- });
1721
- N && u(N.category);
1722
- };
1723
- return /* @__PURE__ */ m("div", { className: ke.indicatorsList, children: [
1724
- /* @__PURE__ */ r("h2", { className: ke.title, style: { color: o }, children: c("indicators.indicators") }),
1725
- i.map((_, N) => /* @__PURE__ */ r(
1726
- je,
1727
- {
1728
- id: _.category,
1729
- cat: _,
1730
- onClickCategory: f,
1731
- activeCategory: p,
1732
- onClickSubCategory: v,
1733
- activeSubCategory: h,
1734
- onClickIndicator: y,
1735
- activeIndicator: b,
1736
- activeColor: d,
1737
- defaultColor: o,
1738
- multiple: t,
1739
- onChange: n,
1740
- onChangeType: l,
1741
- activeIndicatorType: a
1742
- },
1743
- `categoryKey${N}`
1744
- ))
1745
- ] });
1746
- };
1747
- Ln.propTypes = {
1748
- indicators: e.arrayOf(e.object),
1749
- activeColor: e.string,
1750
- defaultColor: e.string,
1751
- onChange: e.func,
1752
- changeIndType: e.func,
1753
- multiple: e.bool,
1754
- activeIndicator: e.oneOfType([e.object, e.array]),
1755
- defaultValue: e.oneOfType([e.object, e.array]),
1756
- activeIndicatorType: e.string
1757
- };
1758
- const Fn = "_langSelector_1of0g_2", Bn = "_currentLang_1of0g_7", Dn = "_arrow_1of0g_19", An = "_prevImg_1of0g_22", On = "_langMenu_1of0g_26", K = {
1759
- langSelector: Fn,
1760
- currentLang: Bn,
1761
- arrow: Dn,
1762
- prevImg: An,
1763
- langMenu: On
1764
- }, Rn = ({ langs: i, arrow: d, imgPrev: o }) => {
1765
- const [n, t] = B(!1), { i18n: s } = w(), l = i.find((c) => c.code == s.language), a = (c) => {
1766
- s.changeLanguage(c), t(!1);
1767
- };
1768
- return /* @__PURE__ */ m("div", { className: K.langSelector, children: [
1769
- /* @__PURE__ */ m(
1770
- "div",
1771
- {
1772
- className: K.currentLang,
1773
- onClick: () => {
1774
- t(!n);
1775
- },
1776
- children: [
1777
- o && /* @__PURE__ */ r("img", { className: K.prevImg, src: o }),
1778
- l.titleSelected || l.title,
1779
- /* @__PURE__ */ r("img", { src: d, className: K.arrow })
1780
- ]
1781
- }
1782
- ),
1783
- n && /* @__PURE__ */ r("div", { className: K.langMenu, children: i.map((c) => /* @__PURE__ */ r(
1784
- "button",
1785
- {
1786
- className: l.code == c.code ? K.active : "",
1787
- onClick: () => a(c.code),
1788
- children: c.title
1789
- },
1790
- c.code
1791
- )) })
1792
- ] });
1793
- };
1794
- Rn.propTypes = {
1795
- langs: e.arrayOf(
1796
- e.shape({
1797
- code: e.string,
1798
- title: e.string,
1799
- titleSelected: e.string
1800
- })
1801
- ),
1802
- color: e.string,
1803
- bckColor: e.string,
1804
- hoverColor: e.string,
1805
- arrow: e.object,
1806
- imgPrev: e.object
1807
- };
1808
- const In = "_legendContainer_atg3j_3", zn = "_closeButton_atg3j_18", Vn = "_titleContainer_atg3j_46", jn = "_infoContainer_atg3j_52", Pn = "_titleLegendList_atg3j_63", qn = "_legendListContainer_atg3j_70", En = "_gridContainer_atg3j_70", Kn = "_elementLegendContainer_atg3j_76", Un = "_colorDot_atg3j_82", Zn = "_absoluteValueContainer_atg3j_88", Hn = "_absoluteValueColor_atg3j_91", Gn = "_absoluteValueText_atg3j_96", Yn = "_moreInfoContainer_atg3j_108", M = {
1809
- legendContainer: In,
1810
- closeButton: zn,
1811
- titleContainer: Vn,
1812
- infoContainer: jn,
1813
- titleLegendList: Pn,
1814
- legendListContainer: qn,
1815
- gridContainer: En,
1816
- elementLegendContainer: Kn,
1817
- colorDot: Un,
1818
- absoluteValueContainer: Zn,
1819
- absoluteValueColor: Hn,
1820
- absoluteValueText: Gn,
1821
- moreInfoContainer: Yn
1822
- }, Wn = ({
1823
- //JSON with the styles of the container (optional)
1824
- containerStyles: i,
1825
- //Title on top of the legend
1826
- title: d,
1827
- //Array to display the info behind the title should have: [{title, value}, ...]
1828
- infoList: o,
1829
- //Array to display the items of the legend: [{title, color}, ...]
1830
- //color should be a string with hexadecimal value
1831
- legendList: n,
1832
- //If not passed it will read t("mainUser")
1833
- legendListTitle: t,
1834
- //Should be an object with {maxColor, minColor, maxValue, minValue}
1835
- //If this has is not null or undefined, the legendList values wont be displayed.
1836
- //It will display only the absolute value indicator.
1837
- absoluteValue: s,
1838
- //Function to be called when the button is clicked (optional).
1839
- //If this is null or undefined the button wont be displayed.
1840
- onClickMoreInfo: l,
1841
- //If not passed it will read t("moreInformation")
1842
- buttonTitle: a,
1843
- onClickClose: c
1844
- }) => {
1845
- const { t: p } = w();
1846
- return /* @__PURE__ */ m(
1847
- "div",
1848
- {
1849
- style: i ? { ...i } : {},
1850
- className: `${M.legendContainer}`,
1851
- children: [
1852
- /* @__PURE__ */ r("button", { className: M.closeButton, onClick: c }),
1853
- d && /* @__PURE__ */ r("div", { className: M.titleContainer, children: /* @__PURE__ */ r("h2", { children: d }) }),
1854
- o && o.length > 0 && /* @__PURE__ */ r("div", { className: M.infoContainer, children: /* @__PURE__ */ r("ul", { children: o.map(({ title: u, value: h }) => /* @__PURE__ */ m("li", { children: [
1855
- /* @__PURE__ */ r("h3", { className: M.title, children: `${u}:` }),
1856
- /* @__PURE__ */ m("span", { className: M.value, children: [
1857
- "  ",
1858
- h
1859
- ] })
1860
- ] }, d)) }) }),
1861
- /* @__PURE__ */ r("h3", { className: M.titleLegendList, children: t ? /* @__PURE__ */ r(me, { i18nKey: t, components: { sup: /* @__PURE__ */ r("sup", {}) } }) : p("mainUse") }),
1862
- /* @__PURE__ */ r("div", { className: M.legendListContainer, children: s ? /* @__PURE__ */ m("div", { className: M.absoluteValueContainer, children: [
1863
- /* @__PURE__ */ r(
1864
- "div",
1865
- {
1866
- className: M.absoluteValueColor,
1867
- style: {
1868
- background: `linear-gradient(to bottom, ${s.maxColor} 0%, ${s.minColor} 100%)`
1869
- }
1870
- }
1871
- ),
1872
- /* @__PURE__ */ m("div", { className: M.absoluteValueText, children: [
1873
- /* @__PURE__ */ m("span", { children: [
1874
- s.maxValue,
1875
- " ",
1876
- p(s.unit)
1877
- ] }),
1878
- /* @__PURE__ */ m("span", { children: [
1879
- s.minValue,
1880
- " ",
1881
- p(s.unit)
1882
- ] })
1883
- ] })
1884
- ] }) : n && n.length > 0 && /* @__PURE__ */ r("div", { className: M.gridContainer, children: n.map(
1885
- ({ title: u, color: h }) => /* @__PURE__ */ m("div", { className: M.elementLegendContainer, children: [
1886
- /* @__PURE__ */ r(
1887
- "div",
1888
- {
1889
- className: M.colorDot,
1890
- style: { backgroundColor: h }
1891
- }
1892
- ),
1893
- /* @__PURE__ */ m("div", { className: M.titleLegendElement, children: [
1894
- p(u),
1895
- " "
1896
- ] })
1897
- ] }, d)
1898
- ) }) }),
1899
- l && /* @__PURE__ */ r("button", { className: M.moreInfoContainer, onClick: l, children: a || p("moreInformation") })
1900
- ]
1901
- }
1902
- );
1903
- };
1904
- Wn.propTypes = {
1905
- title: e.string,
1906
- containerStyles: e.object,
1907
- infoList: e.arrayOf(
1908
- e.shape({
1909
- title: e.string.isRequired,
1910
- value: e.oneOfType([e.string, e.number])
1911
- })
1912
- ),
1913
- legendList: e.arrayOf(
1914
- e.shape({
1915
- title: e.string,
1916
- color: e.string
1917
- })
1918
- ),
1919
- legendListTitle: e.string,
1920
- absoluteValue: e.shape({
1921
- maxColor: e.string,
1922
- minColor: e.string,
1923
- maxValue: e.number,
1924
- minValue: e.number
1925
- }),
1926
- onClickMoreInfo: e.func,
1927
- buttonTitle: e.string,
1928
- onClickClose: e.func
1929
- };
1930
- const Xn = "_logo_1ewa6_2", we = {
1931
- logo: Xn
1932
- }, Jn = ({ src: i, alt: d, href: o }) => {
1933
- const { t: n } = w(), t = /* @__PURE__ */ r("img", { src: i, alt: n(d) });
1934
- return o ? /* @__PURE__ */ r("div", { className: we.logo, children: /* @__PURE__ */ r("a", { href: o, children: t }) }) : /* @__PURE__ */ r("div", { className: we.logo, children: t });
1935
- };
1936
- Jn.propTypes = {
1937
- src: e.string.isRequired,
1938
- alt: e.string.isRequired,
1939
- href: e.string,
1940
- className: e.string
1941
- };
1942
- const Qn = "_mapContainer_84pkf_2", ei = {
1943
- mapContainer: Qn
1944
- };
1945
- Ue.accessToken = "pk.eyJ1IjoiY2ljbGljYSIsImEiOiJja3llODhxZ2UwYzF1Mm5xcHVhMzI3anhqIn0.-r56FLAzEH57eVsB2ZeVcA";
1946
- const ti = ({
1947
- initialView: i = { latitude: 39.4699, longitude: -0.3763, zoom: 12 },
1948
- maxZoom: d = 17,
1949
- minZoom: o = 8,
1950
- mapStyle: n,
1951
- firstSymbolLayer: t,
1952
- cssProps: s = "",
1953
- onClick: l = "",
1954
- interactiveLayers: a = [],
1955
- popUp: c = !1,
1956
- sources: p = [],
1957
- layers: u = []
1958
- }) => {
1959
- const h = he(), [g, b] = B(null), C = ce((f) => f.mapState.showTexts);
1960
- return L(() => {
1961
- if (h.current) {
1962
- const f = h.current.getMap();
1963
- f.getStyle().layers.map((y) => {
1964
- y.type == "symbol" && y.id != "professionals" && (C ? f.setLayoutProperty(y.id, "visibility", "visible") : f.setLayoutProperty(y.id, "visibility", "none"));
1965
- });
1966
- }
1967
- }, [C]), /* @__PURE__ */ r("div", { className: `${ei.mapContainer}`, style: s, children: /* @__PURE__ */ m(
1968
- Ze,
1969
- {
1970
- initialViewState: i,
1971
- ref: h,
1972
- hash: !1,
1973
- maxZoom: d,
1974
- minZoom: o,
1975
- mapStyle: n,
1976
- onClick: l,
1977
- interactiveLayerIds: a,
1978
- children: [
1979
- p.length && p.map((f, v) => /* @__PURE__ */ r(
1980
- He,
1981
- {
1982
- ...f,
1983
- children: u.length && u.map((y, x) => {
1984
- if (y.sourceId == f.id) return /* @__PURE__ */ r(
1985
- Ge,
1986
- {
1987
- ...y.layer,
1988
- beforeId: t
1989
- },
1990
- x
1991
- );
1992
- })
1993
- },
1994
- v
1995
- )),
1996
- /* @__PURE__ */ r(Ye, { position: "bottom-right", visualizePitch: !0 }),
1997
- c && g && /* @__PURE__ */ r(
1998
- We,
1999
- {
2000
- longitude: c.longitude,
2001
- latitude: c.latitude,
2002
- anchor: c.anchor,
2003
- onClose: () => b(null),
2004
- children: c.content
2005
- }
2006
- )
2007
- ]
2008
- }
2009
- ) });
2010
- };
2011
- ti.propTypes = {
2012
- initialView: e.shape({
2013
- latitude: e.number.isRequired,
2014
- longitude: e.number.isRequired,
2015
- zoom: e.number.isRequired
2016
- }),
2017
- mapStyle: e.object,
2018
- firstSymbolLayer: e.string,
2019
- cssProps: e.object,
2020
- style: e.object,
2021
- maxZoom: e.number,
2022
- minZoom: e.number,
2023
- onClick: e.func,
2024
- interactiveLayers: e.array,
2025
- popUp: e.shape({
2026
- latitude: e.number,
2027
- longitude: e.number,
2028
- anchor: e.string,
2029
- content: e.element
2030
- }),
2031
- textsUrl: e.string,
2032
- sources: e.arrayOf(
2033
- e.shape({
2034
- id: e.string,
2035
- type: e.string,
2036
- url: e.string,
2037
- //si es type: vector
2038
- data: e.object
2039
- //si es type: geojson
2040
- })
2041
- ),
2042
- layers: e.arrayOf(
2043
- e.shape({
2044
- sourceId: e.string,
2045
- layer: e.shape({
2046
- id: e.string,
2047
- type: e.string,
2048
- sourceLayer: e.string,
2049
- minZoom: e.number,
2050
- maxZoom: e.number,
2051
- paint: e.object
2052
- })
2053
- })
2054
- )
2055
- };
2056
- const ni = "_mapContainer_b0pyr_3", ii = {
2057
- mapContainer: ni
2058
- }, si = "_FeaturePopUp_1gd6w_2", oi = "_title_1gd6w_2", Ne = {
2059
- FeaturePopUp: si,
2060
- title: oi
2061
- }, ri = ({ props: i }) => {
2062
- const { t: d } = w();
2063
- return /* @__PURE__ */ r("div", { className: Ne.FeaturePopUp, children: i.map((o) => /* @__PURE__ */ m("p", { children: [
2064
- /* @__PURE__ */ m("span", { className: Ne.title, children: [
2065
- /* @__PURE__ */ r(me, { i18nKey: o.name, components: { sup: /* @__PURE__ */ r("sup", {}) } }),
2066
- ": "
2067
- ] }),
2068
- o.value.toLocaleString("de", { maximumFractionDigits: 2 }),
2069
- " ",
2070
- d(o.unit)
2071
- ] })) });
2072
- }, ai = ({
2073
- initialView: i = { latitude: 39.4699, longitude: -0.3763, zoom: 12 },
2074
- maxZoom: d = 17,
2075
- minZoom: o = 8,
2076
- mapStyle: n,
2077
- firstSymbolLayer: t,
2078
- cssProps: s = {},
2079
- onClick: l = "",
2080
- interactiveLayers: a = [],
2081
- sources: c = [],
2082
- layers: p = [],
2083
- filters: u,
2084
- popUpParams: h,
2085
- onClosePopUp: g,
2086
- showTexts: b
2087
- }) => {
2088
- console.log(u);
2089
- const C = he();
2090
- return L(() => {
2091
- if (C.current) {
2092
- const f = C.current.getMap();
2093
- f.getStyle().layers.map((y) => {
2094
- y.type == "symbol" && y.id != "professionals" && (b ? f.setLayoutProperty(y.id, "visibility", "visible") : f.setLayoutProperty(y.id, "visibility", "none"));
2095
- });
2096
- }
2097
- }, [b]), L(() => {
2098
- let f = new Xe();
2099
- return ie.addProtocol("pmtiles", f.tile), () => {
2100
- ie.removeProtocol("pmtiles");
2101
- };
2102
- }, []), /* @__PURE__ */ r("div", { className: `${ii.mapContainer}`, style: s && s, children: /* @__PURE__ */ m(
2103
- Je,
2104
- {
2105
- mapLib: ie,
2106
- initialViewState: i,
2107
- ref: C,
2108
- hash: !1,
2109
- maxZoom: d,
2110
- minZoom: o,
2111
- mapStyle: n,
2112
- onClick: l,
2113
- interactiveLayerIds: a,
2114
- children: [
2115
- c.length && c.map((f, v) => /* @__PURE__ */ r(
2116
- Qe,
2117
- {
2118
- ...f,
2119
- children: p.length && p.map((y, x) => {
2120
- if (y.sourceId == f.id) return /* @__PURE__ */ r(
2121
- et,
2122
- {
2123
- ...y.layer,
2124
- beforeId: t,
2125
- filter: u && u
2126
- },
2127
- x
2128
- );
2129
- })
2130
- },
2131
- v
2132
- )),
2133
- /* @__PURE__ */ r(tt, { position: "bottom-right", visualizePitch: !0 }),
2134
- h && /* @__PURE__ */ r(
2135
- nt,
2136
- {
2137
- longitude: h.lng,
2138
- latitude: h.lat,
2139
- onClose: g,
2140
- children: /* @__PURE__ */ r(ri, { props: h.props })
2141
- }
2142
- )
2143
- ]
2144
- }
2145
- ) });
2146
- };
2147
- ai.propTypes = {
2148
- initialView: e.shape({
2149
- latitude: e.number.isRequired,
2150
- longitude: e.number.isRequired,
2151
- zoom: e.number.isRequired
2152
- }),
2153
- mapStyle: e.string,
2154
- firstSymbolLayer: e.string,
2155
- cssProps: e.object,
2156
- style: e.object,
2157
- maxZoom: e.number,
2158
- minZoom: e.number,
2159
- onClick: e.func,
2160
- interactiveLayers: e.array,
2161
- popUp: e.bool,
2162
- sources: e.arrayOf(
2163
- e.shape({
2164
- id: e.string,
2165
- type: e.string,
2166
- url: e.string,
2167
- //si es type: vector
2168
- data: e.object
2169
- //si es type: geojson
2170
- })
2171
- ),
2172
- layers: e.arrayOf(
2173
- e.shape({
2174
- sourceId: e.string,
2175
- layer: e.shape({
2176
- id: e.string,
2177
- type: e.string,
2178
- sourceLayer: e.string,
2179
- minZoom: e.number,
2180
- maxZoom: e.number,
2181
- paint: e.object
2182
- })
2183
- })
2184
- ),
2185
- showTexts: e.bool,
2186
- filters: e.array,
2187
- popUpParams: e.object,
2188
- onClosePopUp: e.func
2189
- };
2190
- const li = "_sectionBar_1nshk_2", ci = "_leftContent_1nshk_14", di = "_textContainer_1nshk_20", pi = "_title_1nshk_27", ui = "_subtitle_1nshk_33", hi = "_rightContent_1nshk_38", V = {
2191
- sectionBar: li,
2192
- leftContent: ci,
2193
- textContainer: di,
2194
- title: pi,
2195
- subtitle: ui,
2196
- rightContent: hi
2197
- }, mi = ({ leftIcon: i, title: d, subtitle: o, rightContent: n, mainColor: t }) => {
2198
- const { t: s } = w();
2199
- return /* @__PURE__ */ m("div", { className: V.sectionBar, children: [
2200
- /* @__PURE__ */ m("div", { className: V.leftContent, children: [
2201
- i && /* @__PURE__ */ r("img", { src: i, alt: "Icono", className: V.icon }),
2202
- /* @__PURE__ */ m("div", { className: V.textContainer, children: [
2203
- /* @__PURE__ */ r("div", { className: V.title, style: t ? { color: t } : {}, children: s(d) }),
2204
- o && /* @__PURE__ */ r("div", { className: V.subtitle, children: o })
2205
- ] })
2206
- ] }),
2207
- /* @__PURE__ */ r("div", { className: V.rightContent, children: n })
2208
- ] });
2209
- };
2210
- mi.propTypes = {
2211
- leftIcon: e.node.isRequired,
2212
- title: e.string.isRequired,
2213
- subtitle: e.string,
2214
- rightContent: e.node.isRequired,
2215
- mainColor: e.string
2216
- };
2217
- const gi = Me({
2218
- name: "mapSlice",
2219
- initialState: {
2220
- showTexts: !0,
2221
- sliderSelectedYear: 2025,
2222
- activeIndicatorKey: 0,
2223
- activeIndicatorType: "cat",
2224
- activeIndicatorUnit: null
2225
- },
2226
- reducers: {
2227
- setShowTexts: (i, d) => {
2228
- i.showTexts = d.payload;
2229
- },
2230
- setYear: (i, d) => {
2231
- i.sliderSelectedYear = d.payload;
2232
- },
2233
- setActiveIndicatorKey: (i, d) => {
2234
- i.activeIndicatorKey = d.payload;
2235
- },
2236
- setActiveIndicatorType: (i, d) => {
2237
- i.activeIndicatorType = d.payload;
2238
- },
2239
- setActiveIndicatorUnit: (i, d) => {
2240
- i.activeIndicatorUnit = d.payload;
2241
- }
2242
- }
2243
- }), { setShowTexts: rs, setYear: le, setActiveIndicatorKey: as, setActiveIndicatorType: ls, setActiveIndicatorUnit: cs } = gi.actions, bi = "data:image/svg+xml,%3csvg%20width='42'%20height='42'%20viewBox='0%200%2042%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='21'%20cy='21'%20r='20.25'%20fill='%23FDFDFD'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3cpath%20d='M15.2722%2012.6627C15.2722%2011.8929%2016.1055%2011.4118%2016.7722%2011.7967L31.5641%2020.3368C32.2308%2020.7217%2032.2308%2021.684%2031.5641%2022.0689L16.7722%2030.609C16.1055%2030.9939%2015.2722%2030.5128%2015.2722%2029.743L15.2722%2012.6627Z'%20fill='%23605B56'/%3e%3c/svg%3e", fi = "data:image/svg+xml,%3csvg%20width='42'%20height='42'%20viewBox='0%200%2042%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='21'%20cy='21'%20r='20.25'%20fill='%23FDFDFD'%20stroke='%23605B56'%20stroke-width='1.5'/%3e%3crect%20x='15'%20y='12'%20width='4'%20height='19'%20rx='1'%20fill='%23605B56'/%3e%3crect%20x='23'%20y='12'%20width='4'%20height='19'%20rx='1'%20fill='%23605B56'/%3e%3c/svg%3e", yi = "_slider_a19yo_2", Ci = "_playButton_a19yo_17", vi = "_sliderOpen_a19yo_28", _i = "_sliderResults_a19yo_32", Y = {
2244
- slider: yi,
2245
- playButton: Ci,
2246
- sliderOpen: vi,
2247
- sliderResults: _i
2248
- }, xi = ({ onResults: i = !1, defaultYear: d = 2025, firstYear: o = 2025, lastYear: n = 2050, zIndex: t = 10, rightBarOpen: s = !1 }) => {
2249
- const [l, a] = B(d), c = Te(), p = (y, x) => {
2250
- a(x), c(le(x - 2e3));
2251
- }, [u, h] = B(!1), g = () => {
2252
- h(!0);
2253
- }, b = () => {
2254
- h(!1);
2255
- };
2256
- ((y, x) => {
2257
- const k = he();
2258
- L(() => {
2259
- k.current = y;
2260
- }, [y]), L(() => {
2261
- function _() {
2262
- k.current();
2263
- }
2264
- {
2265
- let N = setInterval(_, x);
2266
- return () => clearInterval(N);
2267
- }
2268
- }, [x]);
2269
- })(() => {
2270
- u && (l != 2050 ? (a(l + 1), c(le(l - 2e3 + 1))) : (a(2025), c(le(25))));
2271
- }, 1e3);
2272
- const f = st({
2273
- palette: {
2274
- primary: {
2275
- main: "#605b56"
2276
- }
2277
- },
2278
- components: {
2279
- MuiSlider: {
2280
- styleOverrides: {
2281
- mark: {
2282
- height: 10,
2283
- backgroundColor: "#605b56"
2284
- },
2285
- valueLabel: {
2286
- backgroundColor: "transparent",
2287
- color: "#605b56",
2288
- padding: 0,
2289
- top: 3
2290
- }
2291
- }
2292
- }
2293
- }
2294
- }), v = [
2295
- { label: "", value: 2025 },
2296
- { label: "", value: 2032 },
2297
- { label: "", value: 2041 },
2298
- { label: "", value: 2050 }
2299
- ];
2300
- return /* @__PURE__ */ r(rt, { theme: f, children: /* @__PURE__ */ m(
2301
- ot,
2302
- {
2303
- sx: { width: 400 },
2304
- className: `${i ? Y.sliderResults : Y.slider} ${s ? Y.sliderOpen : ""}`,
2305
- style: { zIndex: t },
2306
- children: [
2307
- o,
2308
- /* @__PURE__ */ r(
2309
- it,
2310
- {
2311
- "aria-label": "TimeSlider",
2312
- value: l,
2313
- valueLabelDisplay: "on",
2314
- step: 1,
2315
- marks: v,
2316
- min: o,
2317
- max: n,
2318
- onChange: p,
2319
- color: "primary",
2320
- size: "small"
2321
- }
2322
- ),
2323
- n,
2324
- !u && /* @__PURE__ */ r("button", { className: Y.playButton, onClick: g, children: /* @__PURE__ */ r("img", { src: bi, alt: "Play" }) }),
2325
- u && /* @__PURE__ */ r("button", { className: Y.playButton, onClick: b, children: /* @__PURE__ */ r("img", { src: fi, alt: "Pause" }) })
2326
- ]
2327
- }
2328
- ) });
2329
- };
2330
- xi.propTypes = {
2331
- defaultYear: e.number,
2332
- onResults: e.bool,
2333
- firstYear: e.number,
2334
- lastYear: e.number,
2335
- zIndex: e.number,
2336
- rightBarOpen: e.bool
2337
- };
2338
- const ki = "_TopNavMenuContainer_ku22g_2", wi = "_topNavOptions_ku22g_11", Se = {
2339
- TopNavMenuContainer: ki,
2340
- topNavOptions: wi
2341
- }, Ni = ({ options: i = [], cssProps: d = {}, activeColor: o }) => {
2342
- const { t: n } = w(), t = d.textColor || "inherit";
2343
- d.borderColor;
2344
- const s = d.height || "calc(70px - 10px);";
2345
- return /* @__PURE__ */ r("div", { className: Se.TopNavMenuContainer, children: i.map((l, a) => /* @__PURE__ */ r(
2346
- at,
2347
- {
2348
- to: l.url,
2349
- className: ({ isActive: c }) => `${Se.topNavOptions}`,
2350
- style: {
2351
- color: t,
2352
- height: s,
2353
- boxShadow: isActive ? `0 5px 0 0 ${o}` : "inherit"
2354
- },
2355
- children: n(l.name)
2356
- },
2357
- a
2358
- )) });
2359
- };
2360
- Ni.propTypes = {
2361
- options: e.arrayOf(
2362
- e.object
2363
- ),
2364
- cssProps: e.shape({
2365
- borderColor: e.string.isRequired,
2366
- textColor: e.string.isRequired
2367
- // height: PropTypes.string.isRequired,
2368
- })
2369
- // activeColor: PropTypes.string,
2370
- // defaultColor: PropTypes.string
2371
- };
2372
- const Si = Me({
2373
- name: "userSlice",
2374
- initialState: {
2375
- user: {
2376
- isLoggedIn: !1,
2377
- username: ""
2378
- },
2379
- showLogIn: !1,
2380
- showUserMenu: !1
2381
- },
2382
- reducers: {
2383
- setShowLogIn: (i, d) => {
2384
- i.showLogIn = d.payload;
2385
- },
2386
- setShowUserMenu: (i, d) => {
2387
- i.showUserMenu = d.payload;
2388
- }
2389
- }
2390
- }), { setShowLogIn: Ti, setShowUserMenu: Mi } = Si.actions, $i = "_UserMenuTrigger_uglss_2", Li = {
2391
- UserMenuTrigger: $i
2392
- }, Fi = ({ cssClass: i, loginLocale: d = "login" }) => {
2393
- const o = Te(), n = ce((a) => a.userState.user.isLoggedIn), t = ce((a) => a.userState.user.username), { t: s } = w(), l = () => {
2394
- o(n ? Ti(!0) : Mi(!0));
2395
- };
2396
- return /* @__PURE__ */ r("div", { className: `${Li.UserMenuTrigger} link ${i}`, onClick: l, children: n ? t : s(d) });
2397
- };
2398
- Fi.propTypes = {
2399
- onClickLoggedIn: e.func.isRequired,
2400
- onClickLoggedOut: e.func.isRequired,
2401
- log: e.bool,
2402
- name: e.string,
2403
- cssClass: e.string,
2404
- loginLocale: e.string
2405
- };
2406
- const Bi = "_header_t7qdl_2", Di = "_leftComponents_t7qdl_12", Ai = "_centerComponents_t7qdl_13", Oi = "_rightComponents_t7qdl_14", Q = {
2407
- header: Bi,
2408
- leftComponents: Di,
2409
- centerComponents: Ai,
2410
- rightComponents: Oi
2411
- }, Ri = ({ cssProps: i, leftComponents: d = [], centerComponents: o = [], rightComponents: n = [] }) => /* @__PURE__ */ m("div", { className: Q.header, style: i, children: [
2412
- /* @__PURE__ */ r("div", { className: Q.leftComponents, style: { height: i.height }, children: d.map((t, s) => /* @__PURE__ */ r("div", { style: { height: i.height }, children: t }, s)) }),
2413
- /* @__PURE__ */ r("div", { className: Q.centerComponents, style: { height: i.height }, children: o.map((t, s) => /* @__PURE__ */ r("div", { style: { height: i.height }, children: t }, s)) }),
2414
- /* @__PURE__ */ r("div", { className: Q.rightComponents, style: { height: i.height }, children: n.map((t, s) => /* @__PURE__ */ r("div", { style: { height: i.height }, children: t }, s)) })
2415
- ] });
2416
- Ri.propTypes = {
2417
- cssProps: e.shape({
2418
- backgroundColor: e.string.isRequired,
2419
- height: e.string.isRequired,
2420
- borderColor: e.string,
2421
- textColor: e.string
2422
- }),
2423
- leftComponents: e.arrayOf(e.node),
2424
- centerComponents: e.arrayOf(e.node),
2425
- rightComponents: e.arrayOf(e.node)
2426
- };
2427
- const Ii = "_sidebar_1jqo2_2", zi = "_open_1jqo2_16", Vi = "_content_1jqo2_20", ji = "_closeButton_1jqo2_26", ee = {
2428
- sidebar: Ii,
2429
- open: zi,
2430
- content: Vi,
2431
- closeButton: ji
2432
- }, Pi = ({ width: i = "300px", children: d, showRightBar: o, onCloseBar: n }) => {
2433
- const t = () => {
2434
- n();
2435
- };
2436
- return /* @__PURE__ */ r(
2437
- "div",
2438
- {
2439
- className: `${ee.sidebar} ${o ? ee.open : ""}`,
2440
- style: { width: o ? i : 0 },
2441
- children: o && /* @__PURE__ */ m("div", { className: ee.content, children: [
2442
- /* @__PURE__ */ r("button", { className: ee.closeButton, onClick: t, children: "×" }),
2443
- d
2444
- ] })
2445
- }
2446
- );
2447
- };
2448
- Pi.propTypes = {
2449
- width: e.string,
2450
- children: e.node,
2451
- showRightBar: e.bool,
2452
- onCloseBar: e.func
2453
- };
2454
- export {
2455
- wt as AmbitSelector,
2456
- Rt as ButtonsList,
2457
- j as DropdownList,
2458
- os as EditAmbit,
2459
- an as FiltersAmbit,
2460
- un as Graphic,
2461
- Ri as HeaderSection,
2462
- Ln as IndicatorsList,
2463
- Rn as LangSelector,
2464
- Wn as Legend,
2465
- Jn as LogoApp,
2466
- ti as MapboxMap,
2467
- ai as MaplibreMap,
2468
- Pi as RightSidebar,
2469
- mi as SectionBar,
2470
- xi as TimeSlider,
2471
- Le as Tooltip,
2472
- Ni as TopNavMenu,
2473
- Fi as UserMenuTrigger
2474
- };