@datagouv/components-next 1.5.1-dev.1397.g7333a397 → 1.5.1-dev.1399.g35c3eb9f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/{Control-DPuXeUqi.js → Control-BbyEe8x_.js} +7 -7
  2. package/dist/{Datafair.client-LlEgG7WU.js → Datafair.client-CQNxPvZt.js} +1 -1
  3. package/dist/{Image-DVWRoLLI.js → Image-umPJvSA8.js} +16 -13
  4. package/dist/{ImagePreview.client-Db5dmxMP.js → ImagePreview.client-DbkBb47d.js} +1 -1
  5. package/dist/{JsonPreview.client-DKy2AexC.js → JsonPreview.client-Ba-_lUCj.js} +2 -2
  6. package/dist/{Layer-D_5tYbVm.js → Layer-CagLskq_.js} +67 -61
  7. package/dist/{Map-CTBJEae_.js → Map-Cek3vwVi.js} +1094 -932
  8. package/dist/{MapContainer.client-DoN1jSzM.js → MapContainer.client-BsJGdnP2.js} +7 -7
  9. package/dist/{OSM-B5Zc3qAf.js → OSM-Bm69tJpi.js} +1 -1
  10. package/dist/{PdfPreview.client-D3wHTDb9.js → PdfPreview.client-CJbZbXds.js} +3 -3
  11. package/dist/{PdfSkeleton-nas5Pmia.js → PdfSkeleton-sY8nI3Lv.js} +1 -1
  12. package/dist/{Pmtiles.client-DncYrZSp.js → Pmtiles.client-Wea3YvTU.js} +9997 -9276
  13. package/dist/{PreviewError-EeaGx3SL.js → PreviewError-BzUvwX47.js} +329 -290
  14. package/dist/{PreviewWrapper-BhldDdXK.js → PreviewWrapper-CwOJqQSn.js} +1 -1
  15. package/dist/{ScaleLine-C_tuJ6VG.js → ScaleLine-C8xmHdEk.js} +15 -8
  16. package/dist/Tile-DfivRbb3.js +479 -0
  17. package/dist/{Tile-8nHSuqcv.js → Tile-DvVc2IeI.js} +220 -151
  18. package/dist/{TileImage-CgO5alXc.js → TileImage-CxC7EP7_.js} +53 -45
  19. package/dist/{View-Dad8DfSD.js → View-44C9US2-.js} +210 -208
  20. package/dist/{XmlPreview.client-CmGbc3c3.js → XmlPreview.client-xXdnrUCW.js} +2 -2
  21. package/dist/assets/maplibre-gl-worker-Dlv-oLtU.js +10 -0
  22. package/dist/components-next.css +1 -1
  23. package/dist/components-next.js +11889 -10504
  24. package/dist/components.css +2 -2
  25. package/dist/{france-BtSQqcqV.js → france-BYzDEL-I.js} +23 -23
  26. package/dist/{proj-COhZ08DR.js → proj-0ED4AWuV.js} +260 -246
  27. package/dist/purify.es-D-UgLNEK.js +848 -0
  28. package/dist/{src-DJJgtynU.js → src-DdUvT8zT.js} +1972 -1306
  29. package/dist/{transform-CNeEnSK9.js → transform-bRfffInI.js} +3 -3
  30. package/package.json +18 -18
  31. package/src/components/AccessTypeBadge.vue +46 -0
  32. package/src/components/Badge.vue +74 -0
  33. package/src/components/ChartBadge.vue +17 -0
  34. package/src/components/ChartCard.vue +4 -17
  35. package/src/components/DataserviceBadge.vue +17 -0
  36. package/src/components/DataserviceCard.vue +12 -31
  37. package/src/components/DatasetBadge.vue +17 -0
  38. package/src/components/DatasetCard.vue +11 -15
  39. package/src/components/DatasetInformation/DatasetInformationSection.vue +3 -7
  40. package/src/components/DatasetInformation/DatasetSchemaSection.vue +1 -4
  41. package/src/components/DatasetLabelTag.vue +4 -15
  42. package/src/components/Form/SelectGroup.vue +0 -2
  43. package/src/components/LicenseBadge.vue +7 -12
  44. package/src/components/ObjectStatusBadge.vue +47 -0
  45. package/src/components/OrganizationBadge.vue +24 -0
  46. package/src/components/OrganizationTypeBadge.vue +5 -4
  47. package/src/components/ResourceAccordion/SchemaBadge.vue +6 -2
  48. package/src/components/ReuseBadge.vue +17 -0
  49. package/src/components/ReuseCard.vue +5 -20
  50. package/src/components/SchemaCard.vue +1 -5
  51. package/src/components/StatBox.vue +5 -3
  52. package/src/components/Tag.vue +61 -15
  53. package/src/functions/objectStatus.ts +34 -0
  54. package/src/main.ts +25 -3
  55. package/src/types/ui.ts +2 -0
  56. package/dist/Tile-Bu5lF4M5.js +0 -463
  57. package/dist/assets/maplibre-gl-worker-CEzvAyZY.js +0 -10
  58. package/dist/purify.es-eElsWhh7.js +0 -876
  59. package/src/components/ObjectCardBadge.vue +0 -33
