@datagouv/components-next 1.5.1-dev.1396.g522e09d9 → 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
@@ -1,4 +1,4 @@
1
- import { At as e, ht as t, kt as n, mt as r, ot as i } from "./proj-COhZ08DR.js";
1
+ import { At as e, gt as t, ht as n, jt as r, st as i } from "./proj-0ED4AWuV.js";
2
2
  // ../node_modules/ol/easing.js
3
3
  function a(e) {
4
4
  return e ** 3;
@@ -52,8 +52,8 @@ function m(e, t, n, r, i) {
52
52
  }
53
53
  // ../node_modules/ol/geom/flat/intersectsextent.js
54
54
  function h(t, a, o, s, c, l) {
55
- return l ??= r(i(), t, a, o, s), n(c, l) ? l[0] >= c[0] && l[2] <= c[2] || l[1] >= c[1] && l[3] <= c[3] || m(t, a, o, s, function(t, n) {
56
- return e(c, t, n);
55
+ return l ??= n(i(), t, a, o, s), e(c, l) ? l[0] >= c[0] && l[2] <= c[2] || l[1] >= c[1] && l[3] <= c[3] || m(t, a, o, s, function(e, t) {
56
+ return r(c, e, t);
57
57
  }) : !1;
58
58
  }
59
59
  function g(e, t, n, r, i) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datagouv/components-next",
3
- "version": "1.5.1-dev.1396.g522e09d9",
3
+ "version": "1.5.1-dev.1398.g03d927e4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -31,14 +31,14 @@
31
31
  "@types/leaflet": "^1.9.22",
32
32
  "@vueuse/core": "^14.4.0",
33
33
  "@vueuse/router": "^14.4.0",
34
- "chart.js": "^4.5.1",
35
- "dompurify": "^3.4.17",
34
+ "chart.js": "^4.6.1",
35
+ "dompurify": "^3.4.18",
36
36
  "echarts": "^6.1.0",
37
37
  "geopf-extensions-openlayers": "1.0.0-beta.15",
38
38
  "leaflet": "^1.9.4",
39
- "maplibre-gl": "^6.13.0",
39
+ "maplibre-gl": "^6.18.0",
40
40
  "ofetch": "^1.5.1",
41
- "ol": "^10.10.0",
41
+ "ol": "^10.11.0",
42
42
  "pdfjs-dist": "^4.10.38",
43
43
  "pmtiles": "^4.5.0",
44
44
  "popmotion": "^11.0.5",
@@ -48,7 +48,7 @@
48
48
  "rehype-sanitize": "^6.0.0",
49
49
  "rehype-slug": "^6.0.0",
50
50
  "rehype-stringify": "^10.0.1",
51
- "reka-ui": "^2.10.4",
51
+ "reka-ui": "^2.11.0",
52
52
  "remark-behead": "^3.1.0",
53
53
  "remark-breaks": "^4.0.0",
54
54
  "remark-gfm": "^4.0.1",
@@ -57,36 +57,36 @@
57
57
  "strip-markdown": "^6.0.0",
58
58
  "stylefire": "^7.0.3",
59
59
  "unified": "^11.0.5",
60
- "unist-util-visit": "^5.1.0",
60
+ "unist-util-visit": "^5.2.0",
61
61
  "vue-content-loader": "^2.0.1",
62
62
  "vue-sonner": "^2.0.9",
63
63
  "vue3-json-viewer": "^2.4.1",
64
64
  "vue3-text-clamp": "^0.1.2",
65
65
  "vue3-xml-viewer": "^0.0.14",
66
- "yaml": "^2.9.0"
66
+ "yaml": "^2.9.1"
67
67
  },
68
68
  "devDependencies": {
69
- "@tailwindcss/cli": "^4.3.3",
69
+ "@tailwindcss/cli": "^4.3.5",
70
70
  "@tailwindcss/typography": "^0.5.20",
71
- "@tsconfig/node22": "^22.0.6",
71
+ "@tsconfig/node22": "^22.0.7",
72
72
  "@types/geojson": "^7946.0.16",
73
- "@types/node": "^22.20.2",
74
- "@vitejs/plugin-vue": "^6.0.8",
73
+ "@types/node": "^22.20.5",
74
+ "@vitejs/plugin-vue": "^6.0.11",
75
75
  "@vue/eslint-config-prettier": "^10.2.0",
76
76
  "@vue/eslint-config-typescript": "^14.9.0",
77
77
  "@vue/tsconfig": "^0.8.1",
78
78
  "eslint": "^9.39.5",
79
- "eslint-plugin-vue": "^10.11.0",
79
+ "eslint-plugin-vue": "^10.12.1",
80
80
  "jiti": "^2.7.0",
81
81
  "npm-run-all2": "^8.0.4",
82
82
  "openapi-types": "^12.1.3",
83
- "prettier": "^3.9.6",
84
- "tailwindcss": "^4.3.3",
83
+ "prettier": "^3.10.1",
84
+ "tailwindcss": "^4.3.5",
85
85
  "typescript": "^5.9.3",
86
- "vite": "^8.3.5",
86
+ "vite": "^8.3.8",
87
87
  "vite-plugin-vue-devtools": "^8.2.1",
88
- "vue": "^3.5.42",
89
- "vue-router": "^5.3.1",
88
+ "vue": "^3.5.45",
89
+ "vue-router": "^5.5.1",
90
90
  "vue-tsc": "3.3.11"
91
91
  },
92
92
  "peerDependencies": {
@@ -83,7 +83,6 @@ export type SelectGroupProps = {
83
83
  isValid?: boolean
84
84
  label: string
85
85
  hideLabel?: boolean
86
- modelValue?: string | boolean | null
87
86
  options: Array<SelectOption>
88
87
  required?: boolean
89
88
  validText?: string
@@ -98,7 +97,6 @@ const props = withDefaults(defineProps<SelectGroupProps>(), {
98
97
  hasError: false,
99
98
  hintText: '',
100
99
  isValid: false,
101
- modelValue: undefined,
102
100
  required: false,
103
101
  validText: '',
104
102
  hideLabel: false,
@@ -1,463 +0,0 @@
1
- import { B as e, Bt as t, Ct as n, Dt as r, Et as i, Ft as a, G as o, Ot as s, Q as c, U as l, Ut as u, _t as d, a as f, an as p, cn as m, ft as h, gt as g, ht as _, kt as v, m as y, nt as b, on as x, ot as S, p as C, pt as w, vt as T, wt as E, x as D, yt as O, zt as k } from "./proj-COhZ08DR.js";
2
- import { g as A, i as j, l as M, u as N, w as P } from "./Image-DVWRoLLI.js";
3
- import { C as F, n as I } from "./transform-CNeEnSK9.js";
4
- // ../node_modules/ol/Tile.js
5
- var L = class extends u {
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(p.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
- k();
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, n, r, i, a) {
97
- return `${t(e)},${n},${V(r, i, a)}`;
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 = D(n, t, e), a = C(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 || b(c, i)) {
135
- let t = C(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, O(n), r);
142
- return (!isFinite(i) || i <= 0) && _(n, function(n) {
143
- return i = Y(e, t, n, r), isFinite(i) && i > 0;
144
- }), i;
145
- }
146
- function X(e, t, r, a, c, l, u, d, f, p, m, g, _, v) {
147
- let y = N(Math.round(r * e), Math.round(r * t), K);
148
- if (g || (y.imageSmoothingEnabled = !1), f.length === 0) return y.canvas;
149
- y.scale(r, r);
150
- function b(e) {
151
- return Math.round(e * r) / r;
152
- }
153
- y.globalCompositeOperation = "lighter";
154
- let x = S();
155
- f.forEach(function(e, t, n) {
156
- h(x, e.extent);
157
- });
158
- let C, w = r / a, T = (g ? 1 : 1 + 2 ** -24) / w;
159
- if (!_ || f.length !== 1 || p !== 0) {
160
- if (C = N(Math.round(s(x) * w), Math.round(n(x) * w), K), g || (C.imageSmoothingEnabled = !1), c && v) {
161
- let e = (c[0] - x[0]) * w, t = -(c[3] - x[3]) * w, r = s(c) * w, i = n(c) * w;
162
- C.rect(e, t, r, i), C.clip();
163
- }
164
- f.forEach(function(e, t, r) {
165
- if (e.image.width > 0 && e.image.height > 0) {
166
- if (e.clipExtent) {
167
- C.save();
168
- let t = (e.clipExtent[0] - x[0]) * w, r = -(e.clipExtent[3] - x[3]) * w, i = s(e.clipExtent) * w, a = n(e.clipExtent) * w;
169
- C.rect(g ? t : Math.round(t), g ? r : Math.round(r), g ? i : Math.round(t + i) - Math.round(t), g ? a : Math.round(r + a) - Math.round(r)), C.clip();
170
- }
171
- let t = (e.extent[0] - x[0]) * w, r = -(e.extent[3] - x[3]) * w, i = s(e.extent) * w, a = n(e.extent) * w;
172
- C.drawImage(e.image, p, p, e.image.width - 2 * p, e.image.height - 2 * p, g ? t : Math.round(t), g ? r : Math.round(r), g ? i : Math.round(t + i) - Math.round(t), g ? a : Math.round(r + a) - Math.round(r)), e.clipExtent && C.restore();
173
- }
174
- });
175
- }
176
- let E = i(u);
177
- return d.getTriangles().forEach(function(e, t, r) {
178
- let i = e.source, a = e.target, c = i[0][0], u = i[0][1], d = i[1][0], p = i[1][1], m = i[2][0], h = i[2][1], _ = b((a[0][0] - E[0]) / l), v = b(-(a[0][1] - E[1]) / l), S = b((a[1][0] - E[0]) / l), w = b(-(a[1][1] - E[1]) / l), D = b((a[2][0] - E[0]) / l), O = b(-(a[2][1] - E[1]) / l), k = c, A = u;
179
- c = 0, u = 0, d -= k, p -= A, m -= k, h -= A;
180
- let j = [
181
- [
182
- d,
183
- p,
184
- 0,
185
- 0,
186
- S - _
187
- ],
188
- [
189
- m,
190
- h,
191
- 0,
192
- 0,
193
- D - _
194
- ],
195
- [
196
- 0,
197
- 0,
198
- d,
199
- p,
200
- w - v
201
- ],
202
- [
203
- 0,
204
- 0,
205
- m,
206
- h,
207
- O - v
208
- ]
209
- ], M = o(j);
210
- if (!M) return;
211
- if (y.save(), y.beginPath(), te() || !g) {
212
- y.moveTo(S, w);
213
- let e = _ - S, t = v - w;
214
- for (let n = 0; n < 4; n++) y.lineTo(S + b((n + 1) * e / 4), w + b(n * t / 3)), n != 3 && y.lineTo(S + b((n + 1) * e / 4), w + b((n + 1) * t / 3));
215
- y.lineTo(D, O);
216
- } else y.moveTo(S, w), y.lineTo(_, v), y.lineTo(D, O);
217
- y.clip(), y.transform(M[0], M[2], M[1], M[3], _, v), y.translate(x[0] - k, x[3] - A);
218
- let N;
219
- if (C) N = C.canvas, y.scale(T, -T);
220
- else {
221
- let e = f[0], t = e.extent;
222
- N = e.image, y.scale(s(t) / N.width, -n(t) / N.height);
223
- }
224
- y.drawImage(N, 0, 0), y.restore();
225
- }), C && (A(C), K.push(C.canvas)), m && (y.save(), y.globalCompositeOperation = "source-over", y.strokeStyle = "black", y.lineWidth = 1, d.getTriangles().forEach(function(e, t, n) {
226
- let r = e.target, i = (r[0][0] - E[0]) / l, a = -(r[0][1] - E[1]) / l, o = (r[1][0] - E[0]) / l, s = -(r[1][1] - E[1]) / l, c = (r[2][0] - E[0]) / l, u = -(r[2][1] - E[1]) / l;
227
- y.beginPath(), y.moveTo(o, s), y.lineTo(i, a), y.lineTo(c, u), y.closePath(), y.stroke();
228
- }), y.restore()), y.canvas;
229
- }
230
- // ../node_modules/ol/ImageTile.js
231
- var re = class extends L {
232
- constructor(e, t, n, r, i, a) {
233
- 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.image_.crossOrigin = this.crossOrigin_), this.referrerPolicy_ !== void 0 && (this.image_.referrerPolicy = this.referrerPolicy_)), this.unlisten_ = null, this.tileLoadFunction_ = i;
234
- }
235
- getImage() {
236
- return this.image_;
237
- }
238
- setImage(e) {
239
- this.image_ = e, this.state = M.LOADED, this.unlistenImage_(), this.changed();
240
- }
241
- getCrossOrigin() {
242
- return this.crossOrigin_;
243
- }
244
- getReferrerPolicy() {
245
- return this.referrerPolicy_;
246
- }
247
- handleImageError_() {
248
- this.state = M.ERROR, this.unlistenImage_(), this.image_ = ie(), this.changed();
249
- }
250
- handleImageLoad_() {
251
- if (P) this.state = M.LOADED;
252
- else {
253
- let e = this.image_;
254
- this.state = e.naturalWidth && e.naturalHeight ? M.LOADED : M.EMPTY;
255
- }
256
- this.unlistenImage_(), this.changed();
257
- }
258
- load() {
259
- this.state == M.ERROR && (this.state = M.IDLE, this.image_ = new Image(), this.crossOrigin_ !== null && (this.image_.crossOrigin = this.crossOrigin_), this.referrerPolicy_ !== void 0 && (this.image_.referrerPolicy = this.referrerPolicy_)), this.state == M.IDLE && (this.state = M.LOADING, this.changed(), this.tileLoadFunction_(this, this.src_), this.unlisten_ = j(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this)));
260
- }
261
- unlistenImage_() {
262
- this.unlisten_ &&= (this.unlisten_(), null);
263
- }
264
- disposeInternal() {
265
- this.unlistenImage_(), this.image_ = null, super.disposeInternal();
266
- }
267
- };
268
- function ie() {
269
- let e = N(1, 1);
270
- return e.fillStyle = "rgba(0,0,0,0)", e.fillRect(0, 0, 1, 1), e.canvas;
271
- }
272
- // ../node_modules/ol/reproj/Triangulation.js
273
- var ae = 10, Z = .25, Q = class {
274
- constructor(e, t, n, a, o, c, l) {
275
- this.sourceProj_ = e, this.targetProj_ = t;
276
- let u = {}, p = l ? f((e) => I(l, D(e, this.targetProj_, this.sourceProj_))) : y(this.targetProj_, this.sourceProj_);
277
- this.transformInv_ = function(e) {
278
- let t = e[0] + "/" + e[1];
279
- return u[t] || (u[t] = p(e)), u[t];
280
- }, this.maxSourceExtent_ = a, this.errorThresholdSquared_ = o * o, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!a && !!this.sourceProj_.getExtent() && s(a) >= s(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? s(this.sourceProj_.getExtent()) : null, this.targetWorldWidth_ = this.targetProj_.getExtent() ? s(this.targetProj_.getExtent()) : null;
281
- let m = i(n), h = r(n), _ = T(n), v = d(n), b = this.transformInv_(m), x = this.transformInv_(h), S = this.transformInv_(_), C = this.transformInv_(v), w = ae + (c ? Math.max(0, Math.ceil(Math.log2(g(n) / (c * c * 256 * 256)))) : 0);
282
- if (this.addQuad_(m, h, _, v, b, x, S, C, w), this.wrapsXInSource_) {
283
- let e = Infinity;
284
- this.triangles_.forEach(function(t, n, r) {
285
- e = Math.min(e, t.source[0][0], t.source[1][0], t.source[2][0]);
286
- }), this.triangles_.forEach((t) => {
287
- if (Math.max(t.source[0][0], t.source[1][0], t.source[2][0]) - e > this.sourceWorldWidth_ / 2) {
288
- let n = [
289
- [t.source[0][0], t.source[0][1]],
290
- [t.source[1][0], t.source[1][1]],
291
- [t.source[2][0], t.source[2][1]]
292
- ];
293
- n[0][0] - e > this.sourceWorldWidth_ / 2 && (n[0][0] -= this.sourceWorldWidth_), n[1][0] - e > this.sourceWorldWidth_ / 2 && (n[1][0] -= this.sourceWorldWidth_), n[2][0] - e > this.sourceWorldWidth_ / 2 && (n[2][0] -= this.sourceWorldWidth_);
294
- let r = Math.min(n[0][0], n[1][0], n[2][0]);
295
- Math.max(n[0][0], n[1][0], n[2][0]) - r < this.sourceWorldWidth_ / 2 && (t.source = n);
296
- }
297
- });
298
- }
299
- u = {};
300
- }
301
- addTriangle_(e, t, n, r, i, a) {
302
- this.triangles_.push({
303
- source: [
304
- r,
305
- i,
306
- a
307
- ],
308
- target: [
309
- e,
310
- t,
311
- n
312
- ]
313
- });
314
- }
315
- addQuad_(e, t, n, r, i, a, o, u, d) {
316
- let f = c([
317
- i,
318
- a,
319
- o,
320
- u
321
- ]), p = this.sourceWorldWidth_ ? s(f) / this.sourceWorldWidth_ : null, m = this.sourceWorldWidth_, h = this.sourceProj_.canWrapX() && p > .5 && p < 1, g = !1;
322
- if (d > 0) {
323
- if (this.targetProj_.isGlobal() && this.targetWorldWidth_) {
324
- let i = c([
325
- e,
326
- t,
327
- n,
328
- r
329
- ]);
330
- g = s(i) / this.targetWorldWidth_ > Z || g;
331
- }
332
- !h && this.sourceProj_.isGlobal() && p && (g = p > Z || g);
333
- }
334
- if (!g && this.maxSourceExtent_ && isFinite(f[0]) && isFinite(f[1]) && isFinite(f[2]) && isFinite(f[3]) && !v(f, this.maxSourceExtent_)) return;
335
- let _ = 0;
336
- if (!g && (!isFinite(i[0]) || !isFinite(i[1]) || !isFinite(a[0]) || !isFinite(a[1]) || !isFinite(o[0]) || !isFinite(o[1]) || !isFinite(u[0]) || !isFinite(u[1]))) {
337
- if (d > 0) g = !0;
338
- else if (_ = (!isFinite(i[0]) || !isFinite(i[1]) ? 8 : 0) + (!isFinite(a[0]) || !isFinite(a[1]) ? 4 : 0) + (!isFinite(o[0]) || !isFinite(o[1]) ? 2 : 0) + +(!isFinite(u[0]) || !isFinite(u[1])), _ != 1 && _ != 2 && _ != 4 && _ != 8) return;
339
- }
340
- if (d > 0) {
341
- if (!g) {
342
- let t = [(e[0] + n[0]) / 2, (e[1] + n[1]) / 2], r = this.transformInv_(t), a;
343
- a = h ? (l(i[0], m) + l(o[0], m)) / 2 - l(r[0], m) : (i[0] + o[0]) / 2 - r[0];
344
- let s = (i[1] + o[1]) / 2 - r[1];
345
- g = a * a + s * s > this.errorThresholdSquared_;
346
- }
347
- if (g) {
348
- if (Math.abs(e[0] - n[0]) <= Math.abs(e[1] - n[1])) {
349
- let s = [(t[0] + n[0]) / 2, (t[1] + n[1]) / 2], c = this.transformInv_(s), l = [(r[0] + e[0]) / 2, (r[1] + e[1]) / 2], f = this.transformInv_(l);
350
- this.addQuad_(e, t, s, l, i, a, c, f, d - 1), this.addQuad_(l, s, n, r, f, c, o, u, d - 1);
351
- } else {
352
- let s = [(e[0] + t[0]) / 2, (e[1] + t[1]) / 2], c = this.transformInv_(s), l = [(n[0] + r[0]) / 2, (n[1] + r[1]) / 2], f = this.transformInv_(l);
353
- this.addQuad_(e, s, l, r, i, c, f, u, d - 1), this.addQuad_(s, t, n, l, c, a, o, f, d - 1);
354
- }
355
- return;
356
- }
357
- }
358
- if (h) {
359
- if (!this.canWrapXInSource_) return;
360
- this.wrapsXInSource_ = !0;
361
- }
362
- _ & 11 || this.addTriangle_(e, n, r, i, o, u), _ & 14 || this.addTriangle_(e, n, t, i, o, a), _ && (_ & 13 || this.addTriangle_(t, r, e, a, u, i), _ & 7 || this.addTriangle_(t, r, n, a, u, o));
363
- }
364
- calculateSourceExtent() {
365
- let e = S();
366
- return this.triangles_.forEach(function(t, n, r) {
367
- let i = t.source;
368
- w(e, i[0]), w(e, i[1]), w(e, i[2]);
369
- }), e;
370
- }
371
- getTriangles() {
372
- return this.triangles_;
373
- }
374
- }, $ = .5, oe = class extends L {
375
- constructor(t, n, r, i, o, c, l, u, d, f, p, m) {
376
- super(o, M.IDLE, m), this.renderEdges_ = p !== void 0 && p, this.pixelRatio_ = l, this.gutter_ = u, this.canvas_ = null, this.sourceTileGrid_ = n, this.targetTileGrid_ = i, this.wrappedTileCoord_ = c || o, this.sourceTiles_ = [], this.sourcesListenerKeys_ = null, this.sourceZ_ = 0, this.clipExtent_ = t.canWrapX() ? t.getExtent() : void 0;
377
- let h = i.getTileCoordExtent(this.wrappedTileCoord_), _ = this.targetTileGrid_.getExtent(), v = this.sourceTileGrid_.getExtent(), y = _ ? E(h, _) : h;
378
- if (g(y) === 0) {
379
- this.state = M.EMPTY;
380
- return;
381
- }
382
- let b = t.getExtent();
383
- b && (v = v ? E(v, b) : b);
384
- let x = i.getResolution(this.wrappedTileCoord_[0]), S = ne(t, r, y, x);
385
- if (!isFinite(S) || S <= 0) {
386
- this.state = M.EMPTY;
387
- return;
388
- }
389
- let C = f === void 0 ? $ : f;
390
- if (this.triangulation_ = new Q(t, r, y, v, S * C, x), this.triangulation_.getTriangles().length === 0) {
391
- this.state = M.EMPTY;
392
- return;
393
- }
394
- this.sourceZ_ = n.getZForResolution(S);
395
- let w = this.triangulation_.calculateSourceExtent();
396
- if (v && (t.canWrapX() ? (w[1] = e(w[1], v[1], v[3]), w[3] = e(w[3], v[1], v[3])) : w = E(w, v)), !g(w)) this.state = M.EMPTY;
397
- else {
398
- let e = 0, r = 0;
399
- t.canWrapX() && (e = s(b), r = Math.floor((w[0] - b[0]) / e)), a(w.slice(), t, !0).forEach((t) => {
400
- let i = n.getTileRangeForExtentAndZ(t, this.sourceZ_);
401
- for (let t = i.minX; t <= i.maxX; t++) for (let n = i.minY; n <= i.maxY; n++) {
402
- let i = r * e;
403
- this.sourceTiles_.push({
404
- getTile: () => d(this.sourceZ_, t, n, l),
405
- offset: i
406
- });
407
- }
408
- ++r;
409
- }), this.sourceTiles_.length === 0 && (this.state = M.EMPTY);
410
- }
411
- }
412
- getImage() {
413
- return this.canvas_;
414
- }
415
- reproject_() {
416
- let e = [];
417
- if (this.sourceTiles_.forEach((t) => {
418
- let n = t.tile;
419
- if (n && n.getState() == M.LOADED) {
420
- let r = this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);
421
- r[0] += t.offset, r[2] += t.offset;
422
- let i = this.clipExtent_?.slice();
423
- i && (i[0] += t.offset, i[2] += t.offset), e.push({
424
- extent: r,
425
- clipExtent: i,
426
- image: n.getImage()
427
- });
428
- }
429
- }), this.sourceTiles_.length = 0, e.length === 0) this.state = M.ERROR;
430
- else {
431
- 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_);
432
- this.canvas_ = X(r, i, this.pixelRatio_, o, this.sourceTileGrid_.getExtent(), a, s, this.triangulation_, e, this.gutter_, this.renderEdges_, this.interpolate), this.state = M.LOADED;
433
- }
434
- this.changed();
435
- }
436
- load() {
437
- for (let e of this.sourceTiles_) e.tile = e.getTile();
438
- if (this.state == M.IDLE) {
439
- this.state = M.LOADING, this.changed();
440
- let e = 0;
441
- this.sourcesListenerKeys_ = [], this.sourceTiles_.forEach(({ tile: t }) => {
442
- let n = t.getState();
443
- if (n == M.IDLE || n == M.LOADING) {
444
- e++;
445
- let n = x(t, p.CHANGE, (r) => {
446
- let i = t.getState();
447
- (i == M.LOADED || i == M.ERROR || i == M.EMPTY) && (m(n), e--, e === 0 && (this.unlistenSources_(), this.reproject_()));
448
- });
449
- this.sourcesListenerKeys_.push(n);
450
- }
451
- }), e === 0 ? setTimeout(this.reproject_.bind(this), 0) : this.sourceTiles_.forEach(function({ tile: e }, t, n) {
452
- e.getState() == M.IDLE && e.load();
453
- });
454
- }
455
- }
456
- unlistenSources_() {
457
- this.sourcesListenerKeys_.forEach(m), this.sourcesListenerKeys_ = null;
458
- }
459
- release() {
460
- this.canvas_ &&= (A(this.canvas_.getContext("2d")), K.push(this.canvas_), null), this.sourceTiles_.length = 0, super.release();
461
- }
462
- };
463
- 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 };