@datagouv/components-next 1.5.1-dev.1397.g7333a397 → 1.5.1-dev.1398.g03d927e4

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 (34) hide show
  1. package/dist/{Control-DPuXeUqi.js → Control-BbyEe8x_.js} +7 -7
  2. package/dist/{Datafair.client-LlEgG7WU.js → Datafair.client-Dy9xu8CW.js} +1 -1
  3. package/dist/{Image-DVWRoLLI.js → Image-umPJvSA8.js} +16 -13
  4. package/dist/{ImagePreview.client-Db5dmxMP.js → ImagePreview.client-CwAd1LgO.js} +1 -1
  5. package/dist/{JsonPreview.client-DKy2AexC.js → JsonPreview.client-B_3llbkW.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-AMALm4aj.js} +7 -7
  9. package/dist/{OSM-B5Zc3qAf.js → OSM-Bm69tJpi.js} +1 -1
  10. package/dist/{PdfPreview.client-D3wHTDb9.js → PdfPreview.client-BzcjEgi5.js} +3 -3
  11. package/dist/{PdfSkeleton-nas5Pmia.js → PdfSkeleton-CEK7DOge.js} +1 -1
  12. package/dist/{Pmtiles.client-DncYrZSp.js → Pmtiles.client-C8SVSeQV.js} +9992 -9271
  13. package/dist/{PreviewError-EeaGx3SL.js → PreviewError-DOcS8Jau.js} +83 -46
  14. package/dist/{PreviewWrapper-BhldDdXK.js → PreviewWrapper-CdSsdB9s.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-BnIm8NMm.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 +11524 -10316
  24. package/dist/components.css +2 -2
  25. package/dist/{france-BtSQqcqV.js → france-DjD07ZB4.js} +1 -1
  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/Form/SelectGroup.vue +0 -2
  32. package/dist/Tile-Bu5lF4M5.js +0 -463
  33. package/dist/assets/maplibre-gl-worker-CEzvAyZY.js +0 -10
  34. package/dist/purify.es-eElsWhh7.js +0 -876
@@ -0,0 +1,479 @@
1
+ import { $ as e, At as t, Dt as n, Ht as r, It as i, K as a, Ot as o, Tt as s, V as c, W as l, Xt as u, Yt as d, _t as f, a as p, bt as m, cn as h, gt as g, kt as _, m as v, mt as y, p as b, pt as x, rt as S, sn as C, st as w, un as T, vt as E, wt as D, x as O, yt as k } from "./proj-0ED4AWuV.js";
2
+ import { g as A, i as j, l as M, u as N, w as P } from "./Image-umPJvSA8.js";
3
+ import { C as F, n as I } from "./transform-bRfffInI.js";
4
+ // ../node_modules/ol/Tile.js
5
+ var L = class extends r {
6
+ constructor(e, t, n) {
7
+ super(), n ||= {}, this.tileCoord = e, this.state = t, this.key = "", this.transition_ = n.transition === void 0 ? 250 : n.transition, this.transitionStarts_ = {}, this.interpolate = !!n.interpolate;
8
+ }
9
+ changed() {
10
+ this.dispatchEvent(C.CHANGE);
11
+ }
12
+ release() {
13
+ this.setState(M.EMPTY);
14
+ }
15
+ getKey() {
16
+ return this.key + "/" + this.tileCoord;
17
+ }
18
+ getTileCoord() {
19
+ return this.tileCoord;
20
+ }
21
+ getState() {
22
+ return this.state;
23
+ }
24
+ setState(e) {
25
+ if (this.state !== M.EMPTY) {
26
+ if (this.state !== M.ERROR && this.state > e) throw Error("Tile load sequence violation");
27
+ this.state = e, this.changed();
28
+ }
29
+ }
30
+ load() {
31
+ d();
32
+ }
33
+ getAlpha(e, t) {
34
+ if (!this.transition_) return 1;
35
+ let n = this.transitionStarts_[e];
36
+ if (!n) n = t, this.transitionStarts_[e] = n;
37
+ else if (n === -1) return 1;
38
+ let r = t - n + 1e3 / 60;
39
+ return r >= this.transition_ ? 1 : F(r / this.transition_);
40
+ }
41
+ inTransition(e) {
42
+ return this.transition_ ? this.transitionStarts_[e] !== -1 : !1;
43
+ }
44
+ endTransition(e) {
45
+ this.transition_ && (this.transitionStarts_[e] = -1);
46
+ }
47
+ disposeInternal() {
48
+ this.release(), super.disposeInternal();
49
+ }
50
+ }, R = class {
51
+ constructor(e, t, n, r) {
52
+ this.minX = e, this.maxX = t, this.minY = n, this.maxY = r;
53
+ }
54
+ contains(e) {
55
+ return this.containsXY(e[1], e[2]);
56
+ }
57
+ containsTileRange(e) {
58
+ return this.minX <= e.minX && e.maxX <= this.maxX && this.minY <= e.minY && e.maxY <= this.maxY;
59
+ }
60
+ containsXY(e, t) {
61
+ return this.minX <= e && e <= this.maxX && this.minY <= t && t <= this.maxY;
62
+ }
63
+ equals(e) {
64
+ return this.minX == e.minX && this.minY == e.minY && this.maxX == e.maxX && this.maxY == e.maxY;
65
+ }
66
+ extend(e) {
67
+ e.minX < this.minX && (this.minX = e.minX), e.maxX > this.maxX && (this.maxX = e.maxX), e.minY < this.minY && (this.minY = e.minY), e.maxY > this.maxY && (this.maxY = e.maxY);
68
+ }
69
+ getHeight() {
70
+ return this.maxY - this.minY + 1;
71
+ }
72
+ getSize() {
73
+ return [this.getWidth(), this.getHeight()];
74
+ }
75
+ getWidth() {
76
+ return this.maxX - this.minX + 1;
77
+ }
78
+ intersects(e) {
79
+ return this.minX <= e.maxX && this.maxX >= e.minX && this.minY <= e.maxY && this.maxY >= e.minY;
80
+ }
81
+ };
82
+ function z(e, t, n, r, i) {
83
+ return i === void 0 ? new R(e, t, n, r) : (i.minX = e, i.maxX = t, i.minY = n, i.maxY = r, i);
84
+ }
85
+ // ../node_modules/ol/tilecoord.js
86
+ function B(e, t, n, r) {
87
+ return r === void 0 ? [
88
+ e,
89
+ t,
90
+ n
91
+ ] : (r[0] = e, r[1] = t, r[2] = n, r);
92
+ }
93
+ function V(e, t, n) {
94
+ return e + "/" + t + "/" + n;
95
+ }
96
+ function H(e, t, n, r, i) {
97
+ return `${u(e)},${t},${V(n, r, i)}`;
98
+ }
99
+ function U(e) {
100
+ return W(e[0], e[1], e[2]);
101
+ }
102
+ function W(e, t, n) {
103
+ return (t << e) + n;
104
+ }
105
+ function ee(e, t) {
106
+ let n = e[0], r = e[1], i = e[2];
107
+ if (t.getMinZoom() > n || n > t.getMaxZoom()) return !1;
108
+ let a = t.getFullTileRange(n);
109
+ return !a || a.containsXY(r, i);
110
+ }
111
+ // ../node_modules/ol/reproj.js
112
+ var G, K = [];
113
+ function q(e, t, n, r, i) {
114
+ e.beginPath(), e.moveTo(0, 0), e.lineTo(t, n), e.lineTo(r, i), e.closePath(), e.save(), e.clip(), e.fillRect(0, 0, Math.max(t, r) + 1, Math.max(n, i)), e.restore();
115
+ }
116
+ function J(e, t) {
117
+ return Math.abs(e[t * 4] - 210) > 2 || Math.abs(e[t * 4 + 3] - 191.25) > 2;
118
+ }
119
+ function te() {
120
+ if (G === void 0) {
121
+ let e = N(6, 6, K);
122
+ e.globalCompositeOperation = "lighter", e.fillStyle = "rgba(210, 0, 0, 0.75)", q(e, 4, 5, 4, 0), q(e, 4, 5, 0, 5);
123
+ let t = e.getImageData(0, 0, 3, 3).data;
124
+ G = J(t, 0) || J(t, 4) || J(t, 8), A(e), K.push(e.canvas);
125
+ }
126
+ return G;
127
+ }
128
+ function Y(e, t, n, r) {
129
+ let i = O(n, t, e), a = b(t, r, n), o = t.getMetersPerUnit();
130
+ o !== void 0 && (a *= o);
131
+ let s = e.getMetersPerUnit();
132
+ s !== void 0 && (a /= s);
133
+ let c = e.getExtent();
134
+ if (!c || S(c, i)) {
135
+ let t = b(e, a, i) / a;
136
+ isFinite(t) && t > 0 && (a /= t);
137
+ }
138
+ return a;
139
+ }
140
+ function ne(e, t, n, r) {
141
+ let i = Y(e, t, m(n), r);
142
+ return (!isFinite(i) || i <= 0) && g(n, function(n) {
143
+ return i = Y(e, t, n, r), isFinite(i) && i > 0;
144
+ }), i;
145
+ }
146
+ function X(e, t, r, i, o, s, c, l, u, d, f, p, m, h) {
147
+ let g = N(Math.round(r * e), Math.round(r * t), K);
148
+ if (p || (g.imageSmoothingEnabled = !1), u.length === 0) return g.canvas;
149
+ g.scale(r, r);
150
+ function v(e) {
151
+ return Math.round(e * r) / r;
152
+ }
153
+ g.globalCompositeOperation = "lighter";
154
+ let y = w();
155
+ u.forEach(function(e, t, n) {
156
+ x(y, e.extent);
157
+ });
158
+ let b, S = r / i, C = (p ? 1 : 1 + 2 ** -24) / S;
159
+ if (!m || u.length !== 1 || d !== 0) {
160
+ let e = N(Math.round(_(y) * S), Math.round(D(y) * S), K);
161
+ if (b = e, p || (e.imageSmoothingEnabled = !1), o && h) {
162
+ let t = (o[0] - y[0]) * S, n = -(o[3] - y[3]) * S, r = _(o) * S, i = D(o) * S;
163
+ e.rect(t, n, r, i), e.clip();
164
+ }
165
+ u.forEach(function(t, n, r) {
166
+ if (t.image.width > 0 && t.image.height > 0) {
167
+ if (t.clipExtent) {
168
+ e.save();
169
+ let n = (t.clipExtent[0] - y[0]) * S, r = -(t.clipExtent[3] - y[3]) * S, i = _(t.clipExtent) * S, a = D(t.clipExtent) * S;
170
+ e.rect(p ? n : Math.round(n), p ? r : Math.round(r), p ? i : Math.round(n + i) - Math.round(n), p ? a : Math.round(r + a) - Math.round(r)), e.clip();
171
+ }
172
+ let n = (t.extent[0] - y[0]) * S, r = -(t.extent[3] - y[3]) * S, i = _(t.extent) * S, a = D(t.extent) * S;
173
+ e.drawImage(t.image, d, d, t.image.width - 2 * d, t.image.height - 2 * d, p ? n : Math.round(n), p ? r : Math.round(r), p ? i : Math.round(n + i) - Math.round(n), p ? a : Math.round(r + a) - Math.round(r)), t.clipExtent && e.restore();
174
+ }
175
+ });
176
+ }
177
+ let T = n(c);
178
+ return l.getTriangles().forEach(function(e, t, n) {
179
+ let r = e.source, i = e.target, o = r[0][0], c = r[0][1], l = r[1][0], d = r[1][1], f = r[2][0], m = r[2][1], h = v((i[0][0] - T[0]) / s), x = v(-(i[0][1] - T[1]) / s), S = v((i[1][0] - T[0]) / s), w = v(-(i[1][1] - T[1]) / s), E = v((i[2][0] - T[0]) / s), O = v(-(i[2][1] - T[1]) / s), k = o, A = c;
180
+ o = 0, c = 0, l -= k, d -= A, f -= k, m -= A;
181
+ let j = [
182
+ [
183
+ l,
184
+ d,
185
+ 0,
186
+ 0,
187
+ S - h
188
+ ],
189
+ [
190
+ f,
191
+ m,
192
+ 0,
193
+ 0,
194
+ E - h
195
+ ],
196
+ [
197
+ 0,
198
+ 0,
199
+ l,
200
+ d,
201
+ w - x
202
+ ],
203
+ [
204
+ 0,
205
+ 0,
206
+ f,
207
+ m,
208
+ O - x
209
+ ]
210
+ ], M = a(j);
211
+ if (!M) return;
212
+ if (g.save(), g.beginPath(), te() || !p) {
213
+ g.moveTo(S, w);
214
+ let e = h - S, t = x - w;
215
+ for (let n = 0; n < 4; n++) g.lineTo(S + v((n + 1) * e / 4), w + v(n * t / 3)), n != 3 && g.lineTo(S + v((n + 1) * e / 4), w + v((n + 1) * t / 3));
216
+ g.lineTo(E, O);
217
+ } else g.moveTo(S, w), g.lineTo(h, x), g.lineTo(E, O);
218
+ g.clip(), g.transform(M[0], M[2], M[1], M[3], h, x), g.translate(y[0] - k, y[3] - A);
219
+ let N;
220
+ if (b) N = b.canvas, g.scale(C, -C);
221
+ else {
222
+ let e = u[0], t = e.extent;
223
+ N = e.image, g.scale(_(t) / N.width, -D(t) / N.height);
224
+ }
225
+ g.drawImage(N, 0, 0), g.restore();
226
+ }), b && (A(b), K.push(b.canvas)), f && (g.save(), g.globalCompositeOperation = "source-over", g.strokeStyle = "black", g.lineWidth = 1, l.getTriangles().forEach(function(e, t, n) {
227
+ let r = e.target, i = (r[0][0] - T[0]) / s, a = -(r[0][1] - T[1]) / s, o = (r[1][0] - T[0]) / s, c = -(r[1][1] - T[1]) / s, l = (r[2][0] - T[0]) / s, u = -(r[2][1] - T[1]) / s;
228
+ g.beginPath(), g.moveTo(o, c), g.lineTo(i, a), g.lineTo(l, u), g.closePath(), g.stroke();
229
+ }), g.restore()), g.canvas;
230
+ }
231
+ // ../node_modules/ol/ImageTile.js
232
+ var re = class extends L {
233
+ constructor(e, t, n, r, i, a) {
234
+ super(e, t, a), this.crossOrigin_ = r?.crossOrigin, this.referrerPolicy_ = r?.referrerPolicy, this.src_ = n, this.key = n, this.image_, P ? this.image_ = new OffscreenCanvas(1, 1) : (this.image_ = new Image(), this.crossOrigin_ !== null && this.crossOrigin_ !== void 0 && (this.image_.crossOrigin = this.crossOrigin_), this.referrerPolicy_ !== void 0 && (this.image_.referrerPolicy = this.referrerPolicy_)), this.unlisten_ = null, this.tileLoadFunction_ = i;
235
+ }
236
+ getImage() {
237
+ return this.image_;
238
+ }
239
+ setImage(e) {
240
+ this.image_ = e, this.state = M.LOADED, this.unlistenImage_(), this.changed();
241
+ }
242
+ getCrossOrigin() {
243
+ return this.crossOrigin_ ?? null;
244
+ }
245
+ getReferrerPolicy() {
246
+ return this.referrerPolicy_;
247
+ }
248
+ handleImageError_() {
249
+ this.state = M.ERROR, this.unlistenImage_(), this.image_ = ie(), this.changed();
250
+ }
251
+ handleImageLoad_() {
252
+ if (P) this.state = M.LOADED;
253
+ else {
254
+ let e = this.image_;
255
+ this.state = e.naturalWidth && e.naturalHeight ? M.LOADED : M.EMPTY;
256
+ }
257
+ this.unlistenImage_(), this.changed();
258
+ }
259
+ load() {
260
+ if (this.state == M.ERROR && (this.state = M.IDLE, this.image_ = new Image(), this.crossOrigin_ !== null && this.crossOrigin_ !== void 0 && (this.image_.crossOrigin = this.crossOrigin_), this.referrerPolicy_ !== void 0 && (this.image_.referrerPolicy = this.referrerPolicy_)), this.state == M.IDLE) {
261
+ this.state = M.LOADING, this.changed(), this.tileLoadFunction_(this, this.src_);
262
+ let e = this.image_;
263
+ e && (this.unlisten_ = j(e, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this)));
264
+ }
265
+ }
266
+ unlistenImage_() {
267
+ this.unlisten_ &&= (this.unlisten_(), null);
268
+ }
269
+ disposeInternal() {
270
+ this.unlistenImage_(), this.image_ = null, super.disposeInternal();
271
+ }
272
+ };
273
+ function ie() {
274
+ let e = N(1, 1);
275
+ return e.fillStyle = "rgba(0,0,0,0)", e.fillRect(0, 0, 1, 1), e.canvas;
276
+ }
277
+ // ../node_modules/ol/reproj/Triangulation.js
278
+ var ae = 10, Z = .25, Q = class {
279
+ constructor(e, t, r, i, a, s, c) {
280
+ this.sourceProj_ = e, this.targetProj_ = t;
281
+ let l = {}, u = c ? p((e) => I(c, O(e, this.targetProj_, this.sourceProj_))) : v(this.targetProj_, this.sourceProj_);
282
+ this.transformInv_ = function(e) {
283
+ let t = e[0] + "/" + e[1];
284
+ return l[t] || (l[t] = u(e)), l[t];
285
+ }, this.maxSourceExtent_ = i, this.errorThresholdSquared_ = a * a, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!i && !!this.sourceProj_.getExtent() && _(i) >= _(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? _(this.sourceProj_.getExtent()) : void 0, this.targetWorldWidth_ = this.targetProj_.getExtent() ? _(this.targetProj_.getExtent()) : void 0;
286
+ let d = n(r), m = o(r), h = k(r), g = E(r), y = this.transformInv_(d), b = this.transformInv_(m), x = this.transformInv_(h), S = this.transformInv_(g), C = ae + (s ? Math.max(0, Math.ceil(Math.log2(f(r) / (s * s * 256 * 256)))) : 0);
287
+ if (this.addQuad_(d, m, h, g, y, b, x, S, C), this.wrapsXInSource_) {
288
+ let e = this.sourceWorldWidth_;
289
+ if (!e) return;
290
+ let t = Infinity;
291
+ this.triangles_.forEach(function(e, n, r) {
292
+ t = Math.min(t, e.source[0][0], e.source[1][0], e.source[2][0]);
293
+ }), this.triangles_.forEach((n) => {
294
+ if (Math.max(n.source[0][0], n.source[1][0], n.source[2][0]) - t > e / 2) {
295
+ let r = [
296
+ [n.source[0][0], n.source[0][1]],
297
+ [n.source[1][0], n.source[1][1]],
298
+ [n.source[2][0], n.source[2][1]]
299
+ ];
300
+ r[0][0] - t > e / 2 && (r[0][0] -= e), r[1][0] - t > e / 2 && (r[1][0] -= e), r[2][0] - t > e / 2 && (r[2][0] -= e);
301
+ let i = Math.min(r[0][0], r[1][0], r[2][0]);
302
+ Math.max(r[0][0], r[1][0], r[2][0]) - i < e / 2 && (n.source = r);
303
+ }
304
+ });
305
+ }
306
+ l = {};
307
+ }
308
+ addTriangle_(e, t, n, r, i, a) {
309
+ this.triangles_.push({
310
+ source: [
311
+ r,
312
+ i,
313
+ a
314
+ ],
315
+ target: [
316
+ e,
317
+ t,
318
+ n
319
+ ]
320
+ });
321
+ }
322
+ addQuad_(n, r, i, a, o, s, c, u, d) {
323
+ let f = e([
324
+ o,
325
+ s,
326
+ c,
327
+ u
328
+ ]), p = this.sourceWorldWidth_, m = p ? _(f) / p : void 0, h = this.sourceProj_.canWrapX() && m !== void 0 && m > .5 && m < 1, g = !1;
329
+ if (d > 0) {
330
+ if (this.targetProj_.isGlobal() && this.targetWorldWidth_) {
331
+ let t = e([
332
+ n,
333
+ r,
334
+ i,
335
+ a
336
+ ]);
337
+ g = _(t) / this.targetWorldWidth_ > Z || g;
338
+ }
339
+ !h && this.sourceProj_.isGlobal() && m && (g = m > Z || g);
340
+ }
341
+ if (!g && this.maxSourceExtent_ && isFinite(f[0]) && isFinite(f[1]) && isFinite(f[2]) && isFinite(f[3]) && !t(f, this.maxSourceExtent_)) return;
342
+ let v = 0;
343
+ if (!g && (!isFinite(o[0]) || !isFinite(o[1]) || !isFinite(s[0]) || !isFinite(s[1]) || !isFinite(c[0]) || !isFinite(c[1]) || !isFinite(u[0]) || !isFinite(u[1]))) {
344
+ if (d > 0) g = !0;
345
+ else if (v = (!isFinite(o[0]) || !isFinite(o[1]) ? 8 : 0) + (!isFinite(s[0]) || !isFinite(s[1]) ? 4 : 0) + (!isFinite(c[0]) || !isFinite(c[1]) ? 2 : 0) + +(!isFinite(u[0]) || !isFinite(u[1])), v != 1 && v != 2 && v != 4 && v != 8) return;
346
+ }
347
+ if (d > 0) {
348
+ if (!g) {
349
+ let e = [(n[0] + i[0]) / 2, (n[1] + i[1]) / 2], t = this.transformInv_(e), r;
350
+ if (h) {
351
+ let e = p;
352
+ r = (l(o[0], e) + l(c[0], e)) / 2 - l(t[0], e);
353
+ } else r = (o[0] + c[0]) / 2 - t[0];
354
+ let a = (o[1] + c[1]) / 2 - t[1];
355
+ g = r * r + a * a > this.errorThresholdSquared_;
356
+ }
357
+ if (g) {
358
+ if (Math.abs(n[0] - i[0]) <= Math.abs(n[1] - i[1])) {
359
+ let e = [(r[0] + i[0]) / 2, (r[1] + i[1]) / 2], t = this.transformInv_(e), l = [(a[0] + n[0]) / 2, (a[1] + n[1]) / 2], f = this.transformInv_(l);
360
+ this.addQuad_(n, r, e, l, o, s, t, f, d - 1), this.addQuad_(l, e, i, a, f, t, c, u, d - 1);
361
+ } else {
362
+ let e = [(n[0] + r[0]) / 2, (n[1] + r[1]) / 2], t = this.transformInv_(e), l = [(i[0] + a[0]) / 2, (i[1] + a[1]) / 2], f = this.transformInv_(l);
363
+ this.addQuad_(n, e, l, a, o, t, f, u, d - 1), this.addQuad_(e, r, i, l, t, s, c, f, d - 1);
364
+ }
365
+ return;
366
+ }
367
+ }
368
+ if (h) {
369
+ if (!this.canWrapXInSource_) return;
370
+ this.wrapsXInSource_ = !0;
371
+ }
372
+ v & 11 || this.addTriangle_(n, i, a, o, c, u), v & 14 || this.addTriangle_(n, i, r, o, c, s), v && (v & 13 || this.addTriangle_(r, a, n, s, u, o), v & 7 || this.addTriangle_(r, a, i, s, u, c));
373
+ }
374
+ calculateSourceExtent() {
375
+ let e = w();
376
+ return this.triangles_.forEach(function(t, n, r) {
377
+ let i = t.source;
378
+ y(e, i[0]), y(e, i[1]), y(e, i[2]);
379
+ }), e;
380
+ }
381
+ getTriangles() {
382
+ return this.triangles_;
383
+ }
384
+ }, $ = .5, oe = class extends L {
385
+ constructor(e, t, n, r, a, o, l, u, d, p, m, h) {
386
+ super(a, M.IDLE, h), this.renderEdges_ = m !== void 0 && m, this.pixelRatio_ = l, this.gutter_ = u, this.canvas_ = null, this.sourceTileGrid_ = t, this.targetTileGrid_ = r, this.wrappedTileCoord_ = o || a, this.sourceTiles_ = [], this.sourcesListenerKeys_ = null, this.sourceZ_ = 0, this.clipExtent_ = e.canWrapX() && e.getExtent() || void 0;
387
+ let g = r.getTileCoordExtent(this.wrappedTileCoord_), v = this.targetTileGrid_.getExtent(), y = this.sourceTileGrid_.getExtent(), b = v ? s(g, v) : g;
388
+ if (f(b) === 0) {
389
+ this.state = M.EMPTY;
390
+ return;
391
+ }
392
+ let x = e.getExtent();
393
+ x && (y = y ? s(y, x) : x);
394
+ let S = r.getResolution(this.wrappedTileCoord_[0]), C = ne(e, n, b, S);
395
+ if (!isFinite(C) || C <= 0) {
396
+ this.state = M.EMPTY;
397
+ return;
398
+ }
399
+ let w = p === void 0 ? $ : p;
400
+ if (this.triangulation_ = new Q(e, n, b, y || void 0, C * w, S), this.triangulation_.getTriangles().length === 0) {
401
+ this.state = M.EMPTY;
402
+ return;
403
+ }
404
+ this.sourceZ_ = t.getZForResolution(C);
405
+ let T = this.triangulation_.calculateSourceExtent();
406
+ if (y && (e.canWrapX() ? (T[1] = c(T[1], y[1], y[3]), T[3] = c(T[3], y[1], y[3])) : T = s(T, y)), !f(T)) this.state = M.EMPTY;
407
+ else {
408
+ let n = 0, r = 0;
409
+ e.canWrapX() && (n = _(x), r = Math.floor((T[0] - x[0]) / n)), i(T.slice(), e, !0).forEach((e) => {
410
+ let i = t.getTileRangeForExtentAndZ(e, this.sourceZ_);
411
+ for (let e = i.minX; e <= i.maxX; e++) for (let t = i.minY; t <= i.maxY; t++) {
412
+ let i = r * n;
413
+ this.sourceTiles_.push({
414
+ getTile: () => d(this.sourceZ_, e, t, l),
415
+ offset: i
416
+ });
417
+ }
418
+ ++r;
419
+ }), this.sourceTiles_.length === 0 && (this.state = M.EMPTY);
420
+ }
421
+ }
422
+ getImage() {
423
+ return this.canvas_;
424
+ }
425
+ reproject_() {
426
+ let e = [];
427
+ if (this.sourceTiles_.forEach((t) => {
428
+ let n = t.tile;
429
+ if (n && n.getState() == M.LOADED) {
430
+ let r = this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);
431
+ r[0] += t.offset, r[2] += t.offset;
432
+ let i = this.clipExtent_?.slice();
433
+ i && (i[0] += t.offset, i[2] += t.offset);
434
+ let a = n.getImage();
435
+ if (!a) return;
436
+ e.push({
437
+ extent: r,
438
+ clipExtent: i,
439
+ image: a
440
+ });
441
+ }
442
+ }), this.sourceTiles_.length = 0, e.length === 0) this.state = M.ERROR;
443
+ else {
444
+ let t = this.wrappedTileCoord_[0], n = this.targetTileGrid_.getTileSize(t), r = typeof n == "number" ? n : n[0], i = typeof n == "number" ? n : n[1], a = this.targetTileGrid_.getResolution(t), o = this.sourceTileGrid_.getResolution(this.sourceZ_), s = this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);
445
+ this.canvas_ = X(r, i, this.pixelRatio_, o, this.sourceTileGrid_.getExtent() ?? s, a, s, this.triangulation_, e, this.gutter_, this.renderEdges_, this.interpolate), this.state = M.LOADED;
446
+ }
447
+ this.changed();
448
+ }
449
+ load() {
450
+ for (let e of this.sourceTiles_) e.tile = e.getTile();
451
+ if (this.state == M.IDLE) {
452
+ this.state = M.LOADING, this.changed();
453
+ let e = 0;
454
+ this.sourcesListenerKeys_ = [], this.sourceTiles_.forEach((t) => {
455
+ let n = t.tile;
456
+ if (!n) return;
457
+ let r = n.getState();
458
+ if (r == M.IDLE || r == M.LOADING) {
459
+ e++;
460
+ let t = h(n, C.CHANGE, () => {
461
+ let r = n.getState();
462
+ (r == M.LOADED || r == M.ERROR || r == M.EMPTY) && (T(t), e--, e === 0 && (this.unlistenSources_(), this.reproject_()));
463
+ });
464
+ this.sourcesListenerKeys_.push(t);
465
+ }
466
+ }), e === 0 ? setTimeout(this.reproject_.bind(this), 0) : this.sourceTiles_.forEach(function(e) {
467
+ let t = e.tile;
468
+ t && t.getState() == M.IDLE && t.load();
469
+ });
470
+ }
471
+ }
472
+ unlistenSources_() {
473
+ this.sourcesListenerKeys_ &&= (this.sourcesListenerKeys_.forEach(T), null);
474
+ }
475
+ release() {
476
+ this.canvas_ &&= (A(this.canvas_.getContext("2d")), K.push(this.canvas_), null), this.sourceTiles_.length = 0, super.release();
477
+ }
478
+ };
479
+ export { Y as a, H as c, R as d, z as f, re as i, U as l, $ as n, X as o, L as p, Q as r, B as s, oe as t, ee as u };