@@ -1,4 +1,4 @@
1
- import { Rt as e, cn as t, on as n, qt as r } from "./proj-COhZ08DR.js";
1
+ import { Kt as e, cn as t, un as n, zt as r } from "./proj-0ED4AWuV.js";
2
2
  // ../node_modules/ol/MapEventType.js
3
3
  var i = {
4
4
  POSTRENDER: "postrender",
@@ -31,7 +31,7 @@ var i = {
31
31
  r !== void 0 && (n[f[e]] = typeof r == "string" ? r.trim() : r);
32
32
  }
33
33
  return isNaN(Number(n.weight)) && n.weight in p && (n.weight = p[n.weight]), n.families = n.family.split(/,\s?/).map((e) => e.trim().replace(/^['"]|['"]$/g, "")), n;
34
- }, h = class extends e {
34
+ }, h = class extends r {
35
35
  constructor(e) {
36
36
  super();
37
37
  let t = e.element;
@@ -43,12 +43,12 @@ var i = {
43
43
  getMap() {
44
44
  return this.map_;
45
45
  }
46
- setMap(e) {
46
+ setMap(r) {
47
47
  this.map_ && this.element?.remove();
48
- for (let e = 0, n = this.listenerKeys.length; e < n; ++e) t(this.listenerKeys[e]);
49
- if (this.listenerKeys.length = 0, this.map_ = e, e) {
50
- let t = this.target_ ?? e.getOverlayContainerStopEvent();
51
- this.element && t.appendChild(this.element), this.render !== r && this.listenerKeys.push(n(e, i.POSTRENDER, this.render, this)), e.render();
48
+ for (let e = 0, t = this.listenerKeys.length; e < t; ++e) n(this.listenerKeys[e]);
49
+ if (this.listenerKeys.length = 0, this.map_ = r, r) {
50
+ let n = this.target_ ?? r.getOverlayContainerStopEvent();
51
+ this.element && n && n.appendChild(this.element), this.render !== e && this.listenerKeys.push(t(r, i.POSTRENDER, this.render, this)), r.render();
52
52
  }
53
53
  }
54
54
  render(e) {}
@@ -1,4 +1,4 @@
1
- import { a as e, t } from "./PreviewError-EeaGx3SL.js";
1
+ import { a as e, t } from "./PreviewError-BzUvwX47.js";
2
2
  import { computed as n, createBlock as r, createElementBlock as i, createElementVNode as a, defineComponent as o, openBlock as s } from "vue";
3
3
  // src/components/ResourceAccordion/Datafair.client.vue?vue&type=script&setup=true&lang.ts
4
4
  var c = { class: "fr-text--xs" }, l = { key: 0 }, u = ["src"], d = /* @__PURE__ */ o({
@@ -1,4 +1,4 @@
1
- import { Ut as e, Yt as t, an as n, cn as r, sn as i } from "./proj-COhZ08DR.js";
1
+ import { Ht as e, Jt as t, ln as n, sn as r, un as i } from "./proj-0ED4AWuV.js";
2
2
  // ../node_modules/ol/has.js
3
3
  var a = typeof navigator < "u" && navigator.userAgent !== void 0 ? navigator.userAgent.toLowerCase() : "";
4
4
  a.includes("safari") && !a.includes("chrom") && (a.includes("version/15.4") || /cpu (os|iphone os) 15_4 like mac os x/.test(a));
@@ -105,7 +105,7 @@ var O = {
105
105
  super(), this.extent = e, this.pixelRatio_ = n, this.resolution = t, this.state = typeof r == "function" ? O.IDLE : r, this.image_ = null, this.loader = typeof r == "function" ? r : null;
106
106
  }
107
107
  changed() {
108
- this.dispatchEvent(n.CHANGE);
108
+ this.dispatchEvent(r.CHANGE);
109
109
  }
110
110
  getExtent() {
111
111
  return this.extent;
@@ -123,14 +123,17 @@ var O = {
123
123
  return this.state;
124
124
  }
125
125
  load() {
126
- if (this.state == O.IDLE && this.loader) {
127
- this.state = O.LOADING, this.changed();
128
- let e = this.getResolution(), n = Array.isArray(e) ? e[0] : e;
129
- t(() => this.loader(this.getExtent(), n, this.getPixelRatio())).then((e) => {
130
- "image" in e && (this.image_ = e.image), "extent" in e && (this.extent = e.extent), "resolution" in e && (this.resolution = e.resolution), "pixelRatio" in e && (this.pixelRatio_ = e.pixelRatio), (e instanceof HTMLImageElement || d && e instanceof ImageBitmap || e instanceof HTMLCanvasElement || e instanceof HTMLVideoElement) && (this.image_ = e), this.state = O.LOADED;
131
- }).catch((e) => {
132
- this.state = O.ERROR, console.error(e);
133
- }).finally(() => this.changed());
126
+ if (this.state == O.IDLE) {
127
+ let e = this.loader;
128
+ if (e) {
129
+ this.state = O.LOADING, this.changed();
130
+ let n = this.getResolution(), r = Array.isArray(n) ? n[0] : n;
131
+ t(() => e(this.getExtent(), r, this.getPixelRatio())).then((e) => {
132
+ "image" in e && (this.image_ = e.image), "extent" in e && e.extent && (this.extent = e.extent), "resolution" in e && e.resolution !== void 0 && (this.resolution = e.resolution), "pixelRatio" in e && e.pixelRatio !== void 0 && (this.pixelRatio_ = e.pixelRatio), (e instanceof HTMLImageElement || d && e instanceof ImageBitmap || e instanceof HTMLCanvasElement || e instanceof HTMLVideoElement) && (this.image_ = e), this.state = O.LOADED;
133
+ }).catch((e) => {
134
+ this.state = O.ERROR, console.error(e);
135
+ }).finally(() => this.changed());
136
+ }
134
137
  }
135
138
  }
136
139
  setImage(e) {
@@ -141,15 +144,15 @@ var O = {
141
144
  }
142
145
  };
143
146
  function A(e, t, a) {
144
- let o = e, s = !0, c = !1, l = !1, d = [i(o, n.LOAD, function() {
147
+ let o = e, s = !0, c = !1, l = !1, d = [n(o, r.LOAD, function() {
145
148
  l = !0, c || t();
146
149
  })];
147
150
  return o.src && u ? (c = !0, o.decode().then(function() {
148
151
  s && t();
149
152
  }).catch(function(e) {
150
153
  s && (l ? t() : a());
151
- })) : d.push(i(o, n.ERROR, a)), function() {
152
- s = !1, d.forEach(r);
154
+ })) : d.push(n(o, r.ERROR, a)), function() {
155
+ s = !1, d.forEach(i);
153
156
  };
154
157
  }
155
158
  function j(e, t) {
@@ -1,4 +1,4 @@
1
- import { H as e, L as t, _ as n, i as r, t as i } from "./PreviewError-EeaGx3SL.js";
1
+ import { H as e, L as t, _ as n, i as r, t as i } from "./PreviewError-BzUvwX47.js";
2
2
  import { computed as a, createBlock as o, createElementBlock as s, defineComponent as c, openBlock as l, ref as u } from "vue";
3
3
  // src/components/ResourceAccordion/ImagePreview.client.vue?vue&type=script&setup=true&lang.ts
4
4
  var d = { class: "text-xs" }, f = ["src"], p = /* @__PURE__ */ c({
@@ -1,5 +1,5 @@
1
- import { L as e } from "./PreviewError-EeaGx3SL.js";
2
- import { t } from "./PreviewWrapper-BhldDdXK.js";
1
+ import { L as e } from "./PreviewError-BzUvwX47.js";
2
+ import { t } from "./PreviewWrapper-CwOJqQSn.js";
3
3
  import { createBlock as n, createVNode as r, defineAsyncComponent as i, defineComponent as a, openBlock as o, unref as s, withCtx as c } from "vue";
4
4
  // src/components/ResourceAccordion/JsonPreview.client.vue
5
5
  var l = /* @__PURE__ */ a({
@@ -1,7 +1,7 @@
1
- import { B as e, J as t, Rt as n, Wt as r, an as i, cn as a, kt as o, on as s, zt as c } from "./proj-COhZ08DR.js";
2
- import { u as l } from "./Image-DVWRoLLI.js";
3
- import { S as u } from "./transform-CNeEnSK9.js";
4
- import { t as d } from "./View-Dad8DfSD.js";
1
+ import { At as e, Ut as t, V as n, Y as r, Yt as i, cn as a, sn as o, un as s, zt as c } from "./proj-0ED4AWuV.js";
2
+ import { u as l } from "./Image-umPJvSA8.js";
3
+ import { S as u } from "./transform-bRfffInI.js";
4
+ import { t as d } from "./View-44C9US2-.js";
5
5
  // ../node_modules/ol/render/EventType.js
6
6
  var f = {
7
7
  PRERENDER: "prerender",
@@ -28,45 +28,45 @@ function b(e, t) {
28
28
  function x(e) {
29
29
  throw Error("failed to parse \"" + e + "\" as color");
30
30
  }
31
- function S(n) {
32
- if (n.toLowerCase().startsWith("rgb")) {
33
- let t = n.match(_) || n.match(g) || n.match(v);
31
+ function S(e) {
32
+ if (e.toLowerCase().startsWith("rgb")) {
33
+ let t = e.match(_) || e.match(g) || e.match(v);
34
34
  if (t) {
35
- let n = t[4], r = 100 / 255;
35
+ let e = t[4], r = 100 / 255;
36
36
  return [
37
- e(b(t[1], r) + .5 | 0, 0, 255),
38
- e(b(t[2], r) + .5 | 0, 0, 255),
39
- e(b(t[3], r) + .5 | 0, 0, 255),
40
- n === void 0 ? 1 : e(b(n, 100), 0, 1)
37
+ n(b(t[1], r) + .5 | 0, 0, 255),
38
+ n(b(t[2], r) + .5 | 0, 0, 255),
39
+ n(b(t[3], r) + .5 | 0, 0, 255),
40
+ e === void 0 ? 1 : n(b(e, 100), 0, 1)
41
41
  ];
42
42
  }
43
- x(n);
43
+ x(e);
44
44
  }
45
- if (n.startsWith("#")) {
46
- if (y.test(n)) {
47
- let e = n.substring(1), t = e.length <= 4 ? 1 : 2, r = [
45
+ if (e.startsWith("#")) {
46
+ if (y.test(e)) {
47
+ let t = e.substring(1), n = t.length <= 4 ? 1 : 2, r = [
48
48
  0,
49
49
  0,
50
50
  0,
51
51
  255
52
52
  ];
53
- for (let n = 0, i = e.length; n < i; n += t) {
54
- let i = parseInt(e.substring(n, n + t), 16);
55
- t === 1 && (i += i << 4), r[n / t] = i;
53
+ for (let e = 0, i = t.length; e < i; e += n) {
54
+ let i = parseInt(t.substring(e, e + n), 16);
55
+ n === 1 && (i += i << 4), r[e / n] = i;
56
56
  }
57
57
  return r[3] /= 255, r;
58
58
  }
59
- x(n);
59
+ x(e);
60
60
  }
61
- let r = h();
62
- r.fillStyle = "#abcdef";
63
- let i = r.fillStyle;
64
- r.fillStyle = n, r.fillStyle === i && (r.fillStyle = "#fedcba", i = r.fillStyle, r.fillStyle = n, r.fillStyle === i && x(n));
65
- let a = r.fillStyle;
61
+ let t = h();
62
+ t.fillStyle = "#abcdef";
63
+ let i = t.fillStyle;
64
+ t.fillStyle = e, t.fillStyle === i && (t.fillStyle = "#fedcba", i = t.fillStyle, t.fillStyle = e, t.fillStyle === i && x(e));
65
+ let a = t.fillStyle;
66
66
  if (a.startsWith("#") || a.startsWith("rgba")) return S(a);
67
- r.clearRect(0, 0, 1, 1), r.fillRect(0, 0, 1, 1);
68
- let o = Array.from(r.getImageData(0, 0, 1, 1).data);
69
- return o[3] = t(o[3] / 255, 3), o;
67
+ t.clearRect(0, 0, 1, 1), t.fillRect(0, 0, 1, 1);
68
+ let o = Array.from(t.getImageData(0, 0, 1, 1).data);
69
+ return o[3] = r(o[3] / 255, 3), o;
70
70
  }
71
71
  function C(e) {
72
72
  return typeof e == "string" ? e : I(e);
@@ -98,13 +98,13 @@ function M(e) {
98
98
  e[3]
99
99
  ];
100
100
  }
101
- function N(t) {
102
- let n = (t[0] + 16) / 116, r = t[1], i = t[2] * Math.PI / 180, a = k(n), o = k(n + r / 500 * Math.cos(i)), s = k(n - r / 200 * Math.sin(i)), c = O(o * 3.021973625 - a * 1.617392459 - s * .404875592), l = O(o * -.943766287 + a * 1.916279586 + s * .027607165), u = O(o * .069407491 - a * .22898585 + s * 1.159737864);
101
+ function N(e) {
102
+ let t = (e[0] + 16) / 116, r = e[1], i = e[2] * Math.PI / 180, a = k(t), o = k(t + r / 500 * Math.cos(i)), s = k(t - r / 200 * Math.sin(i)), c = O(o * 3.021973625 - a * 1.617392459 - s * .404875592), l = O(o * -.943766287 + a * 1.916279586 + s * .027607165), u = O(o * .069407491 - a * .22898585 + s * 1.159737864);
103
103
  return [
104
- e(c + .5 | 0, 0, 255),
105
- e(l + .5 | 0, 0, 255),
106
- e(u + .5 | 0, 0, 255),
107
- t[3]
104
+ n(c + .5 | 0, 0, 255),
105
+ n(l + .5 | 0, 0, 255),
106
+ n(u + .5 | 0, 0, 255),
107
+ e[3]
108
108
  ];
109
109
  }
110
110
  function P(e) {
@@ -133,9 +133,9 @@ function I(e) {
133
133
  return "rgba(" + t + "," + n + "," + r + "," + i + ")";
134
134
  }
135
135
  // ../node_modules/ol/render/Event.js
136
- var L = class extends r {
136
+ var L = class extends t {
137
137
  constructor(e, t, n, r) {
138
- super(e), this.inversePixelTransform = t, this.frameState = n, this.context = r;
138
+ super(e), this.inversePixelTransform = t, this.frameState = n, this.context = r ?? void 0;
139
139
  }
140
140
  }, R = {
141
141
  OPACITY: "opacity",
@@ -148,7 +148,7 @@ var L = class extends r {
148
148
  MIN_ZOOM: "minZoom",
149
149
  SOURCE: "source",
150
150
  MAP: "map"
151
- }, z = class extends n {
151
+ }, z = class extends c {
152
152
  constructor(e) {
153
153
  super(), this.on, this.once, this.un, this.background_ = e.background;
154
154
  let t = Object.assign({}, e);
@@ -160,18 +160,18 @@ var L = class extends r {
160
160
  getClassName() {
161
161
  return this.className_;
162
162
  }
163
- getLayerState(t) {
164
- let n = this.state_ || {
163
+ getLayerState(e) {
164
+ let t = this.state_ || {
165
165
  layer: this,
166
- managed: t === void 0 || t
166
+ managed: e === void 0 || e
167
167
  }, r = this.getZIndex();
168
- return n.opacity = e(Math.round(this.getOpacity() * 100) / 100, 0, 1), n.visible = this.getVisible(), n.extent = this.getExtent(), n.zIndex = r === void 0 && !n.managed ? Infinity : r, n.maxResolution = this.getMaxResolution(), n.minResolution = Math.max(this.getMinResolution(), 0), n.minZoom = this.getMinZoom(), n.maxZoom = this.getMaxZoom(), this.state_ = n, n;
168
+ return t.opacity = n(Math.round(this.getOpacity() * 100) / 100, 0, 1), t.visible = this.getVisible(), t.extent = this.getExtent(), t.zIndex = r === void 0 && !t.managed ? Infinity : r, t.maxResolution = this.getMaxResolution(), t.minResolution = Math.max(this.getMinResolution(), 0), t.minZoom = this.getMinZoom(), t.maxZoom = this.getMaxZoom(), this.state_ = t, t;
169
169
  }
170
170
  getLayersArray(e) {
171
- return c();
171
+ return i();
172
172
  }
173
173
  getLayerStatesArray(e) {
174
- return c();
174
+ return i();
175
175
  }
176
176
  getExtent() {
177
177
  return this.get(R.EXTENT);
@@ -192,7 +192,7 @@ var L = class extends r {
192
192
  return this.get(R.OPACITY);
193
193
  }
194
194
  getSourceState() {
195
- return c();
195
+ return i();
196
196
  }
197
197
  getVisible() {
198
198
  return this.get(R.VISIBLE);
@@ -254,12 +254,14 @@ var L = class extends r {
254
254
  return e ? e.getState() : "undefined";
255
255
  }
256
256
  handleSourceChange_() {
257
- this.changed(), this.sourceReady_ || this.getSource().getState() !== "ready" || (this.sourceReady_ = !0, this.dispatchEvent("sourceready"));
257
+ this.changed();
258
+ let e = this.getSource();
259
+ e && !this.sourceReady_ && e.getState() === "ready" && (this.sourceReady_ = !0, this.dispatchEvent("sourceready"));
258
260
  }
259
261
  handleSourcePropertyChange_() {
260
- this.sourceChangeKey_ &&= (a(this.sourceChangeKey_), null), this.sourceReady_ = !1;
262
+ this.sourceChangeKey_ &&= (s(this.sourceChangeKey_), null), this.sourceReady_ = !1;
261
263
  let e = this.getSource();
262
- e && (this.sourceChangeKey_ = s(e, i.CHANGE, this.handleSourceChange_, this), e.getState() === "ready" && (this.sourceReady_ = !0, setTimeout(() => {
264
+ e && (this.sourceChangeKey_ = a(e, o.CHANGE, this.handleSourceChange_, this), e.getState() === "ready" && (this.sourceReady_ = !0, setTimeout(() => {
263
265
  this.dispatchEvent("sourceready");
264
266
  }, 0))), this.changed();
265
267
  }
@@ -269,18 +271,20 @@ var L = class extends r {
269
271
  getData(e) {
270
272
  return !this.renderer_ || !this.rendered ? null : this.renderer_.getData(e);
271
273
  }
272
- isVisible(e) {
273
- let t, n = this.getMapInternal();
274
- !e && n && (e = n.getView()), t = e instanceof d ? {
275
- viewState: e.getState(),
276
- extent: e.calculateExtent()
277
- } : e, !t.layerStatesArray && n && (t.layerStatesArray = n.getLayerGroup().getLayerStatesArray());
278
- let r;
279
- if (t.layerStatesArray) {
280
- if (r = t.layerStatesArray.find((e) => e.layer === this), !r) return !1;
281
- } else r = this.getLayerState();
282
- let i = this.getExtent();
283
- return V(r, t.viewState) && (!i || o(i, t.extent));
274
+ isVisible(t) {
275
+ let n, r = this.getMapInternal();
276
+ !t && r && (t = r.getView()), n = t instanceof d ? {
277
+ viewState: t.getState(),
278
+ extent: t.calculateExtent()
279
+ } : t;
280
+ let i = n;
281
+ !i.layerStatesArray && r && (i.layerStatesArray = r.getLayerGroup().getLayerStatesArray());
282
+ let a;
283
+ if (i.layerStatesArray) {
284
+ if (a = i.layerStatesArray.find((e) => e.layer === this), !a) return !1;
285
+ } else a = this.getLayerState();
286
+ let o = this.getExtent();
287
+ return V(a, i.viewState) && (!o || e(o, i.extent));
284
288
  }
285
289
  getAttributions(e) {
286
290
  if (!this.isVisible(e)) return [];
@@ -309,10 +313,12 @@ var L = class extends r {
309
313
  return this.get(R.MAP);
310
314
  }
311
315
  setMap(e) {
312
- this.mapPrecomposeKey_ &&= (a(this.mapPrecomposeKey_), null), e || this.changed(), this.mapRenderKey_ &&= (a(this.mapRenderKey_), null), e && (this.mapPrecomposeKey_ = s(e, f.PRECOMPOSE, this.handlePrecompose_, this), this.mapRenderKey_ = s(this, i.CHANGE, e.render, e), this.changed());
316
+ this.mapPrecomposeKey_ &&= (s(this.mapPrecomposeKey_), null), e || this.changed(), this.mapRenderKey_ &&= (s(this.mapRenderKey_), null), e && (this.mapPrecomposeKey_ = a(e, f.PRECOMPOSE, this.handlePrecompose_, this), this.mapRenderKey_ = a(this, o.CHANGE, e.render, e), this.changed());
313
317
  }
314
318
  handlePrecompose_(e) {
315
- let t = e.frameState.layerStatesArray, n = this.getLayerState(!1);
319
+ let t = e.frameState?.layerStatesArray;
320
+ if (!t) return;
321
+ let n = this.getLayerState(!1);
316
322
  u(!t.some((e) => e.layer === n.layer), "A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."), t.push(n);
317
323
  }
318
324
  setSource(e) {