@datagouv/components-next 1.0.0 → 1.0.2-dev.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.
Files changed (62) hide show
  1. package/assets/main.css +0 -28
  2. package/dist/{Control-BNCDn-8E.js → Control-DuZJdKV_.js} +1 -1
  3. package/dist/{Datafair.client-Dls5AHTE.js → Datafair.client-DpeBuzZZ.js} +2 -2
  4. package/dist/{Event-BOgJUhNR.js → Event--kp8kMdJ.js} +21 -21
  5. package/dist/{Image-BN-4XkIn.js → Image-34hvypZI.js} +114 -58
  6. package/dist/{JsonPreview.client-DPDTs433.js → JsonPreview.client-B3sQR-rW.js} +16 -16
  7. package/dist/{Map-BdT3i2C4.js → Map-BjUnLyj8.js} +1534 -1466
  8. package/dist/{MapContainer.client-BdAzd7bj.js → MapContainer.client-BA6GCqKX.js} +8 -8
  9. package/dist/{OSM-CamriM9b.js → OSM-s40W6sQ2.js} +22 -12
  10. package/dist/PdfPreview.client-CbeSChb8.js +14513 -0
  11. package/dist/Pmtiles.client-D8pFim1L.js +25190 -0
  12. package/dist/{ScaleLine-BiesrgOv.js → ScaleLine-KW-nXqp3.js} +2 -2
  13. package/dist/Swagger.client-B-2Q16qa.js +4 -0
  14. package/dist/{Tile-DCuqwNOI.js → Tile-DbNFNPfU.js} +189 -172
  15. package/dist/{TileImage-CmZf8EdU.js → TileImage-BsXBxMtq.js} +132 -102
  16. package/dist/{View-DcDc7N2K.js → View-BR92hTWP.js} +8 -8
  17. package/dist/{XmlPreview.client-C0OgBkSq.js → XmlPreview.client-DWJt61wG.js} +15 -15
  18. package/dist/{common-C4rDcQpp.js → common-PJfpC179.js} +34 -33
  19. package/dist/components-next.css +4 -4
  20. package/dist/components-next.js +130 -125
  21. package/dist/components.css +2 -2
  22. package/dist/{index-BRGqW8aQ.js → index-DVp7Y0Xu.js} +11105 -6743
  23. package/dist/{main-CNHxAJ8J.js → main-CrSRA2X-.js} +25208 -25053
  24. package/dist/{proj-CKwYjU38.js → proj-DsetBcW7.js} +513 -498
  25. package/dist/{tilecoord-YW3qEH_j.js → tilecoord-Db24Px13.js} +242 -224
  26. package/dist/{vue3-xml-viewer.common-CmAdQfIy.js → vue3-xml-viewer.common-BjA4LdSC.js} +1 -1
  27. package/package.json +3 -2
  28. package/src/components/DataserviceCard.vue +3 -3
  29. package/src/components/DatasetCard.vue +2 -2
  30. package/src/components/DatasetQuality.vue +23 -16
  31. package/src/components/DatasetQualityInline.vue +13 -17
  32. package/src/components/DatasetQualityScore.vue +12 -15
  33. package/src/components/DiscussionMessageCard.vue +1 -1
  34. package/src/components/ObjectCard.vue +2 -2
  35. package/src/components/ObjectCardHeader.vue +1 -1
  36. package/src/components/OrganizationHorizontalCard.vue +87 -0
  37. package/src/components/OrganizationNameWithCertificate.vue +1 -1
  38. package/src/components/ProgressBar.vue +31 -0
  39. package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
  40. package/src/components/ResourceAccordion/JsonPreview.client.vue +3 -3
  41. package/src/components/ResourceAccordion/MapContainer.client.vue +1 -1
  42. package/src/components/ResourceAccordion/PdfPreview.client.vue +70 -74
  43. package/src/components/ResourceAccordion/Pmtiles.client.vue +1 -1
  44. package/src/components/ResourceAccordion/Preview.vue +1 -1
  45. package/src/components/ResourceAccordion/ResourceAccordion.vue +5 -8
  46. package/src/components/ResourceAccordion/XmlPreview.client.vue +3 -3
  47. package/src/components/ReuseHorizontalCard.vue +1 -1
  48. package/src/components/Search/Filter/ProducerTypeFilter.vue +13 -3
  49. package/src/components/Search/GlobalSearch.vue +124 -28
  50. package/src/components/Toggletip.vue +5 -2
  51. package/src/components/TopicCard.vue +1 -1
  52. package/src/composables/useHasTabularData.ts +15 -0
  53. package/src/composables/useResourceCapabilities.ts +3 -4
  54. package/src/composables/useTranslation.ts +2 -1
  55. package/src/functions/api.types.ts +1 -1
  56. package/src/main.ts +8 -1
  57. package/src/types/search.ts +29 -1
  58. package/dist/PdfPreview.client-CopqSDyt.js +0 -107
  59. package/dist/Pmtiles.client-mF6xaOO_.js +0 -22812
  60. package/dist/Swagger.client-eJ7gpfZA.js +0 -4
  61. package/dist/pdf-vue3-IkJO65RH.js +0 -273
  62. package/dist/pdf.min-f72cfa08-CdgJTooZ.js +0 -9501
