@alfadocs/ui-kit-debug 1.119.0 → 1.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{address-autocomplete-zLygkxFc.js → address-autocomplete-D2uNpxcE.js} +2 -2
- package/dist/_chunks/{address-autocomplete-zLygkxFc.js.map → address-autocomplete-D2uNpxcE.js.map} +1 -1
- package/dist/_chunks/{address-fields-Dl1ALKhP.js → address-fields-BU65pA-V.js} +2 -2
- package/dist/_chunks/{address-fields-Dl1ALKhP.js.map → address-fields-BU65pA-V.js.map} +1 -1
- package/dist/_chunks/map-view-h6ngp2xi.js +1578 -0
- package/dist/_chunks/map-view-h6ngp2xi.js.map +1 -0
- package/dist/_chunks/maps-core-gate-DKx96CC_.js +1492 -0
- package/dist/_chunks/{maps-core-gate-C4dyo1ic.js.map → maps-core-gate-DKx96CC_.js.map} +1 -1
- package/dist/_chunks/{practice-results-b3uchdBn.js → practice-results-yCresv86.js} +759 -750
- package/dist/_chunks/practice-results-yCresv86.js.map +1 -0
- package/dist/_chunks/{reserved.agent-V2Eqoabh.js → reserved.agent-DRSZ8UcL.js} +2 -2
- package/dist/_chunks/{reserved.agent-V2Eqoabh.js.map → reserved.agent-DRSZ8UcL.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/browser-support.js +1 -1
- package/dist/components/address-autocomplete/index.js +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view-pin-geometry.d.ts +39 -0
- package/dist/components/map-view/map-view-pin-geometry.d.ts.map +1 -0
- package/dist/components/map-view/map-view-pin.d.ts +15 -0
- package/dist/components/map-view/map-view-pin.d.ts.map +1 -0
- package/dist/components/map-view/map-view.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +8 -0
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/core.css +1 -1
- package/dist/index.js +5 -5
- package/dist/tokens.css +1 -1
- package/package.json +4 -1
- package/dist/_chunks/map-view-CHeGd94F.js +0 -1443
- package/dist/_chunks/map-view-CHeGd94F.js.map +0 -1
- package/dist/_chunks/maps-core-gate-C4dyo1ic.js +0 -1571
- package/dist/_chunks/practice-results-b3uchdBn.js.map +0 -1
|
@@ -0,0 +1,1492 @@
|
|
|
1
|
+
import * as Ae from "react";
|
|
2
|
+
import A, { useMemo as N, useContext as H, useEffect as C, useLayoutEffect as J, useState as k, useReducer as De, useCallback as ce, useRef as x, forwardRef as B, useImperativeHandle as F, Children as je, createContext as Fe } from "react";
|
|
3
|
+
import { createPortal as Le } from "react-dom";
|
|
4
|
+
import { g as ze } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
5
|
+
var te, he;
|
|
6
|
+
function Ue() {
|
|
7
|
+
return he || (he = 1, te = function e(n, t) {
|
|
8
|
+
if (n === t) return !0;
|
|
9
|
+
if (n && t && typeof n == "object" && typeof t == "object") {
|
|
10
|
+
if (n.constructor !== t.constructor) return !1;
|
|
11
|
+
var o, r, a;
|
|
12
|
+
if (Array.isArray(n)) {
|
|
13
|
+
if (o = n.length, o != t.length) return !1;
|
|
14
|
+
for (r = o; r-- !== 0; )
|
|
15
|
+
if (!e(n[r], t[r])) return !1;
|
|
16
|
+
return !0;
|
|
17
|
+
}
|
|
18
|
+
if (n.constructor === RegExp) return n.source === t.source && n.flags === t.flags;
|
|
19
|
+
if (n.valueOf !== Object.prototype.valueOf) return n.valueOf() === t.valueOf();
|
|
20
|
+
if (n.toString !== Object.prototype.toString) return n.toString() === t.toString();
|
|
21
|
+
if (a = Object.keys(n), o = a.length, o !== Object.keys(t).length) return !1;
|
|
22
|
+
for (r = o; r-- !== 0; )
|
|
23
|
+
if (!Object.prototype.hasOwnProperty.call(t, a[r])) return !1;
|
|
24
|
+
for (r = o; r-- !== 0; ) {
|
|
25
|
+
var s = a[r];
|
|
26
|
+
if (!e(n[s], t[s])) return !1;
|
|
27
|
+
}
|
|
28
|
+
return !0;
|
|
29
|
+
}
|
|
30
|
+
return n !== n && t !== t;
|
|
31
|
+
}), te;
|
|
32
|
+
}
|
|
33
|
+
var Ge = Ue();
|
|
34
|
+
const q = /* @__PURE__ */ ze(Ge), He = "1.8.3";
|
|
35
|
+
function R(e, n) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
|
|
38
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
39
|
+
for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
|
|
40
|
+
n.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (t[o[r]] = e[o[r]]);
|
|
41
|
+
return t;
|
|
42
|
+
}
|
|
43
|
+
function ve(e, n, t, o) {
|
|
44
|
+
function r(a) {
|
|
45
|
+
return a instanceof t ? a : new t(function(s) {
|
|
46
|
+
s(a);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return new (t || (t = Promise))(function(a, s) {
|
|
50
|
+
function i(l) {
|
|
51
|
+
try {
|
|
52
|
+
d(o.next(l));
|
|
53
|
+
} catch (h) {
|
|
54
|
+
s(h);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function f(l) {
|
|
58
|
+
try {
|
|
59
|
+
d(o.throw(l));
|
|
60
|
+
} catch (h) {
|
|
61
|
+
s(h);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function d(l) {
|
|
65
|
+
l.done ? a(l.value) : r(l.value).then(i, f);
|
|
66
|
+
}
|
|
67
|
+
d((o = o.apply(e, [])).next());
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function Je(e, n) {
|
|
71
|
+
e.src = n;
|
|
72
|
+
}
|
|
73
|
+
const Ve = (e) => {
|
|
74
|
+
var n, t, o, r = "The Google Maps JavaScript API", a = "google", s = "importLibrary", i = "__ib__", f = document, d = window, l = d[a] || (d[a] = {}), h = l.maps || (l.maps = {}), p = /* @__PURE__ */ new Set(), u = new URLSearchParams(), m = () => n || (n = new Promise(async (y, c) => {
|
|
75
|
+
var g;
|
|
76
|
+
await (t = f.createElement("script")), u.set("libraries", [...p] + "");
|
|
77
|
+
for (o in e)
|
|
78
|
+
u.set(o.replace(/[A-Z]/g, (b) => "_" + b[0].toLowerCase()), e[o]);
|
|
79
|
+
u.set("callback", a + ".maps." + i), Je(t, "https://maps.googleapis.com/maps/api/js?" + u), h[i] = y, t.onerror = () => n = c(Error(r + " could not load.")), t.nonce = ((g = f.querySelector("script[nonce]")) == null ? void 0 : g.nonce) || "", f.head.append(t);
|
|
80
|
+
}));
|
|
81
|
+
h[s] ? console.warn(r + " only loads once. Ignoring:", e) : h[s] = (y, ...c) => p.add(y) && m().then(() => h[s](y, ...c));
|
|
82
|
+
}, $e = (e) => `The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(e)}) will be ignored.`, qe = (e) => `The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(e)}) will be ignored.`, Ze = "No options were set before calling importLibrary. Make sure to configure the loader using setOptions().", We = "There already is a script loading the Google Maps JavaScript API, and no google.maps.importLibrary function is defined. @googlemaps/js-api-loader will proceed to bootstrap the API with the specified options, but the existing script might cause problems using the API. Make sure to remove the script loading the API.", Pe = process.env.NODE_ENV !== "production", ue = Pe ? (e) => {
|
|
83
|
+
console.warn(`[@googlemaps/js-api-loader] ${e}`);
|
|
84
|
+
} : () => {
|
|
85
|
+
}, Ke = Pe ? (e) => {
|
|
86
|
+
console.info(`[@googlemaps/js-api-loader] ${e}`);
|
|
87
|
+
} : () => {
|
|
88
|
+
}, Ye = process.env.NODE_ENV !== "production";
|
|
89
|
+
let re = !1;
|
|
90
|
+
function Xe(e) {
|
|
91
|
+
if (re) {
|
|
92
|
+
ue($e(e));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
en(e), re = !0;
|
|
96
|
+
}
|
|
97
|
+
async function Qe(e) {
|
|
98
|
+
var n, t;
|
|
99
|
+
if (re || ue(Ze), !((t = (n = window == null ? void 0 : window.google) == null ? void 0 : n.maps) != null && t.importLibrary))
|
|
100
|
+
throw new Error("google.maps.importLibrary is not installed.");
|
|
101
|
+
return await google.maps.importLibrary(e);
|
|
102
|
+
}
|
|
103
|
+
function en(e) {
|
|
104
|
+
var t, o;
|
|
105
|
+
const n = !!((o = (t = window.google) == null ? void 0 : t.maps) != null && o.importLibrary);
|
|
106
|
+
n ? Ke(qe(e)) : Ye && document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]') && ue(We), n || Ve(e);
|
|
107
|
+
}
|
|
108
|
+
const T = {
|
|
109
|
+
NOT_LOADED: "NOT_LOADED",
|
|
110
|
+
LOADING: "LOADING",
|
|
111
|
+
LOADED: "LOADED",
|
|
112
|
+
FAILED: "FAILED",
|
|
113
|
+
AUTH_FAILURE: "AUTH_FAILURE"
|
|
114
|
+
}, nn = "GMP_visgl_rgmlibrary_v1_default", tn = [
|
|
115
|
+
`gmp_visgl_reactgooglemaps_v${He}`
|
|
116
|
+
], V = A.createContext(null);
|
|
117
|
+
let j = T.NOT_LOADED, Y;
|
|
118
|
+
const ae = /* @__PURE__ */ new Set();
|
|
119
|
+
function X(e) {
|
|
120
|
+
e !== j && (j = e, ae.forEach((n) => n(j)));
|
|
121
|
+
}
|
|
122
|
+
function on() {
|
|
123
|
+
const [e, n] = k({});
|
|
124
|
+
return { mapInstances: e, addMapInstance: (a, s = "default") => {
|
|
125
|
+
n((i) => Object.assign(Object.assign({}, i), { [s]: a }));
|
|
126
|
+
}, removeMapInstance: (a = "default") => {
|
|
127
|
+
n((s) => {
|
|
128
|
+
var i = a;
|
|
129
|
+
s[i];
|
|
130
|
+
var f = R(s, [typeof i == "symbol" ? i : i + ""]);
|
|
131
|
+
return f;
|
|
132
|
+
});
|
|
133
|
+
}, clearMapInstances: () => {
|
|
134
|
+
n({});
|
|
135
|
+
} };
|
|
136
|
+
}
|
|
137
|
+
function rn() {
|
|
138
|
+
const [e, n] = k({});
|
|
139
|
+
return {
|
|
140
|
+
map3dInstances: e,
|
|
141
|
+
addMap3DInstance: (a, s = "default") => {
|
|
142
|
+
n((i) => Object.assign(Object.assign({}, i), { [s]: a }));
|
|
143
|
+
},
|
|
144
|
+
removeMap3DInstance: (a = "default") => {
|
|
145
|
+
n((s) => {
|
|
146
|
+
var i = a;
|
|
147
|
+
s[i];
|
|
148
|
+
var f = R(s, [typeof i == "symbol" ? i : i + ""]);
|
|
149
|
+
return f;
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
clearMap3DInstances: () => {
|
|
153
|
+
n({});
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function an(e) {
|
|
158
|
+
const { onLoad: n, onError: t, apiKey: o, version: r, libraries: a = [], region: s, language: i, authReferrerPolicy: f, channel: d, solutionChannel: l, fetchAppCheckToken: h } = e, [p, u] = k(j), [m, y] = De((b, E) => b[E.name] ? b : Object.assign(Object.assign({}, b), { [E.name]: E.value }), {}), c = N(() => {
|
|
159
|
+
const b = {
|
|
160
|
+
apiKey: o,
|
|
161
|
+
version: r,
|
|
162
|
+
libraries: a.join(","),
|
|
163
|
+
region: s,
|
|
164
|
+
language: i,
|
|
165
|
+
authReferrerPolicy: f,
|
|
166
|
+
channel: d,
|
|
167
|
+
solutionChannel: l
|
|
168
|
+
};
|
|
169
|
+
return JSON.stringify(b);
|
|
170
|
+
}, [
|
|
171
|
+
o,
|
|
172
|
+
r,
|
|
173
|
+
a,
|
|
174
|
+
s,
|
|
175
|
+
i,
|
|
176
|
+
f,
|
|
177
|
+
d,
|
|
178
|
+
l
|
|
179
|
+
]), g = ce((b) => ve(this, void 0, void 0, function* () {
|
|
180
|
+
if (m[b])
|
|
181
|
+
return m[b];
|
|
182
|
+
const E = yield Qe(b);
|
|
183
|
+
return y({ name: b, value: E }), E;
|
|
184
|
+
}), [m]);
|
|
185
|
+
return C(() => (ae.add(u), u(j), () => {
|
|
186
|
+
ae.delete(u);
|
|
187
|
+
}), []), C(
|
|
188
|
+
() => {
|
|
189
|
+
ve(this, void 0, void 0, function* () {
|
|
190
|
+
var b, E;
|
|
191
|
+
try {
|
|
192
|
+
Y && Y !== c && console.warn("The Google Maps JavaScript API has already been loaded with different parameters. The new parameters will be ignored. If you need to use different parameters, please refresh the page.");
|
|
193
|
+
const M = ["core", "maps", ...a];
|
|
194
|
+
if (!((E = (b = window.google) === null || b === void 0 ? void 0 : b.maps) === null || E === void 0) && E.importLibrary) {
|
|
195
|
+
Y || X(T.LOADED), yield Promise.all(M.map((v) => g(v))), n && n();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (j === T.LOADING || j === T.LOADED) {
|
|
199
|
+
j === T.LOADED && n && n();
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
Y = c, X(T.LOADING);
|
|
203
|
+
const D = Object.fromEntries(Object.entries({
|
|
204
|
+
key: o,
|
|
205
|
+
v: r,
|
|
206
|
+
libraries: a,
|
|
207
|
+
region: s,
|
|
208
|
+
language: i,
|
|
209
|
+
authReferrerPolicy: f
|
|
210
|
+
}).filter(([, v]) => v !== void 0));
|
|
211
|
+
d !== void 0 && d >= 0 && d <= 999 && (D.channel = String(d)), l === void 0 ? D.solutionChannel = nn : l !== "" && (D.solutionChannel = l), Xe(D), yield Promise.all(M.map((v) => g(v))), X(T.LOADED), n && n();
|
|
212
|
+
} catch (M) {
|
|
213
|
+
X(T.FAILED), t ? t(M) : console.error("The Google Maps JavaScript API failed to load.", M);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
},
|
|
217
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
218
|
+
[c, n, t, g, a]
|
|
219
|
+
), C(() => {
|
|
220
|
+
if (p !== T.LOADED)
|
|
221
|
+
return;
|
|
222
|
+
const b = google.maps.Settings.getInstance();
|
|
223
|
+
h ? b.fetchAppCheckToken = h : b.fetchAppCheckToken && (b.fetchAppCheckToken = null);
|
|
224
|
+
}, [p, h]), {
|
|
225
|
+
status: p,
|
|
226
|
+
loadedLibraries: m,
|
|
227
|
+
importLibrary: g
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function sn(e) {
|
|
231
|
+
return N(() => e.disableUsageAttribution ? null : tn, [e.disableUsageAttribution]);
|
|
232
|
+
}
|
|
233
|
+
const St = (e) => {
|
|
234
|
+
const { children: n } = e, t = R(e, ["children"]), { mapInstances: o, addMapInstance: r, removeMapInstance: a, clearMapInstances: s } = on(), { map3dInstances: i, addMap3DInstance: f, removeMap3DInstance: d, clearMap3DInstances: l } = rn(), { status: h, loadedLibraries: p, importLibrary: u } = an(t), m = sn(t), y = N(() => ({
|
|
235
|
+
mapInstances: o,
|
|
236
|
+
addMapInstance: r,
|
|
237
|
+
removeMapInstance: a,
|
|
238
|
+
clearMapInstances: s,
|
|
239
|
+
map3dInstances: i,
|
|
240
|
+
addMap3DInstance: f,
|
|
241
|
+
removeMap3DInstance: d,
|
|
242
|
+
clearMap3DInstances: l,
|
|
243
|
+
status: h,
|
|
244
|
+
loadedLibraries: p,
|
|
245
|
+
importLibrary: u,
|
|
246
|
+
internalUsageAttributionIds: m
|
|
247
|
+
}), [
|
|
248
|
+
o,
|
|
249
|
+
r,
|
|
250
|
+
a,
|
|
251
|
+
s,
|
|
252
|
+
i,
|
|
253
|
+
f,
|
|
254
|
+
d,
|
|
255
|
+
l,
|
|
256
|
+
h,
|
|
257
|
+
p,
|
|
258
|
+
u,
|
|
259
|
+
m
|
|
260
|
+
]);
|
|
261
|
+
return A.createElement(V.Provider, { value: y }, n);
|
|
262
|
+
};
|
|
263
|
+
function ln(e, n) {
|
|
264
|
+
for (const t of gn) {
|
|
265
|
+
const o = n[t], r = Ie[t];
|
|
266
|
+
C(() => {
|
|
267
|
+
if (!e || !o)
|
|
268
|
+
return;
|
|
269
|
+
const a = google.maps.event.addListener(e, r, (s) => {
|
|
270
|
+
o(cn(r, e, s));
|
|
271
|
+
});
|
|
272
|
+
return () => a.remove();
|
|
273
|
+
}, [e, r, o]);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function cn(e, n, t) {
|
|
277
|
+
var o;
|
|
278
|
+
const r = {
|
|
279
|
+
type: e,
|
|
280
|
+
map: n,
|
|
281
|
+
detail: {},
|
|
282
|
+
stoppable: !1,
|
|
283
|
+
stop: () => {
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
if (un.includes(e)) {
|
|
287
|
+
const a = r, s = n.getCenter(), i = n.getZoom(), f = n.getHeading() || 0, d = n.getTilt() || 0, l = n.getBounds();
|
|
288
|
+
return (!s || !l || !Number.isFinite(i)) && console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"), a.detail = {
|
|
289
|
+
center: (s == null ? void 0 : s.toJSON()) || { lat: 0, lng: 0 },
|
|
290
|
+
zoom: i || 0,
|
|
291
|
+
heading: f,
|
|
292
|
+
tilt: d,
|
|
293
|
+
bounds: (l == null ? void 0 : l.toJSON()) || {
|
|
294
|
+
north: 90,
|
|
295
|
+
east: 180,
|
|
296
|
+
south: -90,
|
|
297
|
+
west: -180
|
|
298
|
+
}
|
|
299
|
+
}, a;
|
|
300
|
+
} else if (dn.includes(e)) {
|
|
301
|
+
if (!t)
|
|
302
|
+
throw new Error("[createEvent] mouse events must provide a srcEvent");
|
|
303
|
+
const a = r;
|
|
304
|
+
return a.domEvent = t.domEvent, a.stoppable = !0, a.stop = () => t.stop(), a.detail = {
|
|
305
|
+
latLng: ((o = t.latLng) === null || o === void 0 ? void 0 : o.toJSON()) || null,
|
|
306
|
+
placeId: t.placeId
|
|
307
|
+
}, a;
|
|
308
|
+
}
|
|
309
|
+
return r;
|
|
310
|
+
}
|
|
311
|
+
const Ie = {
|
|
312
|
+
onBoundsChanged: "bounds_changed",
|
|
313
|
+
onCenterChanged: "center_changed",
|
|
314
|
+
onClick: "click",
|
|
315
|
+
onContextmenu: "contextmenu",
|
|
316
|
+
onDblclick: "dblclick",
|
|
317
|
+
onDrag: "drag",
|
|
318
|
+
onDragend: "dragend",
|
|
319
|
+
onDragstart: "dragstart",
|
|
320
|
+
onHeadingChanged: "heading_changed",
|
|
321
|
+
onIdle: "idle",
|
|
322
|
+
onIsFractionalZoomEnabledChanged: "isfractionalzoomenabled_changed",
|
|
323
|
+
onMapCapabilitiesChanged: "mapcapabilities_changed",
|
|
324
|
+
onMapTypeIdChanged: "maptypeid_changed",
|
|
325
|
+
onMousemove: "mousemove",
|
|
326
|
+
onMouseout: "mouseout",
|
|
327
|
+
onMouseover: "mouseover",
|
|
328
|
+
onProjectionChanged: "projection_changed",
|
|
329
|
+
onRenderingTypeChanged: "renderingtype_changed",
|
|
330
|
+
onTilesLoaded: "tilesloaded",
|
|
331
|
+
onTiltChanged: "tilt_changed",
|
|
332
|
+
onZoomChanged: "zoom_changed",
|
|
333
|
+
// note: onCameraChanged is an alias for the bounds_changed event,
|
|
334
|
+
// since that is going to be fired in every situation where the camera is
|
|
335
|
+
// updated.
|
|
336
|
+
onCameraChanged: "bounds_changed"
|
|
337
|
+
}, un = [
|
|
338
|
+
"bounds_changed",
|
|
339
|
+
"center_changed",
|
|
340
|
+
"heading_changed",
|
|
341
|
+
"tilt_changed",
|
|
342
|
+
"zoom_changed"
|
|
343
|
+
], dn = [
|
|
344
|
+
"click",
|
|
345
|
+
"contextmenu",
|
|
346
|
+
"dblclick",
|
|
347
|
+
"mousemove",
|
|
348
|
+
"mouseout",
|
|
349
|
+
"mouseover"
|
|
350
|
+
], gn = Object.keys(Ie);
|
|
351
|
+
function Z(e, n) {
|
|
352
|
+
const t = x(e);
|
|
353
|
+
return n(e, t.current) || (t.current = e), t.current;
|
|
354
|
+
}
|
|
355
|
+
function fn(e, n, t) {
|
|
356
|
+
C(e, [Z(n, t)]);
|
|
357
|
+
}
|
|
358
|
+
function _e(e, n) {
|
|
359
|
+
fn(e, n, q);
|
|
360
|
+
}
|
|
361
|
+
const mn = /* @__PURE__ */ new Set([
|
|
362
|
+
"backgroundColor",
|
|
363
|
+
"clickableIcons",
|
|
364
|
+
"controlSize",
|
|
365
|
+
"disableDefaultUI",
|
|
366
|
+
"disableDoubleClickZoom",
|
|
367
|
+
"draggable",
|
|
368
|
+
"draggableCursor",
|
|
369
|
+
"draggingCursor",
|
|
370
|
+
"fullscreenControl",
|
|
371
|
+
"fullscreenControlOptions",
|
|
372
|
+
"gestureHandling",
|
|
373
|
+
"headingInteractionEnabled",
|
|
374
|
+
"isFractionalZoomEnabled",
|
|
375
|
+
"keyboardShortcuts",
|
|
376
|
+
"mapTypeControl",
|
|
377
|
+
"mapTypeControlOptions",
|
|
378
|
+
"mapTypeId",
|
|
379
|
+
"maxZoom",
|
|
380
|
+
"minZoom",
|
|
381
|
+
"noClear",
|
|
382
|
+
"panControl",
|
|
383
|
+
"panControlOptions",
|
|
384
|
+
"restriction",
|
|
385
|
+
"rotateControl",
|
|
386
|
+
"rotateControlOptions",
|
|
387
|
+
"scaleControl",
|
|
388
|
+
"scaleControlOptions",
|
|
389
|
+
"scrollwheel",
|
|
390
|
+
"streetView",
|
|
391
|
+
"streetViewControl",
|
|
392
|
+
"streetViewControlOptions",
|
|
393
|
+
"styles",
|
|
394
|
+
"tiltInteractionEnabled",
|
|
395
|
+
"zoomControl",
|
|
396
|
+
"zoomControlOptions"
|
|
397
|
+
]);
|
|
398
|
+
function pn(e, n) {
|
|
399
|
+
const t = {}, o = Object.keys(n);
|
|
400
|
+
for (const r of o)
|
|
401
|
+
mn.has(r) && (t[r] = n[r]);
|
|
402
|
+
_e(() => {
|
|
403
|
+
e && e.setOptions(t);
|
|
404
|
+
}, [t]);
|
|
405
|
+
}
|
|
406
|
+
function Se() {
|
|
407
|
+
var e;
|
|
408
|
+
return ((e = H(V)) === null || e === void 0 ? void 0 : e.status) || T.NOT_LOADED;
|
|
409
|
+
}
|
|
410
|
+
function hn(e, n) {
|
|
411
|
+
const { viewport: t, viewState: o } = n, r = !!t;
|
|
412
|
+
return J(() => {
|
|
413
|
+
if (!e || !o)
|
|
414
|
+
return;
|
|
415
|
+
const { latitude: a, longitude: s, bearing: i, pitch: f, zoom: d } = o;
|
|
416
|
+
e.moveCamera({
|
|
417
|
+
center: { lat: a, lng: s },
|
|
418
|
+
heading: i,
|
|
419
|
+
tilt: f,
|
|
420
|
+
zoom: d + 1
|
|
421
|
+
});
|
|
422
|
+
}, [e, o]), r;
|
|
423
|
+
}
|
|
424
|
+
function vn(e) {
|
|
425
|
+
return !e || typeof e != "object" || !("lat" in e && "lng" in e) ? !1 : Number.isFinite(e.lat) && Number.isFinite(e.lng);
|
|
426
|
+
}
|
|
427
|
+
function ke(e, n) {
|
|
428
|
+
if (!e || !n)
|
|
429
|
+
return !1;
|
|
430
|
+
const t = ee(e), o = ee(n);
|
|
431
|
+
return !(t.lat !== o.lat || t.lng !== o.lng);
|
|
432
|
+
}
|
|
433
|
+
function ee(e) {
|
|
434
|
+
return vn(e) ? e : e.toJSON();
|
|
435
|
+
}
|
|
436
|
+
function ye(e) {
|
|
437
|
+
if ("north" in e && "south" in e && "east" in e && "west" in e)
|
|
438
|
+
return e;
|
|
439
|
+
const n = e.getNorthEast().toJSON(), t = e.getSouthWest().toJSON();
|
|
440
|
+
return {
|
|
441
|
+
north: n.lat,
|
|
442
|
+
east: n.lng,
|
|
443
|
+
south: t.lat,
|
|
444
|
+
west: t.lng
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
function yn(e, n) {
|
|
448
|
+
if (!e || !n)
|
|
449
|
+
return !1;
|
|
450
|
+
const t = ye(e), o = ye(n);
|
|
451
|
+
return t.north === o.north && t.south === o.south && t.east === o.east && t.west === o.west;
|
|
452
|
+
}
|
|
453
|
+
function we(e, n) {
|
|
454
|
+
if (!e || !n)
|
|
455
|
+
return e === n;
|
|
456
|
+
const t = "getArray" in n ? n.getArray() : n;
|
|
457
|
+
if (e.length !== t.length)
|
|
458
|
+
return !1;
|
|
459
|
+
for (let o = 0; o < e.length; o++)
|
|
460
|
+
if (!ke(e[o], t[o]))
|
|
461
|
+
return !1;
|
|
462
|
+
return !0;
|
|
463
|
+
}
|
|
464
|
+
function bn(e, n) {
|
|
465
|
+
if (!e || !n)
|
|
466
|
+
return e === n;
|
|
467
|
+
const t = "getArray" in n ? n.getArray().map((o) => o.getArray()) : n;
|
|
468
|
+
if (e.length !== t.length)
|
|
469
|
+
return !1;
|
|
470
|
+
for (let o = 0; o < e.length; o++)
|
|
471
|
+
if (!we(e[o], t[o]))
|
|
472
|
+
return !1;
|
|
473
|
+
return !0;
|
|
474
|
+
}
|
|
475
|
+
function En(e, n, t) {
|
|
476
|
+
const o = t.center ? ee(t.center) : null;
|
|
477
|
+
let r = null, a = null;
|
|
478
|
+
o && Number.isFinite(o.lat) && Number.isFinite(o.lng) && (r = o.lat, a = o.lng);
|
|
479
|
+
const s = Number.isFinite(t.zoom) ? t.zoom : null, i = Number.isFinite(t.heading) ? t.heading : null, f = Number.isFinite(t.tilt) ? t.tilt : null;
|
|
480
|
+
J(() => {
|
|
481
|
+
if (!e)
|
|
482
|
+
return;
|
|
483
|
+
const d = {};
|
|
484
|
+
let l = !1;
|
|
485
|
+
r !== null && a !== null && (n.current.center.lat !== r || n.current.center.lng !== a) && (d.center = { lat: r, lng: a }, l = !0), s !== null && n.current.zoom !== s && (d.zoom = s, l = !0), i !== null && n.current.heading !== i && (d.heading = i, l = !0), f !== null && n.current.tilt !== f && (d.tilt = f, l = !0), l && e.moveCamera(d);
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
const Cn = () => {
|
|
489
|
+
const e = {
|
|
490
|
+
position: "absolute",
|
|
491
|
+
top: 0,
|
|
492
|
+
left: 0,
|
|
493
|
+
bottom: 0,
|
|
494
|
+
right: 0,
|
|
495
|
+
zIndex: 999,
|
|
496
|
+
display: "flex",
|
|
497
|
+
flexFlow: "column nowrap",
|
|
498
|
+
textAlign: "center",
|
|
499
|
+
justifyContent: "center",
|
|
500
|
+
fontSize: ".8rem",
|
|
501
|
+
color: "rgba(0,0,0,0.6)",
|
|
502
|
+
background: "#dddddd",
|
|
503
|
+
padding: "1rem 1.5rem"
|
|
504
|
+
};
|
|
505
|
+
return A.createElement(
|
|
506
|
+
"div",
|
|
507
|
+
{ style: e },
|
|
508
|
+
A.createElement("h2", null, "Error: AuthFailure"),
|
|
509
|
+
A.createElement(
|
|
510
|
+
"p",
|
|
511
|
+
null,
|
|
512
|
+
"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ",
|
|
513
|
+
A.createElement("code", null, "APIProvider.apiKey"),
|
|
514
|
+
" prop is correct. Check the error-message in the console for further details."
|
|
515
|
+
)
|
|
516
|
+
);
|
|
517
|
+
};
|
|
518
|
+
function ie() {
|
|
519
|
+
const [e, n] = k(null), t = ce((o) => n(o), [n]);
|
|
520
|
+
return [e, t];
|
|
521
|
+
}
|
|
522
|
+
function Te() {
|
|
523
|
+
return Se() === T.LOADED;
|
|
524
|
+
}
|
|
525
|
+
function Ne() {
|
|
526
|
+
const [, e] = De((n) => n + 1, 0);
|
|
527
|
+
return e;
|
|
528
|
+
}
|
|
529
|
+
function On(e, n) {
|
|
530
|
+
const t = e.getCenter(), o = e.getZoom(), r = e.getHeading() || 0, a = e.getTilt() || 0, s = e.getBounds();
|
|
531
|
+
(!t || !s || !Number.isFinite(o)) && console.warn("[useTrackedCameraState] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"), Object.assign(n.current, {
|
|
532
|
+
center: (t == null ? void 0 : t.toJSON()) || { lat: 0, lng: 0 },
|
|
533
|
+
zoom: o || 0,
|
|
534
|
+
heading: r,
|
|
535
|
+
tilt: a
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
function Mn(e) {
|
|
539
|
+
const n = Ne(), t = x({
|
|
540
|
+
center: { lat: 0, lng: 0 },
|
|
541
|
+
heading: 0,
|
|
542
|
+
tilt: 0,
|
|
543
|
+
zoom: 0
|
|
544
|
+
});
|
|
545
|
+
return C(() => {
|
|
546
|
+
if (!e)
|
|
547
|
+
return;
|
|
548
|
+
const o = google.maps.event.addListener(e, "bounds_changed", () => {
|
|
549
|
+
On(e, t), n();
|
|
550
|
+
});
|
|
551
|
+
return () => o.remove();
|
|
552
|
+
}, [e, n]), t;
|
|
553
|
+
}
|
|
554
|
+
class Q {
|
|
555
|
+
static has(n) {
|
|
556
|
+
return this.entries[n] && this.entries[n].length > 0;
|
|
557
|
+
}
|
|
558
|
+
static pop(n) {
|
|
559
|
+
return this.entries[n] && this.entries[n].pop() || null;
|
|
560
|
+
}
|
|
561
|
+
static push(n, t) {
|
|
562
|
+
this.entries[n] || (this.entries[n] = []), this.entries[n].push(t);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
Q.entries = {};
|
|
566
|
+
function An(e, n) {
|
|
567
|
+
const t = Te(), [o, r] = k(null), [a, s] = ie(), i = Mn(o), { id: f, defaultBounds: d, defaultCenter: l, defaultZoom: h, defaultHeading: p, defaultTilt: u, reuseMaps: m, renderingType: y, colorScheme: c } = e, g = R(e, ["id", "defaultBounds", "defaultCenter", "defaultZoom", "defaultHeading", "defaultTilt", "reuseMaps", "renderingType", "colorScheme"]), b = e.zoom !== void 0 || e.defaultZoom !== void 0, E = e.center !== void 0 || e.defaultCenter !== void 0;
|
|
568
|
+
!d && (!b || !E) && console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"), !g.center && l && (g.center = l), !g.zoom && Number.isFinite(h) && (g.zoom = h), !g.heading && Number.isFinite(p) && (g.heading = p), !g.tilt && Number.isFinite(u) && (g.tilt = u);
|
|
569
|
+
const M = g.internalUsageAttributionIds;
|
|
570
|
+
M == null ? g.internalUsageAttributionIds = n.internalUsageAttributionIds : g.internalUsageAttributionIds = [
|
|
571
|
+
...n.internalUsageAttributionIds || [],
|
|
572
|
+
...M
|
|
573
|
+
];
|
|
574
|
+
for (const v of Object.keys(g))
|
|
575
|
+
g[v] === void 0 && delete g[v];
|
|
576
|
+
const D = x(void 0);
|
|
577
|
+
return C(
|
|
578
|
+
() => {
|
|
579
|
+
if (!a || !t)
|
|
580
|
+
return;
|
|
581
|
+
const { addMapInstance: v, removeMapInstance: O } = n, { mapId: P } = e, _ = `${P || "default"}:${y || "default"}:${c || "LIGHT"}`;
|
|
582
|
+
let L, w;
|
|
583
|
+
if (m && Q.has(_) ? (w = Q.pop(_), L = w.getDiv(), a.appendChild(L), w.setOptions(g), setTimeout(() => w.moveCamera({}), 0)) : (L = document.createElement("div"), L.style.height = "100%", a.appendChild(L), w = new google.maps.Map(L, Object.assign(Object.assign(Object.assign({}, g), y ? { renderingType: y } : {}), c ? { colorScheme: c } : {}))), r(w), v(w, f), d) {
|
|
584
|
+
const { padding: W } = d, K = R(d, ["padding"]);
|
|
585
|
+
w.fitBounds(K, W);
|
|
586
|
+
} else (!b || !E) && w.fitBounds({ east: 180, west: -180, south: -90, north: 90 });
|
|
587
|
+
if (D.current) {
|
|
588
|
+
const { mapId: W, cameraState: K } = D.current;
|
|
589
|
+
W !== P && w.moveCamera(K);
|
|
590
|
+
}
|
|
591
|
+
return () => {
|
|
592
|
+
D.current = {
|
|
593
|
+
mapId: P,
|
|
594
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
595
|
+
cameraState: i.current
|
|
596
|
+
}, L.remove(), m ? Q.push(_, w) : google.maps.event.clearInstanceListeners(w), r(null), O(f);
|
|
597
|
+
};
|
|
598
|
+
},
|
|
599
|
+
// some dependencies are ignored in the list below:
|
|
600
|
+
// - defaultBounds and the default* camera props will only be used once, and
|
|
601
|
+
// changes should be ignored
|
|
602
|
+
// - mapOptions has special hooks that take care of updating the options
|
|
603
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
604
|
+
[
|
|
605
|
+
a,
|
|
606
|
+
t,
|
|
607
|
+
f,
|
|
608
|
+
// these props can't be changed after initialization and require a new
|
|
609
|
+
// instance to be created
|
|
610
|
+
e.mapId,
|
|
611
|
+
e.renderingType,
|
|
612
|
+
e.colorScheme
|
|
613
|
+
]
|
|
614
|
+
), [o, s, i];
|
|
615
|
+
}
|
|
616
|
+
const Re = A.createContext(null), Dn = (e) => {
|
|
617
|
+
const { children: n, id: t, className: o, style: r } = e, a = H(V), s = Se();
|
|
618
|
+
if (!a)
|
|
619
|
+
throw new Error("<Map> can only be used inside an <ApiProvider> component.");
|
|
620
|
+
const [i, f, d] = An(e, a);
|
|
621
|
+
En(i, d, e), ln(i, e), pn(i, e);
|
|
622
|
+
const l = hn(i, e), h = !!e.controlled;
|
|
623
|
+
C(() => {
|
|
624
|
+
if (i)
|
|
625
|
+
return l && i.setOptions({ disableDefaultUI: !0 }), (l || h) && i.setOptions({
|
|
626
|
+
gestureHandling: "none",
|
|
627
|
+
keyboardShortcuts: !1
|
|
628
|
+
}), () => {
|
|
629
|
+
i.setOptions({
|
|
630
|
+
gestureHandling: e.gestureHandling,
|
|
631
|
+
keyboardShortcuts: e.keyboardShortcuts
|
|
632
|
+
});
|
|
633
|
+
};
|
|
634
|
+
}, [
|
|
635
|
+
i,
|
|
636
|
+
l,
|
|
637
|
+
h,
|
|
638
|
+
e.gestureHandling,
|
|
639
|
+
e.keyboardShortcuts
|
|
640
|
+
]);
|
|
641
|
+
const p = e.center ? ee(e.center) : null;
|
|
642
|
+
let u = null, m = null;
|
|
643
|
+
p && Number.isFinite(p.lat) && Number.isFinite(p.lng) && (u = p.lat, m = p.lng);
|
|
644
|
+
const y = N(() => {
|
|
645
|
+
var b, E, M;
|
|
646
|
+
return {
|
|
647
|
+
center: { lat: u ?? 0, lng: m ?? 0 },
|
|
648
|
+
zoom: (b = e.zoom) !== null && b !== void 0 ? b : 0,
|
|
649
|
+
heading: (E = e.heading) !== null && E !== void 0 ? E : 0,
|
|
650
|
+
tilt: (M = e.tilt) !== null && M !== void 0 ? M : 0
|
|
651
|
+
};
|
|
652
|
+
}, [u, m, e.zoom, e.heading, e.tilt]);
|
|
653
|
+
J(() => {
|
|
654
|
+
if (!i || !h)
|
|
655
|
+
return;
|
|
656
|
+
i.moveCamera(y);
|
|
657
|
+
const b = i.addListener("bounds_changed", () => {
|
|
658
|
+
i.moveCamera(y);
|
|
659
|
+
});
|
|
660
|
+
return () => b.remove();
|
|
661
|
+
}, [i, h, y]);
|
|
662
|
+
const c = N(() => Object.assign({
|
|
663
|
+
width: "100%",
|
|
664
|
+
height: "100%",
|
|
665
|
+
position: "relative",
|
|
666
|
+
// when using deckgl, the map should be sent to the back
|
|
667
|
+
zIndex: l ? -1 : 0
|
|
668
|
+
}, r), [r, l]), g = N(() => ({ map: i }), [i]);
|
|
669
|
+
return s === T.AUTH_FAILURE ? A.createElement(
|
|
670
|
+
"div",
|
|
671
|
+
{ style: Object.assign({ position: "relative" }, o ? {} : c), className: o },
|
|
672
|
+
A.createElement(Cn, null)
|
|
673
|
+
) : A.createElement("div", Object.assign({ ref: f, "data-testid": "map", style: o ? void 0 : c, className: o }, t ? { id: t } : {}), i ? A.createElement(Re.Provider, { value: g }, n) : null);
|
|
674
|
+
};
|
|
675
|
+
Dn.deckGLViewProps = !0;
|
|
676
|
+
const be = /* @__PURE__ */ new Set();
|
|
677
|
+
function Ln(...e) {
|
|
678
|
+
const n = JSON.stringify(e);
|
|
679
|
+
be.has(n) || (be.add(n), console.error(...e));
|
|
680
|
+
}
|
|
681
|
+
const $ = (e = null) => {
|
|
682
|
+
const n = H(V), { map: t } = H(Re) || {};
|
|
683
|
+
if (n === null)
|
|
684
|
+
return Ln("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."), null;
|
|
685
|
+
const { mapInstances: o } = n;
|
|
686
|
+
return e !== null ? o[e] || null : t || o.default || null;
|
|
687
|
+
};
|
|
688
|
+
function ne(e) {
|
|
689
|
+
const n = Te(), t = H(V);
|
|
690
|
+
return C(() => {
|
|
691
|
+
!n || !t || t.importLibrary(e);
|
|
692
|
+
}, [n, t, e]), (t == null ? void 0 : t.loadedLibraries[e]) || null;
|
|
693
|
+
}
|
|
694
|
+
var oe;
|
|
695
|
+
const { useLayoutEffect: Pn, useRef: In } = Ae, _n = (oe = Ae.useInsertionEffect) !== null && oe !== void 0 ? oe : Pn;
|
|
696
|
+
function Sn() {
|
|
697
|
+
throw new Error("useEffectEvent: invalid call during rendering.");
|
|
698
|
+
}
|
|
699
|
+
function kn(e) {
|
|
700
|
+
const n = In(Sn);
|
|
701
|
+
return _n(() => {
|
|
702
|
+
n.current = e;
|
|
703
|
+
}, [e]), ((...t) => n.current(...t));
|
|
704
|
+
}
|
|
705
|
+
const xe = kn, wn = () => {
|
|
706
|
+
};
|
|
707
|
+
function I(e, n, t) {
|
|
708
|
+
const o = xe(t ?? wn), r = !!t;
|
|
709
|
+
C(() => {
|
|
710
|
+
if (!e || !n || !r)
|
|
711
|
+
return;
|
|
712
|
+
const a = google.maps.event.addListener(e, n, o);
|
|
713
|
+
return () => a.remove();
|
|
714
|
+
}, [e, n, r]);
|
|
715
|
+
}
|
|
716
|
+
function S(e, n, t) {
|
|
717
|
+
C(() => {
|
|
718
|
+
e && (e[n] = t);
|
|
719
|
+
}, [e, n, t]);
|
|
720
|
+
}
|
|
721
|
+
const Tn = () => {
|
|
722
|
+
};
|
|
723
|
+
function se(e, n, t) {
|
|
724
|
+
const o = xe(t ?? Tn), r = !!t;
|
|
725
|
+
C(() => {
|
|
726
|
+
if (!e || !n || !r)
|
|
727
|
+
return;
|
|
728
|
+
const a = o;
|
|
729
|
+
return e.addEventListener(n, a), () => e.removeEventListener(n, a);
|
|
730
|
+
}, [e, n, r]);
|
|
731
|
+
}
|
|
732
|
+
class Nn {
|
|
733
|
+
constructor() {
|
|
734
|
+
this.renderedStyles = /* @__PURE__ */ new Set(), this.styleElement = null;
|
|
735
|
+
}
|
|
736
|
+
getStyleElement() {
|
|
737
|
+
return this.styleElement || (this.styleElement = document.createElement("style"), this.styleElement.setAttribute("data-rgm-anchor-styles", ""), document.head.appendChild(this.styleElement)), this.styleElement;
|
|
738
|
+
}
|
|
739
|
+
addAdvancedMarkerPointerEventsOverwrite() {
|
|
740
|
+
if (this.renderedStyles.has("marker-pointer-events"))
|
|
741
|
+
return;
|
|
742
|
+
const n = this.getStyleElement();
|
|
743
|
+
n.textContent += `
|
|
744
|
+
gmp-advanced-marker[data-origin='rgm'] {
|
|
745
|
+
pointer-events: none !important;
|
|
746
|
+
}
|
|
747
|
+
`, this.renderedStyles.add("marker-pointer-events");
|
|
748
|
+
}
|
|
749
|
+
cleanup() {
|
|
750
|
+
this.styleElement && (this.styleElement.remove(), this.styleElement = null, this.renderedStyles.clear());
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
const Rn = new Nn();
|
|
754
|
+
function xn(e, n) {
|
|
755
|
+
var t;
|
|
756
|
+
if (!(!((t = google == null ? void 0 : google.maps) === null || t === void 0) && t.version))
|
|
757
|
+
return;
|
|
758
|
+
const o = google.maps.version.split("."), r = parseInt(o[0], 10), a = parseInt(o[1], 10);
|
|
759
|
+
return r > e || r === e && a >= n;
|
|
760
|
+
}
|
|
761
|
+
const Bn = A.createContext(null), jn = {
|
|
762
|
+
BOTTOM: ["50%", "100%"]
|
|
763
|
+
}, Fn = B((e, n) => {
|
|
764
|
+
const { children: t, style: o, className: r, anchorPoint: a } = e, [s, i] = Un(e), f = N(() => s ? { marker: s } : null, [s]);
|
|
765
|
+
return F(n, () => s, [s]), i ? A.createElement(Bn.Provider, { value: f }, Le(A.createElement(zn, { anchorPoint: a, styles: o, className: r }, t), i)) : null;
|
|
766
|
+
});
|
|
767
|
+
Fn.displayName = "AdvancedMarker";
|
|
768
|
+
function le(e) {
|
|
769
|
+
return e.nodeType === Node.ELEMENT_NODE;
|
|
770
|
+
}
|
|
771
|
+
const zn = ({ children: e, styles: n, className: t }) => A.createElement("div", { className: t, style: n }, e);
|
|
772
|
+
function Un(e) {
|
|
773
|
+
const [n, t] = k(null), [o, r] = k(null), a = $(), s = ne("marker"), { children: i, onClick: f, className: d, onMouseEnter: l, onMouseLeave: h, onDrag: p, onDragStart: u, onDragEnd: m, collisionBehavior: y, clickable: c, draggable: g, position: b, title: E, zIndex: M, anchorPoint: D, anchorLeft: v, anchorTop: O } = e, P = je.count(i);
|
|
774
|
+
return C(() => {
|
|
775
|
+
if (!a || !s)
|
|
776
|
+
return;
|
|
777
|
+
const _ = new s.AdvancedMarkerElement();
|
|
778
|
+
_.map = a, t(_);
|
|
779
|
+
let L = null;
|
|
780
|
+
return P > 0 && (L = document.createElement("div"), _.content = L, r(L)), () => {
|
|
781
|
+
_.map = null, L == null || L.remove(), t(null), r(null);
|
|
782
|
+
};
|
|
783
|
+
}, [a, s, P]), C(() => {
|
|
784
|
+
!(n != null && n.content) || !le(n.content) || P > 0 || (n.content.className = d ?? "");
|
|
785
|
+
}, [n, d, P]), Gn(n, D, v, O, P > 0), S(n, "position", b), S(n, "title", E ?? ""), S(n, "zIndex", M), S(n, "collisionBehavior", y), C(() => {
|
|
786
|
+
n && (g !== void 0 ? n.gmpDraggable = g : p || u || m ? n.gmpDraggable = !0 : n.gmpDraggable = !1);
|
|
787
|
+
}, [n, g, p, m, u]), C(() => {
|
|
788
|
+
if (!n)
|
|
789
|
+
return;
|
|
790
|
+
const _ = c !== void 0 ? c : !!f || !!l || !!h;
|
|
791
|
+
n.gmpClickable = _, _ && (n != null && n.content) && le(n.content) && (n.content.style.pointerEvents = "all", f && (n.content.style.cursor = "pointer"));
|
|
792
|
+
}, [n, c, f, l, h]), I(n, "click", f), I(n, "drag", p), I(n, "dragstart", u), I(n, "dragend", m), se(n == null ? void 0 : n.element, "mouseenter", l), se(n == null ? void 0 : n.element, "mouseleave", h), [n, o];
|
|
793
|
+
}
|
|
794
|
+
function Gn(e, n, t, o, r) {
|
|
795
|
+
C(() => {
|
|
796
|
+
if (!e || !r)
|
|
797
|
+
return;
|
|
798
|
+
const a = xn(3, 62), s = e.content;
|
|
799
|
+
if (!(!s || !le(s))) {
|
|
800
|
+
if (t !== void 0 || o !== void 0) {
|
|
801
|
+
a || console.warn(`AdvancedMarker: The anchorLeft and anchorTop props are only supported in Google Maps API version 3.62 and above. The current version is ${google.maps.version}.`), e.anchorLeft = t, e.anchorTop = o, n !== void 0 && console.warn("AdvancedMarker: the anchorPoint prop is ignored when anchorLeft and/or anchorTop are set.");
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
if (n !== void 0) {
|
|
805
|
+
const [i, f] = n ?? jn.BOTTOM, d = `calc(-1 * ${i})`, l = `calc(-1 * ${f})`;
|
|
806
|
+
a ? (e.anchorLeft = d, e.anchorTop = l, s.style.transform = "") : (s.style.transform = `translate(50%, 100%) translate(${d}, ${l})`, e.dataset.origin = "rgm", Rn.addAdvancedMarkerPointerEventsOverwrite());
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}, [e, n, t, o, r]);
|
|
810
|
+
}
|
|
811
|
+
function Hn(e) {
|
|
812
|
+
var n, t, o;
|
|
813
|
+
const { onClick: r, onDrag: a, onDragStart: s, onDragEnd: i, onMouseOver: f, onMouseOut: d, onRadiusChanged: l, onCenterChanged: h, center: p, defaultCenter: u, radius: m, defaultRadius: y } = e, c = R(e, ["onClick", "onDrag", "onDragStart", "onDragEnd", "onMouseOver", "onMouseOut", "onRadiusChanged", "onCenterChanged", "center", "defaultCenter", "radius", "defaultRadius"]), [g, b] = k(null), E = $(), M = Z(Object.assign(Object.assign({}, c), { clickable: (n = c.clickable) !== null && n !== void 0 ? n : !!r, draggable: (t = c.draggable) !== null && t !== void 0 ? t : !!(a || s || i || h), editable: (o = c.editable) !== null && o !== void 0 ? o : !!l }), q);
|
|
814
|
+
return C(() => {
|
|
815
|
+
if (!E) {
|
|
816
|
+
E === void 0 && console.error("<Circle> has to be inside a Map component.");
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
const D = new google.maps.Circle(Object.assign(Object.assign({}, M), { center: p ?? u, radius: m ?? y }));
|
|
820
|
+
return D.setMap(E), b(D), () => {
|
|
821
|
+
D.setMap(null), b(null);
|
|
822
|
+
};
|
|
823
|
+
}, [E]), I(g, "click", r), I(g, "drag", a), I(g, "dragstart", s), I(g, "dragend", i), I(g, "mouseover", f), I(g, "mouseout", d), I(g, "radius_changed", l ? () => {
|
|
824
|
+
const D = g == null ? void 0 : g.getRadius();
|
|
825
|
+
D !== void 0 && l(D);
|
|
826
|
+
} : null), I(g, "center_changed", h ? () => {
|
|
827
|
+
h(g == null ? void 0 : g.getCenter());
|
|
828
|
+
} : null), C(() => {
|
|
829
|
+
g && g.setOptions(M);
|
|
830
|
+
}, [g, M]), C(() => {
|
|
831
|
+
!g || !p || ke(p, g.getCenter()) || g.setCenter(p);
|
|
832
|
+
}, [g, p]), C(() => {
|
|
833
|
+
!g || m === void 0 || m !== g.getRadius() && g.setRadius(m);
|
|
834
|
+
}, [g, m]), g;
|
|
835
|
+
}
|
|
836
|
+
const Jn = B((e, n) => {
|
|
837
|
+
const t = Hn(e);
|
|
838
|
+
return F(n, () => t, [t]), A.createElement(A.Fragment, null);
|
|
839
|
+
});
|
|
840
|
+
Jn.displayName = "Circle";
|
|
841
|
+
function Vn(e, n, t) {
|
|
842
|
+
if (n != null && typeof n != "object")
|
|
843
|
+
throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
|
|
844
|
+
const o = e.style;
|
|
845
|
+
if (t == null) {
|
|
846
|
+
if (n == null)
|
|
847
|
+
return;
|
|
848
|
+
for (const r in n)
|
|
849
|
+
n.hasOwnProperty(r) && Ee(o, r, n[r]);
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
for (const r in t)
|
|
853
|
+
t.hasOwnProperty(r) && (n == null || !n.hasOwnProperty(r)) && (r.indexOf("--") === 0 ? o.setProperty(r, "") : r === "float" ? o.cssFloat = "" : o[r] = "");
|
|
854
|
+
if (n != null)
|
|
855
|
+
for (const r in n) {
|
|
856
|
+
const a = n[r];
|
|
857
|
+
n.hasOwnProperty(r) && t[r] !== a && Ee(o, r, a);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
function Ee(e, n, t) {
|
|
861
|
+
const o = n.indexOf("--") === 0;
|
|
862
|
+
t == null || typeof t == "boolean" || t === "" ? o ? e.setProperty(n, "") : n === "float" ? e.cssFloat = "" : e[n] = "" : o ? e.setProperty(n, t) : typeof t == "number" && t !== 0 && !qn(n) ? e[n] = t + "px" : n === "float" ? e.cssFloat = t : e[n] = ("" + t).trim();
|
|
863
|
+
}
|
|
864
|
+
const $n = /* @__PURE__ */ new Set([
|
|
865
|
+
"animationIterationCount",
|
|
866
|
+
"aspectRatio",
|
|
867
|
+
"borderImageOutset",
|
|
868
|
+
"borderImageSlice",
|
|
869
|
+
"borderImageWidth",
|
|
870
|
+
"boxFlex",
|
|
871
|
+
"boxFlexGroup",
|
|
872
|
+
"boxOrdinalGroup",
|
|
873
|
+
"columnCount",
|
|
874
|
+
"columns",
|
|
875
|
+
"flex",
|
|
876
|
+
"flexGrow",
|
|
877
|
+
"flexPositive",
|
|
878
|
+
"flexShrink",
|
|
879
|
+
"flexNegative",
|
|
880
|
+
"flexOrder",
|
|
881
|
+
"gridArea",
|
|
882
|
+
"gridRow",
|
|
883
|
+
"gridRowEnd",
|
|
884
|
+
"gridRowSpan",
|
|
885
|
+
"gridRowStart",
|
|
886
|
+
"gridColumn",
|
|
887
|
+
"gridColumnEnd",
|
|
888
|
+
"gridColumnSpan",
|
|
889
|
+
"gridColumnStart",
|
|
890
|
+
"fontWeight",
|
|
891
|
+
"lineClamp",
|
|
892
|
+
"lineHeight",
|
|
893
|
+
"opacity",
|
|
894
|
+
"order",
|
|
895
|
+
"orphans",
|
|
896
|
+
"scale",
|
|
897
|
+
"tabSize",
|
|
898
|
+
"widows",
|
|
899
|
+
"zIndex",
|
|
900
|
+
"zoom",
|
|
901
|
+
"fillOpacity",
|
|
902
|
+
// SVG-related properties
|
|
903
|
+
"floodOpacity",
|
|
904
|
+
"stopOpacity",
|
|
905
|
+
"strokeDasharray",
|
|
906
|
+
"strokeDashoffset",
|
|
907
|
+
"strokeMiterlimit",
|
|
908
|
+
"strokeOpacity",
|
|
909
|
+
"strokeWidth"
|
|
910
|
+
]);
|
|
911
|
+
function qn(e) {
|
|
912
|
+
return $n.has(e);
|
|
913
|
+
}
|
|
914
|
+
function Ce(e) {
|
|
915
|
+
const n = e.getPaths(), t = [];
|
|
916
|
+
for (let o = 0; o < n.getLength(); o++)
|
|
917
|
+
t.push(n.getAt(o).getArray());
|
|
918
|
+
return t;
|
|
919
|
+
}
|
|
920
|
+
function Zn(e) {
|
|
921
|
+
var n, t, o;
|
|
922
|
+
const { onClick: r, onDrag: a, onDragStart: s, onDragEnd: i, onMouseOver: f, onMouseOut: d, onPathsChanged: l, polygon: h, encodedPaths: p, paths: u, defaultPaths: m } = e, y = R(e, ["onClick", "onDrag", "onDragStart", "onDragEnd", "onMouseOver", "onMouseOut", "onPathsChanged", "polygon", "encodedPaths", "paths", "defaultPaths"]), [c, g] = k(null), b = $(), E = ne("geometry"), M = x(!1), D = Z(Object.assign(Object.assign({}, y), { clickable: (n = y.clickable) !== null && n !== void 0 ? n : !!r, draggable: (t = y.draggable) !== null && t !== void 0 ? t : !!(a || s || i || l), editable: (o = y.editable) !== null && o !== void 0 ? o : !!l }), q);
|
|
923
|
+
return C(() => {
|
|
924
|
+
if (!b) {
|
|
925
|
+
b === void 0 && console.error("<Polygon> has to be inside a Map component.");
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
let v;
|
|
929
|
+
if (h) {
|
|
930
|
+
v = h;
|
|
931
|
+
const O = u ?? m;
|
|
932
|
+
O && Array.isArray(O) && v.setPaths(O), v.setOptions(D);
|
|
933
|
+
} else {
|
|
934
|
+
const O = u ?? m, P = Object.assign({}, D);
|
|
935
|
+
O && Array.isArray(O) && (P.paths = O), v = new google.maps.Polygon(P);
|
|
936
|
+
}
|
|
937
|
+
return v.setMap(b), g(v), () => {
|
|
938
|
+
v.setMap(null), g(null);
|
|
939
|
+
};
|
|
940
|
+
}, [b, h]), I(c, "click", r), I(c, "drag", a), I(c, "dragstart", s), I(c, "mouseover", f), I(c, "mouseout", d), I(c, "dragend", (v) => {
|
|
941
|
+
i == null || i(v), l && c && !M.current && l(Ce(c));
|
|
942
|
+
}), C(() => {
|
|
943
|
+
if (!c || !l)
|
|
944
|
+
return;
|
|
945
|
+
const v = [], O = c.getPaths();
|
|
946
|
+
if (typeof O.getLength != "function" || typeof O.getAt != "function")
|
|
947
|
+
return;
|
|
948
|
+
const P = () => {
|
|
949
|
+
M.current || l(Ce(c));
|
|
950
|
+
}, _ = (L) => {
|
|
951
|
+
v.push(google.maps.event.addListener(L, "insert_at", P)), v.push(google.maps.event.addListener(L, "remove_at", P)), v.push(google.maps.event.addListener(L, "set_at", P));
|
|
952
|
+
};
|
|
953
|
+
for (let L = 0; L < O.getLength(); L++)
|
|
954
|
+
_(O.getAt(L));
|
|
955
|
+
return v.push(google.maps.event.addListener(O, "insert_at", (L) => {
|
|
956
|
+
_(O.getAt(L)), P();
|
|
957
|
+
})), v.push(google.maps.event.addListener(O, "set_at", (L) => {
|
|
958
|
+
_(O.getAt(L)), P();
|
|
959
|
+
})), v.push(google.maps.event.addListener(O, "remove_at", P)), () => {
|
|
960
|
+
v.forEach((L) => L.remove());
|
|
961
|
+
};
|
|
962
|
+
}, [
|
|
963
|
+
c,
|
|
964
|
+
l,
|
|
965
|
+
u,
|
|
966
|
+
p,
|
|
967
|
+
D.editable,
|
|
968
|
+
D.draggable
|
|
969
|
+
]), C(() => {
|
|
970
|
+
c && c.setOptions(D);
|
|
971
|
+
}, [c, D]), C(() => {
|
|
972
|
+
if (!c || !u || !Array.isArray(u))
|
|
973
|
+
return;
|
|
974
|
+
const v = u[0], O = Array.isArray(v) ? u : [u], P = c.getPaths();
|
|
975
|
+
bn(O, P) || (M.current = !0, c.setPaths(u), M.current = !1);
|
|
976
|
+
}, [c, u]), C(() => {
|
|
977
|
+
if (!c || !p || !E)
|
|
978
|
+
return;
|
|
979
|
+
M.current = !0;
|
|
980
|
+
const v = p.map((O) => E.encoding.decodePath(O));
|
|
981
|
+
c.setPaths(v), M.current = !1;
|
|
982
|
+
}, [c, p, E]), c;
|
|
983
|
+
}
|
|
984
|
+
const Wn = B((e, n) => {
|
|
985
|
+
const t = Zn(e);
|
|
986
|
+
return F(n, () => t, [t]), A.createElement(A.Fragment, null);
|
|
987
|
+
});
|
|
988
|
+
Wn.displayName = "Polygon";
|
|
989
|
+
function Kn(e) {
|
|
990
|
+
var n, t, o;
|
|
991
|
+
const { onClick: r, onDrag: a, onDragStart: s, onDragEnd: i, onMouseOver: f, onMouseOut: d, onPathChanged: l, polyline: h, encodedPath: p, path: u, defaultPath: m } = e, y = R(e, ["onClick", "onDrag", "onDragStart", "onDragEnd", "onMouseOver", "onMouseOut", "onPathChanged", "polyline", "encodedPath", "path", "defaultPath"]), [c, g] = k(null), b = $(), E = ne("geometry"), M = x(!1), D = Z(Object.assign(Object.assign({}, y), { clickable: (n = y.clickable) !== null && n !== void 0 ? n : !!r, draggable: (t = y.draggable) !== null && t !== void 0 ? t : !!(a || s || i || l), editable: (o = y.editable) !== null && o !== void 0 ? o : !!l }), q);
|
|
992
|
+
return C(() => {
|
|
993
|
+
if (!b) {
|
|
994
|
+
b === void 0 && console.error("<Polyline> has to be inside a Map component.");
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
let v;
|
|
998
|
+
if (h) {
|
|
999
|
+
v = h;
|
|
1000
|
+
const O = u ?? m;
|
|
1001
|
+
O && Array.isArray(O) && v.setPath(O), v.setOptions(D);
|
|
1002
|
+
} else {
|
|
1003
|
+
const O = u ?? m, P = Object.assign({}, D);
|
|
1004
|
+
O && Array.isArray(O) && (P.path = O), v = new google.maps.Polyline(P);
|
|
1005
|
+
}
|
|
1006
|
+
return v.setMap(b), g(v), () => {
|
|
1007
|
+
v.setMap(null), g(null);
|
|
1008
|
+
};
|
|
1009
|
+
}, [b, h]), I(c, "click", r), I(c, "drag", a), I(c, "dragstart", s), I(c, "mouseover", f), I(c, "mouseout", d), I(c, "dragend", (v) => {
|
|
1010
|
+
i == null || i(v), l && c && !M.current && l(c.getPath().getArray());
|
|
1011
|
+
}), C(() => {
|
|
1012
|
+
if (!c || !l)
|
|
1013
|
+
return;
|
|
1014
|
+
const v = c.getPath();
|
|
1015
|
+
if (!v)
|
|
1016
|
+
return;
|
|
1017
|
+
const O = () => {
|
|
1018
|
+
M.current || l(v.getArray());
|
|
1019
|
+
}, P = [
|
|
1020
|
+
google.maps.event.addListener(v, "insert_at", O),
|
|
1021
|
+
google.maps.event.addListener(v, "remove_at", O),
|
|
1022
|
+
google.maps.event.addListener(v, "set_at", O)
|
|
1023
|
+
];
|
|
1024
|
+
return () => {
|
|
1025
|
+
P.forEach((_) => _.remove());
|
|
1026
|
+
};
|
|
1027
|
+
}, [
|
|
1028
|
+
c,
|
|
1029
|
+
l,
|
|
1030
|
+
u,
|
|
1031
|
+
p,
|
|
1032
|
+
D.editable,
|
|
1033
|
+
D.draggable
|
|
1034
|
+
]), C(() => {
|
|
1035
|
+
c && c.setOptions(D);
|
|
1036
|
+
}, [c, D]), C(() => {
|
|
1037
|
+
if (!c || !u)
|
|
1038
|
+
return;
|
|
1039
|
+
const v = c.getPath();
|
|
1040
|
+
we(u, v) || (M.current = !0, c.setPath(u), M.current = !1);
|
|
1041
|
+
}, [c, u]), C(() => {
|
|
1042
|
+
if (!c || !p || !E)
|
|
1043
|
+
return;
|
|
1044
|
+
M.current = !0;
|
|
1045
|
+
const v = E.encoding.decodePath(p);
|
|
1046
|
+
c.setPath(v), M.current = !1;
|
|
1047
|
+
}, [c, p, E]), c;
|
|
1048
|
+
}
|
|
1049
|
+
const Yn = B((e, n) => {
|
|
1050
|
+
const t = Kn(e);
|
|
1051
|
+
return F(n, () => t, [t]), A.createElement(A.Fragment, null);
|
|
1052
|
+
});
|
|
1053
|
+
Yn.displayName = "Polyline";
|
|
1054
|
+
const Xn = {
|
|
1055
|
+
center: { lat: 0, lng: 0, altitude: 0 },
|
|
1056
|
+
range: 0,
|
|
1057
|
+
heading: 0,
|
|
1058
|
+
tilt: 0,
|
|
1059
|
+
roll: 0
|
|
1060
|
+
}, Qn = ["center", "range", "heading", "tilt", "roll"];
|
|
1061
|
+
function et(e, n, t) {
|
|
1062
|
+
const o = e[t];
|
|
1063
|
+
if (o != null)
|
|
1064
|
+
if (t === "center") {
|
|
1065
|
+
const r = o;
|
|
1066
|
+
n.current.center = r.toJSON ? r.toJSON() : r;
|
|
1067
|
+
} else
|
|
1068
|
+
n.current[t] = o;
|
|
1069
|
+
}
|
|
1070
|
+
function nt(e) {
|
|
1071
|
+
const n = Ne(), t = x(Object.assign({}, Xn));
|
|
1072
|
+
return C(() => {
|
|
1073
|
+
if (!e)
|
|
1074
|
+
return;
|
|
1075
|
+
const o = [];
|
|
1076
|
+
for (const r of Qn) {
|
|
1077
|
+
const a = `gmp-${r}change`, s = () => {
|
|
1078
|
+
et(e, t, r), n();
|
|
1079
|
+
};
|
|
1080
|
+
e.addEventListener(a, s), o.push(() => e.removeEventListener(a, s));
|
|
1081
|
+
}
|
|
1082
|
+
return () => {
|
|
1083
|
+
for (const r of o)
|
|
1084
|
+
r();
|
|
1085
|
+
};
|
|
1086
|
+
}, [e, n]), t;
|
|
1087
|
+
}
|
|
1088
|
+
function tt(e) {
|
|
1089
|
+
const n = ne("maps3d"), [t, o] = k(!1), [, r] = ie(), [a, s] = ie(), i = nt(a);
|
|
1090
|
+
return C(() => {
|
|
1091
|
+
customElements.whenDefined("gmp-map-3d").then(() => {
|
|
1092
|
+
o(!0);
|
|
1093
|
+
});
|
|
1094
|
+
}, []), C(
|
|
1095
|
+
() => {
|
|
1096
|
+
if (!a)
|
|
1097
|
+
return;
|
|
1098
|
+
const {
|
|
1099
|
+
center: d,
|
|
1100
|
+
heading: l,
|
|
1101
|
+
tilt: h,
|
|
1102
|
+
range: p,
|
|
1103
|
+
roll: u,
|
|
1104
|
+
defaultCenter: m,
|
|
1105
|
+
defaultHeading: y,
|
|
1106
|
+
defaultTilt: c,
|
|
1107
|
+
defaultRange: g,
|
|
1108
|
+
defaultRoll: b,
|
|
1109
|
+
// Non-element props to exclude
|
|
1110
|
+
id: E,
|
|
1111
|
+
style: M,
|
|
1112
|
+
className: D,
|
|
1113
|
+
children: v,
|
|
1114
|
+
onCenterChanged: O,
|
|
1115
|
+
onHeadingChanged: P,
|
|
1116
|
+
onTiltChanged: _,
|
|
1117
|
+
onRangeChanged: L,
|
|
1118
|
+
onRollChanged: w,
|
|
1119
|
+
onCameraChanged: W,
|
|
1120
|
+
onClick: K,
|
|
1121
|
+
onSteadyChange: Ot,
|
|
1122
|
+
onAnimationEnd: Mt,
|
|
1123
|
+
onError: At,
|
|
1124
|
+
mode: Dt,
|
|
1125
|
+
gestureHandling: Lt
|
|
1126
|
+
} = e, Be = R(e, ["center", "heading", "tilt", "range", "roll", "defaultCenter", "defaultHeading", "defaultTilt", "defaultRange", "defaultRoll", "id", "style", "className", "children", "onCenterChanged", "onHeadingChanged", "onTiltChanged", "onRangeChanged", "onRollChanged", "onCameraChanged", "onClick", "onSteadyChange", "onAnimationEnd", "onError", "mode", "gestureHandling"]), de = d ?? m, ge = l ?? y, fe = h ?? c, me = p ?? g, pe = u ?? b, U = Object.assign({}, Be);
|
|
1127
|
+
de && (U.center = de), ge !== void 0 && (U.heading = ge), fe !== void 0 && (U.tilt = fe), me !== void 0 && (U.range = me), pe !== void 0 && (U.roll = pe), Object.assign(a, U);
|
|
1128
|
+
},
|
|
1129
|
+
// this effect should only run when the map3d element first becomes
|
|
1130
|
+
// available, so we skip re-running it when other props change.
|
|
1131
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1132
|
+
[a]
|
|
1133
|
+
), [a, r, s, i, !!n && t];
|
|
1134
|
+
}
|
|
1135
|
+
function ot(e) {
|
|
1136
|
+
return e ? "toJSON" in e && typeof e.toJSON == "function" ? e.toJSON() : e : null;
|
|
1137
|
+
}
|
|
1138
|
+
function rt(e, n, t) {
|
|
1139
|
+
var o, r, a, s, i, f, d;
|
|
1140
|
+
const l = ot(t.center), h = (o = l == null ? void 0 : l.lat) !== null && o !== void 0 ? o : null, p = (r = l == null ? void 0 : l.lng) !== null && r !== void 0 ? r : null, u = (a = l == null ? void 0 : l.altitude) !== null && a !== void 0 ? a : null, m = (s = t.range) !== null && s !== void 0 ? s : null, y = (i = t.heading) !== null && i !== void 0 ? i : null, c = (f = t.tilt) !== null && f !== void 0 ? f : null, g = (d = t.roll) !== null && d !== void 0 ? d : null;
|
|
1141
|
+
J(() => {
|
|
1142
|
+
var b;
|
|
1143
|
+
if (!e)
|
|
1144
|
+
return;
|
|
1145
|
+
const E = n.current;
|
|
1146
|
+
h !== null && p !== null && (E.center.lat !== h || E.center.lng !== p || u !== null && E.center.altitude !== u) && (e.center = {
|
|
1147
|
+
lat: h,
|
|
1148
|
+
lng: p,
|
|
1149
|
+
altitude: (b = u ?? E.center.altitude) !== null && b !== void 0 ? b : 0
|
|
1150
|
+
}), m !== null && E.range !== m && (e.range = m), y !== null && E.heading !== y && (e.heading = y), c !== null && E.tilt !== c && (e.tilt = c), g !== null && E.roll !== g && (e.roll = g);
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
const Oe = [
|
|
1154
|
+
"gmp-centerchange",
|
|
1155
|
+
"gmp-headingchange",
|
|
1156
|
+
"gmp-tiltchange",
|
|
1157
|
+
"gmp-rangechange",
|
|
1158
|
+
"gmp-rollchange"
|
|
1159
|
+
];
|
|
1160
|
+
function G(e, n) {
|
|
1161
|
+
const t = e.center;
|
|
1162
|
+
let o;
|
|
1163
|
+
return t && "toJSON" in t && typeof t.toJSON == "function" ? o = t.toJSON() : t ? o = t : o = { lat: 0, lng: 0, altitude: 0 }, {
|
|
1164
|
+
type: n,
|
|
1165
|
+
map3d: e,
|
|
1166
|
+
detail: {
|
|
1167
|
+
center: o,
|
|
1168
|
+
range: e.range || 0,
|
|
1169
|
+
heading: e.heading || 0,
|
|
1170
|
+
tilt: e.tilt || 0,
|
|
1171
|
+
roll: e.roll || 0
|
|
1172
|
+
}
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
function at(e, n) {
|
|
1176
|
+
const t = n;
|
|
1177
|
+
return {
|
|
1178
|
+
type: "gmp-click",
|
|
1179
|
+
map3d: e,
|
|
1180
|
+
detail: {
|
|
1181
|
+
position: n.position || null,
|
|
1182
|
+
placeId: t.placeId
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
function it(e, n) {
|
|
1187
|
+
return {
|
|
1188
|
+
type: "gmp-steadychange",
|
|
1189
|
+
map3d: e,
|
|
1190
|
+
detail: {
|
|
1191
|
+
isSteady: n.isSteady
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
function st(e, n) {
|
|
1196
|
+
const { onCenterChanged: t, onHeadingChanged: o, onTiltChanged: r, onRangeChanged: a, onRollChanged: s, onCameraChanged: i, onClick: f, onSteadyChange: d, onAnimationEnd: l, onError: h } = n;
|
|
1197
|
+
z(e, "gmp-centerchange", t, G), z(e, "gmp-headingchange", o, G), z(e, "gmp-tiltchange", r, G), z(e, "gmp-rangechange", a, G), z(e, "gmp-rollchange", s, G), C(() => {
|
|
1198
|
+
if (!e || !i)
|
|
1199
|
+
return;
|
|
1200
|
+
const p = () => {
|
|
1201
|
+
i(G(e, "camerachange"));
|
|
1202
|
+
};
|
|
1203
|
+
for (const u of Oe)
|
|
1204
|
+
e.addEventListener(u, p);
|
|
1205
|
+
return () => {
|
|
1206
|
+
for (const u of Oe)
|
|
1207
|
+
e.removeEventListener(u, p);
|
|
1208
|
+
};
|
|
1209
|
+
}, [e, i]), C(() => {
|
|
1210
|
+
if (!e || !f)
|
|
1211
|
+
return;
|
|
1212
|
+
const p = (u) => {
|
|
1213
|
+
f(at(e, u));
|
|
1214
|
+
};
|
|
1215
|
+
return e.addEventListener("gmp-click", p), () => e.removeEventListener("gmp-click", p);
|
|
1216
|
+
}, [e, f]), C(() => {
|
|
1217
|
+
if (!e || !d)
|
|
1218
|
+
return;
|
|
1219
|
+
const p = (u) => {
|
|
1220
|
+
d(it(e, u));
|
|
1221
|
+
};
|
|
1222
|
+
return e.addEventListener("gmp-steadychange", p), () => e.removeEventListener("gmp-steadychange", p);
|
|
1223
|
+
}, [e, d]), z(e, "gmp-animationend", l, (p, u) => ({
|
|
1224
|
+
type: u,
|
|
1225
|
+
map3d: p
|
|
1226
|
+
})), z(e, "gmp-error", h, (p, u) => ({
|
|
1227
|
+
type: u,
|
|
1228
|
+
map3d: p
|
|
1229
|
+
}));
|
|
1230
|
+
}
|
|
1231
|
+
function z(e, n, t, o) {
|
|
1232
|
+
C(() => {
|
|
1233
|
+
if (!e || !t)
|
|
1234
|
+
return;
|
|
1235
|
+
const r = () => {
|
|
1236
|
+
t(o(e, n));
|
|
1237
|
+
};
|
|
1238
|
+
return e.addEventListener(n, r), () => e.removeEventListener(n, r);
|
|
1239
|
+
}, [e, n, t, o]);
|
|
1240
|
+
}
|
|
1241
|
+
const lt = /* @__PURE__ */ new Set([
|
|
1242
|
+
"bounds",
|
|
1243
|
+
"defaultUIHidden",
|
|
1244
|
+
"gestureHandling",
|
|
1245
|
+
"internalUsageAttributionIds",
|
|
1246
|
+
"maxAltitude",
|
|
1247
|
+
"maxHeading",
|
|
1248
|
+
"maxTilt",
|
|
1249
|
+
"minAltitude",
|
|
1250
|
+
"minHeading",
|
|
1251
|
+
"minTilt",
|
|
1252
|
+
"mode"
|
|
1253
|
+
]);
|
|
1254
|
+
function ct(e, n) {
|
|
1255
|
+
const t = N(() => {
|
|
1256
|
+
const o = {}, r = Object.keys(n);
|
|
1257
|
+
for (const a of r) {
|
|
1258
|
+
if (!lt.has(a))
|
|
1259
|
+
continue;
|
|
1260
|
+
const s = n[a];
|
|
1261
|
+
s !== void 0 && (o[a] = s);
|
|
1262
|
+
}
|
|
1263
|
+
return o;
|
|
1264
|
+
}, [n]);
|
|
1265
|
+
_e(() => {
|
|
1266
|
+
e && Object.assign(e, t);
|
|
1267
|
+
}, [e, t]);
|
|
1268
|
+
}
|
|
1269
|
+
const ut = A.createContext(null), dt = {
|
|
1270
|
+
width: "100%",
|
|
1271
|
+
height: "100%",
|
|
1272
|
+
position: "relative"
|
|
1273
|
+
}, gt = B((e, n) => {
|
|
1274
|
+
const { children: t, id: o, className: r, style: a } = e, s = H(V);
|
|
1275
|
+
if (!s)
|
|
1276
|
+
throw new Error("<Map3D> can only be used inside an <APIProvider> component.");
|
|
1277
|
+
const { addMap3DInstance: i, removeMap3DInstance: f } = s, [d, l, h, p, u] = tt(e);
|
|
1278
|
+
rt(d, p, e), st(d, e), ct(d, e), C(() => {
|
|
1279
|
+
if (!d)
|
|
1280
|
+
return;
|
|
1281
|
+
const c = o ?? "default";
|
|
1282
|
+
return i(d, c), () => {
|
|
1283
|
+
f(c);
|
|
1284
|
+
};
|
|
1285
|
+
}, [d, o]), F(n, () => ({
|
|
1286
|
+
map3d: d,
|
|
1287
|
+
flyCameraAround: (c) => {
|
|
1288
|
+
d == null || d.flyCameraAround(c);
|
|
1289
|
+
},
|
|
1290
|
+
flyCameraTo: (c) => {
|
|
1291
|
+
d == null || d.flyCameraTo(c);
|
|
1292
|
+
},
|
|
1293
|
+
stopCameraAnimation: () => {
|
|
1294
|
+
d == null || d.stopCameraAnimation();
|
|
1295
|
+
}
|
|
1296
|
+
}), [d]);
|
|
1297
|
+
const m = N(() => Object.assign(Object.assign({}, dt), a), [a]), y = N(() => ({ map3d: d }), [d]);
|
|
1298
|
+
return u ? A.createElement(
|
|
1299
|
+
"div",
|
|
1300
|
+
Object.assign({ ref: l, "data-testid": "map-3d", style: r ? void 0 : m, className: r }, o ? { id: o } : {}),
|
|
1301
|
+
A.createElement("gmp-map-3d", { ref: h, style: { width: "100%", height: "100%" } }, d && A.createElement(ut.Provider, { value: y }, t))
|
|
1302
|
+
) : A.createElement("div", Object.assign({ ref: l, "data-testid": "map-3d", style: r ? void 0 : m, className: r }, o ? { id: o } : {}));
|
|
1303
|
+
});
|
|
1304
|
+
gt.displayName = "Map3D";
|
|
1305
|
+
const ft = Fe(null), mt = B(function(n, t) {
|
|
1306
|
+
const { children: o, onClick: r, position: a, altitudeMode: s, collisionBehavior: i, drawsWhenOccluded: f, extruded: d, label: l, sizePreserved: h, zIndex: p, title: u } = n, m = !!r, [y, c] = k(null), [g, b] = k(!1), E = N(() => {
|
|
1307
|
+
const v = document.createElement("div");
|
|
1308
|
+
return v.style.display = "none", document.body.appendChild(v), v;
|
|
1309
|
+
}, []);
|
|
1310
|
+
C(() => () => E.remove(), [E]);
|
|
1311
|
+
const M = ce((v) => {
|
|
1312
|
+
c(v), typeof t == "function" ? t(v) : t && (t.current = v);
|
|
1313
|
+
}, [t]);
|
|
1314
|
+
se(y, "gmp-click", r), J(() => {
|
|
1315
|
+
if (g || !y || !E)
|
|
1316
|
+
return;
|
|
1317
|
+
for (; y.firstChild; )
|
|
1318
|
+
y.removeChild(y.firstChild);
|
|
1319
|
+
const v = Array.from(E.childNodes);
|
|
1320
|
+
for (const O of v) {
|
|
1321
|
+
if (O.nodeType !== Node.ELEMENT_NODE)
|
|
1322
|
+
continue;
|
|
1323
|
+
const P = O, _ = P.tagName.toLowerCase();
|
|
1324
|
+
if (_ === "img" || _ === "svg") {
|
|
1325
|
+
const L = document.createElement("template");
|
|
1326
|
+
L.content.appendChild(P.cloneNode(!0)), y.appendChild(L);
|
|
1327
|
+
} else
|
|
1328
|
+
y.appendChild(P.cloneNode(!0));
|
|
1329
|
+
}
|
|
1330
|
+
}, [y, E, o, g]);
|
|
1331
|
+
const D = N(() => ({ marker: y, setContentHandledExternally: b }), [y]);
|
|
1332
|
+
return S(y, "position", a), S(y, "altitudeMode", s), S(y, "collisionBehavior", i), S(y, "drawsWhenOccluded", f), S(y, "extruded", d), S(y, "label", l), S(y, "sizePreserved", h), S(y, "zIndex", p), S(y, "title", u ?? ""), A.createElement(
|
|
1333
|
+
ft.Provider,
|
|
1334
|
+
{ value: D },
|
|
1335
|
+
m ? A.createElement("gmp-marker-3d-interactive", { ref: M }) : A.createElement("gmp-marker-3d", { ref: M }),
|
|
1336
|
+
Le(o, E)
|
|
1337
|
+
);
|
|
1338
|
+
});
|
|
1339
|
+
mt.displayName = "Marker3D";
|
|
1340
|
+
const pt = B(function(n, t) {
|
|
1341
|
+
var o;
|
|
1342
|
+
const { children: r, headerContent: a, style: s, className: i, open: f = !0, position: d, anchor: l, anchorId: h, altitudeMode: p, lightDismissDisabled: u, autoPanDisabled: m, onClose: y } = n, [c, g] = k(null), b = x(null);
|
|
1343
|
+
F(t, () => c, [c]), ht(c, f, y), S(c, "open", f ?? !1), S(c, "altitudeMode", p), S(c, "lightDismissDisabled", u), S(c, "autoPanDisabled", m);
|
|
1344
|
+
const E = (o = l ?? h) !== null && o !== void 0 ? o : d;
|
|
1345
|
+
return S(c, "positionAnchor", E), J(() => {
|
|
1346
|
+
c && (Vn(c, s || null, b.current), b.current = s || null);
|
|
1347
|
+
}, [c, s]), A.createElement(
|
|
1348
|
+
"gmp-popover",
|
|
1349
|
+
{ ref: g, className: i },
|
|
1350
|
+
a && A.createElement("div", { slot: "header" }, a),
|
|
1351
|
+
r
|
|
1352
|
+
);
|
|
1353
|
+
});
|
|
1354
|
+
pt.displayName = "Popover";
|
|
1355
|
+
function ht(e, n, t) {
|
|
1356
|
+
const o = x(void 0), r = x(n);
|
|
1357
|
+
C(() => {
|
|
1358
|
+
r.current = n;
|
|
1359
|
+
}, [n]), C(() => {
|
|
1360
|
+
if (!e || !t)
|
|
1361
|
+
return;
|
|
1362
|
+
const a = new MutationObserver((s) => {
|
|
1363
|
+
for (const i of s)
|
|
1364
|
+
if (i.type === "attributes" && i.attributeName === "open") {
|
|
1365
|
+
const f = e.hasAttribute("open");
|
|
1366
|
+
o.current === !0 && !f && r.current !== !1 && t(), o.current = f;
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
return a.observe(e, {
|
|
1370
|
+
attributes: !0,
|
|
1371
|
+
attributeFilter: ["open"]
|
|
1372
|
+
}), o.current = e.hasAttribute("open"), () => {
|
|
1373
|
+
a.disconnect();
|
|
1374
|
+
};
|
|
1375
|
+
}, [e, t]);
|
|
1376
|
+
}
|
|
1377
|
+
function vt(e) {
|
|
1378
|
+
const [n, t] = k(null), o = $(), { onClick: r, onDrag: a, onDragStart: s, onDragEnd: i, onMouseOver: f, onMouseOut: d } = e, l = R(e, ["onClick", "onDrag", "onDragStart", "onDragEnd", "onMouseOver", "onMouseOut"]), { position: h, draggable: p } = l;
|
|
1379
|
+
return C(() => {
|
|
1380
|
+
if (!o) {
|
|
1381
|
+
o === void 0 && console.error("<Marker> has to be inside a Map component.");
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
const u = new google.maps.Marker(l);
|
|
1385
|
+
return u.setMap(o), t(u), () => {
|
|
1386
|
+
u.setMap(null), t(null);
|
|
1387
|
+
};
|
|
1388
|
+
}, [o]), C(() => {
|
|
1389
|
+
if (!n)
|
|
1390
|
+
return;
|
|
1391
|
+
const u = n, m = google.maps.event;
|
|
1392
|
+
return r && m.addListener(u, "click", r), a && m.addListener(u, "drag", a), s && m.addListener(u, "dragstart", s), i && m.addListener(u, "dragend", i), f && m.addListener(u, "mouseover", f), d && m.addListener(u, "mouseout", d), n.setDraggable(!!p), () => {
|
|
1393
|
+
m.clearInstanceListeners(u);
|
|
1394
|
+
};
|
|
1395
|
+
}, [
|
|
1396
|
+
n,
|
|
1397
|
+
p,
|
|
1398
|
+
r,
|
|
1399
|
+
a,
|
|
1400
|
+
s,
|
|
1401
|
+
i,
|
|
1402
|
+
f,
|
|
1403
|
+
d
|
|
1404
|
+
]), C(() => {
|
|
1405
|
+
n && l && n.setOptions(l);
|
|
1406
|
+
}, [n, l]), C(() => {
|
|
1407
|
+
p || !h || !n || n.setPosition(h);
|
|
1408
|
+
}, [p, h, n]), n;
|
|
1409
|
+
}
|
|
1410
|
+
const yt = B((e, n) => {
|
|
1411
|
+
const t = vt(e);
|
|
1412
|
+
return F(n, () => t, [t]), A.createElement(A.Fragment, null);
|
|
1413
|
+
});
|
|
1414
|
+
yt.displayName = "Marker";
|
|
1415
|
+
function bt(e) {
|
|
1416
|
+
var n, t, o;
|
|
1417
|
+
const { onClick: r, onDrag: a, onDragStart: s, onDragEnd: i, onMouseOver: f, onMouseOut: d, onBoundsChanged: l, bounds: h, defaultBounds: p } = e, u = R(e, ["onClick", "onDrag", "onDragStart", "onDragEnd", "onMouseOver", "onMouseOut", "onBoundsChanged", "bounds", "defaultBounds"]), [m, y] = k(null), c = $(), g = Z(Object.assign(Object.assign({}, u), { clickable: (n = u.clickable) !== null && n !== void 0 ? n : !!r, draggable: (t = u.draggable) !== null && t !== void 0 ? t : !!(a || s || i || l), editable: (o = u.editable) !== null && o !== void 0 ? o : !!l }), q);
|
|
1418
|
+
return C(() => {
|
|
1419
|
+
if (!c) {
|
|
1420
|
+
c === void 0 && console.error("<Rectangle> has to be inside a Map component.");
|
|
1421
|
+
return;
|
|
1422
|
+
}
|
|
1423
|
+
const b = new google.maps.Rectangle(Object.assign(Object.assign({}, g), { bounds: h ?? p }));
|
|
1424
|
+
return b.setMap(c), y(b), () => {
|
|
1425
|
+
b.setMap(null), y(null);
|
|
1426
|
+
};
|
|
1427
|
+
}, [c]), I(m, "click", r), I(m, "drag", a), I(m, "dragstart", s), I(m, "dragend", i), I(m, "mouseover", f), I(m, "mouseout", d), I(m, "bounds_changed", l ? () => {
|
|
1428
|
+
l(m == null ? void 0 : m.getBounds());
|
|
1429
|
+
} : null), C(() => {
|
|
1430
|
+
m && m.setOptions(g);
|
|
1431
|
+
}, [m, g]), C(() => {
|
|
1432
|
+
!m || !h || yn(h, m.getBounds()) || m.setBounds(h);
|
|
1433
|
+
}, [m, h]), m;
|
|
1434
|
+
}
|
|
1435
|
+
const Et = B((e, n) => {
|
|
1436
|
+
const t = bt(e);
|
|
1437
|
+
return F(n, () => t, [
|
|
1438
|
+
t
|
|
1439
|
+
]), A.createElement(A.Fragment, null);
|
|
1440
|
+
});
|
|
1441
|
+
Et.displayName = "Rectangle";
|
|
1442
|
+
const Ct = {
|
|
1443
|
+
core: "Settings",
|
|
1444
|
+
maps: "Map"
|
|
1445
|
+
}, Me = (e) => {
|
|
1446
|
+
var t;
|
|
1447
|
+
const n = (t = globalThis.google) == null ? void 0 : t.maps;
|
|
1448
|
+
return !n || typeof n.importLibrary != "function" ? !0 : e.every((o) => {
|
|
1449
|
+
const r = Ct[o];
|
|
1450
|
+
return r !== void 0 && typeof n[r] == "function";
|
|
1451
|
+
});
|
|
1452
|
+
};
|
|
1453
|
+
function kt({
|
|
1454
|
+
libraries: e = [],
|
|
1455
|
+
pending: n,
|
|
1456
|
+
children: t
|
|
1457
|
+
}) {
|
|
1458
|
+
const o = ["core", ...e.filter((i) => i !== "core")], r = o.join(","), [a, s] = k(() => ({
|
|
1459
|
+
status: Me(o) ? "ready" : "pending"
|
|
1460
|
+
}));
|
|
1461
|
+
if (C(() => {
|
|
1462
|
+
var d;
|
|
1463
|
+
const i = (d = globalThis.google) == null ? void 0 : d.maps;
|
|
1464
|
+
if (!i || Me(r.split(","))) {
|
|
1465
|
+
s({ status: "ready" });
|
|
1466
|
+
return;
|
|
1467
|
+
}
|
|
1468
|
+
let f = !1;
|
|
1469
|
+
return Promise.all(r.split(",").map((l) => {
|
|
1470
|
+
var h;
|
|
1471
|
+
return (h = i.importLibrary) == null ? void 0 : h.call(i, l);
|
|
1472
|
+
})).then(() => {
|
|
1473
|
+
f || s({ status: "ready" });
|
|
1474
|
+
}).catch((l) => {
|
|
1475
|
+
f || s({ status: "failed", error: l });
|
|
1476
|
+
}), () => {
|
|
1477
|
+
f = !0;
|
|
1478
|
+
};
|
|
1479
|
+
}, [r]), a.status === "failed") throw a.error;
|
|
1480
|
+
return a.status === "ready" ? t : n;
|
|
1481
|
+
}
|
|
1482
|
+
export {
|
|
1483
|
+
St as A,
|
|
1484
|
+
kt as M,
|
|
1485
|
+
Dn as a,
|
|
1486
|
+
Te as b,
|
|
1487
|
+
$ as c,
|
|
1488
|
+
Fn as d,
|
|
1489
|
+
yt as e,
|
|
1490
|
+
ne as u
|
|
1491
|
+
};
|
|
1492
|
+
//# sourceMappingURL=maps-core-gate-DKx96CC_.js.map
|