@rsltda/components 1.0.15 → 1.0.16
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/README.md +4 -3
- package/custom-elements.json +1 -1
- package/dist/components/rs-map.d.ts +24 -0
- package/dist/components/rs-quote-form.d.ts +24 -0
- package/dist/rs-components.es.js +820 -443
- package/dist/rs-components.es.js.map +1 -1
- package/dist/rs-components.iife.js +203 -6
- package/dist/rs-components.iife.js.map +1 -1
- package/package.json +1 -1
package/dist/rs-components.es.js
CHANGED
|
@@ -1,32 +1,51 @@
|
|
|
1
1
|
var D = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
customElements.get(
|
|
2
|
+
var G = (m, b, e) => b in m ? D(m, b, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[b] = e;
|
|
3
|
+
var l = (m, b, e) => G(m, typeof b != "symbol" ? b + "" : b, e);
|
|
4
|
+
function Q(m, b) {
|
|
5
|
+
customElements.get(m) || customElements.define(m, b);
|
|
6
6
|
}
|
|
7
|
-
const O = /* @__PURE__ */ Object.assign({
|
|
8
|
-
"../json/PuntosMapas_gasgas_0.json": () => import("./PuntosMapas_gasgas_0-CjccjpQ8.js").then((
|
|
9
|
-
"../json/PuntosMapas_gasgas_1.json": () => import("./PuntosMapas_gasgas_1-inakGBZ_.js").then((
|
|
10
|
-
"../json/PuntosMapas_hqv_0.json": () => import("./PuntosMapas_hqv_0-OSIxCcrz.js").then((
|
|
11
|
-
"../json/PuntosMapas_hqv_1.json": () => import("./PuntosMapas_hqv_1-Cr9cIOs3.js").then((
|
|
12
|
-
"../json/PuntosMapas_ktm_0.json": () => import("./PuntosMapas_ktm_0-ChWkcgec.js").then((
|
|
13
|
-
"../json/PuntosMapas_ktm_1.json": () => import("./PuntosMapas_ktm_1-DCq6GRnp.js").then((
|
|
14
|
-
"../json/PuntosMapas_voge_0.json": () => import("./PuntosMapas_voge_0-DL0EWJWf.js").then((
|
|
15
|
-
"../json/PuntosMapas_voge_1.json": () => import("./PuntosMapas_voge_1-Clawdtrj.js").then((
|
|
16
|
-
}),
|
|
7
|
+
const q = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAByVJREFUeNrUW11sFFUUPrvbsluhu21aqrZbaampQKPyJyIx2FIggURpkSi+CItCYtTUGqLUBEvTmGhCtAg+iPJT4MFEDO2LaFugvhRbNO0LUAnImv4gQukvwrYUPefune223dK5s/fObk9zM9vZO7Nzvvud35mxgEnS4MxOwM18HLk4XPxzsPzCt/U4Wpb1Xeox47osipXOwE0Bjk0hFJ5MCIhKHFUqwbAoVLwUx2YJpyPlq3AUqwDCooDmpPh7CnAl5fcgCLuiEgBUnih+AkeGYrNtwVGIQHhlnMwqSXmi+hkTlAfuS5o54JFnAFf+EJgvZBJ5yISWiAEQQeWlgWAJ0+abIfJCICww6hOsBpVP4DYfDZLAna95DEAATvAER0ge3bYBElfnQ4wzXtf8fy/+AZeLyvWevgJZUKwcAFQ+18jqP1VzDKY/+4ww2O3ln0Lbbt1uJlPUFGIMEKBU9IDM8qKA8sP9/XDrh2ro+qlO17F3/2oX+SlCKk8ZA4yu/uLzZyDWncqUb16UD0PXe1X6BCEWiDKgSPRqnMtymPIk1yq+YsrHzUuHJ2tOgC0+XrYJaAz1SAeAe35hx5fy6vrA55s/+mk/a/u7THlixN0LreOOccybEwBHO0ZACpQAwOt48Ri1cgXb3m48B3cutEHswy5wrvbvu3HoKFzduWfUfPp+8aUm9vkORgE6RvQnyVTRDOpl5wEviF4JUV2j/43jVWybvG5VYHVdq/JZdKBBpqJ9r0nXccPhPVcFA4SLj+S1K0foX13r/8GgHCBu7hNsO9TeCXeu+L095QljTcaAPC09CiCtunnWpUyIMfPP1gXo37L0JcMlM5rAAtkMEFaeMj9Hepru+UnrR3zs9YNHwi2ZlSVC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0-CjccjpQ8.js").then((m) => m.default),
|
|
9
|
+
"../json/PuntosMapas_gasgas_1.json": () => import("./PuntosMapas_gasgas_1-inakGBZ_.js").then((m) => m.default),
|
|
10
|
+
"../json/PuntosMapas_hqv_0.json": () => import("./PuntosMapas_hqv_0-OSIxCcrz.js").then((m) => m.default),
|
|
11
|
+
"../json/PuntosMapas_hqv_1.json": () => import("./PuntosMapas_hqv_1-Cr9cIOs3.js").then((m) => m.default),
|
|
12
|
+
"../json/PuntosMapas_ktm_0.json": () => import("./PuntosMapas_ktm_0-ChWkcgec.js").then((m) => m.default),
|
|
13
|
+
"../json/PuntosMapas_ktm_1.json": () => import("./PuntosMapas_ktm_1-DCq6GRnp.js").then((m) => m.default),
|
|
14
|
+
"../json/PuntosMapas_voge_0.json": () => import("./PuntosMapas_voge_0-DL0EWJWf.js").then((m) => m.default),
|
|
15
|
+
"../json/PuntosMapas_voge_1.json": () => import("./PuntosMapas_voge_1-Clawdtrj.js").then((m) => m.default)
|
|
16
|
+
}), X = /* @__PURE__ */ Object.assign({
|
|
17
|
+
"../pin/gasgas.png": q,
|
|
18
|
+
"../pin/gasgas_distribuidor.png": O,
|
|
19
|
+
"../pin/hqv.png": Y,
|
|
20
|
+
"../pin/hqv_distribuidor.png": H,
|
|
21
|
+
"../pin/ktm.png": W,
|
|
22
|
+
"../pin/ktm_distribuidor.png": J,
|
|
23
|
+
"../pin/voge.png": V,
|
|
24
|
+
"../pin/voge_distribuidor.png": j
|
|
25
|
+
}), Z = "#000000", F = "/assets/fontawesome/css/all.min.css", I = "https://ap2.rs-shop.cl/web/PuntosMapas", $ = {
|
|
26
|
+
gasgas: "#cb0d25",
|
|
17
27
|
ktm: "#ff6600"
|
|
18
|
-
},
|
|
28
|
+
}, T = {
|
|
29
|
+
gas: "gasgas",
|
|
30
|
+
gasgas: "gasgas",
|
|
31
|
+
husqvarna: "hqv"
|
|
32
|
+
}, B = {
|
|
19
33
|
sucursal: 0,
|
|
20
34
|
distribuidor: 1
|
|
21
|
-
},
|
|
35
|
+
}, ee = ["norte", "rm", "centro", "sur"], te = {
|
|
22
36
|
norte: "Zona Norte",
|
|
23
37
|
rm: "RM",
|
|
24
38
|
centro: "Zona Centro",
|
|
25
39
|
sur: "Zona Sur"
|
|
26
|
-
},
|
|
40
|
+
}, S = {
|
|
27
41
|
0: "Sucursales",
|
|
28
42
|
1: "Distribuidores"
|
|
29
|
-
},
|
|
43
|
+
}, _ = {
|
|
44
|
+
minLat: -56.5,
|
|
45
|
+
maxLat: -17,
|
|
46
|
+
minLng: -76,
|
|
47
|
+
maxLng: -66
|
|
48
|
+
}, L = 720 * 60 * 60 * 1e3, ne = "rs-map-cache", w = "points", R = {
|
|
30
49
|
"region de arica y parinacota": "norte",
|
|
31
50
|
"arica y parinacota": "norte",
|
|
32
51
|
"region de tarapaca": "norte",
|
|
@@ -64,71 +83,90 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
64
83
|
aysen: "sur",
|
|
65
84
|
"region de magallanes y la antartica chilena": "sur",
|
|
66
85
|
magallanes: "sur"
|
|
67
|
-
},
|
|
86
|
+
}, f = class f extends HTMLElement {
|
|
68
87
|
constructor() {
|
|
69
88
|
super();
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
l(this, "root");
|
|
90
|
+
l(this, "mapEl");
|
|
91
|
+
l(this, "map");
|
|
92
|
+
l(this, "pointModalOverlayEl");
|
|
93
|
+
l(this, "pointModalTitleEl");
|
|
94
|
+
l(this, "pointModalBodyEl");
|
|
95
|
+
l(this, "pointModalCloseButton");
|
|
96
|
+
l(this, "markers", []);
|
|
97
|
+
l(this, "marca", "");
|
|
98
|
+
l(this, "marcaKey", "default");
|
|
99
|
+
l(this, "tipo", "");
|
|
100
|
+
l(this, "tipoCode", null);
|
|
101
|
+
l(this, "pointsController");
|
|
102
|
+
l(this, "points", []);
|
|
103
|
+
l(this, "pointsByZone", {
|
|
81
104
|
norte: [],
|
|
82
105
|
rm: [],
|
|
83
106
|
centro: [],
|
|
84
107
|
sur: []
|
|
85
108
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
l(this, "initialViewApplied", !1);
|
|
110
|
+
l(this, "zonesContainer");
|
|
111
|
+
l(this, "componentMessageEl");
|
|
112
|
+
l(this, "mapLayoutEl");
|
|
113
|
+
l(this, "zoneButtons", []);
|
|
114
|
+
l(this, "nearestButton");
|
|
115
|
+
l(this, "panelTitleEl");
|
|
116
|
+
l(this, "activeZone", "all");
|
|
117
|
+
l(this, "mapHeight", "");
|
|
118
|
+
l(this, "googleMapsApiKey", "");
|
|
119
|
+
l(this, "pointsApiUrl", I);
|
|
120
|
+
l(this, "markerIconBaseUrl", "");
|
|
121
|
+
l(this, "defaultMarkerIconUrl", "");
|
|
122
|
+
l(this, "pointsCacheTtlMs", L);
|
|
123
|
+
l(this, "panAnimationFrame", null);
|
|
124
|
+
l(this, "highlightTimeout", null);
|
|
125
|
+
l(this, "isSyncingInitialAttributes", !1);
|
|
126
|
+
l(this, "refreshQueued", !1);
|
|
127
|
+
l(this, "localPointsRequests", /* @__PURE__ */ new Map());
|
|
128
|
+
l(this, "closePointModal", () => {
|
|
129
|
+
var e;
|
|
130
|
+
this.pointModalOverlayEl && (this.pointModalOverlayEl.setAttribute("hidden", ""), (e = this.pointModalBodyEl) == null || e.replaceChildren());
|
|
131
|
+
});
|
|
132
|
+
l(this, "handlePointModalOverlayClick", (e) => {
|
|
133
|
+
e.target === this.pointModalOverlayEl && this.closePointModal();
|
|
134
|
+
});
|
|
135
|
+
l(this, "handlePointModalKeydown", (e) => {
|
|
136
|
+
e.key === "Escape" && this.pointModalOverlayEl && !this.pointModalOverlayEl.hasAttribute("hidden") && this.closePointModal();
|
|
137
|
+
});
|
|
138
|
+
l(this, "handleZoneButtonClick", (e) => {
|
|
139
|
+
const n = e.currentTarget.dataset.zone;
|
|
107
140
|
n && (this.setActiveZone(n), this.scrollToZoneSection(n));
|
|
108
141
|
});
|
|
109
|
-
|
|
142
|
+
l(this, "handleNearestClick", () => {
|
|
110
143
|
if (!navigator.geolocation) {
|
|
111
144
|
alert("La geolocalizacion no esta soportada en este navegador.");
|
|
112
145
|
return;
|
|
113
146
|
}
|
|
114
147
|
navigator.geolocation.getCurrentPosition(
|
|
115
|
-
(
|
|
116
|
-
const { latitude:
|
|
117
|
-
|
|
148
|
+
(e) => {
|
|
149
|
+
const { latitude: t, longitude: n } = e.coords, o = this.findNearestPoint(t, n);
|
|
150
|
+
if (o) {
|
|
151
|
+
const a = this.getPointPosition(o);
|
|
152
|
+
a && this.centerMapOnPoint(a.lat, a.lng), this.scrollToPointCard(o.id);
|
|
153
|
+
} else
|
|
154
|
+
alert("No hay puntos disponibles para calcular la tienda cercana.");
|
|
118
155
|
},
|
|
119
156
|
() => {
|
|
120
157
|
alert("No se pudo obtener tu ubicacion.");
|
|
121
158
|
}
|
|
122
159
|
);
|
|
123
160
|
});
|
|
124
|
-
|
|
125
|
-
<link rel="stylesheet" href="${
|
|
161
|
+
f.ensureFontAwesome(), this.root = this.attachShadow({ mode: "open" }), this.root.innerHTML = `
|
|
162
|
+
<link rel="stylesheet" href="${F}" />
|
|
126
163
|
<style>
|
|
127
164
|
:host {
|
|
128
165
|
display: block;
|
|
166
|
+
position: relative;
|
|
129
167
|
width: 100%;
|
|
130
168
|
height: var(--map-height, 520px);
|
|
131
|
-
--rs-map-accent: ${
|
|
169
|
+
--rs-map-accent: ${Z};
|
|
132
170
|
}
|
|
133
171
|
.map-layout {
|
|
134
172
|
display: grid;
|
|
@@ -327,14 +365,59 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
327
365
|
background: transparent;
|
|
328
366
|
color: var(--rs-map-accent);
|
|
329
367
|
cursor: pointer;
|
|
330
|
-
align-self: flex-start;
|
|
331
|
-
margin-top: 8px;
|
|
332
368
|
}
|
|
333
369
|
.point-card__focus:hover,
|
|
334
370
|
.point-card__focus:focus-visible {
|
|
335
371
|
background: var(--rs-map-accent);
|
|
336
372
|
color: #fff;
|
|
337
373
|
}
|
|
374
|
+
.point-card__map-actions {
|
|
375
|
+
display: flex;
|
|
376
|
+
align-items: center;
|
|
377
|
+
flex-wrap: wrap;
|
|
378
|
+
gap: 8px;
|
|
379
|
+
align-self: flex-start;
|
|
380
|
+
margin-top: 8px;
|
|
381
|
+
}
|
|
382
|
+
.point-card__mobile-navigation {
|
|
383
|
+
display: none;
|
|
384
|
+
align-items: center;
|
|
385
|
+
flex-wrap: wrap;
|
|
386
|
+
gap: 8px;
|
|
387
|
+
}
|
|
388
|
+
.point-card__mobile-nav-link {
|
|
389
|
+
display: inline-flex;
|
|
390
|
+
align-items: center;
|
|
391
|
+
gap: 6px;
|
|
392
|
+
border: 1px solid var(--rs-map-accent);
|
|
393
|
+
border-radius: 999px;
|
|
394
|
+
padding: 4px 12px;
|
|
395
|
+
background: var(--rs-map-accent);
|
|
396
|
+
color: #fff;
|
|
397
|
+
font-size: 0.8rem;
|
|
398
|
+
text-decoration: none;
|
|
399
|
+
}
|
|
400
|
+
.point-card__mobile-nav-link:hover,
|
|
401
|
+
.point-card__mobile-nav-link:focus-visible {
|
|
402
|
+
filter: brightness(0.94);
|
|
403
|
+
}
|
|
404
|
+
.point-card__coordinate-warning {
|
|
405
|
+
display: flex;
|
|
406
|
+
align-items: center;
|
|
407
|
+
gap: 6px;
|
|
408
|
+
border: 1px solid #d6dbe3;
|
|
409
|
+
border-radius: 999px;
|
|
410
|
+
padding: 4px 12px;
|
|
411
|
+
background: #f8fafc;
|
|
412
|
+
color: #4b5563;
|
|
413
|
+
font-size: 0.8rem;
|
|
414
|
+
line-height: 1.35;
|
|
415
|
+
align-self: flex-start;
|
|
416
|
+
margin-top: 8px;
|
|
417
|
+
}
|
|
418
|
+
.point-card__coordinate-warning i {
|
|
419
|
+
color: #6b7280;
|
|
420
|
+
}
|
|
338
421
|
@media (max-width: 768px) {
|
|
339
422
|
.map-layout {
|
|
340
423
|
grid-template-columns: 1fr;
|
|
@@ -352,6 +435,9 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
352
435
|
.point-card__focus {
|
|
353
436
|
display: none;
|
|
354
437
|
}
|
|
438
|
+
.point-card__mobile-navigation {
|
|
439
|
+
display: flex;
|
|
440
|
+
}
|
|
355
441
|
}
|
|
356
442
|
.point-card__address,
|
|
357
443
|
.point-card__meta,
|
|
@@ -505,6 +591,143 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
505
591
|
color: #666;
|
|
506
592
|
font-size: 0.9rem;
|
|
507
593
|
}
|
|
594
|
+
.point-modal-overlay {
|
|
595
|
+
position: absolute;
|
|
596
|
+
inset: 0;
|
|
597
|
+
z-index: 30;
|
|
598
|
+
display: flex;
|
|
599
|
+
align-items: center;
|
|
600
|
+
justify-content: center;
|
|
601
|
+
padding: 16px;
|
|
602
|
+
background: rgba(0, 0, 0, 0.48);
|
|
603
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
604
|
+
}
|
|
605
|
+
.point-modal-overlay[hidden] {
|
|
606
|
+
display: none;
|
|
607
|
+
}
|
|
608
|
+
.point-modal {
|
|
609
|
+
width: min(560px, 100%);
|
|
610
|
+
max-height: calc(100% - 16px);
|
|
611
|
+
border-radius: 8px;
|
|
612
|
+
overflow: hidden;
|
|
613
|
+
background: #f7f7fb;
|
|
614
|
+
color: #151515;
|
|
615
|
+
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
|
|
616
|
+
display: flex;
|
|
617
|
+
flex-direction: column;
|
|
618
|
+
}
|
|
619
|
+
.point-modal__header {
|
|
620
|
+
display: flex;
|
|
621
|
+
align-items: center;
|
|
622
|
+
justify-content: space-between;
|
|
623
|
+
gap: 12px;
|
|
624
|
+
padding: 14px 18px;
|
|
625
|
+
background: #000;
|
|
626
|
+
color: #fff;
|
|
627
|
+
}
|
|
628
|
+
.point-modal__title {
|
|
629
|
+
margin: 0;
|
|
630
|
+
font-size: 1.15rem;
|
|
631
|
+
font-weight: 700;
|
|
632
|
+
line-height: 1.2;
|
|
633
|
+
}
|
|
634
|
+
.point-modal__close {
|
|
635
|
+
border: 0;
|
|
636
|
+
width: 34px;
|
|
637
|
+
height: 34px;
|
|
638
|
+
border-radius: 50%;
|
|
639
|
+
background: transparent;
|
|
640
|
+
color: #fff;
|
|
641
|
+
cursor: pointer;
|
|
642
|
+
font-size: 1.1rem;
|
|
643
|
+
display: inline-flex;
|
|
644
|
+
align-items: center;
|
|
645
|
+
justify-content: center;
|
|
646
|
+
}
|
|
647
|
+
.point-modal__close:hover,
|
|
648
|
+
.point-modal__close:focus-visible {
|
|
649
|
+
background: rgba(255, 255, 255, 0.14);
|
|
650
|
+
}
|
|
651
|
+
.point-modal__body {
|
|
652
|
+
padding: 20px 24px 24px;
|
|
653
|
+
overflow-y: auto;
|
|
654
|
+
line-height: 1.45;
|
|
655
|
+
}
|
|
656
|
+
.point-modal__cover {
|
|
657
|
+
width: calc(100% + 48px);
|
|
658
|
+
max-height: 300px;
|
|
659
|
+
object-fit: cover;
|
|
660
|
+
margin: -20px -24px 18px;
|
|
661
|
+
display: block;
|
|
662
|
+
background: #e5e7eb;
|
|
663
|
+
}
|
|
664
|
+
.point-modal__section {
|
|
665
|
+
margin: 0 0 20px;
|
|
666
|
+
display: flex;
|
|
667
|
+
flex-direction: column;
|
|
668
|
+
gap: 6px;
|
|
669
|
+
}
|
|
670
|
+
.point-modal__section:last-child {
|
|
671
|
+
margin-bottom: 0;
|
|
672
|
+
}
|
|
673
|
+
.point-modal__line {
|
|
674
|
+
margin: 0;
|
|
675
|
+
font-size: 0.95rem;
|
|
676
|
+
color: #242424;
|
|
677
|
+
}
|
|
678
|
+
.point-modal__label {
|
|
679
|
+
font-weight: 700;
|
|
680
|
+
}
|
|
681
|
+
.point-modal__phone-list {
|
|
682
|
+
list-style: none;
|
|
683
|
+
padding: 0;
|
|
684
|
+
margin: 4px 0 0;
|
|
685
|
+
display: flex;
|
|
686
|
+
flex-direction: column;
|
|
687
|
+
gap: 3px;
|
|
688
|
+
}
|
|
689
|
+
.point-modal__phone-item {
|
|
690
|
+
font-size: 0.94rem;
|
|
691
|
+
color: #222;
|
|
692
|
+
}
|
|
693
|
+
.point-modal__extra {
|
|
694
|
+
margin: 0;
|
|
695
|
+
font-size: 0.94rem;
|
|
696
|
+
color: #242424;
|
|
697
|
+
}
|
|
698
|
+
.point-modal__extra a,
|
|
699
|
+
.point-modal__link {
|
|
700
|
+
color: #111;
|
|
701
|
+
font-weight: 600;
|
|
702
|
+
text-decoration: none;
|
|
703
|
+
border-bottom: 1px solid currentColor;
|
|
704
|
+
}
|
|
705
|
+
.point-modal__extra a:hover,
|
|
706
|
+
.point-modal__extra a:focus-visible,
|
|
707
|
+
.point-modal__link:hover,
|
|
708
|
+
.point-modal__link:focus-visible {
|
|
709
|
+
color: var(--rs-map-accent);
|
|
710
|
+
}
|
|
711
|
+
.point-modal__actions {
|
|
712
|
+
display: flex;
|
|
713
|
+
flex-wrap: wrap;
|
|
714
|
+
gap: 10px;
|
|
715
|
+
}
|
|
716
|
+
@media (max-width: 768px) {
|
|
717
|
+
.point-modal-overlay {
|
|
718
|
+
position: fixed;
|
|
719
|
+
}
|
|
720
|
+
.point-modal {
|
|
721
|
+
max-height: calc(100dvh - 24px);
|
|
722
|
+
}
|
|
723
|
+
.point-modal__body {
|
|
724
|
+
padding: 16px 18px 20px;
|
|
725
|
+
}
|
|
726
|
+
.point-modal__cover {
|
|
727
|
+
width: calc(100% + 36px);
|
|
728
|
+
margin: -16px -18px 16px;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
508
731
|
</style>
|
|
509
732
|
<div class="component-shell">
|
|
510
733
|
<p class="component-message" data-component-message>Cargando puntos...</p>
|
|
@@ -530,6 +753,17 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
530
753
|
</aside>
|
|
531
754
|
</div>
|
|
532
755
|
</div>
|
|
756
|
+
<div class="point-modal-overlay" data-point-modal-overlay hidden>
|
|
757
|
+
<section class="point-modal" role="dialog" aria-modal="true" aria-labelledby="rs-map-point-modal-title">
|
|
758
|
+
<header class="point-modal__header">
|
|
759
|
+
<h2 class="point-modal__title" id="rs-map-point-modal-title" data-point-modal-title></h2>
|
|
760
|
+
<button class="point-modal__close" type="button" data-point-modal-close aria-label="Cerrar">
|
|
761
|
+
<i class="fa-solid fa-xmark" aria-hidden="true"></i>
|
|
762
|
+
</button>
|
|
763
|
+
</header>
|
|
764
|
+
<div class="point-modal__body" data-point-modal-body></div>
|
|
765
|
+
</section>
|
|
766
|
+
</div>
|
|
533
767
|
`;
|
|
534
768
|
}
|
|
535
769
|
static get observedAttributes() {
|
|
@@ -545,116 +779,116 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
545
779
|
];
|
|
546
780
|
}
|
|
547
781
|
connectedCallback() {
|
|
548
|
-
this.mapEl = this.root.querySelector("#map"), this.panelTitleEl = this.root.querySelector("[data-panel-title]"), this.zonesContainer = this.root.querySelector("[data-zone-container]"), this.componentMessageEl = this.root.querySelector("[data-component-message]"), this.mapLayoutEl = this.root.querySelector("[data-map-layout]"), this.zoneButtons = Array.from(this.root.querySelectorAll("[data-zone]")), this.nearestButton = this.root.querySelector('[data-action="nearest"]'), this.zoneButtons.forEach((
|
|
782
|
+
this.mapEl = this.root.querySelector("#map"), this.panelTitleEl = this.root.querySelector("[data-panel-title]"), this.zonesContainer = this.root.querySelector("[data-zone-container]"), this.componentMessageEl = this.root.querySelector("[data-component-message]"), this.mapLayoutEl = this.root.querySelector("[data-map-layout]"), this.pointModalOverlayEl = this.root.querySelector("[data-point-modal-overlay]"), this.pointModalTitleEl = this.root.querySelector("[data-point-modal-title]"), this.pointModalBodyEl = this.root.querySelector("[data-point-modal-body]"), this.pointModalCloseButton = this.root.querySelector("[data-point-modal-close]"), this.zoneButtons = Array.from(this.root.querySelectorAll("[data-zone]")), this.nearestButton = this.root.querySelector('[data-action="nearest"]'), this.zoneButtons.forEach((e) => e.addEventListener("click", this.handleZoneButtonClick)), this.nearestButton && this.nearestButton.addEventListener("click", this.handleNearestClick), this.pointModalOverlayEl.addEventListener("click", this.handlePointModalOverlayClick), this.pointModalCloseButton.addEventListener("click", this.closePointModal), window.addEventListener("keydown", this.handlePointModalKeydown), this.updateZoneButtons(), this.setMapHeight(this.getAttribute("height")), this.setComponentState("loading"), this.syncAttributesToState();
|
|
549
783
|
}
|
|
550
784
|
disconnectedCallback() {
|
|
551
|
-
var t;
|
|
552
|
-
(
|
|
785
|
+
var e, t, n;
|
|
786
|
+
(e = this.pointsController) == null || e.abort(), this.zoneButtons.forEach((o) => o.removeEventListener("click", this.handleZoneButtonClick)), this.nearestButton && this.nearestButton.removeEventListener("click", this.handleNearestClick), (t = this.pointModalOverlayEl) == null || t.removeEventListener("click", this.handlePointModalOverlayClick), (n = this.pointModalCloseButton) == null || n.removeEventListener("click", this.closePointModal), window.removeEventListener("keydown", this.handlePointModalKeydown);
|
|
553
787
|
}
|
|
554
|
-
attributeChangedCallback(
|
|
555
|
-
|
|
788
|
+
attributeChangedCallback(e, t, n) {
|
|
789
|
+
e === "marca" ? this.setMarca(n != null ? n : "") : e === "tipo" ? this.setTipo(n != null ? n : "") : e === "height" ? this.setMapHeight(n) : e === "google-maps-key" ? this.setGoogleMapsKey(n) : e === "points-api-url" ? this.setPointsApiUrl(n) : e === "cache-days" ? this.setCacheDays(n) : e === "marker-icon-base" ? this.setMarkerIconBase(n) : e === "marker-icon-default" && this.setDefaultMarkerIcon(n);
|
|
556
790
|
}
|
|
557
791
|
loadGoogleMaps() {
|
|
558
792
|
return window._rsGoogleMapsLoaded ? Promise.resolve().then(() => {
|
|
559
793
|
this.initMap();
|
|
560
|
-
}) : this.googleMapsApiKey ? (
|
|
794
|
+
}) : this.googleMapsApiKey ? (f.googleMapsLoaderPromise || (f.googleMapsLoaderPromise = new Promise((e, t) => {
|
|
561
795
|
const n = document.querySelector('script[data-rs-google-maps="true"]');
|
|
562
796
|
if (n) {
|
|
563
|
-
n.addEventListener("load", () =>
|
|
797
|
+
n.addEventListener("load", () => e(), { once: !0 }), n.addEventListener(
|
|
564
798
|
"error",
|
|
565
|
-
() =>
|
|
799
|
+
() => t(new Error("Error al cargar la API de Google Maps")),
|
|
566
800
|
{ once: !0 }
|
|
567
801
|
);
|
|
568
802
|
return;
|
|
569
803
|
}
|
|
570
|
-
const
|
|
804
|
+
const o = document.createElement("script"), a = new URLSearchParams({
|
|
571
805
|
key: this.googleMapsApiKey,
|
|
572
806
|
v: "weekly"
|
|
573
807
|
});
|
|
574
|
-
|
|
575
|
-
window._rsGoogleMapsLoaded = !0,
|
|
576
|
-
},
|
|
577
|
-
|
|
578
|
-
}, document.head.appendChild(
|
|
579
|
-
})),
|
|
808
|
+
o.src = `https://maps.googleapis.com/maps/api/js?${a.toString()}`, o.async = !0, o.defer = !0, o.dataset.rsGoogleMaps = "true", o.onload = () => {
|
|
809
|
+
window._rsGoogleMapsLoaded = !0, e();
|
|
810
|
+
}, o.onerror = () => {
|
|
811
|
+
f.googleMapsLoaderPromise = null, t(new Error("Error al cargar la API de Google Maps"));
|
|
812
|
+
}, document.head.appendChild(o);
|
|
813
|
+
})), f.googleMapsLoaderPromise.then(() => {
|
|
580
814
|
window._rsGoogleMapsLoaded = !0, this.initMap();
|
|
581
|
-
}).catch((
|
|
582
|
-
console.error(
|
|
815
|
+
}).catch((e) => {
|
|
816
|
+
console.error(e instanceof Error ? e.message : "Error al cargar la API de Google Maps");
|
|
583
817
|
})) : (console.error('Falta la clave de Google Maps. Define el atributo "google-maps-key" en <rs-map>.'), Promise.resolve());
|
|
584
818
|
}
|
|
585
819
|
initMap() {
|
|
586
|
-
const
|
|
587
|
-
if (!
|
|
820
|
+
const e = window.google;
|
|
821
|
+
if (!e) {
|
|
588
822
|
console.error("Google Maps aun no esta disponible.");
|
|
589
823
|
return;
|
|
590
824
|
}
|
|
591
|
-
const
|
|
592
|
-
this.map = new
|
|
593
|
-
center:
|
|
825
|
+
const t = this.getInitialCenter();
|
|
826
|
+
this.map = new e.maps.Map(this.mapEl, {
|
|
827
|
+
center: t,
|
|
594
828
|
zoom: 14,
|
|
595
829
|
mapTypeId: "roadmap"
|
|
596
830
|
}), this.points.length && this.updateMarkers(this.points);
|
|
597
831
|
}
|
|
598
832
|
getInitialCenter() {
|
|
599
|
-
const
|
|
600
|
-
return
|
|
833
|
+
const e = this.getFirstValidPoint();
|
|
834
|
+
return e || { lat: -33.4489, lng: -70.6693 };
|
|
601
835
|
}
|
|
602
836
|
getFirstValidPoint() {
|
|
603
|
-
for (const
|
|
604
|
-
const
|
|
605
|
-
if (
|
|
606
|
-
return
|
|
837
|
+
for (const e of this.points) {
|
|
838
|
+
const t = this.getPointPosition(e);
|
|
839
|
+
if (t)
|
|
840
|
+
return t;
|
|
607
841
|
}
|
|
608
842
|
return null;
|
|
609
843
|
}
|
|
610
844
|
syncAttributesToState() {
|
|
611
|
-
var
|
|
612
|
-
this.isSyncingInitialAttributes = !0, this.setMarca((
|
|
845
|
+
var e, t;
|
|
846
|
+
this.isSyncingInitialAttributes = !0, this.setMarca((e = this.getAttribute("marca")) != null ? e : ""), this.setTipo((t = this.getAttribute("tipo")) != null ? t : ""), this.setGoogleMapsKey(this.getAttribute("google-maps-key")), this.setPointsApiUrl(this.getAttribute("points-api-url")), this.setCacheDays(this.getAttribute("cache-days")), this.setMarkerIconBase(this.getAttribute("marker-icon-base")), this.setDefaultMarkerIcon(this.getAttribute("marker-icon-default")), this.isSyncingInitialAttributes = !1, this.queueRefreshPoints();
|
|
613
847
|
}
|
|
614
|
-
setMapHeight(
|
|
615
|
-
const
|
|
616
|
-
if (!
|
|
848
|
+
setMapHeight(e) {
|
|
849
|
+
const t = (e != null ? e : "").trim();
|
|
850
|
+
if (!t) {
|
|
617
851
|
this.mapHeight = "", this.style.removeProperty("--map-height");
|
|
618
852
|
return;
|
|
619
853
|
}
|
|
620
|
-
this.mapHeight =
|
|
854
|
+
this.mapHeight = t, this.style.setProperty("--map-height", t);
|
|
621
855
|
}
|
|
622
|
-
setGoogleMapsKey(
|
|
623
|
-
this.googleMapsApiKey = (
|
|
856
|
+
setGoogleMapsKey(e) {
|
|
857
|
+
this.googleMapsApiKey = (e != null ? e : "").trim(), this.googleMapsApiKey && this.isConnected && this.loadGoogleMaps();
|
|
624
858
|
}
|
|
625
|
-
setPointsApiUrl(
|
|
626
|
-
const
|
|
627
|
-
this.pointsApiUrl =
|
|
859
|
+
setPointsApiUrl(e) {
|
|
860
|
+
const t = (e != null ? e : "").trim();
|
|
861
|
+
this.pointsApiUrl = t || I, this.pointsApiUrl && this.isConnected && !this.isSyncingInitialAttributes && this.queueRefreshPoints();
|
|
628
862
|
}
|
|
629
|
-
setCacheDays(
|
|
630
|
-
const
|
|
631
|
-
if (!
|
|
632
|
-
this.pointsCacheTtlMs =
|
|
863
|
+
setCacheDays(e) {
|
|
864
|
+
const t = (e != null ? e : "").trim();
|
|
865
|
+
if (!t) {
|
|
866
|
+
this.pointsCacheTtlMs = L;
|
|
633
867
|
return;
|
|
634
868
|
}
|
|
635
|
-
const n = Number(
|
|
869
|
+
const n = Number(t);
|
|
636
870
|
if (!Number.isFinite(n) || n < 0) {
|
|
637
|
-
this.pointsCacheTtlMs =
|
|
871
|
+
this.pointsCacheTtlMs = L;
|
|
638
872
|
return;
|
|
639
873
|
}
|
|
640
874
|
this.pointsCacheTtlMs = n * 24 * 60 * 60 * 1e3;
|
|
641
875
|
}
|
|
642
|
-
setMarkerIconBase(
|
|
643
|
-
const
|
|
644
|
-
if (!
|
|
645
|
-
this.markerIconBaseUrl =
|
|
876
|
+
setMarkerIconBase(e) {
|
|
877
|
+
const t = (e != null ? e : "").trim();
|
|
878
|
+
if (!t) {
|
|
879
|
+
this.markerIconBaseUrl = "";
|
|
646
880
|
return;
|
|
647
881
|
}
|
|
648
|
-
this.markerIconBaseUrl =
|
|
882
|
+
this.markerIconBaseUrl = t.endsWith("/") ? t : `${t}/`;
|
|
649
883
|
}
|
|
650
|
-
setDefaultMarkerIcon(
|
|
651
|
-
this.defaultMarkerIconUrl = (
|
|
884
|
+
setDefaultMarkerIcon(e) {
|
|
885
|
+
this.defaultMarkerIconUrl = (e != null ? e : "").trim();
|
|
652
886
|
}
|
|
653
|
-
setMarca(
|
|
654
|
-
this.marca =
|
|
887
|
+
setMarca(e) {
|
|
888
|
+
this.marca = e.trim(), this.marcaKey = this.normalizeBrandKey(this.marca), this.applyBrandColor(), this.isSyncingInitialAttributes || this.queueRefreshPoints();
|
|
655
889
|
}
|
|
656
|
-
setTipo(
|
|
657
|
-
this.tipo =
|
|
890
|
+
setTipo(e) {
|
|
891
|
+
this.tipo = e.trim(), this.tipoCode = this.normalizeTipo(this.tipo), this.updatePanelTitle(), this.isSyncingInitialAttributes || this.queueRefreshPoints();
|
|
658
892
|
}
|
|
659
893
|
queueRefreshPoints() {
|
|
660
894
|
this.refreshQueued || (this.refreshQueued = !0, queueMicrotask(() => {
|
|
@@ -670,27 +904,27 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
670
904
|
updatePanelTitle() {
|
|
671
905
|
if (!this.panelTitleEl)
|
|
672
906
|
return;
|
|
673
|
-
const
|
|
674
|
-
this.panelTitleEl.textContent =
|
|
907
|
+
const e = this.getTipoLabel();
|
|
908
|
+
this.panelTitleEl.textContent = e != null ? e : "Puntos del mapa";
|
|
675
909
|
}
|
|
676
910
|
getTipoLabel() {
|
|
677
|
-
if (this.tipoCode !== null && this.tipoCode in
|
|
678
|
-
return
|
|
679
|
-
const
|
|
680
|
-
return
|
|
911
|
+
if (this.tipoCode !== null && this.tipoCode in S)
|
|
912
|
+
return S[this.tipoCode];
|
|
913
|
+
const e = this.tipo.trim().toLowerCase(), t = e && e in B ? B[e] : null;
|
|
914
|
+
return t !== null && t in S ? S[t] : null;
|
|
681
915
|
}
|
|
682
916
|
applyBrandColor() {
|
|
683
|
-
var
|
|
684
|
-
const
|
|
685
|
-
this.style.setProperty("--rs-map-accent",
|
|
917
|
+
var t;
|
|
918
|
+
const e = (t = $[this.marcaKey]) != null ? t : Z;
|
|
919
|
+
this.style.setProperty("--rs-map-accent", e);
|
|
686
920
|
}
|
|
687
|
-
normalizeTipo(
|
|
688
|
-
if (!
|
|
921
|
+
normalizeTipo(e) {
|
|
922
|
+
if (!e)
|
|
689
923
|
return null;
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
return
|
|
693
|
-
const n = Number(
|
|
924
|
+
const t = e.trim().toLowerCase();
|
|
925
|
+
if (t in B)
|
|
926
|
+
return B[t];
|
|
927
|
+
const n = Number(t);
|
|
694
928
|
return Number.isFinite(n) && (n === 0 || n === 1) ? n : null;
|
|
695
929
|
}
|
|
696
930
|
async refreshPoints() {
|
|
@@ -702,469 +936,612 @@ const O = /* @__PURE__ */ Object.assign({
|
|
|
702
936
|
return;
|
|
703
937
|
}
|
|
704
938
|
(g = this.pointsController) == null || g.abort();
|
|
705
|
-
const
|
|
706
|
-
this.pointsController =
|
|
707
|
-
const
|
|
708
|
-
marca:
|
|
939
|
+
const e = new AbortController();
|
|
940
|
+
this.pointsController = e;
|
|
941
|
+
const t = this.getMarcaRequestValue(), n = new URLSearchParams({
|
|
942
|
+
marca: t,
|
|
709
943
|
tipo: String(this.tipoCode)
|
|
710
|
-
}),
|
|
711
|
-
if (
|
|
712
|
-
if (this.applyPointsPayload(
|
|
944
|
+
}), o = this.pointsApiUrl.includes("?"), a = o && !/[?&]$/.test(this.pointsApiUrl), r = o ? a ? "&" : "" : "?", s = `${this.pointsApiUrl}${r}${n.toString()}`, d = this.getPointsCacheKey(s), c = await this.readPointsCache(d), u = c && Date.now() - c.timestamp < this.pointsCacheTtlMs, h = c ? null : await this.getLocalPointsFallback(t, this.tipoCode);
|
|
945
|
+
if (c) {
|
|
946
|
+
if (this.applyPointsPayload(c.data), this.setComponentState("ready"), u)
|
|
713
947
|
return;
|
|
714
948
|
} else h ? (this.applyPointsPayload(h), this.setComponentState("ready")) : this.setComponentState("loading");
|
|
715
949
|
try {
|
|
716
|
-
const
|
|
717
|
-
signal:
|
|
950
|
+
const A = await fetch(s, {
|
|
951
|
+
signal: e.signal
|
|
718
952
|
});
|
|
719
|
-
if (!
|
|
720
|
-
throw new Error(`Respuesta ${
|
|
721
|
-
const
|
|
722
|
-
if (!Array.isArray(
|
|
953
|
+
if (!A.ok)
|
|
954
|
+
throw new Error(`Respuesta ${A.status}`);
|
|
955
|
+
const i = await A.json();
|
|
956
|
+
if (!Array.isArray(i))
|
|
723
957
|
throw new Error("La respuesta de puntos no es valida.");
|
|
724
|
-
const
|
|
725
|
-
await this.writePointsCache(
|
|
726
|
-
} catch (
|
|
727
|
-
if (
|
|
958
|
+
const p = i;
|
|
959
|
+
await this.writePointsCache(d, p), this.applyPointsPayload(p), this.setComponentState("ready");
|
|
960
|
+
} catch (A) {
|
|
961
|
+
if (A instanceof DOMException && A.name === "AbortError")
|
|
728
962
|
return;
|
|
729
|
-
if (
|
|
730
|
-
console.warn("Se mantienen puntos locales por error al refrescar el mapa",
|
|
963
|
+
if (c || h) {
|
|
964
|
+
console.warn("Se mantienen puntos locales por error al refrescar el mapa", A);
|
|
731
965
|
return;
|
|
732
966
|
}
|
|
733
|
-
console.error("No se pudieron cargar los puntos del mapa",
|
|
967
|
+
console.error("No se pudieron cargar los puntos del mapa", A), this.setComponentState("error");
|
|
734
968
|
}
|
|
735
969
|
}
|
|
736
|
-
applyPointsPayload(
|
|
737
|
-
this.points = this.transformPoints(
|
|
970
|
+
applyPointsPayload(e) {
|
|
971
|
+
this.points = this.transformPoints(e), this.reportUnmappablePoints(this.points), this.renderPoints(this.points), this.initialViewApplied = !1, this.updateMarkers(this.points);
|
|
972
|
+
}
|
|
973
|
+
reportUnmappablePoints(e) {
|
|
974
|
+
const t = e.filter((n) => !this.getPointPosition(n)).map((n) => ({
|
|
975
|
+
id: n.id,
|
|
976
|
+
titulo: n.titulo,
|
|
977
|
+
direccion: n.direccion,
|
|
978
|
+
lat: n.lat,
|
|
979
|
+
lng: n.lng
|
|
980
|
+
}));
|
|
981
|
+
t.length && console.warn("Puntos con coordenadas fuera de rango o invalidas; no se muestran como markers.", t);
|
|
738
982
|
}
|
|
739
|
-
getPointsCacheKey(
|
|
740
|
-
return `rs-map:points:${
|
|
983
|
+
getPointsCacheKey(e) {
|
|
984
|
+
return `rs-map:points:${e}`;
|
|
741
985
|
}
|
|
742
|
-
async getLocalPointsFallback(
|
|
743
|
-
const
|
|
744
|
-
if (
|
|
745
|
-
return
|
|
746
|
-
const
|
|
747
|
-
if (!
|
|
986
|
+
async getLocalPointsFallback(e, t) {
|
|
987
|
+
const o = `../json/PuntosMapas_${this.normalizeBrandKey(e)}_${t}.json`, a = this.localPointsRequests.get(o);
|
|
988
|
+
if (a)
|
|
989
|
+
return a;
|
|
990
|
+
const r = K[o];
|
|
991
|
+
if (!r)
|
|
748
992
|
return null;
|
|
749
|
-
const
|
|
750
|
-
const
|
|
751
|
-
return
|
|
993
|
+
const s = r().then((d) => {
|
|
994
|
+
const c = this.parseLocalPointsPayload(d);
|
|
995
|
+
return c != null && c.length ? c : null;
|
|
752
996
|
}).catch(() => null);
|
|
753
|
-
return this.localPointsRequests.set(
|
|
997
|
+
return this.localPointsRequests.set(o, s), s;
|
|
754
998
|
}
|
|
755
|
-
parseLocalPointsPayload(
|
|
756
|
-
return Array.isArray(
|
|
999
|
+
parseLocalPointsPayload(e) {
|
|
1000
|
+
return Array.isArray(e) ? e : null;
|
|
757
1001
|
}
|
|
758
|
-
async readPointsCache(
|
|
759
|
-
const
|
|
760
|
-
if (
|
|
761
|
-
return
|
|
1002
|
+
async readPointsCache(e) {
|
|
1003
|
+
const t = await this.readPointsCacheFromIndexedDb(e);
|
|
1004
|
+
if (t)
|
|
1005
|
+
return t;
|
|
762
1006
|
try {
|
|
763
|
-
const n = window.localStorage.getItem(
|
|
1007
|
+
const n = window.localStorage.getItem(e);
|
|
764
1008
|
if (!n)
|
|
765
1009
|
return null;
|
|
766
|
-
const
|
|
767
|
-
return !
|
|
1010
|
+
const o = JSON.parse(n);
|
|
1011
|
+
return !o || !Array.isArray(o.data) || !Number.isFinite(o.timestamp) ? (window.localStorage.removeItem(e), null) : o;
|
|
768
1012
|
} catch {
|
|
769
1013
|
return null;
|
|
770
1014
|
}
|
|
771
1015
|
}
|
|
772
|
-
async writePointsCache(
|
|
1016
|
+
async writePointsCache(e, t) {
|
|
773
1017
|
const n = {
|
|
774
1018
|
timestamp: Date.now(),
|
|
775
|
-
data:
|
|
1019
|
+
data: t
|
|
776
1020
|
};
|
|
777
|
-
await this.writePointsCacheToIndexedDb(
|
|
1021
|
+
await this.writePointsCacheToIndexedDb(e, n);
|
|
778
1022
|
try {
|
|
779
|
-
window.localStorage.setItem(
|
|
1023
|
+
window.localStorage.setItem(e, JSON.stringify(n));
|
|
780
1024
|
} catch {
|
|
781
1025
|
}
|
|
782
1026
|
}
|
|
783
|
-
async readPointsCacheFromIndexedDb(
|
|
784
|
-
const
|
|
785
|
-
return
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
1027
|
+
async readPointsCacheFromIndexedDb(e) {
|
|
1028
|
+
const t = await f.openPointsCacheDb();
|
|
1029
|
+
return t ? new Promise((n) => {
|
|
1030
|
+
const r = t.transaction(w, "readonly").objectStore(w).get(e);
|
|
1031
|
+
r.onsuccess = () => {
|
|
1032
|
+
const s = r.result;
|
|
1033
|
+
if (!s || !Array.isArray(s.data) || !Number.isFinite(s.timestamp)) {
|
|
790
1034
|
n(null);
|
|
791
1035
|
return;
|
|
792
1036
|
}
|
|
793
1037
|
n({
|
|
794
|
-
timestamp:
|
|
795
|
-
data:
|
|
1038
|
+
timestamp: s.timestamp,
|
|
1039
|
+
data: s.data
|
|
796
1040
|
});
|
|
797
|
-
},
|
|
1041
|
+
}, r.onerror = () => n(null);
|
|
798
1042
|
}) : null;
|
|
799
1043
|
}
|
|
800
|
-
async writePointsCacheToIndexedDb(
|
|
801
|
-
const n = await
|
|
802
|
-
n && await new Promise((
|
|
803
|
-
const
|
|
804
|
-
key:
|
|
805
|
-
timestamp:
|
|
806
|
-
data:
|
|
1044
|
+
async writePointsCacheToIndexedDb(e, t) {
|
|
1045
|
+
const n = await f.openPointsCacheDb();
|
|
1046
|
+
n && await new Promise((o) => {
|
|
1047
|
+
const s = n.transaction(w, "readwrite").objectStore(w).put({
|
|
1048
|
+
key: e,
|
|
1049
|
+
timestamp: t.timestamp,
|
|
1050
|
+
data: t.data
|
|
807
1051
|
});
|
|
808
|
-
|
|
1052
|
+
s.onsuccess = () => o(), s.onerror = () => o();
|
|
809
1053
|
});
|
|
810
1054
|
}
|
|
811
1055
|
static openPointsCacheDb() {
|
|
812
|
-
return typeof window == "undefined" || !("indexedDB" in window) ? Promise.resolve(null) : (
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
const n =
|
|
816
|
-
n.objectStoreNames.contains(
|
|
817
|
-
},
|
|
818
|
-
})),
|
|
819
|
-
}
|
|
820
|
-
transformPoints(
|
|
821
|
-
return
|
|
822
|
-
...
|
|
823
|
-
zone: this.getZoneForPoint(
|
|
1056
|
+
return typeof window == "undefined" || !("indexedDB" in window) ? Promise.resolve(null) : (f.pointsCacheDbPromise || (f.pointsCacheDbPromise = new Promise((e) => {
|
|
1057
|
+
const t = window.indexedDB.open(ne, 1);
|
|
1058
|
+
t.onupgradeneeded = () => {
|
|
1059
|
+
const n = t.result;
|
|
1060
|
+
n.objectStoreNames.contains(w) || n.createObjectStore(w, { keyPath: "key" });
|
|
1061
|
+
}, t.onsuccess = () => e(t.result), t.onerror = () => e(null);
|
|
1062
|
+
})), f.pointsCacheDbPromise);
|
|
1063
|
+
}
|
|
1064
|
+
transformPoints(e) {
|
|
1065
|
+
return e.map((t) => ({
|
|
1066
|
+
...t,
|
|
1067
|
+
zone: this.getZoneForPoint(t)
|
|
824
1068
|
}));
|
|
825
1069
|
}
|
|
826
|
-
renderPoints(
|
|
1070
|
+
renderPoints(e) {
|
|
827
1071
|
if (!this.zonesContainer)
|
|
828
1072
|
return;
|
|
829
|
-
const
|
|
830
|
-
this.pointsByZone =
|
|
1073
|
+
const t = this.groupPoints(e);
|
|
1074
|
+
this.pointsByZone = t, this.updateZoneButtonCounts();
|
|
831
1075
|
const n = document.createDocumentFragment();
|
|
832
|
-
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
if (
|
|
839
|
-
const
|
|
840
|
-
|
|
1076
|
+
ee.forEach((o) => {
|
|
1077
|
+
const a = document.createElement("section");
|
|
1078
|
+
a.className = "zone-section", a.dataset.zoneSection = o;
|
|
1079
|
+
const r = document.createElement("div");
|
|
1080
|
+
r.className = "zone-section__header";
|
|
1081
|
+
const s = document.createElement("span");
|
|
1082
|
+
if (s.textContent = te[o], r.appendChild(s), a.appendChild(r), t[o].length === 0) {
|
|
1083
|
+
const d = document.createElement("p");
|
|
1084
|
+
d.className = "zone-section__empty", d.textContent = "Sin puntos en esta zona.", a.appendChild(d);
|
|
841
1085
|
} else {
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
}),
|
|
1086
|
+
const d = document.createElement("div");
|
|
1087
|
+
d.className = "zone-section__list", t[o].forEach((c) => {
|
|
1088
|
+
d.appendChild(this.createPointCard(c));
|
|
1089
|
+
}), a.appendChild(d);
|
|
846
1090
|
}
|
|
847
|
-
n.appendChild(
|
|
1091
|
+
n.appendChild(a);
|
|
848
1092
|
}), this.zonesContainer.replaceChildren(n), this.updateZoneVisibility();
|
|
849
1093
|
}
|
|
850
|
-
groupPoints(
|
|
851
|
-
const
|
|
1094
|
+
groupPoints(e) {
|
|
1095
|
+
const t = {
|
|
852
1096
|
norte: [],
|
|
853
1097
|
rm: [],
|
|
854
1098
|
centro: [],
|
|
855
1099
|
sur: []
|
|
856
1100
|
};
|
|
857
|
-
return
|
|
858
|
-
|
|
859
|
-
}),
|
|
860
|
-
}
|
|
861
|
-
createPointCard(
|
|
862
|
-
var
|
|
863
|
-
const
|
|
864
|
-
|
|
865
|
-
const n = document.createElement("h3");
|
|
866
|
-
|
|
1101
|
+
return e.forEach((n) => {
|
|
1102
|
+
t[n.zone].push(n);
|
|
1103
|
+
}), t;
|
|
1104
|
+
}
|
|
1105
|
+
createPointCard(e) {
|
|
1106
|
+
var A;
|
|
1107
|
+
const t = document.createElement("article");
|
|
1108
|
+
t.className = "point-card", t.dataset.pointId = String(e.id);
|
|
1109
|
+
const n = this.getPointCoordinateWarning(e), o = document.createElement("h3");
|
|
1110
|
+
o.className = "point-card__title", o.textContent = e.titulo || "Sin nombre", t.appendChild(o);
|
|
867
1111
|
const a = document.createElement("div");
|
|
868
1112
|
a.className = "point-card__address-block";
|
|
869
|
-
const
|
|
870
|
-
if (
|
|
871
|
-
const
|
|
872
|
-
|
|
1113
|
+
const r = document.createElement("p");
|
|
1114
|
+
if (r.className = "point-card__address", r.textContent = e.direccion || "Sin direccion", a.appendChild(r), e.comuna_name) {
|
|
1115
|
+
const i = document.createElement("p");
|
|
1116
|
+
i.className = "point-card__meta", i.textContent = e.comuna_name, a.appendChild(i);
|
|
873
1117
|
}
|
|
874
|
-
if (
|
|
875
|
-
const
|
|
876
|
-
|
|
1118
|
+
if (e.provincia_name) {
|
|
1119
|
+
const i = document.createElement("p");
|
|
1120
|
+
i.className = "point-card__meta", i.textContent = e.provincia_name, a.appendChild(i);
|
|
877
1121
|
}
|
|
878
|
-
if (
|
|
879
|
-
const
|
|
880
|
-
|
|
1122
|
+
if (e.region_name) {
|
|
1123
|
+
const i = document.createElement("p");
|
|
1124
|
+
i.className = "point-card__meta", i.textContent = e.region_name, a.appendChild(i);
|
|
881
1125
|
}
|
|
882
|
-
|
|
883
|
-
let
|
|
884
|
-
const
|
|
885
|
-
if (
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
1126
|
+
t.appendChild(a);
|
|
1127
|
+
let s = null;
|
|
1128
|
+
const d = this.getPointPosition(e);
|
|
1129
|
+
if (d) {
|
|
1130
|
+
const i = document.createElement("div");
|
|
1131
|
+
i.className = "point-card__map-actions";
|
|
1132
|
+
const p = document.createElement("button");
|
|
1133
|
+
p.type = "button", p.className = "point-card__focus";
|
|
1134
|
+
const C = this.createIconElement("fa-solid fa-location-crosshairs");
|
|
1135
|
+
p.appendChild(C), p.appendChild(document.createTextNode(" Ver en el mapa")), p.addEventListener("click", () => {
|
|
1136
|
+
this.focusPointWithZoom(d.lat, d.lng), this.scrollToPointCard(e.id);
|
|
1137
|
+
}), i.appendChild(p), i.appendChild(this.createMobileNavigationActions(d)), s = i;
|
|
1138
|
+
} else if (n) {
|
|
1139
|
+
const i = document.createElement("div");
|
|
1140
|
+
i.className = "point-card__coordinate-warning";
|
|
1141
|
+
const p = this.createIconElement("fa-solid fa-circle-info");
|
|
1142
|
+
i.appendChild(p);
|
|
1143
|
+
const C = document.createElement("span");
|
|
1144
|
+
C.textContent = n, i.appendChild(C), s = i;
|
|
891
1145
|
}
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
let
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
let
|
|
898
|
-
if (
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
const
|
|
902
|
-
|
|
1146
|
+
const c = document.createElement("div");
|
|
1147
|
+
c.className = "point-card__details", c.hidden = !0;
|
|
1148
|
+
let u = !1;
|
|
1149
|
+
const h = document.createElement("div");
|
|
1150
|
+
h.className = "point-card__actions";
|
|
1151
|
+
let g = null;
|
|
1152
|
+
if (e.url && e.url !== "#") {
|
|
1153
|
+
const i = document.createElement("a");
|
|
1154
|
+
i.href = e.url, i.target = "_blank", i.rel = "noopener noreferrer", i.className = "point-card__action";
|
|
1155
|
+
const p = this.createIconElement("fa-solid fa-globe");
|
|
1156
|
+
i.appendChild(p), i.appendChild(document.createTextNode("Sitio web")), h.appendChild(i);
|
|
903
1157
|
}
|
|
904
|
-
if (
|
|
905
|
-
const
|
|
906
|
-
|
|
907
|
-
const
|
|
908
|
-
|
|
1158
|
+
if (e.email) {
|
|
1159
|
+
const i = document.createElement("a");
|
|
1160
|
+
i.href = `mailto:${e.email}`, i.target = "_blank", i.rel = "noopener noreferrer", i.className = "point-card__action point-card__action--text";
|
|
1161
|
+
const p = this.createIconElement("fa-solid fa-envelope");
|
|
1162
|
+
i.appendChild(p), i.appendChild(document.createTextNode(e.email)), h.appendChild(i);
|
|
909
1163
|
}
|
|
910
|
-
if (
|
|
911
|
-
const
|
|
912
|
-
|
|
913
|
-
const
|
|
914
|
-
|
|
915
|
-
const
|
|
916
|
-
|
|
1164
|
+
if (h.childElementCount && (c.appendChild(h), u = !0), (A = e.telefonos) != null && A.length) {
|
|
1165
|
+
const i = document.createElement("div");
|
|
1166
|
+
i.className = "point-card__contact";
|
|
1167
|
+
const p = document.createElement("div");
|
|
1168
|
+
p.className = "point-card__contact-title";
|
|
1169
|
+
const C = this.createIconElement("fa-solid fa-phone");
|
|
1170
|
+
p.appendChild(C), p.appendChild(document.createTextNode("Telefonos")), i.appendChild(p);
|
|
917
1171
|
const x = document.createElement("ul");
|
|
918
|
-
x.className = "point-card__phone-list",
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1172
|
+
x.className = "point-card__phone-list", e.telefonos.slice().sort((y, E) => y.orden - E.orden).forEach((y) => {
|
|
1173
|
+
const E = document.createElement("li");
|
|
1174
|
+
E.className = "point-card__phone-item";
|
|
1175
|
+
const M = document.createElement("span");
|
|
1176
|
+
M.className = "point-card__phone-icon";
|
|
1177
|
+
const U = this.isWhatsappPhone(y);
|
|
1178
|
+
if (U) {
|
|
1179
|
+
const v = this.createIconElement("fa-brands fa-whatsapp");
|
|
1180
|
+
M.appendChild(v);
|
|
925
1181
|
} else
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
const
|
|
931
|
-
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
}),
|
|
1182
|
+
M.textContent = "-";
|
|
1183
|
+
E.appendChild(M);
|
|
1184
|
+
const k = document.createElement("div");
|
|
1185
|
+
k.className = "point-card__phone-content";
|
|
1186
|
+
const z = document.createElement("span");
|
|
1187
|
+
z.className = "point-card__phone-name", z.textContent = y.nombre, k.appendChild(z);
|
|
1188
|
+
const P = U ? document.createElement("a") : document.createElement("span");
|
|
1189
|
+
if (P.className = "point-card__phone-number", U) {
|
|
1190
|
+
const v = this.getWhatsappLink(y.telefono);
|
|
1191
|
+
v && (P.href = v, P.target = "_blank", P.rel = "noopener noreferrer", P.classList.add("point-card__phone-number--link"));
|
|
1192
|
+
}
|
|
1193
|
+
P.textContent = y.telefono, k.appendChild(P), E.appendChild(k), x.appendChild(E);
|
|
1194
|
+
}), i.appendChild(x), c.appendChild(i), u = !0;
|
|
939
1195
|
}
|
|
940
|
-
if (
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
}),
|
|
1196
|
+
if (e.adicional) {
|
|
1197
|
+
const i = document.createElement("p");
|
|
1198
|
+
i.className = "point-card__extra", i.innerHTML = e.adicional, i.querySelectorAll("a").forEach((p) => {
|
|
1199
|
+
p.classList.add("point-card__extra-link");
|
|
1200
|
+
const C = this.createIconElement("fa-solid fa-arrow-up-right-from-square");
|
|
1201
|
+
C.classList.add("point-card__extra-icon"), p.appendChild(C);
|
|
1202
|
+
}), c.appendChild(i), u = !0;
|
|
947
1203
|
}
|
|
948
|
-
if (
|
|
949
|
-
|
|
950
|
-
const
|
|
951
|
-
|
|
1204
|
+
if (e.googlelink) {
|
|
1205
|
+
g = document.createElement("a"), g.href = e.googlelink, g.target = "_blank", g.rel = "noopener noreferrer", g.className = "point-card__action";
|
|
1206
|
+
const i = this.createIconElement("fa-solid fa-map-location-dot");
|
|
1207
|
+
g.appendChild(i), g.appendChild(document.createTextNode("Google Maps"));
|
|
952
1208
|
}
|
|
953
|
-
if (
|
|
954
|
-
const
|
|
955
|
-
|
|
1209
|
+
if (g) {
|
|
1210
|
+
const i = document.createElement("div");
|
|
1211
|
+
i.className = "point-card__actions", i.appendChild(g), c.appendChild(i), u = !0;
|
|
956
1212
|
}
|
|
957
|
-
if (
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
const x =
|
|
963
|
-
|
|
964
|
-
}),
|
|
1213
|
+
if (u) {
|
|
1214
|
+
const i = document.createElement("button");
|
|
1215
|
+
i.type = "button", i.className = "point-card__toggle";
|
|
1216
|
+
const p = this.createIconElement("fa-solid fa-circle-info"), C = document.createElement("span");
|
|
1217
|
+
C.textContent = "Mas informacion", i.appendChild(p), i.appendChild(C), i.addEventListener("click", () => {
|
|
1218
|
+
const x = c.hidden;
|
|
1219
|
+
c.hidden = !x, C.textContent = x ? "Ocultar informacion" : "Mas informacion", p.className = x ? "fa-solid fa-circle-xmark" : "fa-solid fa-circle-info";
|
|
1220
|
+
}), t.appendChild(i), t.appendChild(c);
|
|
965
1221
|
}
|
|
966
|
-
return
|
|
1222
|
+
return s && t.appendChild(s), t;
|
|
967
1223
|
}
|
|
968
|
-
|
|
969
|
-
const
|
|
970
|
-
return
|
|
1224
|
+
createMobileNavigationActions(e) {
|
|
1225
|
+
const t = document.createElement("div");
|
|
1226
|
+
return t.className = "point-card__mobile-navigation", t.appendChild(
|
|
1227
|
+
this.createMobileNavigationLink(
|
|
1228
|
+
`https://www.google.com/maps/dir/?api=1&destination=${e.lat},${e.lng}&travelmode=driving`,
|
|
1229
|
+
"Ir con Google Maps",
|
|
1230
|
+
"fa-brands fa-google"
|
|
1231
|
+
)
|
|
1232
|
+
), t.appendChild(
|
|
1233
|
+
this.createMobileNavigationLink(
|
|
1234
|
+
`https://waze.com/ul?ll=${e.lat},${e.lng}&navigate=yes`,
|
|
1235
|
+
"Ir con Waze",
|
|
1236
|
+
"fa-brands fa-waze"
|
|
1237
|
+
)
|
|
1238
|
+
), t;
|
|
971
1239
|
}
|
|
972
|
-
|
|
973
|
-
|
|
1240
|
+
createMobileNavigationLink(e, t, n) {
|
|
1241
|
+
const o = document.createElement("a");
|
|
1242
|
+
return o.href = e, o.target = "_blank", o.rel = "noopener noreferrer", o.className = "point-card__mobile-nav-link", o.appendChild(this.createIconElement(n)), o.appendChild(document.createTextNode(t)), o;
|
|
974
1243
|
}
|
|
975
|
-
|
|
976
|
-
|
|
1244
|
+
getZoneForPoint(e) {
|
|
1245
|
+
const t = this.normalizeRegionName(e.region_name || "");
|
|
1246
|
+
return t && t in R ? R[t] : t.includes("metropolitana") ? "rm" : t.includes("araucania") || t.includes("rios") || t.includes("lagos") || t.includes("aysen") || t.includes("magallanes") ? "sur" : t.includes("arica") || t.includes("tarapaca") || t.includes("antofagasta") || t.includes("atacama") || t.includes("coquimbo") ? "norte" : "centro";
|
|
977
1247
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
return this.markerIconBaseUrl ? `${this.markerIconBaseUrl}${t}.png` : this.defaultMarkerIconUrl ? this.defaultMarkerIconUrl : null;
|
|
1248
|
+
normalizeRegionName(e) {
|
|
1249
|
+
return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
|
|
981
1250
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1251
|
+
getMarcaRequestValue() {
|
|
1252
|
+
var t;
|
|
1253
|
+
const e = this.normalizeBrandToken(this.marca);
|
|
1254
|
+
return (t = T[e]) != null ? t : this.marca;
|
|
1255
|
+
}
|
|
1256
|
+
normalizeBrandKey(e) {
|
|
1257
|
+
var n;
|
|
1258
|
+
const t = this.normalizeBrandToken(e);
|
|
1259
|
+
return t ? (n = T[t]) != null ? n : t : "default";
|
|
1260
|
+
}
|
|
1261
|
+
normalizeBrandToken(e) {
|
|
1262
|
+
return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "");
|
|
1263
|
+
}
|
|
1264
|
+
getMarkerIcon(e) {
|
|
1265
|
+
const t = this.marcaKey || "default", n = this.getLocalMarkerIconUrl(t, e);
|
|
1266
|
+
return n || (this.markerIconBaseUrl ? `${this.markerIconBaseUrl}${t}.png` : this.defaultMarkerIconUrl ? this.defaultMarkerIconUrl : null);
|
|
1267
|
+
}
|
|
1268
|
+
getLocalMarkerIconUrl(e, t) {
|
|
1269
|
+
var r;
|
|
1270
|
+
const n = t ? Number(t.tipo) : NaN, a = (Number.isFinite(n) ? n : this.tipoCode) === 1 ? `${e}_distribuidor.png` : `${e}.png`;
|
|
1271
|
+
return (r = X[`../pin/${a}`]) != null ? r : null;
|
|
1272
|
+
}
|
|
1273
|
+
getPointCoordinateWarning(e) {
|
|
1274
|
+
if (this.getPointPosition(e))
|
|
1275
|
+
return null;
|
|
1276
|
+
const t = Number(e.lat), n = Number(e.lng), o = `lat ${e.lat || "sin dato"}, lng ${e.lng || "sin dato"}`;
|
|
1277
|
+
return !Number.isFinite(t) || !Number.isFinite(n) ? `Ubicacion por revisar: ${o}.` : `Ubicacion por revisar: ${o}.`;
|
|
1278
|
+
}
|
|
1279
|
+
getPointPosition(e) {
|
|
1280
|
+
const t = Number(e.lat), n = Number(e.lng);
|
|
1281
|
+
return this.isMappableCoordinate(t, n) ? { lat: t, lng: n } : null;
|
|
1282
|
+
}
|
|
1283
|
+
isMappableCoordinate(e, t) {
|
|
1284
|
+
return Number.isFinite(e) && Number.isFinite(t) && e >= _.minLat && e <= _.maxLat && t >= _.minLng && t <= _.maxLng;
|
|
1285
|
+
}
|
|
1286
|
+
updateMarkers(e) {
|
|
1287
|
+
const t = window.google;
|
|
1288
|
+
if (!t || !this.map)
|
|
985
1289
|
return;
|
|
986
|
-
this.markers.forEach((
|
|
987
|
-
const n =
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1290
|
+
this.markers.forEach((a) => a.setMap(null)), this.markers = [];
|
|
1291
|
+
const n = [];
|
|
1292
|
+
if (e.forEach((a) => {
|
|
1293
|
+
const r = this.getPointPosition(a);
|
|
1294
|
+
r && n.push({ point: a, position: r });
|
|
1295
|
+
}), !n.length)
|
|
992
1296
|
return;
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1297
|
+
const o = new t.maps.LatLngBounds();
|
|
1298
|
+
if (n.forEach(({ point: a, position: r }) => {
|
|
1299
|
+
const { lat: s, lng: d } = r, c = this.getMarkerIcon(a), u = c && this.map ? {
|
|
1300
|
+
url: c,
|
|
1301
|
+
scaledSize: new t.maps.Size(64, 64),
|
|
1302
|
+
anchor: new t.maps.Point(32, 64)
|
|
1303
|
+
} : void 0, h = new t.maps.Marker({
|
|
1000
1304
|
map: this.map,
|
|
1001
|
-
position: { lat:
|
|
1002
|
-
title:
|
|
1003
|
-
icon:
|
|
1305
|
+
position: { lat: s, lng: d },
|
|
1306
|
+
title: a.titulo,
|
|
1307
|
+
icon: u
|
|
1004
1308
|
});
|
|
1005
|
-
|
|
1309
|
+
h.addListener("click", () => {
|
|
1310
|
+
this.openPointModal(a), this.scrollToPointCard(a.id);
|
|
1311
|
+
}), this.markers.push(h);
|
|
1006
1312
|
const g = h.getPosition();
|
|
1007
|
-
g &&
|
|
1313
|
+
g && o.extend(g);
|
|
1008
1314
|
}), !this.initialViewApplied && this.markers.length) {
|
|
1009
|
-
const
|
|
1010
|
-
if (
|
|
1011
|
-
this.map.setCenter(
|
|
1315
|
+
const a = this.markers[0].getPosition();
|
|
1316
|
+
if (a) {
|
|
1317
|
+
this.map.setCenter(a), this.map.setZoom(14), this.initialViewApplied = !0;
|
|
1012
1318
|
return;
|
|
1013
1319
|
}
|
|
1014
1320
|
}
|
|
1015
1321
|
if (this.markers.length === 1) {
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1322
|
+
const a = this.markers[0].getPosition();
|
|
1323
|
+
a && this.map.setCenter(a), this.map.setZoom(14);
|
|
1324
|
+
} else
|
|
1325
|
+
this.map.fitBounds(o);
|
|
1326
|
+
}
|
|
1327
|
+
openPointModal(e) {
|
|
1328
|
+
var t;
|
|
1329
|
+
!this.pointModalOverlayEl || !this.pointModalTitleEl || !this.pointModalBodyEl || (this.pointModalTitleEl.textContent = e.titulo || "Sin nombre", this.pointModalBodyEl.replaceChildren(this.createPointModalContent(e)), this.pointModalOverlayEl.removeAttribute("hidden"), (t = this.pointModalCloseButton) == null || t.focus());
|
|
1330
|
+
}
|
|
1331
|
+
createPointModalContent(e) {
|
|
1332
|
+
var r;
|
|
1333
|
+
const t = document.createDocumentFragment();
|
|
1334
|
+
if (e.portada) {
|
|
1335
|
+
const s = document.createElement("img");
|
|
1336
|
+
s.className = "point-modal__cover", s.src = e.portada, s.alt = e.titulo || "Imagen del punto", s.loading = "lazy", s.addEventListener("error", () => s.remove(), { once: !0 }), t.appendChild(s);
|
|
1337
|
+
}
|
|
1338
|
+
const n = this.createPointModalSection();
|
|
1339
|
+
this.appendPointModalLine(n, "Direccion", e.direccion), this.appendPointModalLine(n, "Comuna", e.comuna_name), this.appendPointModalLine(n, "Provincia", e.provincia_name), this.appendPointModalLine(n, "Region", e.region_name), this.appendPointModalLine(n, "RUT", e.rut), n.childElementCount && t.appendChild(n);
|
|
1340
|
+
const o = this.createPointModalSection();
|
|
1341
|
+
if (this.appendPointModalLine(o, "Correo", e.email), (r = e.telefonos) != null && r.length) {
|
|
1342
|
+
const s = document.createElement("p");
|
|
1343
|
+
s.className = "point-modal__line";
|
|
1344
|
+
const d = document.createElement("span");
|
|
1345
|
+
d.className = "point-modal__label", d.textContent = "Telefonos:", s.appendChild(d), o.appendChild(s);
|
|
1346
|
+
const c = document.createElement("ul");
|
|
1347
|
+
c.className = "point-modal__phone-list", e.telefonos.slice().sort((u, h) => u.orden - h.orden).forEach((u) => {
|
|
1348
|
+
c.appendChild(this.createPointModalPhoneItem(u));
|
|
1349
|
+
}), o.appendChild(c);
|
|
1350
|
+
}
|
|
1351
|
+
if (o.childElementCount && t.appendChild(o), e.adicional) {
|
|
1352
|
+
const s = this.createPointModalSection(), d = document.createElement("div");
|
|
1353
|
+
d.className = "point-modal__extra", d.innerHTML = e.adicional, d.querySelectorAll("a").forEach((c) => {
|
|
1354
|
+
c.target = "_blank", c.rel = "noopener noreferrer";
|
|
1355
|
+
}), s.appendChild(d), t.appendChild(s);
|
|
1356
|
+
}
|
|
1357
|
+
const a = this.createPointModalActions(e);
|
|
1358
|
+
return a.childElementCount && t.appendChild(a), t;
|
|
1359
|
+
}
|
|
1360
|
+
createPointModalSection() {
|
|
1361
|
+
const e = document.createElement("div");
|
|
1362
|
+
return e.className = "point-modal__section", e;
|
|
1363
|
+
}
|
|
1364
|
+
appendPointModalLine(e, t, n) {
|
|
1365
|
+
const o = (n != null ? n : "").trim();
|
|
1366
|
+
if (!o || o === "#")
|
|
1367
|
+
return;
|
|
1368
|
+
const a = document.createElement("p");
|
|
1369
|
+
a.className = "point-modal__line";
|
|
1370
|
+
const r = document.createElement("span");
|
|
1371
|
+
r.className = "point-modal__label", r.textContent = `${t}: `, a.appendChild(r), a.appendChild(document.createTextNode(o)), e.appendChild(a);
|
|
1372
|
+
}
|
|
1373
|
+
createPointModalPhoneItem(e) {
|
|
1374
|
+
var r;
|
|
1375
|
+
const t = document.createElement("li");
|
|
1376
|
+
t.className = "point-modal__phone-item";
|
|
1377
|
+
const n = document.createElement("span");
|
|
1378
|
+
n.className = "point-modal__label", n.textContent = `${e.nombre || "Telefono"}: `, t.appendChild(n);
|
|
1379
|
+
const o = ((r = e.telefono) != null ? r : "").trim(), a = this.isWhatsappPhone(e) ? this.getWhatsappLink(o) : null;
|
|
1380
|
+
if (a) {
|
|
1381
|
+
const s = document.createElement("a");
|
|
1382
|
+
s.href = a, s.target = "_blank", s.rel = "noopener noreferrer", s.className = "point-modal__link", s.textContent = o, t.appendChild(s);
|
|
1018
1383
|
} else
|
|
1019
|
-
|
|
1384
|
+
t.appendChild(document.createTextNode(o));
|
|
1385
|
+
return t;
|
|
1020
1386
|
}
|
|
1021
|
-
|
|
1387
|
+
createPointModalActions(e) {
|
|
1388
|
+
const t = document.createElement("div");
|
|
1389
|
+
return t.className = "point-modal__section point-modal__actions", e.url && e.url !== "#" && t.appendChild(this.createPointModalLink(e.url, "Sitio web")), e.googlelink && t.appendChild(this.createPointModalLink(e.googlelink, "Google Maps")), e.email && t.appendChild(this.createPointModalLink(`mailto:${e.email}`, "Enviar correo", !1)), t;
|
|
1022
1390
|
}
|
|
1023
|
-
|
|
1391
|
+
createPointModalLink(e, t, n = !0) {
|
|
1392
|
+
const o = document.createElement("a");
|
|
1393
|
+
return o.href = e, o.className = "point-modal__link", o.textContent = t, n && (o.target = "_blank", o.rel = "noopener noreferrer"), o;
|
|
1394
|
+
}
|
|
1395
|
+
setActiveZone(e) {
|
|
1396
|
+
}
|
|
1397
|
+
scrollToZoneSection(e) {
|
|
1024
1398
|
if (!this.zonesContainer)
|
|
1025
1399
|
return;
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1400
|
+
const t = this.zonesContainer.querySelector(`[data-zone-section="${e}"]`);
|
|
1401
|
+
t && t.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
1028
1402
|
}
|
|
1029
1403
|
updateZoneButtons() {
|
|
1030
|
-
this.zoneButtons.forEach((
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1404
|
+
this.zoneButtons.forEach((e) => {
|
|
1405
|
+
const t = e.dataset.zone, n = this.activeZone === t;
|
|
1406
|
+
e.classList.toggle("is-active", n), e.setAttribute("aria-pressed", String(n));
|
|
1033
1407
|
});
|
|
1034
1408
|
}
|
|
1035
1409
|
updateZoneButtonCounts() {
|
|
1036
|
-
this.zoneButtons.forEach((
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1410
|
+
this.zoneButtons.forEach((e) => {
|
|
1411
|
+
e.dataset.zone;
|
|
1412
|
+
const t = e.dataset.label || e.textContent || "";
|
|
1413
|
+
e.textContent = t;
|
|
1040
1414
|
});
|
|
1041
1415
|
}
|
|
1042
1416
|
updateZoneVisibility() {
|
|
1043
1417
|
if (!this.zonesContainer)
|
|
1044
1418
|
return;
|
|
1045
|
-
this.zonesContainer.querySelectorAll("[data-zone-section]").forEach((
|
|
1046
|
-
|
|
1419
|
+
this.zonesContainer.querySelectorAll("[data-zone-section]").forEach((t) => {
|
|
1420
|
+
t.removeAttribute("hidden");
|
|
1047
1421
|
});
|
|
1048
1422
|
}
|
|
1049
|
-
findNearestPoint(
|
|
1423
|
+
findNearestPoint(e, t) {
|
|
1050
1424
|
if (!this.points.length)
|
|
1051
1425
|
return null;
|
|
1052
|
-
let n = null,
|
|
1053
|
-
return this.points.forEach((
|
|
1054
|
-
const
|
|
1055
|
-
if (!
|
|
1426
|
+
let n = null, o = 1 / 0;
|
|
1427
|
+
return this.points.forEach((a) => {
|
|
1428
|
+
const r = this.getPointPosition(a);
|
|
1429
|
+
if (!r)
|
|
1056
1430
|
return;
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1431
|
+
const s = this.haversine(e, t, r.lat, r.lng);
|
|
1432
|
+
s < o && (o = s, n = a);
|
|
1059
1433
|
}), n;
|
|
1060
1434
|
}
|
|
1061
|
-
haversine(
|
|
1062
|
-
const
|
|
1063
|
-
return 6371e3 * (2 * Math.atan2(Math.sqrt(
|
|
1435
|
+
haversine(e, t, n, o) {
|
|
1436
|
+
const a = (h) => h * Math.PI / 180, s = a(n - e), d = a(o - t), c = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(a(e)) * Math.cos(a(n)) * Math.sin(d / 2) * Math.sin(d / 2);
|
|
1437
|
+
return 6371e3 * (2 * Math.atan2(Math.sqrt(c), Math.sqrt(1 - c)));
|
|
1064
1438
|
}
|
|
1065
|
-
scrollToPointCard(
|
|
1439
|
+
scrollToPointCard(e) {
|
|
1066
1440
|
if (!this.zonesContainer)
|
|
1067
1441
|
return;
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1442
|
+
const t = this.zonesContainer.querySelector(`[data-point-id="${e}"]`);
|
|
1443
|
+
t && (t.scrollIntoView({ behavior: "smooth", block: "center" }), this.highlightPointCard(t));
|
|
1070
1444
|
}
|
|
1071
|
-
highlightPointCard(
|
|
1072
|
-
var
|
|
1073
|
-
this.highlightTimeout !== null && (clearTimeout(this.highlightTimeout), this.highlightTimeout = null), (
|
|
1445
|
+
highlightPointCard(e) {
|
|
1446
|
+
var t;
|
|
1447
|
+
this.highlightTimeout !== null && (clearTimeout(this.highlightTimeout), this.highlightTimeout = null), (t = this.zonesContainer) == null || t.querySelectorAll(".point-card--highlight").forEach((n) => {
|
|
1074
1448
|
n.classList.remove("point-card--highlight");
|
|
1075
|
-
}),
|
|
1076
|
-
|
|
1449
|
+
}), e.classList.add("point-card--highlight"), this.highlightTimeout = window.setTimeout(() => {
|
|
1450
|
+
e.classList.remove("point-card--highlight"), this.highlightTimeout = null;
|
|
1077
1451
|
}, 3500);
|
|
1078
1452
|
}
|
|
1079
|
-
setComponentState(
|
|
1453
|
+
setComponentState(e) {
|
|
1080
1454
|
if (!(!this.componentMessageEl || !this.mapLayoutEl))
|
|
1081
|
-
if (
|
|
1455
|
+
if (e === "ready")
|
|
1082
1456
|
this.componentMessageEl.setAttribute("hidden", ""), this.mapLayoutEl.removeAttribute("hidden");
|
|
1083
1457
|
else {
|
|
1084
|
-
const
|
|
1085
|
-
this.componentMessageEl.textContent =
|
|
1458
|
+
const t = e === "loading" ? "Cargando puntos..." : "Mapa temporalmente no disponible";
|
|
1459
|
+
this.componentMessageEl.textContent = t, this.componentMessageEl.removeAttribute("hidden"), this.mapLayoutEl.setAttribute("hidden", "");
|
|
1086
1460
|
}
|
|
1087
1461
|
}
|
|
1088
|
-
centerMapOnPoint(
|
|
1089
|
-
if (!window.google || !this.map || !Number.isFinite(
|
|
1462
|
+
centerMapOnPoint(e, t, n = 14) {
|
|
1463
|
+
if (!window.google || !this.map || !Number.isFinite(e) || !Number.isFinite(t))
|
|
1090
1464
|
return;
|
|
1091
|
-
const
|
|
1092
|
-
this.animateMapPan(
|
|
1093
|
-
|
|
1465
|
+
const a = typeof this.map.getZoom == "function" ? this.map.getZoom() : null, r = !a || a < n;
|
|
1466
|
+
this.animateMapPan(e, t, () => {
|
|
1467
|
+
r && this.map.setZoom(n);
|
|
1094
1468
|
});
|
|
1095
1469
|
}
|
|
1096
|
-
async focusPointWithZoom(
|
|
1097
|
-
!window.google || !this.map || !Number.isFinite(
|
|
1098
|
-
this.animateMapPan(
|
|
1470
|
+
async focusPointWithZoom(e, t) {
|
|
1471
|
+
!window.google || !this.map || !Number.isFinite(e) || !Number.isFinite(t) || (await this.animateZoomTo(8, 800), await this.wait(500), await new Promise((o) => {
|
|
1472
|
+
this.animateMapPan(e, t, o);
|
|
1099
1473
|
}), await this.wait(500), await this.animateZoomTo(18, 800));
|
|
1100
1474
|
}
|
|
1101
|
-
wait(
|
|
1102
|
-
return new Promise((
|
|
1103
|
-
window.setTimeout(
|
|
1475
|
+
wait(e) {
|
|
1476
|
+
return new Promise((t) => {
|
|
1477
|
+
window.setTimeout(t, e);
|
|
1104
1478
|
});
|
|
1105
1479
|
}
|
|
1106
|
-
async animateZoomTo(
|
|
1480
|
+
async animateZoomTo(e, t = 600) {
|
|
1107
1481
|
if (!window.google || !this.map || typeof this.map.getZoom != "function" || typeof this.map.setZoom != "function")
|
|
1108
1482
|
return;
|
|
1109
|
-
const
|
|
1110
|
-
if (!Number.isFinite(
|
|
1111
|
-
this.map.setZoom(
|
|
1483
|
+
const o = this.map.getZoom();
|
|
1484
|
+
if (!Number.isFinite(o)) {
|
|
1485
|
+
this.map.setZoom(e);
|
|
1112
1486
|
return;
|
|
1113
1487
|
}
|
|
1114
|
-
const
|
|
1115
|
-
if (Math.abs(
|
|
1116
|
-
this.map.setZoom(
|
|
1488
|
+
const a = e - o;
|
|
1489
|
+
if (Math.abs(a) < 0.01) {
|
|
1490
|
+
this.map.setZoom(e);
|
|
1117
1491
|
return;
|
|
1118
1492
|
}
|
|
1119
|
-
await new Promise((
|
|
1120
|
-
const
|
|
1121
|
-
const
|
|
1122
|
-
this.map.setZoom(Math.round(
|
|
1493
|
+
await new Promise((r) => {
|
|
1494
|
+
const s = performance.now(), d = (u) => 1 - Math.pow(1 - u, 3), c = (u) => {
|
|
1495
|
+
const h = u - s, g = Math.min(h / t, 1), A = d(g), i = o + a * A;
|
|
1496
|
+
this.map.setZoom(Math.round(i * 100) / 100), g < 1 ? requestAnimationFrame(c) : (this.map.setZoom(e), r());
|
|
1123
1497
|
};
|
|
1124
|
-
requestAnimationFrame(
|
|
1498
|
+
requestAnimationFrame(c);
|
|
1125
1499
|
});
|
|
1126
1500
|
}
|
|
1127
|
-
animateMapPan(
|
|
1501
|
+
animateMapPan(e, t, n) {
|
|
1128
1502
|
if (!window.google || !this.map)
|
|
1129
1503
|
return;
|
|
1130
1504
|
this.panAnimationFrame !== null && (cancelAnimationFrame(this.panAnimationFrame), this.panAnimationFrame = null);
|
|
1131
|
-
const
|
|
1132
|
-
if (!
|
|
1133
|
-
this.map.setCenter({ lat:
|
|
1505
|
+
const a = this.map.getCenter();
|
|
1506
|
+
if (!a) {
|
|
1507
|
+
this.map.setCenter({ lat: e, lng: t }), n == null || n();
|
|
1134
1508
|
return;
|
|
1135
1509
|
}
|
|
1136
|
-
const
|
|
1137
|
-
const
|
|
1138
|
-
this.map.setCenter({ lat:
|
|
1510
|
+
const r = a.lat(), s = a.lng(), d = e - r, c = t - s, u = 600, h = performance.now(), g = (i) => 1 - Math.pow(1 - i, 3), A = (i) => {
|
|
1511
|
+
const p = i - h, C = Math.min(p / u, 1), x = g(C), y = r + d * x, E = s + c * x;
|
|
1512
|
+
this.map.setCenter({ lat: y, lng: E }), C < 1 ? this.panAnimationFrame = requestAnimationFrame(A) : (this.panAnimationFrame = null, n == null || n());
|
|
1139
1513
|
};
|
|
1140
|
-
this.panAnimationFrame = requestAnimationFrame(
|
|
1514
|
+
this.panAnimationFrame = requestAnimationFrame(A);
|
|
1141
1515
|
}
|
|
1142
1516
|
static ensureFontAwesome() {
|
|
1143
|
-
if (
|
|
1517
|
+
if (f.fontAwesomeAttached)
|
|
1144
1518
|
return;
|
|
1145
|
-
if (document.querySelector(`link[href="${
|
|
1146
|
-
|
|
1519
|
+
if (document.querySelector(`link[href="${F}"]`)) {
|
|
1520
|
+
f.fontAwesomeAttached = !0;
|
|
1147
1521
|
return;
|
|
1148
1522
|
}
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
}), document.head.appendChild(
|
|
1523
|
+
const t = document.createElement("link");
|
|
1524
|
+
t.rel = "stylesheet", t.href = F, t.crossOrigin = "anonymous", t.referrerPolicy = "no-referrer", t.addEventListener("load", () => {
|
|
1525
|
+
f.fontAwesomeAttached = !0;
|
|
1526
|
+
}), document.head.appendChild(t);
|
|
1527
|
+
}
|
|
1528
|
+
createIconElement(e) {
|
|
1529
|
+
const t = document.createElement("i");
|
|
1530
|
+
return t.className = e, t.setAttribute("aria-hidden", "true"), t;
|
|
1153
1531
|
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
return e.className = t, e.setAttribute("aria-hidden", "true"), e;
|
|
1532
|
+
isWhatsappPhone(e) {
|
|
1533
|
+
return !!(e.whatsapp || e.watshapp);
|
|
1157
1534
|
}
|
|
1158
|
-
getWhatsappLink(
|
|
1159
|
-
const
|
|
1160
|
-
return
|
|
1535
|
+
getWhatsappLink(e) {
|
|
1536
|
+
const t = e.replace(/\D+/g, "");
|
|
1537
|
+
return t ? `https://wa.me/${t}` : null;
|
|
1161
1538
|
}
|
|
1162
1539
|
};
|
|
1163
|
-
|
|
1164
|
-
let
|
|
1165
|
-
|
|
1540
|
+
l(f, "tag", "rs-map"), l(f, "googleMapsLoaderPromise", null), l(f, "pointsCacheDbPromise", null), l(f, "fontAwesomeAttached", !1);
|
|
1541
|
+
let N = f;
|
|
1542
|
+
Q(N.tag, N);
|
|
1166
1543
|
export {
|
|
1167
|
-
|
|
1168
|
-
|
|
1544
|
+
N as RsMap,
|
|
1545
|
+
Q as safeDefine
|
|
1169
1546
|
};
|
|
1170
1547
|
//# sourceMappingURL=rs-components.es.js.map
|