@@ -1,15 +1,15 @@
1
- import { b as Y, e as f, d as G, h as I, w as D, I as v, R as K } from "./tilecoord-YW3qEH_j.js";
2
- import { t as g, s as k, T as _ } from "./Image-BN-4XkIn.js";
3
- import { aQ as N, an as W, p as b, L as q, a6 as B, N as x, R, C as S, M as H, D as $, K as y, W as V, aR as Q, U as J, B as tt, a as E, ak as et, I as it, e as z, E as nt } from "./proj-CKwYjU38.js";
4
- import { a as m, w as A, x as rt, D as st } from "./common-C4rDcQpp.js";
1
+ import { b as Y, e as f, d as b, h as D, w as v, I as K, R as N, g as k } from "./tilecoord-Db24Px13.js";
2
+ import { t as g, s as W, T as _, W as q } from "./Image-34hvypZI.js";
3
+ import { aQ as H, an as $, q as j, N as V, a7 as B, P as F, S as x, D as E, M as J, F as Q, L as w, X as tt, aR as et, W as it, B as nt, a as R, al as rt, J as st, e as z, E as ot } from "./proj-DsetBcW7.js";
4
+ import { a as m, x as A, y as lt, D as at } from "./common-PJfpC179.js";
5
5
  const T = [0, 0, 0], d = 5;
6
- class p {
6
+ class X {
7
7
  /**
8
8
  * @param {Options} options Tile grid options.
9
9
  */
10
10
  constructor(t) {
11
11
  this.minZoom = t.minZoom !== void 0 ? t.minZoom : 0, this.resolutions_ = t.resolutions, m(
12
- N(
12
+ H(
13
13
  this.resolutions_,
14
14
  /**
15
15
  * @param {number} a First resolution
@@ -35,7 +35,7 @@ class p {
35
35
  "Number of `origins` and `resolutions` must be equal"
36
36
  ));
37
37
  const i = t.extent;
38
- i !== void 0 && !this.origin_ && !this.origins_ && (this.origin_ = W(i)), m(
38
+ i !== void 0 && !this.origin_ && !this.origins_ && (this.origin_ = $(i)), m(
39
39
  !this.origin_ && this.origins_ || this.origin_ && !this.origins_,
40
40
  "Either `origin` or `origins` must be configured, never both"
41
41
  ), this.tileSizes_ = null, t.tileSizes !== void 0 && (this.tileSizes_ = t.tileSizes, m(
@@ -194,8 +194,8 @@ class p {
194
194
  const a = Math.pow(this.zoomFactor_, e - n), h = Math.floor(r * a), u = Math.floor(s * a);
195
195
  if (e < n)
196
196
  return f(h, h, u, u, i);
197
- const c = Math.floor(a * (r + 1)) - 1, F = Math.floor(a * (s + 1)) - 1;
198
- return f(h, c, u, F, i);
197
+ const c = Math.floor(a * (r + 1)) - 1, S = Math.floor(a * (s + 1)) - 1;
198
+ return f(h, c, u, S, i);
199
199
  }
200
200
  const l = this.getTileCoordExtent(t, this.tmpExtent_);
201
201
  return this.getTileRangeForExtentAndZ(l, e, i);
@@ -235,7 +235,7 @@ class p {
235
235
  */
236
236
  getTileCoordExtent(t, e) {
237
237
  const i = this.getOrigin(t[0]), n = this.getResolution(t[0]), r = g(this.getTileSize(t[0]), this.tmpSize_), s = i[0] + t[1] * r[0] * n, l = i[1] - (t[2] + 1) * r[1] * n, a = s + r[0] * n, h = l + r[1] * n;
238
- return b(s, l, a, h, e);
238
+ return j(s, l, a, h, e);
239
239
  }
240
240
  /**
241
241
  * Get the tile coordinate for the given map coordinate and resolution. This
@@ -273,7 +273,7 @@ class p {
273
273
  getTileCoordForXYAndResolution_(t, e, i, n, r) {
274
274
  const s = this.getZForResolution(i), l = i / this.getResolution(s), a = this.getOrigin(s), h = g(this.getTileSize(s), this.tmpSize_);
275
275
  let u = l * (t - a[0]) / i / h[0], c = l * (a[1] - e) / i / h[1];
276
- return n ? (u = x(u, d) - 1, c = x(c, d) - 1) : (u = R(u, d), c = R(c, d)), G(s, u, c, r);
276
+ return n ? (u = F(u, d) - 1, c = F(c, d) - 1) : (u = x(u, d), c = x(c, d)), b(s, u, c, r);
277
277
  }
278
278
  /**
279
279
  * Although there is repetition between this method and `getTileCoordForXYAndResolution_`,
@@ -293,7 +293,7 @@ class p {
293
293
  getTileCoordForXYAndZ_(t, e, i, n, r) {
294
294
  const s = this.getOrigin(i), l = this.getResolution(i), a = g(this.getTileSize(i), this.tmpSize_);
295
295
  let h = (t - s[0]) / l / a[0], u = (s[1] - e) / l / a[1];
296
- return n ? (h = x(h, d) - 1, u = x(u, d) - 1) : (h = R(h, d), u = R(u, d)), G(i, h, u, r);
296
+ return n ? (h = F(h, d) - 1, u = F(u, d) - 1) : (h = x(h, d), u = x(u, d)), b(i, h, u, r);
297
297
  }
298
298
  /**
299
299
  * Get a tile coordinate given a map coordinate and zoom level.
@@ -355,7 +355,7 @@ class p {
355
355
  * @api
356
356
  */
357
357
  getZForResolution(t, e) {
358
- const i = q(
358
+ const i = V(
359
359
  this.resolutions_,
360
360
  t,
361
361
  e || 0
@@ -369,7 +369,7 @@ class p {
369
369
  * @return {boolean} The tile with the provided tile coordinate intersects the given viewport.
370
370
  */
371
371
  tileCoordIntersectsViewport(t, e) {
372
- return rt(
372
+ return lt(
373
373
  e,
374
374
  0,
375
375
  e.length,
@@ -388,67 +388,67 @@ class p {
388
388
  this.fullTileRanges_ = i;
389
389
  }
390
390
  }
391
- function w(o) {
391
+ function U(o) {
392
392
  let t = o.getDefaultTileGrid();
393
- return t || (t = at(o), o.setDefaultTileGrid(t)), t;
393
+ return t || (t = ct(o), o.setDefaultTileGrid(t)), t;
394
394
  }
395
- function ot(o, t, e) {
396
- const i = t[0], n = o.getTileCoordCenter(t), r = X(e);
397
- if (!V(r, n)) {
398
- const s = y(r), l = Math.ceil(
395
+ function ht(o, t, e) {
396
+ const i = t[0], n = o.getTileCoordCenter(t), r = Z(e);
397
+ if (!tt(r, n)) {
398
+ const s = w(r), l = Math.ceil(
399
399
  (r[0] - n[0]) / s
400
400
  );
401
401
  return n[0] += s * l, o.getTileCoordForCoordAndZ(n, i);
402
402
  }
403
403
  return t;
404
404
  }
405
- function lt(o, t, e, i) {
405
+ function ut(o, t, e, i) {
406
406
  i = i !== void 0 ? i : "top-left";
407
- const n = U(o, t, e);
408
- return new p({
407
+ const n = p(o, t, e);
408
+ return new X({
409
409
  extent: o,
410
- origin: Q(o, i),
410
+ origin: et(o, i),
411
411
  resolutions: n,
412
412
  tileSize: e
413
413
  });
414
414
  }
415
- function Gt(o) {
416
- const t = o || {}, e = t.extent || S("EPSG:3857").getExtent(), i = {
415
+ function jt(o) {
416
+ const t = o || {}, e = t.extent || E("EPSG:3857").getExtent(), i = {
417
417
  extent: e,
418
418
  minZoom: t.minZoom,
419
419
  tileSize: t.tileSize,
420
- resolutions: U(
420
+ resolutions: p(
421
421
  e,
422
422
  t.maxZoom,
423
423
  t.tileSize,
424
424
  t.maxResolution
425
425
  )
426
426
  };
427
- return new p(i);
427
+ return new X(i);
428
428
  }
429
- function U(o, t, e, i) {
430
- t = t !== void 0 ? t : st, e = g(e !== void 0 ? e : A);
431
- const n = $(o), r = y(o);
429
+ function p(o, t, e, i) {
430
+ t = t !== void 0 ? t : at, e = g(e !== void 0 ? e : A);
431
+ const n = Q(o), r = w(o);
432
432
  i = i > 0 ? i : Math.max(r / e[0], n / e[1]);
433
433
  const s = t + 1, l = new Array(s);
434
434
  for (let a = 0; a < s; ++a)
435
435
  l[a] = i / Math.pow(2, a);
436
436
  return l;
437
437
  }
438
- function at(o, t, e, i) {
439
- const n = X(o);
440
- return lt(n, t, e, i);
438
+ function ct(o, t, e, i) {
439
+ const n = Z(o);
440
+ return ut(n, t, e, i);
441
441
  }
442
- function X(o) {
443
- o = S(o);
442
+ function Z(o) {
443
+ o = E(o);
444
444
  let t = o.getExtent();
445
445
  if (!t) {
446
- const e = 180 * H.degrees / o.getMetersPerUnit();
447
- t = b(-e, -e, e, e);
446
+ const e = 180 * J.degrees / o.getMetersPerUnit();
447
+ t = j(-e, -e, e, e);
448
448
  }
449
449
  return t;
450
450
  }
451
- function jt(o, t) {
451
+ function wt(o, t) {
452
452
  const e = [];
453
453
  Object.keys(t).forEach(function(n) {
454
454
  t[n] !== null && t[n] !== void 0 && e.push(n + "=" + encodeURIComponent(t[n]));
@@ -456,9 +456,9 @@ function jt(o, t) {
456
456
  const i = e.join("&");
457
457
  return o = o.replace(/[?&]$/, ""), o += o.includes("?") ? "&" : "?", o + i;
458
458
  }
459
- const ht = /\{z\}/g, ut = /\{x\}/g, ct = /\{y\}/g, dt = /\{-y\}/g;
460
- function gt(o, t, e, i, n) {
461
- return o.replace(ht, t.toString()).replace(ut, e.toString()).replace(ct, i.toString()).replace(dt, function() {
459
+ const dt = /\{z\}/g, gt = /\{x\}/g, ft = /\{y\}/g, Tt = /\{-y\}/g;
460
+ function mt(o, t, e, i, n) {
461
+ return o.replace(dt, t.toString()).replace(gt, e.toString()).replace(ft, i.toString()).replace(Tt, function() {
462
462
  if (n === void 0)
463
463
  throw new Error(
464
464
  "If the URL template has a {-y} placeholder, the grid extent must be known"
@@ -466,7 +466,7 @@ function gt(o, t, e, i, n) {
466
466
  return (n - i).toString();
467
467
  });
468
468
  }
469
- function ft(o) {
469
+ function _t(o) {
470
470
  const t = [];
471
471
  let e = /\{([a-z])-([a-z])\}/.exec(o);
472
472
  if (e) {
@@ -484,7 +484,7 @@ function ft(o) {
484
484
  }
485
485
  return t.push(o), t;
486
486
  }
487
- function Tt(o, t) {
487
+ function Ft(o, t) {
488
488
  return (
489
489
  /**
490
490
  * @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate.
@@ -501,17 +501,17 @@ function Tt(o, t) {
501
501
  const l = t.getFullTileRange(s);
502
502
  l && (r = l.getHeight() - 1);
503
503
  }
504
- return gt(o, s, e[1], e[2], r);
504
+ return mt(o, s, e[1], e[2], r);
505
505
  })
506
506
  );
507
507
  }
508
- function mt(o, t) {
508
+ function xt(o, t) {
509
509
  const e = o.length, i = new Array(e);
510
510
  for (let n = 0; n < e; ++n)
511
- i[n] = Tt(o[n], t);
512
- return _t(i);
511
+ i[n] = Ft(o[n], t);
512
+ return Rt(i);
513
513
  }
514
- function _t(o) {
514
+ function Rt(o) {
515
515
  return o.length === 1 ? o[0] : (
516
516
  /**
517
517
  * @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate.
@@ -522,17 +522,17 @@ function _t(o) {
522
522
  (function(t, e, i) {
523
523
  if (!t)
524
524
  return;
525
- const n = I(t), r = J(n, o.length);
525
+ const n = D(t), r = it(n, o.length);
526
526
  return o[r](t, e, i);
527
527
  })
528
528
  );
529
529
  }
530
- class Ft extends tt {
530
+ class Et extends nt {
531
531
  /**
532
532
  * @param {Options} options Source options.
533
533
  */
534
534
  constructor(t) {
535
- super(), this.projection = S(t.projection), this.attributions_ = j(t.attributions), this.attributionsCollapsible_ = t.attributionsCollapsible ?? !0, this.loading = !1, this.state_ = t.state !== void 0 ? t.state : "ready", this.wrapX_ = t.wrapX !== void 0 ? t.wrapX : !1, this.interpolate_ = !!t.interpolate, this.viewResolver = null, this.viewRejector = null;
535
+ super(), this.projection = E(t.projection), this.attributions_ = G(t.attributions), this.attributionsCollapsible_ = t.attributionsCollapsible ?? !0, this.loading = !1, this.state_ = t.state !== void 0 ? t.state : "ready", this.wrapX_ = t.wrapX !== void 0 ? t.wrapX : !1, this.interpolate_ = !!t.interpolate, this.viewResolver = null, this.viewRejector = null;
536
536
  const e = this;
537
537
  this.viewPromise_ = new Promise(function(i, n) {
538
538
  e.viewResolver = i, e.viewRejector = n;
@@ -609,7 +609,7 @@ class Ft extends tt {
609
609
  * @api
610
610
  */
611
611
  setAttributions(t) {
612
- this.attributions_ = j(t), this.changed();
612
+ this.attributions_ = G(t), this.changed();
613
613
  }
614
614
  /**
615
615
  * Set the state of the source.
@@ -619,10 +619,10 @@ class Ft extends tt {
619
619
  this.state_ = t, this.changed();
620
620
  }
621
621
  }
622
- function j(o) {
622
+ function G(o) {
623
623
  return o ? typeof o == "function" ? o : (Array.isArray(o) || (o = [o]), (t) => o) : null;
624
624
  }
625
- class xt extends Ft {
625
+ class St extends Et {
626
626
  /**
627
627
  * @param {Options} options SourceTile source options.
628
628
  */
@@ -636,7 +636,7 @@ class xt extends Ft {
636
636
  interpolate: t.interpolate
637
637
  }), this.on, this.once, this.un, this.tilePixelRatio_ = t.tilePixelRatio !== void 0 ? t.tilePixelRatio : 1, this.tileGrid = t.tileGrid !== void 0 ? t.tileGrid : null;
638
638
  const e = [256, 256];
639
- this.tileGrid && g(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()), e), this.tmpSize = [0, 0], this.key_ = t.key || E(this), this.tileOptions = {
639
+ this.tileGrid && g(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()), e), this.tmpSize = [0, 0], this.key_ = t.key || R(this), this.tileOptions = {
640
640
  transition: t.transition,
641
641
  interpolate: t.interpolate
642
642
  }, this.zDirection = t.zDirection ? t.zDirection : 0;
@@ -679,10 +679,11 @@ class xt extends Ft {
679
679
  * @param {number} y Tile coordinate y.
680
680
  * @param {number} pixelRatio Pixel ratio.
681
681
  * @param {import("../proj/Projection.js").default} projection Projection.
682
+ * @param {import("../structs/LRUCache.js").default<import("../Tile.js").default>} [tileCache] Tile cache.
682
683
  * @return {TileType|null} Tile.
683
684
  */
684
- getTile(t, e, i, n, r) {
685
- return et();
685
+ getTile(t, e, i, n, r, s) {
686
+ return rt();
686
687
  }
687
688
  /**
688
689
  * Return the tile grid of the tile source.
@@ -697,7 +698,7 @@ class xt extends Ft {
697
698
  * @return {!import("../tilegrid/TileGrid.js").default} Tile grid.
698
699
  */
699
700
  getTileGridForProjection(t) {
700
- return this.tileGrid ? this.tileGrid : w(t);
701
+ return this.tileGrid ? this.tileGrid : U(t);
701
702
  }
702
703
  /**
703
704
  * Get the tile pixel ratio for this source. Subclasses may override this
@@ -717,7 +718,7 @@ class xt extends Ft {
717
718
  */
718
719
  getTilePixelSize(t, e, i) {
719
720
  const n = this.getTileGridForProjection(i), r = this.getTilePixelRatio(e), s = g(n.getTileSize(t), this.tmpSize);
720
- return r == 1 ? s : k(s, r, this.tmpSize);
721
+ return r == 1 ? s : W(s, r, this.tmpSize);
721
722
  }
722
723
  /**
723
724
  * Returns a tile coordinate wrapped around the x-axis. When the tile coordinate
@@ -730,7 +731,7 @@ class xt extends Ft {
730
731
  */
731
732
  getTileCoordForTileUrlFunction(t, e) {
732
733
  const i = e !== void 0 ? e : this.getProjection(), n = e !== void 0 ? this.getTileGridForProjection(i) : this.tileGrid || this.getTileGridForProjection(i);
733
- return this.getWrapX() && i.isGlobal() && (t = ot(n, t, i)), D(t, n) ? t : null;
734
+ return this.getWrapX() && i.isGlobal() && (t = ht(n, t, i)), v(t, n) ? t : null;
734
735
  }
735
736
  /**
736
737
  * Remove all cached reprojected tiles from the source. The next render cycle will create new tiles.
@@ -745,7 +746,7 @@ class xt extends Ft {
745
746
  this.clear(), super.refresh();
746
747
  }
747
748
  }
748
- class Rt extends it {
749
+ class zt extends st {
749
750
  /**
750
751
  * @param {string} type Type.
751
752
  * @param {import("../Tile.js").default} tile The tile.
@@ -777,7 +778,7 @@ const P = {
777
778
  */
778
779
  TILELOADERROR: "tileloaderror"
779
780
  };
780
- class C extends xt {
781
+ class y extends St {
781
782
  /**
782
783
  * @param {Options} options Image tile options.
783
784
  */
@@ -795,7 +796,7 @@ class C extends xt {
795
796
  key: t.key,
796
797
  attributionsCollapsible: t.attributionsCollapsible,
797
798
  zDirection: t.zDirection
798
- }), this.generateTileUrlFunction_ = this.tileUrlFunction === C.prototype.tileUrlFunction, this.tileLoadFunction = t.tileLoadFunction, t.tileUrlFunction && (this.tileUrlFunction = t.tileUrlFunction), this.urls = null, t.urls ? this.setUrls(t.urls) : t.url && this.setUrl(t.url), this.tileLoadingKeys_ = {};
799
+ }), this.generateTileUrlFunction_ = this.tileUrlFunction === y.prototype.tileUrlFunction, this.tileLoadFunction = t.tileLoadFunction, t.tileUrlFunction && (this.tileUrlFunction = t.tileUrlFunction), this.urls = null, t.urls ? this.setUrls(t.urls) : t.url && this.setUrl(t.url), this.tileLoadingKeys_ = {};
799
800
  }
800
801
  /**
801
802
  * Deprecated. Use an ImageTile source instead.
@@ -835,9 +836,9 @@ class C extends xt {
835
836
  const e = (
836
837
  /** @type {import("../Tile.js").default} */
837
838
  t.target
838
- ), i = E(e), n = e.getState();
839
+ ), i = R(e), n = e.getState();
839
840
  let r;
840
- n == _.LOADING ? (this.tileLoadingKeys_[i] = !0, r = P.TILELOADSTART) : i in this.tileLoadingKeys_ && (delete this.tileLoadingKeys_[i], r = n == _.ERROR ? P.TILELOADERROR : n == _.LOADED ? P.TILELOADEND : void 0), r != null && this.dispatchEvent(new Rt(r, e));
841
+ n == _.LOADING ? (this.tileLoadingKeys_[i] = !0, r = P.TILELOADSTART) : i in this.tileLoadingKeys_ && (delete this.tileLoadingKeys_[i], r = n == _.ERROR ? P.TILELOADERROR : n == _.LOADED ? P.TILELOADEND : void 0), r != null && this.dispatchEvent(new zt(r, e));
841
842
  }
842
843
  /**
843
844
  * Deprecated. Use an ImageTile source instead.
@@ -864,7 +865,7 @@ class C extends xt {
864
865
  * @api
865
866
  */
866
867
  setUrl(t) {
867
- const e = ft(t);
868
+ const e = _t(t);
868
869
  this.urls = e, this.setUrls(e);
869
870
  }
870
871
  /**
@@ -877,7 +878,7 @@ class C extends xt {
877
878
  this.urls = t;
878
879
  const e = t.join(`
879
880
  `);
880
- this.generateTileUrlFunction_ ? this.setTileUrlFunction(mt(t, this.tileGrid), e) : this.setKey(e);
881
+ this.generateTileUrlFunction_ ? this.setTileUrlFunction(xt(t, this.tileGrid), e) : this.setKey(e);
881
882
  }
882
883
  /**
883
884
  * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
@@ -888,7 +889,7 @@ class C extends xt {
888
889
  tileUrlFunction(t, e, i) {
889
890
  }
890
891
  }
891
- class bt extends C {
892
+ class At extends y {
892
893
  /**
893
894
  * @param {!Options} options Image tile options.
894
895
  */
@@ -899,7 +900,7 @@ class bt extends C {
899
900
  projection: t.projection,
900
901
  state: t.state,
901
902
  tileGrid: t.tileGrid,
902
- tileLoadFunction: t.tileLoadFunction ? t.tileLoadFunction : Et,
903
+ tileLoadFunction: t.tileLoadFunction ? t.tileLoadFunction : Pt,
903
904
  tilePixelRatio: t.tilePixelRatio,
904
905
  tileUrlFunction: t.tileUrlFunction,
905
906
  url: t.url,
@@ -910,7 +911,7 @@ class bt extends C {
910
911
  key: t.key,
911
912
  attributionsCollapsible: t.attributionsCollapsible,
912
913
  zDirection: t.zDirection
913
- }), this.crossOrigin = t.crossOrigin !== void 0 ? t.crossOrigin : null, this.tileClass = t.tileClass !== void 0 ? t.tileClass : v, this.tileGridForProjection = {}, this.reprojectionErrorThreshold_ = t.reprojectionErrorThreshold, this.renderReprojectionEdges_ = !1;
914
+ }), this.crossOrigin = t.crossOrigin !== void 0 ? t.crossOrigin : null, this.tileClass = t.tileClass !== void 0 ? t.tileClass : K, this.tileGridForProjection = {}, this.reprojectionErrorThreshold_ = t.reprojectionErrorThreshold, this.renderReprojectionEdges_ = !1;
914
915
  }
915
916
  /**
916
917
  * @param {import("../proj/Projection.js").default} projection Projection.
@@ -944,8 +945,8 @@ class bt extends C {
944
945
  const e = this.getProjection();
945
946
  if (this.tileGrid && (!e || z(e, t)))
946
947
  return this.tileGrid;
947
- const i = E(t);
948
- return i in this.tileGridForProjection || (this.tileGridForProjection[i] = w(t)), this.tileGridForProjection[i];
948
+ const i = R(t);
949
+ return i in this.tileGridForProjection || (this.tileGridForProjection[i] = U(t)), this.tileGridForProjection[i];
949
950
  }
950
951
  /**
951
952
  * @param {number} z Tile coordinate z.
@@ -969,7 +970,7 @@ class bt extends C {
969
970
  this.tileLoadFunction,
970
971
  this.tileOptions
971
972
  );
972
- return u.key = s, u.addEventListener(nt.CHANGE, this.handleTileChange.bind(this)), u;
973
+ return u.key = s, u.addEventListener(ot.CHANGE, this.handleTileChange.bind(this)), u;
973
974
  }
974
975
  /**
975
976
  * @param {number} z Tile coordinate z.
@@ -977,37 +978,38 @@ class bt extends C {
977
978
  * @param {number} y Tile coordinate y.
978
979
  * @param {number} pixelRatio Pixel ratio.
979
980
  * @param {import("../proj/Projection.js").default} projection Projection.
981
+ * @param {import("../structs/LRUCache.js").default<import("../Tile.js").default>} [tileCache] Tile cache.
980
982
  * @return {!(ImageTile|ReprojTile)} Tile.
981
983
  * @override
982
984
  */
983
- getTile(t, e, i, n, r) {
984
- const s = this.getProjection();
985
- if (!s || !r || z(s, r))
985
+ getTile(t, e, i, n, r, s) {
986
+ const l = this.getProjection();
987
+ if (!l || !r || z(l, r))
986
988
  return this.getTileInternal(
987
989
  t,
988
990
  e,
989
991
  i,
990
992
  n,
991
- s || r
993
+ l || r
992
994
  );
993
- const l = [t, e, i], a = this.getKey(), h = this.getTileGridForProjection(s), u = this.getTileGridForProjection(r), c = this.getTileCoordForTileUrlFunction(
994
- l,
995
+ const a = [t, e, i], h = this.getKey(), u = this.getTileGridForProjection(l), c = this.getTileGridForProjection(r), S = this.getTileCoordForTileUrlFunction(
996
+ a,
995
997
  r
996
- ), F = new K(
997
- s,
998
- h,
999
- r,
1000
- u,
998
+ ), C = new N(
1001
999
  l,
1000
+ u,
1001
+ r,
1002
1002
  c,
1003
+ a,
1004
+ S,
1003
1005
  this.getTilePixelRatio(n),
1004
1006
  this.getGutter(),
1005
- (Z, O, L, M) => this.getTileInternal(Z, O, L, M, s),
1007
+ (O, L, I, M) => this.getTileInternal(O, L, I, M, l, s),
1006
1008
  this.reprojectionErrorThreshold_,
1007
1009
  this.renderReprojectionEdges_,
1008
1010
  this.tileOptions
1009
1011
  );
1010
- return F.key = a, F;
1012
+ return C.key = h, C;
1011
1013
  }
1012
1014
  /**
1013
1015
  * @param {number} z Tile coordinate z.
@@ -1015,12 +1017,19 @@ class bt extends C {
1015
1017
  * @param {number} y Tile coordinate y.
1016
1018
  * @param {number} pixelRatio Pixel ratio.
1017
1019
  * @param {!import("../proj/Projection.js").default} projection Projection.
1020
+ * @param {import("../structs/LRUCache.js").default<import("../Tile.js").default>} [tileCache] Tile cache.
1018
1021
  * @return {!ImageTile} Tile.
1019
1022
  * @protected
1020
1023
  */
1021
- getTileInternal(t, e, i, n, r) {
1022
- const s = this.getKey();
1023
- return this.createTile_(t, e, i, n, r, s);
1024
+ getTileInternal(t, e, i, n, r, s) {
1025
+ const l = this.getKey(), a = k(this, l, t, e, i);
1026
+ if (s && s.containsKey(a))
1027
+ return (
1028
+ /** @type {!ImageTile} */
1029
+ s.get(a)
1030
+ );
1031
+ const h = this.createTile_(t, e, i, n, r, l);
1032
+ return s?.set(a, h), h;
1024
1033
  }
1025
1034
  /**
1026
1035
  * Sets whether to render reprojection edges or not (usually for debugging).
@@ -1043,25 +1052,46 @@ class bt extends C {
1043
1052
  * @api
1044
1053
  */
1045
1054
  setTileGridForProjection(t, e) {
1046
- const i = S(t);
1055
+ const i = E(t);
1047
1056
  if (i) {
1048
- const n = E(i);
1057
+ const n = R(i);
1049
1058
  n in this.tileGridForProjection || (this.tileGridForProjection[n] = e);
1050
1059
  }
1051
1060
  }
1052
1061
  }
1053
- function Et(o, t) {
1062
+ function Pt(o, t) {
1063
+ if (q) {
1064
+ const e = o.getCrossOrigin();
1065
+ let i = "same-origin", n = "same-origin";
1066
+ e === "anonymous" || e === "" ? (i = "cors", n = "omit") : e === "use-credentials" && (i = "cors", n = "include"), fetch(t, {
1067
+ mode: i,
1068
+ credentials: n
1069
+ }).then((r) => {
1070
+ if (!r.ok)
1071
+ throw new Error(`HTTP ${r.status}`);
1072
+ return r.blob();
1073
+ }).then((r) => createImageBitmap(r)).then((r) => {
1074
+ const s = o.getImage();
1075
+ s.width = r.width, s.height = r.height, /** @type {OffscreenCanvas} */
1076
+ s.getContext("2d").drawImage(r, 0, 0), r.close?.(), s.dispatchEvent(new Event("load"));
1077
+ }).catch(() => {
1078
+ o.getImage().dispatchEvent(new Event("error"));
1079
+ });
1080
+ return;
1081
+ }
1054
1082
  o.getImage().src = t;
1055
1083
  }
1056
1084
  export {
1057
- Ft as S,
1058
- bt as T,
1059
- C as U,
1060
- p as a,
1061
- jt as b,
1062
- Gt as c,
1063
- ft as d,
1064
- X as e,
1085
+ Et as S,
1086
+ At as T,
1087
+ y as U,
1088
+ X as a,
1089
+ wt as b,
1090
+ jt as c,
1091
+ Pt as d,
1092
+ Z as e,
1065
1093
  _t as f,
1066
- mt as g
1094
+ U as g,
1095
+ Rt as h,
1096
+ xt as i
1067
1097
  };
@@ -1,5 +1,5 @@
1
- import { a6 as p, B as it, m as jt, F as Ft, ak as x, s as Tt, aL as Et, C as vt, D as F, aj as q, k as St, w as S, y as j, n as Zt, aM as zt, r as st, A as Pt, z as Xt, a1 as Yt, J as ot, x as bt, L as rt, K as G, al as Gt, aN as L, M as Lt, ae as Y, aa as y, j as E, U as W, aE as Ot, aO as Vt, af as K, t as kt, P as Ut, V as Dt, aP as Ht } from "./proj-CKwYjU38.js";
2
- import { d as qt, e as Wt, q as at, u as Kt, v as $t, a as N, j as Bt, w as Jt } from "./common-C4rDcQpp.js";
1
+ import { a7 as p, B as it, n as jt, G as Ft, al as x, v as Tt, aL as Et, D as vt, F, ak as W, m as St, x as S, z as j, o as Zt, aM as zt, s as st, C as Pt, A as Xt, a2 as Yt, K as ot, y as bt, N as rt, L as G, am as Gt, aN as L, M as Lt, af as Y, ac as y, j as E, W as q, aE as Ot, aO as Vt, ah as K, k as kt, Q as Ut, V as Dt, aP as Ht } from "./proj-DsetBcW7.js";
2
+ import { d as Wt, e as qt, u as at, v as Kt, w as $t, a as N, j as Bt, x as Jt } from "./common-PJfpC179.js";
3
3
  const I = {
4
4
  ANIMATING: 0,
5
5
  INTERACTING: 1
@@ -83,7 +83,7 @@ function ne(s, t, e, n, i, r, o) {
83
83
  }
84
84
  return o && o.length != l && (o.length = l), o;
85
85
  }
86
- const B = Wt(), ie = [NaN, NaN];
86
+ const B = qt(), ie = [NaN, NaN];
87
87
  class se extends it {
88
88
  constructor() {
89
89
  super(), this.extent_ = jt(), this.extentRevision_ = -1, this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = 0, this.simplifyTransformedInternal = Ft(
@@ -284,7 +284,7 @@ class se extends it {
284
284
  transform(t, e) {
285
285
  const n = vt(t), i = n.getUnits() == "tile-pixels" ? function(r, o, l) {
286
286
  const a = n.getExtent(), c = n.getWorldExtent(), h = F(c) / F(a);
287
- qt(
287
+ Wt(
288
288
  B,
289
289
  c[0],
290
290
  c[3],
@@ -301,9 +301,9 @@ class se extends it {
301
301
  l,
302
302
  B,
303
303
  o
304
- ), g = q(n, e);
304
+ ), g = W(n, e);
305
305
  return g ? g(u, u, l) : u;
306
- } : q(n, e);
306
+ } : W(n, e);
307
307
  return this.applyTransform(i), this;
308
308
  }
309
309
  }
@@ -1802,7 +1802,7 @@ class fe extends it {
1802
1802
  };
1803
1803
  if (h.center && (u.sourceCenter = o, u.targetCenter = h.center.slice(), o = u.targetCenter), h.zoom !== void 0 ? (u.sourceResolution = l, u.targetResolution = this.getResolutionForZoom(h.zoom), l = u.targetResolution) : h.resolution && (u.sourceResolution = l, u.targetResolution = h.resolution, l = u.targetResolution), h.rotation !== void 0) {
1804
1804
  u.sourceRotation = a;
1805
- const g = W(h.rotation - a + Math.PI, 2 * Math.PI) - Math.PI;
1805
+ const g = q(h.rotation - a + Math.PI, 2 * Math.PI) - Math.PI;
1806
1806
  u.targetRotation = a + g, a = u.targetRotation;
1807
1807
  }
1808
1808
  Nt(u) ? u.complete = !0 : r += u.duration, c.push(u);
@@ -1887,7 +1887,7 @@ class fe extends it {
1887
1887
  this.nextResolution_ = a.targetResolution, this.targetResolution_ = g, this.applyTargetState_(!0);
1888
1888
  }
1889
1889
  if (a.sourceRotation !== void 0 && a.targetRotation !== void 0) {
1890
- const g = u === 1 ? W(a.targetRotation + Math.PI, 2 * Math.PI) - Math.PI : a.sourceRotation + u * (a.targetRotation - a.sourceRotation);
1890
+ const g = u === 1 ? q(a.targetRotation + Math.PI, 2 * Math.PI) - Math.PI : a.sourceRotation + u * (a.targetRotation - a.sourceRotation);
1891
1891
  if (a.anchor) {
1892
1892
  const d = this.constraints_.rotation(
1893
1893
  g,