@teritorio/openstreetmap-logical-history-component 0.5.2 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -263,15 +263,15 @@ function Pe(e) {
263
263
  }
264
264
  //#endregion
265
265
  //#region node_modules/geojson-equality-ts/dist/esm/index.js
266
- var Fe = Object.defineProperty, Ie = (e, t) => Fe(e, "name", {
266
+ var Fe = Object.defineProperty, V = (e, t) => Fe(e, "name", {
267
267
  value: t,
268
268
  configurable: !0
269
- }), Le = class {
269
+ }), Ie = class {
270
270
  constructor(e) {
271
271
  this.direction = !1, this.compareProperties = !0, this.precision = 10 ** -(e?.precision ?? 17), this.direction = e?.direction ?? !1, this.compareProperties = e?.compareProperties ?? !0;
272
272
  }
273
273
  compare(e, t) {
274
- if (e.type !== t.type || !ze(e, t)) return !1;
274
+ if (e.type !== t.type || !Re(e, t)) return !1;
275
275
  switch (e.type) {
276
276
  case "Point": return this.compareCoord(e.coordinates, t.coordinates);
277
277
  case "LineString": return this.compareLine(e.coordinates, t.coordinates);
@@ -280,7 +280,7 @@ var Fe = Object.defineProperty, Ie = (e, t) => Fe(e, "name", {
280
280
  case "Feature": return this.compareFeature(e, t);
281
281
  case "FeatureCollection": return this.compareFeatureCollection(e, t);
282
282
  default: if (e.type.startsWith("Multi")) {
283
- let n = Be(e), r = Be(t);
283
+ let n = ze(e), r = ze(t);
284
284
  return n.every((e) => r.some((t) => this.compare(e, t)));
285
285
  }
286
286
  }
@@ -290,7 +290,7 @@ var Fe = Object.defineProperty, Ie = (e, t) => Fe(e, "name", {
290
290
  return e.length === t.length && e.every((e, n) => Math.abs(e - t[n]) < this.precision);
291
291
  }
292
292
  compareLine(e, t, n = 0, r = !1) {
293
- if (!ze(e, t)) return !1;
293
+ if (!Re(e, t)) return !1;
294
294
  let i = e, a = t;
295
295
  if (r && !this.compareCoord(i[0], a[0])) {
296
296
  let e = this.fixStartIndex(a, i);
@@ -319,51 +319,51 @@ var Fe = Object.defineProperty, Ie = (e, t) => Fe(e, "name", {
319
319
  return !1;
320
320
  }
321
321
  compareGeometryCollection(e, t) {
322
- return ze(e.geometries, t.geometries) && this.compareBBox(e, t) && e.geometries.every((e, n) => this.compare(e, t.geometries[n]));
322
+ return Re(e.geometries, t.geometries) && this.compareBBox(e, t) && e.geometries.every((e, n) => this.compare(e, t.geometries[n]));
323
323
  }
324
324
  compareFeature(e, t) {
325
- return e.id === t.id && (this.compareProperties ? He(e.properties, t.properties) : !0) && this.compareBBox(e, t) && this.compare(e.geometry, t.geometry);
325
+ return e.id === t.id && (this.compareProperties ? Ve(e.properties, t.properties) : !0) && this.compareBBox(e, t) && this.compare(e.geometry, t.geometry);
326
326
  }
327
327
  compareFeatureCollection(e, t) {
328
- return ze(e.features, t.features) && this.compareBBox(e, t) && e.features.every((e, n) => this.compare(e, t.features[n]));
328
+ return Re(e.features, t.features) && this.compareBBox(e, t) && e.features.every((e, n) => this.compare(e, t.features[n]));
329
329
  }
330
330
  compareBBox(e, t) {
331
331
  return !e.bbox && !t.bbox || (e.bbox && t.bbox ? this.compareCoord(e.bbox, t.bbox) : !1);
332
332
  }
333
333
  };
334
- Ie(Le, "GeojsonEquality");
335
- var Re = Le;
336
- function ze(e, t) {
334
+ V(Ie, "GeojsonEquality");
335
+ var Le = Ie;
336
+ function Re(e, t) {
337
337
  return e.coordinates ? e.coordinates.length === t.coordinates.length : e.length === t.length;
338
338
  }
339
- Ie(ze, "sameLength");
340
- function Be(e) {
339
+ V(Re, "sameLength");
340
+ function ze(e) {
341
341
  return e.coordinates.map((t) => ({
342
342
  type: e.type.replace("Multi", ""),
343
343
  coordinates: t
344
344
  }));
345
345
  }
346
- Ie(Be, "explode");
347
- function Ve(e, t, n) {
348
- return new Re(n).compare(e, t);
346
+ V(ze, "explode");
347
+ function Be(e, t, n) {
348
+ return new Le(n).compare(e, t);
349
349
  }
350
- Ie(Ve, "geojsonEquality");
351
- function He(e, t) {
350
+ V(Be, "geojsonEquality");
351
+ function Ve(e, t) {
352
352
  if (e === null && t === null) return !0;
353
353
  if (e === null || t === null) return !1;
354
354
  let n = Object.keys(e), r = Object.keys(t);
355
355
  if (n.length !== r.length) return !1;
356
356
  for (var i of n) {
357
- let n = e[i], r = t[i], a = Ue(n) && Ue(r);
358
- if (a && !He(n, r) || !a && n !== r) return !1;
357
+ let n = e[i], r = t[i], a = He(n) && He(r);
358
+ if (a && !Ve(n, r) || !a && n !== r) return !1;
359
359
  }
360
360
  return !0;
361
361
  }
362
- Ie(He, "equal");
363
- var Ue = /* @__PURE__ */ Ie((e) => typeof e == "object" && !!e, "isObject");
362
+ V(Ve, "equal");
363
+ var He = /* @__PURE__ */ V((e) => typeof e == "object" && !!e, "isObject");
364
364
  //#endregion
365
365
  //#region node_modules/@turf/invariant/dist/esm/index.js
366
- function V(e) {
366
+ function H(e) {
367
367
  if (!e) throw Error("coord is required");
368
368
  if (!Array.isArray(e)) {
369
369
  if (e.type === "Feature" && e.geometry !== null && e.geometry.type === "Point") return [...e.geometry.coordinates];
@@ -372,30 +372,30 @@ function V(e) {
372
372
  if (Array.isArray(e) && e.length >= 2 && !Array.isArray(e[0]) && !Array.isArray(e[1])) return [...e];
373
373
  throw Error("coord must be GeoJSON Point or an Array of numbers");
374
374
  }
375
- function H(e) {
375
+ function U(e) {
376
376
  if (Array.isArray(e)) return e;
377
377
  if (e.type === "Feature") {
378
378
  if (e.geometry !== null) return e.geometry.coordinates;
379
379
  } else if (e.coordinates) return e.coordinates;
380
380
  throw Error("coords must be GeoJSON Feature, Geometry Object or an Array");
381
381
  }
382
- function U(e) {
382
+ function W(e) {
383
383
  return e.type === "Feature" ? e.geometry : e;
384
384
  }
385
- function We(e, t) {
385
+ function Ue(e, t) {
386
386
  return e.type === "FeatureCollection" ? "FeatureCollection" : e.type === "GeometryCollection" ? "GeometryCollection" : e.type === "Feature" && e.geometry !== null ? e.geometry.type : e.type;
387
387
  }
388
388
  //#endregion
389
389
  //#region node_modules/@turf/boolean-point-on-line/dist/esm/index.js
390
- function W(e, t, n = {}) {
391
- let r = V(e), i = H(t);
390
+ function G(e, t, n = {}) {
391
+ let r = H(e), i = U(t);
392
392
  for (let e = 0; e < i.length - 1; e++) {
393
393
  let t = !1;
394
- if (n.ignoreEndVertices && (e === 0 && (t = "start"), e === i.length - 2 && (t = "end"), e === 0 && e + 1 === i.length - 1 && (t = "both")), Ge(i[e], i[e + 1], r, t, n.epsilon === void 0 ? null : n.epsilon)) return !0;
394
+ if (n.ignoreEndVertices && (e === 0 && (t = "start"), e === i.length - 2 && (t = "end"), e === 0 && e + 1 === i.length - 1 && (t = "both")), We(i[e], i[e + 1], r, t, n.epsilon === void 0 ? null : n.epsilon)) return !0;
395
395
  }
396
396
  return !1;
397
397
  }
398
- function Ge(e, t, n, r, i) {
398
+ function We(e, t, n, r, i) {
399
399
  let a = n[0], o = n[1], s = e[0], c = e[1], l = t[0], u = t[1], d = n[0] - s, f = n[1] - c, p = l - s, m = u - c, h = d * m - f * p;
400
400
  if (i !== null) {
401
401
  if (Math.abs(h) > i) return !1;
@@ -404,32 +404,32 @@ function Ge(e, t, n, r, i) {
404
404
  }
405
405
  //#endregion
406
406
  //#region node_modules/@turf/clean-coords/dist/esm/index.js
407
- function Ke(e, t = {}) {
407
+ function Ge(e, t = {}) {
408
408
  var n = typeof t == "object" ? t.mutate : t;
409
409
  if (!e) throw Error("geojson is required");
410
- var r = We(e), i = [];
410
+ var r = Ue(e), i = [];
411
411
  switch (r) {
412
412
  case "LineString":
413
- i = qe(e, r);
413
+ i = Ke(e, r);
414
414
  break;
415
415
  case "MultiLineString":
416
416
  case "Polygon":
417
- H(e).forEach(function(e) {
418
- i.push(qe(e, r));
417
+ U(e).forEach(function(e) {
418
+ i.push(Ke(e, r));
419
419
  });
420
420
  break;
421
421
  case "MultiPolygon":
422
- H(e).forEach(function(e) {
422
+ U(e).forEach(function(e) {
423
423
  var t = [];
424
424
  e.forEach(function(e) {
425
- t.push(qe(e, r));
425
+ t.push(Ke(e, r));
426
426
  }), i.push(t);
427
427
  });
428
428
  break;
429
429
  case "Point": return e;
430
430
  case "MultiPoint":
431
431
  var a = {};
432
- H(e).forEach(function(e) {
432
+ U(e).forEach(function(e) {
433
433
  var t = e.join("-");
434
434
  Object.prototype.hasOwnProperty.call(a, t) || (i.push(e), a[t] = !0);
435
435
  });
@@ -447,31 +447,31 @@ function Ke(e, t = {}) {
447
447
  id: e.id
448
448
  });
449
449
  }
450
- function qe(e, t) {
451
- let n = H(e);
452
- if (n.length === 2 && !Je(n[0], n[1])) return n;
450
+ function Ke(e, t) {
451
+ let n = U(e);
452
+ if (n.length === 2 && !qe(n[0], n[1])) return n;
453
453
  let r = [], i = 0, a = 1, o = 2;
454
- for (r.push(n[i]); o < n.length;) W(n[a], R([n[i], n[o]])) ? a = o : (r.push(n[a]), i = a, a++, o = a), o++;
454
+ for (r.push(n[i]); o < n.length;) G(n[a], R([n[i], n[o]])) ? a = o : (r.push(n[a]), i = a, a++, o = a), o++;
455
455
  if (r.push(n[a]), t === "Polygon" || t === "MultiPolygon") {
456
- if (W(r[0], R([r[1], r[r.length - 2]])) && (r.shift(), r.pop(), r.push(r[0])), r.length < 4) throw Error("invalid polygon, fewer than 4 points");
457
- if (!Je(r[0], r[r.length - 1])) throw Error("invalid polygon, first and last points not equal");
456
+ if (G(r[0], R([r[1], r[r.length - 2]])) && (r.shift(), r.pop(), r.push(r[0])), r.length < 4) throw Error("invalid polygon, fewer than 4 points");
457
+ if (!qe(r[0], r[r.length - 1])) throw Error("invalid polygon, first and last points not equal");
458
458
  }
459
459
  return r;
460
460
  }
461
- function Je(e, t) {
461
+ function qe(e, t) {
462
462
  return e[0] === t[0] && e[1] === t[1];
463
463
  }
464
464
  //#endregion
465
465
  //#region node_modules/@turf/boolean-equal/dist/esm/index.js
466
- function Ye(e, t, n = {}) {
466
+ function Je(e, t, n = {}) {
467
467
  let r = n.precision;
468
468
  if (r = r == null || isNaN(r) ? 6 : r, typeof r != "number" || !(r >= 0)) throw Error("precision must be a positive number");
469
- return U(e).type === U(t).type ? Ve(Ke(e), Ke(t), { precision: r }) : !1;
469
+ return W(e).type === W(t).type ? Be(Ge(e), Ge(t), { precision: r }) : !1;
470
470
  }
471
- var Xe = Ye;
471
+ var Ye = Je;
472
472
  //#endregion
473
473
  //#region src/utils/feature-transform.ts
474
- function Ze(e) {
474
+ function Xe(e) {
475
475
  return e.features.map((t) => {
476
476
  if (t.id == null) {
477
477
  console.warn("Skipping feature with null id");
@@ -488,7 +488,7 @@ function Ze(e) {
488
488
  return;
489
489
  }
490
490
  let i = e.features.find((e) => e.properties.links === t.properties.links && e.id !== t.id);
491
- return i?.geometry && t.geometry && (t.properties.geom = !Xe(t.geometry, i.geometry)), t.id === r.before ? {
491
+ return i?.geometry && t.geometry && (t.properties.geom = !Ye(t.geometry, i.geometry)), t.id === r.before ? {
492
492
  ...t,
493
493
  properties: {
494
494
  ...t.properties,
@@ -514,18 +514,18 @@ function Ze(e) {
514
514
  }
515
515
  //#endregion
516
516
  //#region src/composables/useLoCha.ts
517
- var G = {
517
+ var K = {
518
518
  new: "#52c41a",
519
519
  delete: "#FF0000",
520
520
  updateBefore: "#FFA479",
521
521
  updateAfter: "#F2BE00"
522
- }, Qe = Object.fromEntries([
522
+ }, Ze = Object.fromEntries([
523
523
  "new",
524
524
  "delete",
525
525
  "updateAfter",
526
526
  "updateBefore"
527
527
  ].map((e) => [e, e]));
528
- function $e() {
528
+ function Qe() {
529
529
  let e = T(), n = T([]), r = t(() => e.value?.features.length);
530
530
  function i(e) {
531
531
  return e.reduce((e, t) => {
@@ -537,7 +537,7 @@ function $e() {
537
537
  l();
538
538
  let r = {
539
539
  ...t,
540
- features: Ze(t)
540
+ features: Xe(t)
541
541
  };
542
542
  e.value = r, n.value = i(r.features);
543
543
  }
@@ -548,7 +548,7 @@ function $e() {
548
548
  return e.filter((e) => e.properties.is_after || e.properties.is_new);
549
549
  }
550
550
  function c(e) {
551
- return e.properties.is_new ? Qe.new : e.properties.deleted ? Qe.delete : e.properties.is_before ? Qe.updateBefore : Qe.updateAfter;
551
+ return e.properties.is_new ? Ze.new : e.properties.deleted ? Ze.delete : e.properties.is_before ? Ze.updateBefore : Ze.updateAfter;
552
552
  }
553
553
  function l() {
554
554
  e.value = void 0, n.value = [];
@@ -558,6 +558,7 @@ function $e() {
558
558
  loCha: e,
559
559
  groups: n,
560
560
  setLoCha: a,
561
+ resetLoCha: l,
561
562
  getStatus: c,
562
563
  getBeforeFeatures: o,
563
564
  getAfterFeatures: s
@@ -565,32 +566,32 @@ function $e() {
565
566
  }
566
567
  //#endregion
567
568
  //#region src/constants/injectionKeys.ts
568
- var et = Symbol("reasonCollapsed"), tt = Symbol("loCha"), nt = Symbol("loChaInstanceId"), rt = Symbol("mapStyleUrl"), it = {
569
+ var $e = Symbol("reasonCollapsed"), et = Symbol("loCha"), tt = Symbol("loChaInstanceId"), nt = Symbol("mapStyleUrl"), rt = {
569
570
  n: "node",
570
571
  w: "way",
571
572
  r: "relation"
572
573
  };
573
- function at(e, t) {
574
- return `https://www.openstreetmap.org/${it[e]}/${t}/history`;
574
+ function it(e, t) {
575
+ return `https://www.openstreetmap.org/${rt[e]}/${t}/history`;
575
576
  }
576
- function ot(e) {
577
+ function at(e) {
577
578
  return `https://www.openstreetmap.org/user/${encodeURIComponent(e)}`;
578
579
  }
579
- function st(e, t) {
580
+ function ot(e, t) {
580
581
  return `http://127.0.0.1:8111/load_object?objects=${e}${t}`;
581
582
  }
582
- function ct(e, t) {
583
- return `https://osmlab.github.io/osm-deep-history/#/${it[e]}/${t}`;
583
+ function st(e, t) {
584
+ return `https://osmlab.github.io/osm-deep-history/#/${rt[e]}/${t}`;
584
585
  }
585
- function lt(e, t) {
586
- return `https://pewu.github.io/osm-history/#/${it[e]}/${t}`;
586
+ function ct(e, t) {
587
+ return `https://pewu.github.io/osm-history/#/${rt[e]}/${t}`;
587
588
  }
588
589
  //#endregion
589
590
  //#region src/components/LoCha/LoChaObject.vue?vue&type=script&setup=true&lang.ts
590
- var ut = { class: "locha-object" }, dt = { class: "header-row" }, ft = { class: "before-content" }, pt = { class: "wrap" }, mt = ["href"], ht = {
591
+ var lt = { class: "locha-object" }, ut = { class: "header-row" }, dt = { class: "before-content" }, ft = { class: "wrap" }, pt = ["href"], mt = {
591
592
  key: 1,
592
593
  class: "fab"
593
- }, gt = { class: "fab-menu" }, _t = ["href"], vt = ["href", "target"], yt = ["href"], bt = ["href"], xt = { class: "date" }, St = ["href", "title"], Ct = /* @__PURE__ */ l({
594
+ }, ht = { class: "fab-menu" }, gt = ["href"], _t = ["href", "target"], vt = ["href"], yt = ["href"], bt = { class: "date" }, xt = ["href", "title"], St = /* @__PURE__ */ l({
594
595
  __name: "LoChaObject",
595
596
  props: {
596
597
  feature: {},
@@ -600,24 +601,24 @@ var ut = { class: "locha-object" }, dt = { class: "header-row" }, ft = { class:
600
601
  setup(n) {
601
602
  ee((e) => ({
602
603
  v5f3a8926: u.value,
603
- v41a8bc86: M(G).delete,
604
- v532f58a5: M(G).new
604
+ v41a8bc86: M(K).delete,
605
+ v532f58a5: M(K).new
605
606
  }));
606
- let o = n, { getStatus: s } = p(tt), c = t(() => s(o.feature)), l = t(() => {
607
+ let o = n, { getStatus: s } = p(et), c = t(() => s(o.feature)), l = t(() => {
607
608
  switch (c.value) {
608
609
  case "new": return "new";
609
610
  case "delete": return "deleted";
610
611
  default: return "";
611
612
  }
612
- }), u = t(() => G[c.value]);
613
- return (t, s) => (S(), i("article", ut, [a("div", dt, [t.$slots.before ? (S(), i(e, { key: 0 }, [a("div", ft, [D(t.$slots, "before", {}, void 0, !0)]), s[6] ||= a("span", { class: "header-arrow" }, "→", -1)], 64)) : r("", !0), a("header", null, [
614
- a("div", pt, [
613
+ }), u = t(() => K[c.value]);
614
+ return (t, s) => (S(), i("article", lt, [a("div", ut, [t.$slots.before ? (S(), i(e, { key: 0 }, [a("div", dt, [D(t.$slots, "before", {}, void 0, !0)]), s[6] ||= a("span", { class: "header-arrow" }, "→", -1)], 64)) : r("", !0), a("header", null, [
615
+ a("div", ft, [
615
616
  a("a", {
616
- href: M(at)(n.feature.properties.objtype, n.feature.properties.id),
617
+ href: M(it)(n.feature.properties.objtype, n.feature.properties.id),
617
618
  title: "OSM History",
618
619
  target: "_blank",
619
620
  onClick: s[0] ||= F(() => {}, ["stop"])
620
- }, k(`${n.feature.properties.objtype}${n.feature.properties.id}-v${n.feature.properties.version}`), 9, mt),
621
+ }, k(`${n.feature.properties.objtype}${n.feature.properties.id}-v${n.feature.properties.version}`), 9, pt),
621
622
  !n.compact && (c.value === "new" || c.value === "delete") ? (S(), i("div", {
622
623
  key: 0,
623
624
  class: g(["status-content", {
@@ -625,59 +626,59 @@ var ut = { class: "locha-object" }, dt = { class: "header-row" }, ft = { class:
625
626
  "object-deleted": c.value === "delete"
626
627
  }])
627
628
  }, k(l.value), 3)) : r("", !0),
628
- n.compact ? r("", !0) : (S(), i("div", ht, [s[7] ||= a("button", {
629
+ n.compact ? r("", !0) : (S(), i("div", mt, [s[7] ||= a("button", {
629
630
  class: "fab-toggle",
630
631
  type: "button",
631
632
  title: "Tools"
632
- }, " 🔧 Tools ", -1), a("div", gt, [
633
+ }, " 🔧 Tools ", -1), a("div", ht, [
633
634
  a("a", {
634
- href: M(at)(n.feature.properties.objtype, n.feature.properties.id),
635
+ href: M(it)(n.feature.properties.objtype, n.feature.properties.id),
635
636
  class: "action-btn",
636
637
  title: "Edit in OSM iD",
637
638
  target: "_blank",
638
639
  onClick: s[1] ||= F(() => {}, ["stop"])
639
- }, " OSM iD ", 8, _t),
640
+ }, " OSM iD ", 8, gt),
640
641
  a("a", {
641
- href: M(st)(n.feature.properties.objtype, n.feature.properties.id),
642
+ href: M(ot)(n.feature.properties.objtype, n.feature.properties.id),
642
643
  class: "action-btn",
643
644
  title: "Edit in JOSM",
644
645
  target: n.josmTarget || "hidden_josm_target",
645
646
  onClick: s[2] ||= F(() => {}, ["stop"])
646
- }, " JOSM ", 8, vt),
647
+ }, " JOSM ", 8, _t),
647
648
  a("a", {
648
- href: M(ct)(n.feature.properties.objtype, n.feature.properties.id),
649
+ href: M(st)(n.feature.properties.objtype, n.feature.properties.id),
649
650
  class: "action-btn",
650
651
  title: "OSM Deep History",
651
652
  target: "_blank",
652
653
  onClick: s[3] ||= F(() => {}, ["stop"])
653
- }, " Deep H ", 8, yt),
654
+ }, " Deep H ", 8, vt),
654
655
  a("a", {
655
- href: M(lt)(n.feature.properties.objtype, n.feature.properties.id),
656
+ href: M(ct)(n.feature.properties.objtype, n.feature.properties.id),
656
657
  class: "action-btn",
657
658
  title: "OSM History Viewer",
658
659
  target: "_blank",
659
660
  onClick: s[4] ||= F(() => {}, ["stop"])
660
- }, " OSM H ", 8, bt)
661
+ }, " OSM H ", 8, yt)
661
662
  ])]))
662
663
  ]),
663
- a("p", xt, " 📅 " + k(o.feature.properties.created), 1),
664
+ a("p", bt, " 📅 " + k(o.feature.properties.created), 1),
664
665
  n.feature.properties.username ? (S(), i("a", {
665
666
  key: 0,
666
- href: M(ot)(n.feature.properties.username),
667
+ href: M(at)(n.feature.properties.username),
667
668
  title: `View ${n.feature.properties.username} OSM profile`,
668
669
  target: "_blank",
669
670
  onClick: s[5] ||= F(() => {}, ["stop"])
670
- }, " 👤" + k(n.feature.properties.username), 9, St)) : r("", !0)
671
+ }, " 👤" + k(n.feature.properties.username), 9, xt)) : r("", !0)
671
672
  ])]), n.compact ? r("", !0) : D(t.$slots, "object-detail", { key: 0 }, void 0, !0)]));
672
673
  }
673
- }), wt = (e, t) => {
674
+ }), Ct = (e, t) => {
674
675
  let n = e.__vccOpts || e;
675
676
  for (let [e, r] of t) n[e] = r;
676
677
  return n;
677
- }, Tt = /* @__PURE__ */ wt(Ct, [["__scopeId", "data-v-094314b7"]]);
678
+ }, wt = /* @__PURE__ */ Ct(St, [["__scopeId", "data-v-094314b7"]]);
678
679
  //#endregion
679
680
  //#region node_modules/@turf/bbox/dist/esm/index.js
680
- function K(e, t = {}) {
681
+ function q(e, t = {}) {
681
682
  if (e.bbox != null && !0 !== t.recompute) return e.bbox;
682
683
  let n = [
683
684
  Infinity,
@@ -689,31 +690,31 @@ function K(e, t = {}) {
689
690
  n[0] > e[0] && (n[0] = e[0]), n[1] > e[1] && (n[1] = e[1]), n[2] < e[0] && (n[2] = e[0]), n[3] < e[1] && (n[3] = e[1]);
690
691
  }), n;
691
692
  }
692
- var Et = K;
693
+ var Tt = q;
693
694
  //#endregion
694
695
  //#region node_modules/@vueuse/shared/dist/index.js
695
- function Dt(e, t) {
696
+ function Et(e, t) {
696
697
  return d() ? (b(e, t), !0) : !1;
697
698
  }
698
- var Ot = typeof window < "u" && typeof document < "u";
699
+ var Dt = typeof window < "u" && typeof document < "u";
699
700
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
700
- var kt = (e) => e != null, At = Object.prototype.toString, jt = (e) => At.call(e) === "[object Object]", Mt = () => {}, Nt = /* @__PURE__ */ Pt();
701
- function Pt() {
701
+ var Ot = (e) => e != null, kt = Object.prototype.toString, At = (e) => kt.call(e) === "[object Object]", jt = () => {}, Mt = /* @__PURE__ */ Nt();
702
+ function Nt() {
702
703
  var e, t;
703
- return Ot && !!(!((e = window) == null || (e = e.navigator) == null) && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
704
+ return Dt && !!(!((e = window) == null || (e = e.navigator) == null) && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
704
705
  }
705
- function Ft(...e) {
706
+ function Pt(...e) {
706
707
  if (e.length !== 1) return A(...e);
707
708
  let t = e[0];
708
709
  return typeof t == "function" ? w(c(() => ({
709
710
  get: t,
710
- set: Mt
711
+ set: jt
711
712
  }))) : T(t);
712
713
  }
713
- function It(e) {
714
+ function Ft(e) {
714
715
  return Array.isArray(e) ? e : [e];
715
716
  }
716
- function Lt(e, t, n) {
717
+ function It(e, t, n) {
717
718
  return N(e, t, {
718
719
  ...n,
719
720
  immediate: !0
@@ -721,64 +722,64 @@ function Lt(e, t, n) {
721
722
  }
722
723
  //#endregion
723
724
  //#region node_modules/@vueuse/core/dist/index.js
724
- var Rt = Ot ? window : void 0;
725
- Ot && window.document, Ot && window.navigator, Ot && window.location;
726
- function zt(e) {
725
+ var Lt = Dt ? window : void 0;
726
+ Dt && window.document, Dt && window.navigator, Dt && window.location;
727
+ function Rt(e) {
727
728
  let t = j(e);
728
729
  return t?.$el ?? t;
729
730
  }
730
- function Bt(...e) {
731
+ function zt(...e) {
731
732
  let n = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), r = t(() => {
732
- let t = It(j(e[0])).filter((e) => e != null);
733
+ let t = Ft(j(e[0])).filter((e) => e != null);
733
734
  return t.every((e) => typeof e != "string") ? t : void 0;
734
735
  });
735
- return Lt(() => [
736
- r.value?.map((e) => zt(e)) ?? [Rt].filter((e) => e != null),
737
- It(j(r.value ? e[1] : e[0])),
738
- It(M(r.value ? e[2] : e[1])),
736
+ return It(() => [
737
+ r.value?.map((e) => Rt(e)) ?? [Lt].filter((e) => e != null),
738
+ Ft(j(r.value ? e[1] : e[0])),
739
+ Ft(M(r.value ? e[2] : e[1])),
739
740
  j(r.value ? e[3] : e[2])
740
741
  ], ([e, t, r, i], a, o) => {
741
742
  if (!e?.length || !t?.length || !r?.length) return;
742
- let s = jt(i) ? { ...i } : i, c = e.flatMap((e) => t.flatMap((t) => r.map((r) => n(e, t, r, s))));
743
+ let s = At(i) ? { ...i } : i, c = e.flatMap((e) => t.flatMap((t) => r.map((r) => n(e, t, r, s))));
743
744
  o(() => {
744
745
  c.forEach((e) => e());
745
746
  });
746
747
  }, { flush: "post" });
747
748
  }
748
- function Vt() {
749
+ function Bt() {
749
750
  let e = O(!1), t = u();
750
751
  return t && y(() => {
751
752
  e.value = !0;
752
753
  }, t), e;
753
754
  }
754
755
  /* @__NO_SIDE_EFFECTS__ */
755
- function Ht(e) {
756
- let n = Vt();
756
+ function Vt(e) {
757
+ let n = Bt();
757
758
  return t(() => (n.value, !!e()));
758
759
  }
759
- function Ut(e, n, r = {}) {
760
- let { root: i, rootMargin: a, threshold: o = 0, window: s = Rt, immediate: c = !0 } = r, l = /* @__PURE__ */ Ht(() => s && "IntersectionObserver" in s), u = t(() => It(j(e)).map(zt).filter(kt)), d = Mt, f = O(c), p = l.value ? N(() => [
760
+ function Ht(e, n, r = {}) {
761
+ let { root: i, rootMargin: a, threshold: o = 0, window: s = Lt, immediate: c = !0 } = r, l = /* @__PURE__ */ Vt(() => s && "IntersectionObserver" in s), u = t(() => Ft(j(e)).map(Rt).filter(Ot)), d = jt, f = O(c), p = l.value ? N(() => [
761
762
  u.value,
762
- zt(i),
763
+ Rt(i),
763
764
  j(a),
764
765
  f.value
765
766
  ], ([e, t, r]) => {
766
767
  if (d(), !f.value || !e.length) return;
767
768
  let i = new IntersectionObserver(n, {
768
- root: zt(t),
769
+ root: Rt(t),
769
770
  rootMargin: r,
770
771
  threshold: o
771
772
  });
772
773
  e.forEach((e) => e && i.observe(e)), d = () => {
773
- i.disconnect(), d = Mt;
774
+ i.disconnect(), d = jt;
774
775
  };
775
776
  }, {
776
777
  immediate: c,
777
778
  flush: "post"
778
- }) : Mt, m = () => {
779
+ }) : jt, m = () => {
779
780
  d(), p(), f.value = !1;
780
781
  };
781
- return Dt(m), {
782
+ return Et(m), {
782
783
  isSupported: l,
783
784
  isActive: f,
784
785
  pause() {
@@ -790,42 +791,42 @@ function Ut(e, n, r = {}) {
790
791
  stop: m
791
792
  };
792
793
  }
793
- function Wt(e) {
794
+ function Ut(e) {
794
795
  return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
795
796
  }
796
- function Gt(e) {
797
+ function Wt(e) {
797
798
  let t = window.getComputedStyle(e);
798
799
  if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight) return !0;
799
800
  {
800
801
  let t = e.parentNode;
801
- return !t || t.tagName === "BODY" ? !1 : Gt(t);
802
+ return !t || t.tagName === "BODY" ? !1 : Wt(t);
802
803
  }
803
804
  }
804
- function Kt(e) {
805
+ function Gt(e) {
805
806
  let t = e || window.event, n = t.target;
806
- return Gt(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
807
+ return Wt(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
807
808
  }
808
- var qt = /* @__PURE__ */ new WeakMap();
809
- function Jt(e, n = !1) {
809
+ var Kt = /* @__PURE__ */ new WeakMap();
810
+ function qt(e, n = !1) {
810
811
  let r = O(n), i = null, a = "";
811
- N(Ft(e), (e) => {
812
- let t = Wt(j(e));
812
+ N(Pt(e), (e) => {
813
+ let t = Ut(j(e));
813
814
  if (t) {
814
815
  let e = t;
815
- if (qt.get(e) || qt.set(e, e.style.overflow), e.style.overflow !== "hidden" && (a = e.style.overflow), e.style.overflow === "hidden") return r.value = !0;
816
+ if (Kt.get(e) || Kt.set(e, e.style.overflow), e.style.overflow !== "hidden" && (a = e.style.overflow), e.style.overflow === "hidden") return r.value = !0;
816
817
  if (r.value) return e.style.overflow = "hidden";
817
818
  }
818
819
  }, { immediate: !0 });
819
820
  let o = () => {
820
- let t = Wt(j(e));
821
- !t || r.value || (Nt && (i = Bt(t, "touchmove", (e) => {
822
- Kt(e);
821
+ let t = Ut(j(e));
822
+ !t || r.value || (Mt && (i = zt(t, "touchmove", (e) => {
823
+ Gt(e);
823
824
  }, { passive: !1 })), t.style.overflow = "hidden", r.value = !0);
824
825
  }, s = () => {
825
- let t = Wt(j(e));
826
- !t || !r.value || (Nt && i?.(), t.style.overflow = a, qt.delete(t), r.value = !1);
826
+ let t = Ut(j(e));
827
+ !t || !r.value || (Mt && i?.(), t.style.overflow = a, Kt.delete(t), r.value = !1);
827
828
  };
828
- return Dt(s), t({
829
+ return Et(s), t({
829
830
  get() {
830
831
  return r.value;
831
832
  },
@@ -836,26 +837,26 @@ function Jt(e, n = !1) {
836
837
  }
837
838
  //#endregion
838
839
  //#region node_modules/@vueuse/components/dist/index.js
839
- var Yt = { mounted(e, t) {
840
- typeof t.value == "function" ? Ut(e, t.value) : Ut(e, ...t.value);
840
+ var Jt = { mounted(e, t) {
841
+ typeof t.value == "function" ? Ht(e, t.value) : Ht(e, ...t.value);
841
842
  } };
842
- function Xt() {
843
+ function Yt() {
843
844
  let e = !1, t = O(!1);
844
845
  return (n, r) => {
845
846
  if (t.value = r.value, e) return;
846
847
  e = !0;
847
- let i = Jt(n, r.value);
848
+ let i = qt(n, r.value);
848
849
  N(t, (e) => i.value = e);
849
850
  };
850
851
  }
851
- Xt();
852
+ Yt();
852
853
  //#endregion
853
854
  //#region src/constants/map.ts
854
- var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5", $t = "bbox", q = "lochas", J = {
855
+ var Xt = "https://maps.cartoway.com/styles/positron/style.json", Zt = "#f4f4f5", Qt = "bbox", $t = "lochas", J = {
855
856
  Bbox: {
856
857
  id: "bbox-layer",
857
858
  type: "line",
858
- source: $t,
859
+ source: Qt,
859
860
  layout: { "line-join": "miter" },
860
861
  paint: {
861
862
  "line-color": "#000000",
@@ -867,7 +868,7 @@ var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5",
867
868
  PolygonBorder: {
868
869
  id: "feature-polygons-border",
869
870
  type: "line",
870
- source: q,
871
+ source: $t,
871
872
  paint: {
872
873
  "line-width": [
873
874
  "case",
@@ -890,7 +891,7 @@ var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5",
890
891
  Polygon: {
891
892
  id: "feature-polygons",
892
893
  type: "fill",
893
- source: q,
894
+ source: $t,
894
895
  paint: {
895
896
  "fill-opacity": [
896
897
  "case",
@@ -909,26 +910,26 @@ var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5",
909
910
  ["get", "geom"],
910
911
  !1
911
912
  ],
912
- Qt,
913
+ Zt,
913
914
  [
914
915
  "==",
915
916
  ["get", "is_new"],
916
917
  !0
917
918
  ],
918
- G.new,
919
+ K.new,
919
920
  [
920
921
  "==",
921
922
  ["get", "deleted"],
922
923
  !0
923
924
  ],
924
- G.delete,
925
+ K.delete,
925
926
  [
926
927
  "==",
927
928
  ["get", "is_before"],
928
929
  !0
929
930
  ],
930
- G.updateBefore,
931
- G.updateAfter
931
+ K.updateBefore,
932
+ K.updateAfter
932
933
  ]
933
934
  },
934
935
  filter: [
@@ -940,7 +941,7 @@ var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5",
940
941
  LineString: {
941
942
  id: "feature-lines",
942
943
  type: "line",
943
- source: q,
944
+ source: $t,
944
945
  paint: {
945
946
  "line-width": 6,
946
947
  "line-color": [
@@ -950,26 +951,26 @@ var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5",
950
951
  ["get", "geom"],
951
952
  !1
952
953
  ],
953
- Qt,
954
+ Zt,
954
955
  [
955
956
  "==",
956
957
  ["get", "is_new"],
957
958
  !0
958
959
  ],
959
- G.new,
960
+ K.new,
960
961
  [
961
962
  "==",
962
963
  ["get", "deleted"],
963
964
  !0
964
965
  ],
965
- G.delete,
966
+ K.delete,
966
967
  [
967
968
  "==",
968
969
  ["get", "is_before"],
969
970
  !0
970
971
  ],
971
- G.updateBefore,
972
- G.updateAfter
972
+ K.updateBefore,
973
+ K.updateAfter
973
974
  ],
974
975
  "line-opacity": [
975
976
  "case",
@@ -1002,7 +1003,7 @@ var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5",
1002
1003
  LineStringBorder: {
1003
1004
  id: "feature-lines-border",
1004
1005
  type: "line",
1005
- source: q,
1006
+ source: $t,
1006
1007
  paint: {
1007
1008
  "line-width": [
1008
1009
  "case",
@@ -1036,7 +1037,7 @@ var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5",
1036
1037
  Point: {
1037
1038
  id: "feature-points",
1038
1039
  type: "circle",
1039
- source: q,
1040
+ source: $t,
1040
1041
  paint: {
1041
1042
  "circle-radius": [
1042
1043
  "case",
@@ -1076,26 +1077,26 @@ var Zt = "https://maps.cartoway.com/styles/positron/style.json", Qt = "#f4f4f5",
1076
1077
  ["get", "geom"],
1077
1078
  !1
1078
1079
  ],
1079
- Qt,
1080
+ Zt,
1080
1081
  [
1081
1082
  "==",
1082
1083
  ["get", "is_new"],
1083
1084
  !0
1084
1085
  ],
1085
- G.new,
1086
+ K.new,
1086
1087
  [
1087
1088
  "==",
1088
1089
  ["get", "deleted"],
1089
1090
  !0
1090
1091
  ],
1091
- G.delete,
1092
+ K.delete,
1092
1093
  [
1093
1094
  "==",
1094
1095
  ["get", "is_before"],
1095
1096
  !0
1096
1097
  ],
1097
- G.updateBefore,
1098
- G.updateAfter
1098
+ K.updateBefore,
1099
+ K.updateAfter
1099
1100
  ]
1100
1101
  },
1101
1102
  filter: [
@@ -1136,7 +1137,7 @@ function rn(e, t) {
1136
1137
  return e[0] < t[0] ? n |= 1 : e[0] > t[2] && (n |= 2), e[1] < t[1] ? n |= 4 : e[1] > t[3] && (n |= 8), n;
1137
1138
  }
1138
1139
  function an(e, t) {
1139
- let n = U(e), r = n.type, i = e.type === "Feature" ? e.properties : {}, a = n.coordinates;
1140
+ let n = W(e), r = n.type, i = e.type === "Feature" ? e.properties : {}, a = n.coordinates;
1140
1141
  switch (r) {
1141
1142
  case "LineString":
1142
1143
  case "MultiLineString": {
@@ -1238,7 +1239,7 @@ function Sn(e, t) {
1238
1239
  function Cn(e, t, n = {}) {
1239
1240
  if (!e) throw Error("point is required");
1240
1241
  if (!t) throw Error("polygon is required");
1241
- let r = V(e), i = U(t), a = i.type, o = t.bbox, s = i.coordinates;
1242
+ let r = H(e), i = W(t), a = i.type, o = t.bbox, s = i.coordinates;
1242
1243
  if (o && wn(r, o) === !1) return !1;
1243
1244
  a === "Polygon" && (s = [s]);
1244
1245
  let c = !1;
@@ -1482,8 +1483,8 @@ function En(e) {
1482
1483
  e[3],
1483
1484
  e[4]
1484
1485
  ];
1485
- else if (e.type === "Feature") t = K(e);
1486
- else if (e.type === "FeatureCollection") t = K(e);
1486
+ else if (e.type === "Feature") t = q(e);
1487
+ else if (e.type === "FeatureCollection") t = q(e);
1487
1488
  else throw Error("invalid geojson");
1488
1489
  return {
1489
1490
  minX: t[0],
@@ -1498,21 +1499,21 @@ var Dn = class {
1498
1499
  }
1499
1500
  insert(e) {
1500
1501
  if (e.type !== "Feature") throw Error("invalid feature");
1501
- return e.bbox = e.bbox ? e.bbox : K(e), this.tree.insert(e), this;
1502
+ return e.bbox = e.bbox ? e.bbox : q(e), this.tree.insert(e), this;
1502
1503
  }
1503
1504
  load(e) {
1504
1505
  var t = [];
1505
1506
  return Array.isArray(e) ? e.forEach(function(e) {
1506
1507
  if (e.type !== "Feature") throw Error("invalid features");
1507
- e.bbox = e.bbox ? e.bbox : K(e), t.push(e);
1508
+ e.bbox = e.bbox ? e.bbox : q(e), t.push(e);
1508
1509
  }) : we(e, function(e) {
1509
1510
  if (e.type !== "Feature") throw Error("invalid features");
1510
- e.bbox = e.bbox ? e.bbox : K(e), t.push(e);
1511
+ e.bbox = e.bbox ? e.bbox : q(e), t.push(e);
1511
1512
  }), this.tree.load(t), this;
1512
1513
  }
1513
1514
  remove(e, t) {
1514
1515
  if (e.type !== "Feature") throw Error("invalid feature");
1515
- return e.bbox = e.bbox ? e.bbox : K(e), this.tree.remove(e, t), this;
1516
+ return e.bbox = e.bbox ? e.bbox : q(e), this.tree.remove(e, t), this;
1516
1517
  }
1517
1518
  clear() {
1518
1519
  return this.tree.clear(), this;
@@ -1569,9 +1570,9 @@ function Mn(e, t) {
1569
1570
  if (r !== null) {
1570
1571
  switch (r.type) {
1571
1572
  case "Polygon":
1572
- n = H(r);
1573
+ n = U(r);
1573
1574
  break;
1574
- case "LineString": n = [H(r)];
1575
+ case "LineString": n = [U(r)];
1575
1576
  }
1576
1577
  n.forEach((n) => {
1577
1578
  Nn(n, e.properties).forEach((e) => {
@@ -1726,7 +1727,7 @@ function Xn(e, t, n = {}) {
1726
1727
  //#endregion
1727
1728
  //#region node_modules/@turf/distance/dist/esm/index.js
1728
1729
  function Zn(e, t, n = {}) {
1729
- var r = V(e), i = V(t), a = B(i[1] - r[1]), o = B(i[0] - r[0]), s = B(r[1]), c = B(i[1]), l = Math.sin(a / 2) ** 2 + Math.sin(o / 2) ** 2 * Math.cos(s) * Math.cos(c);
1730
+ var r = H(e), i = H(t), a = B(i[1] - r[1]), o = B(i[0] - r[0]), s = B(r[1]), c = B(i[1]), l = Math.sin(a / 2) ** 2 + Math.sin(o / 2) ** 2 * Math.cos(s) * Math.cos(c);
1730
1731
  return ye(2 * Math.atan2(Math.sqrt(l), Math.sqrt(1 - l)), n.units);
1731
1732
  }
1732
1733
  //#endregion
@@ -1743,7 +1744,7 @@ var Qn = Object.defineProperty, $n = Object.defineProperties, er = Object.getOwn
1743
1744
  }, or = (e, t) => $n(e, er(t));
1744
1745
  function sr(e, t, n = {}) {
1745
1746
  if (!e || !t) throw Error("lines and inputPoint are required arguments");
1746
- let r = V(t), i = he([Infinity, Infinity], {
1747
+ let r = H(t), i = he([Infinity, Infinity], {
1747
1748
  lineStringIndex: -1,
1748
1749
  segmentIndex: -1,
1749
1750
  totalDistance: -1,
@@ -1757,9 +1758,9 @@ function sr(e, t, n = {}) {
1757
1758
  }), a = 0, o = 0, s = -1;
1758
1759
  return Oe(e, function(e, c, l) {
1759
1760
  s !== l && (s = l, o = 0);
1760
- let u = H(e);
1761
+ let u = U(e);
1761
1762
  for (let e = 0; e < u.length - 1; e++) {
1762
- let s = he(u[e]), c = V(s), d = he(u[e + 1]), f = V(d), p = Zn(s, d, n), m, h;
1763
+ let s = he(u[e]), c = H(s), d = he(u[e + 1]), f = H(d), p = Zn(s, d, n), m, h;
1763
1764
  f[0] === r[0] && f[1] === r[1] ? [m, h] = [f, !0] : c[0] === r[0] && c[1] === r[1] ? [m, h] = [c, !1] : [m, h] = pr(c, f, r);
1764
1765
  let g = Zn(t, m, n);
1765
1766
  if (g < i.properties.pointDistance) {
@@ -1838,7 +1839,7 @@ function pr(e, t, n) {
1838
1839
  function mr(e, t) {
1839
1840
  if (!e) throw Error("line is required");
1840
1841
  if (!t) throw Error("splitter is required");
1841
- let n = We(e), r = We(t);
1842
+ let n = Ue(e), r = Ue(t);
1842
1843
  if (n !== "LineString") throw Error("line must be LineString");
1843
1844
  if (r === "FeatureCollection") throw Error("splitter cannot be a FeatureCollection");
1844
1845
  if (r === "GeometryCollection") throw Error("splitter cannot be a GeometryCollection");
@@ -1872,14 +1873,14 @@ function hr(e, t) {
1872
1873
  }), z(n);
1873
1874
  }
1874
1875
  function gr(e, t) {
1875
- var n = [], r = H(e)[0], i = H(e)[e.geometry.coordinates.length - 1];
1876
- if (vr(r, V(t)) || vr(i, V(t))) return z([e]);
1876
+ var n = [], r = U(e)[0], i = U(e)[e.geometry.coordinates.length - 1];
1877
+ if (vr(r, H(t)) || vr(i, H(t))) return z([e]);
1877
1878
  var a = On(), o = jn(e);
1878
1879
  a.load(o);
1879
1880
  var s = a.search(t);
1880
1881
  if (!s.features.length) return z([e]);
1881
1882
  var c = _r(t, s), l = Te(o, function(e, r, i) {
1882
- var a = H(r)[1], o = V(t);
1883
+ var a = U(r)[1], o = H(t);
1883
1884
  return i === c.id ? (e.push(o), n.push(R(e)), vr(o, a) ? [o] : [o, a]) : (e.push(a), e);
1884
1885
  }, [r]);
1885
1886
  return l.length > 1 && n.push(R(l)), z(n);
@@ -1899,7 +1900,7 @@ function vr(e, t) {
1899
1900
  //#endregion
1900
1901
  //#region node_modules/@turf/boolean-contains/dist/esm/index.js
1901
1902
  function yr(e, t) {
1902
- let n = U(e), r = U(t), i = n.type, a = r.type, o = n.coordinates, s = r.coordinates;
1903
+ let n = W(e), r = W(t), i = n.type, a = r.type, o = n.coordinates, s = r.coordinates;
1903
1904
  switch (i) {
1904
1905
  case "Point": switch (a) {
1905
1906
  case "Point": return jr(o, s);
@@ -1911,7 +1912,7 @@ function yr(e, t) {
1911
1912
  default: throw Error("feature2 " + a + " geometry not supported");
1912
1913
  }
1913
1914
  case "LineString": switch (a) {
1914
- case "Point": return W(r, n, { ignoreEndVertices: !0 });
1915
+ case "Point": return G(r, n, { ignoreEndVertices: !0 });
1915
1916
  case "LineString": return Er(n, r);
1916
1917
  case "MultiPoint": return wr(n, r);
1917
1918
  default: throw Error("feature2 " + a + " geometry not supported");
@@ -1964,7 +1965,7 @@ function Cr(e, t) {
1964
1965
  }
1965
1966
  function wr(e, t) {
1966
1967
  let n = !1;
1967
- for (let r of t.coordinates) if (W(r, e, { ignoreEndVertices: !0 }) && (n = !0), !W(r, e)) return !1;
1968
+ for (let r of t.coordinates) if (G(r, e, { ignoreEndVertices: !0 }) && (n = !0), !G(r, e)) return !1;
1968
1969
  return !!n;
1969
1970
  }
1970
1971
  function Tr(e, t) {
@@ -1973,10 +1974,10 @@ function Tr(e, t) {
1973
1974
  }
1974
1975
  function Er(e, t) {
1975
1976
  let n = !1;
1976
- for (let r of t.coordinates) if (W({
1977
+ for (let r of t.coordinates) if (G({
1977
1978
  type: "Point",
1978
1979
  coordinates: r
1979
- }, e, { ignoreEndVertices: !0 }) && (n = !0), !W({
1980
+ }, e, { ignoreEndVertices: !0 }) && (n = !0), !G({
1980
1981
  type: "Point",
1981
1982
  coordinates: r
1982
1983
  }, e, { ignoreEndVertices: !1 })) return !1;
@@ -1991,7 +1992,7 @@ function Dr(e, t) {
1991
1992
  return z(r);
1992
1993
  }
1993
1994
  function Or(e, t) {
1994
- if (!Ar(K(e), K(t))) return !1;
1995
+ if (!Ar(q(e), q(t))) return !1;
1995
1996
  for (let n of t.coordinates) if (!Cn(n, e)) return !1;
1996
1997
  let n = !1, r = Dr(t, e);
1997
1998
  for (let t of r.features) {
@@ -2002,8 +2003,8 @@ function Or(e, t) {
2002
2003
  return n;
2003
2004
  }
2004
2005
  function kr(e, t) {
2005
- if (e.type === "Feature" && e.geometry === null || t.type === "Feature" && t.geometry === null || !Ar(K(e), K(t))) return !1;
2006
- let n = U(t).coordinates;
2006
+ if (e.type === "Feature" && e.geometry === null || t.type === "Feature" && t.geometry === null || !Ar(q(e), q(t))) return !1;
2007
+ let n = W(t).coordinates;
2007
2008
  for (let t of n) for (let n of t) if (!Cn(n, e)) return !1;
2008
2009
  return !0;
2009
2010
  }
@@ -2020,7 +2021,7 @@ var Nr = yr;
2020
2021
  //#endregion
2021
2022
  //#region node_modules/@turf/envelope/dist/esm/index.js
2022
2023
  function Pr(e) {
2023
- return cn(K(e));
2024
+ return cn(q(e));
2024
2025
  }
2025
2026
  var Fr = Pr;
2026
2027
  //#endregion
@@ -2049,7 +2050,7 @@ function Vr(e) {
2049
2050
  }
2050
2051
  //#endregion
2051
2052
  //#region src/components/VMap.vue?vue&type=script&setup=true&lang.ts
2052
- var Hr = ["id"], Ur = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2053
+ var Hr = ["id"], Ur = /* @__PURE__ */ Ct(/* @__PURE__ */ l({
2053
2054
  __name: "VMap",
2054
2055
  props: {
2055
2056
  id: {},
@@ -2057,36 +2058,65 @@ var Hr = ["id"], Ur = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2057
2058
  bbox: {}
2058
2059
  },
2059
2060
  setup(e) {
2060
- let t = e, n = p(rt, Zt), r = {
2061
- top: 60,
2062
- left: 60,
2063
- right: 60,
2064
- bottom: 80
2065
- }, a = O(), o = O(!1), s = O(), c = O(), l, u;
2061
+ let t = e, n = p(nt, Xt);
2062
+ function r(e) {
2063
+ let t = e.offsetWidth, n = e.offsetHeight;
2064
+ return {
2065
+ top: Math.min(60, Math.floor(n * .15)),
2066
+ left: Math.min(60, Math.floor(t * .15)),
2067
+ right: Math.min(60, Math.floor(t * .15)),
2068
+ bottom: Math.min(80, Math.floor(n * .2))
2069
+ };
2070
+ }
2071
+ let a = O(), o = O(!1), s = O(), c = O(), l;
2066
2072
  N(o, (e) => {
2067
- e ? d() : (a.value && a.value.remove(), a.value = void 0);
2073
+ e ? u() : (a.value && a.value.remove(), a.value = void 0);
2068
2074
  }), N(() => t.features, (e) => {
2069
- a.value && o.value && e && (a.value.remove(), a.value = void 0, d());
2075
+ a.value && o.value && e && (a.value.remove(), a.value = void 0, u());
2070
2076
  });
2071
- function d() {
2077
+ function u() {
2072
2078
  if (!a.value) {
2079
+ let e = document.getElementById(`map-${t.id}`);
2080
+ if (!e) return;
2073
2081
  l = t.bbox ? Br(t.bbox) : void 0;
2074
- let e = l ? Lr(t.features, l) : z(t.features);
2075
- if (e) {
2076
- let r = l ?? Et(e);
2077
- u = [[r[0], r[1]], [r[2], r[3]]], a.value = new ie.Map({
2082
+ let i = t.features.filter((e) => e.geometry != null);
2083
+ if (!i.length) return;
2084
+ let o = l ? Lr(i, l) : z(i);
2085
+ if (o) {
2086
+ let i = Tt(o);
2087
+ Vr(i) && (i = [
2088
+ i[0] - 1e-4,
2089
+ i[1] - 1e-4,
2090
+ i[2] + 1e-4,
2091
+ i[3] + 1e-4
2092
+ ]);
2093
+ let s = t.bbox, c = s ? [
2094
+ Math.max(i[0], s[0]),
2095
+ Math.max(i[1], s[1]),
2096
+ Math.min(i[2], s[2]),
2097
+ Math.min(i[3], s[3])
2098
+ ] : i;
2099
+ (c[0] > c[2] || c[1] > c[3]) && (c = i);
2100
+ let l = [[c[0], c[1]], [c[2], c[3]]];
2101
+ a.value = new ie.Map({
2078
2102
  hash: !1,
2079
2103
  container: `map-${t.id}`,
2104
+ bounds: l,
2105
+ fitBoundsOptions: {
2106
+ padding: r(e),
2107
+ animate: !1,
2108
+ maxZoom: 17
2109
+ },
2080
2110
  style: n,
2081
2111
  cooperativeGestures: !0,
2082
2112
  attributionControl: !1
2083
- }), a.value.addControl(new ie.FullscreenControl()), a.value.on("load", m);
2113
+ }), a.value.addControl(new ie.FullscreenControl()), a.value.on("load", f);
2084
2114
  }
2085
2115
  }
2086
2116
  }
2087
- function f(e) {
2117
+ function d(e) {
2088
2118
  if (!a.value) throw Error("Call initMap() function first.");
2089
- a.value.addSource($t, {
2119
+ a.value.addSource(Qt, {
2090
2120
  type: "geojson",
2091
2121
  data: {
2092
2122
  type: "Feature",
@@ -2104,60 +2134,56 @@ var Hr = ["id"], Ur = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2104
2134
  }
2105
2135
  }), a.value.addLayer(J.Bbox);
2106
2136
  }
2107
- function m() {
2137
+ function f() {
2108
2138
  if (!a.value) throw Error("Call initMap() function first.");
2109
- a.value.resize(), u && a.value.fitBounds(u, {
2110
- padding: r,
2111
- animate: !1,
2112
- maxZoom: 17
2113
- }), t.bbox && f(Vr(t.bbox) ? [
2139
+ t.bbox && d(Vr(t.bbox) ? [
2114
2140
  t.bbox[0] - 1e-4,
2115
2141
  t.bbox[1] - 1e-4,
2116
2142
  t.bbox[2] + 1e-4,
2117
2143
  t.bbox[3] + 1e-4
2118
- ] : t.bbox), a.value.addSource(q, {
2144
+ ] : t.bbox), a.value.addSource($t, {
2119
2145
  type: "geojson",
2120
2146
  data: {
2121
2147
  type: "FeatureCollection",
2122
2148
  features: t.features
2123
2149
  }
2124
- }), h(), y();
2150
+ }), m(), v();
2125
2151
  }
2126
- function h() {
2152
+ function m() {
2127
2153
  if (!a.value) throw Error("Call initMap() function first.");
2128
2154
  a.value.getLayer(J.Polygon.id) || a.value.addLayer(J.Polygon), a.value.getLayer(J.PolygonBorder.id) || a.value.addLayer(J.PolygonBorder), a.value.getLayer(J.LineStringBorder.id) || a.value.addLayer(J.LineStringBorder), a.value.getLayer(J.LineString.id) || a.value.addLayer(J.LineString), a.value.getLayer(J.Point.id) || a.value.addLayer(J.Point);
2129
2155
  }
2130
- function g(e) {
2131
- !e.features || e.features.length === 0 || (c.value !== void 0 && x(), c.value = e.features[0], b(e.lngLat, e.features[0]));
2156
+ function h(e) {
2157
+ !e.features || e.features.length === 0 || (c.value !== void 0 && b(), c.value = e.features[0], y(e.lngLat, e.features[0]));
2132
2158
  }
2133
- function _() {
2159
+ function g() {
2134
2160
  a.value.getCanvas().style.cursor = "pointer";
2135
2161
  }
2136
- function v() {
2137
- a.value.getCanvas().style.cursor = "", c.value !== void 0 && (c.value = void 0), x();
2162
+ function _() {
2163
+ a.value.getCanvas().style.cursor = "", c.value !== void 0 && (c.value = void 0), b();
2138
2164
  }
2139
- function y() {
2165
+ function v() {
2140
2166
  if (!a.value) throw Error("Call initMap() function first.");
2141
2167
  Object.values(J).forEach((e) => {
2142
- e.id !== "bbox-layer" && (a.value.on("mousemove", e.id, g), a.value.on("mouseenter", e.id, _), a.value.on("mouseleave", e.id, v));
2168
+ e.id !== "bbox-layer" && (a.value.on("mousemove", e.id, h), a.value.on("mouseenter", e.id, g), a.value.on("mouseleave", e.id, _));
2143
2169
  });
2144
2170
  }
2145
- function b(e, t) {
2171
+ function y(e, t) {
2146
2172
  if (!a.value) throw Error("Call initMap() function first.");
2147
- s.value = new ie.Popup().setLngLat(e).setHTML(`${it[t.properties.objtype]}-${t.properties.id}-v${t.properties.version}`).addTo(a.value);
2173
+ s.value = new ie.Popup().setLngLat(e).setHTML(`${rt[t.properties.objtype]}-${t.properties.id}-v${t.properties.version}`).addTo(a.value);
2148
2174
  }
2149
- function x() {
2175
+ function b() {
2150
2176
  s.value?.remove(), s.value = void 0;
2151
2177
  }
2152
- function C([e]) {
2178
+ function x([e]) {
2153
2179
  o.value = e?.isIntersecting || !1;
2154
2180
  }
2155
2181
  return (t, n) => re((S(), i("div", {
2156
2182
  id: `map-${e.id}`,
2157
2183
  class: "v-map"
2158
- }, null, 8, Hr)), [[M(Yt), C]]);
2184
+ }, null, 8, Hr)), [[M(Jt), x]]);
2159
2185
  }
2160
- }), [["__scopeId", "data-v-1987b771"]]), Wr = ["id"], Gr = { class: "group-header" }, Kr = { class: "header-start" }, qr = ["href"], Jr = ["title"], Yr = {
2186
+ }), [["__scopeId", "data-v-31c46779"]]), Wr = ["id"], Gr = { class: "group-header" }, Kr = { class: "header-start" }, qr = ["href"], Jr = ["title"], Yr = {
2161
2187
  key: 0,
2162
2188
  class: "name-before"
2163
2189
  }, Xr = {
@@ -2169,7 +2195,7 @@ var Hr = ["id"], Ur = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2169
2195
  }, Qr = { class: "header-center" }, $r = { class: "header-end" }, ei = { class: "group-content" }, ti = {
2170
2196
  key: 0,
2171
2197
  class: "content-start"
2172
- }, ni = { key: 0 }, ri = { key: 1 }, ii = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2198
+ }, ni = { key: 0 }, ri = { key: 1 }, ii = /* @__PURE__ */ Ct(/* @__PURE__ */ l({
2173
2199
  __name: "LoChaGroup",
2174
2200
  props: {
2175
2201
  id: {},
@@ -2178,12 +2204,18 @@ var Hr = ["id"], Ur = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2178
2204
  josmTarget: {}
2179
2205
  },
2180
2206
  emits: ["navigate"],
2181
- setup(n) {
2182
- ee((e) => ({ v590c99f3: d.value }));
2183
- let c = n, l = te(), u = t(() => !!l["content-start"]), d = t(() => u.value ? "repeat(4, minmax(0, 1fr))" : "repeat(3, minmax(0, 1fr))"), f = t(() => u.value ? 3 : 2), m = t(() => u.value ? 4 : 3), h = p(nt), { loCha: _, getBeforeFeatures: y, getAfterFeatures: b } = p(tt);
2184
- if (!_.value) throw Error("LoCha is empty.");
2185
- let x = t(() => y(c.features)), C = t(() => b(c.features)), w = t(() => x.value.length > 0 && C.value.length === 0), T = t(() => x.value.length === 0 && C.value.length > 0), O = t(() => x.value.length === 1 && C.value.length === 1 && !!C.value[0]?.properties.deleted), A = t(() => x.value.length === 1 && C.value.length === 1 && !C.value[0]?.properties.deleted), j = t(() => {
2186
- let e = [...new Set(x.value.map((e) => e.properties.tags?.name).filter(Boolean))], t = [...new Set(C.value.map((e) => e.properties.tags?.name).filter(Boolean))], n = e.length > 0 ? e.join(", ") : null, r = t.length > 0 ? t.join(", ") : null;
2207
+ setup(c) {
2208
+ ee((e) => ({ v223c9cda: f.value }));
2209
+ let l = c, u = te(), d = t(() => !!u["content-start"]), f = t(() => d.value ? "repeat(4, minmax(0, 1fr))" : "repeat(3, minmax(0, 1fr))"), m = t(() => d.value ? 3 : 2), h = t(() => d.value ? 4 : 3), _ = p(tt), { loCha: y, getBeforeFeatures: b, getAfterFeatures: x } = p(et);
2210
+ if (!y.value) throw Error("LoCha is empty.");
2211
+ let C = t(() => b(l.features)), w = t(() => x(l.features)), T = t(() => C.value.length > 0 && w.value.length === 0), O = t(() => C.value.length === 0 && w.value.length > 0), A = t(() => C.value.length === 1 && w.value.length === 1 && !!w.value[0]?.properties.deleted), j = t(() => C.value.length === 1 && w.value.length === 1 && !w.value[0]?.properties.deleted), ne = t(() => {
2212
+ let e = y.value?.metadata.links[l.index] ?? [];
2213
+ return new Map(w.value.map((t) => {
2214
+ let n = e.filter((e) => e.after === t.id).map((e) => e.before).filter(Boolean);
2215
+ return [t.id, l.features.filter((e) => n.includes(e.id))];
2216
+ }));
2217
+ }), N = t(() => {
2218
+ let e = [...new Set(C.value.map((e) => e.properties.tags?.name).filter(Boolean))], t = [...new Set(w.value.map((e) => e.properties.tags?.name).filter(Boolean))], n = e.length > 0 ? e.join(", ") : null, r = t.length > 0 ? t.join(", ") : null;
2187
2219
  return n === r ? {
2188
2220
  before: null,
2189
2221
  after: r
@@ -2191,87 +2223,99 @@ var Hr = ["id"], Ur = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2191
2223
  before: n,
2192
2224
  after: r
2193
2225
  };
2194
- }), ne = t(() => {
2195
- let { before: e, after: t } = j.value;
2226
+ }), re = t(() => {
2227
+ let { before: e, after: t } = N.value;
2196
2228
  return e && t ? `${e} → ${t}` : e ?? t ?? void 0;
2197
2229
  });
2198
- return (t, l) => (S(), i("div", {
2199
- id: n.id,
2230
+ return (t, u) => (S(), i("div", {
2231
+ id: c.id,
2200
2232
  class: "locha-group"
2201
2233
  }, [a("div", Gr, [
2202
- a("div", Kr, [a("a", {
2203
- class: "anchor-button",
2204
- href: `#${n.id}`,
2205
- onClick: l[0] ||= F((e) => t.$emit("navigate", `#${n.id}`), ["prevent"])
2206
- }, "🔗", 8, qr), a("h3", {
2207
- class: "group-name",
2208
- title: ne.value
2209
- }, [
2210
- j.value.before ? (S(), i("span", Yr, k(j.value.before), 1)) : r("", !0),
2211
- j.value.before ? (S(), i("span", Xr, " → ")) : r("", !0),
2212
- j.value.after ? (S(), i("span", Zr, k(j.value.after), 1)) : r("", !0)
2213
- ], 8, Jr)]),
2214
- a("div", Qr, [D(t.$slots, "header-center", { index: n.index }, void 0, !0)]),
2215
- a("div", $r, [D(t.$slots, "header-end", { index: n.index }, void 0, !0)])
2234
+ a("div", Kr, [
2235
+ a("a", {
2236
+ class: "anchor-button",
2237
+ href: `#${c.id}`,
2238
+ onClick: u[0] ||= F((e) => t.$emit("navigate", `#${c.id}`), ["prevent"])
2239
+ }, "🔗", 8, qr),
2240
+ D(t.$slots, "header-start-end", { index: c.index }, void 0, !0),
2241
+ a("h3", {
2242
+ class: "group-name",
2243
+ title: re.value
2244
+ }, [
2245
+ N.value.before ? (S(), i("span", Yr, k(N.value.before), 1)) : r("", !0),
2246
+ N.value.before ? (S(), i("span", Xr, " ")) : r("", !0),
2247
+ N.value.after ? (S(), i("span", Zr, k(N.value.after), 1)) : r("", !0)
2248
+ ], 8, Jr)
2249
+ ]),
2250
+ a("div", Qr, [D(t.$slots, "header-center", { index: c.index }, void 0, !0)]),
2251
+ a("div", $r, [D(t.$slots, "header-end", { index: c.index }, void 0, !0)])
2216
2252
  ]), a("div", ei, [
2217
- t.$slots["content-start"] ? (S(), i("div", ti, [D(t.$slots, "content-start", { index: n.index }, void 0, !0)])) : r("", !0),
2218
- !A.value && !T.value && !O.value ? (S(), i("div", {
2253
+ t.$slots["content-start"] ? (S(), i("div", ti, [D(t.$slots, "content-start", { index: c.index }, void 0, !0)])) : r("", !0),
2254
+ !j.value && !O.value && !A.value ? (S(), i("div", {
2219
2255
  key: 1,
2220
2256
  class: "before-list",
2221
- style: v(w.value ? { gridColumnStart: 2 } : {})
2222
- }, [a("ul", null, [(S(!0), i(e, null, E(x.value, (e) => (S(), i("li", { key: e.id }, [s(Tt, {
2257
+ style: v(T.value ? { gridColumnStart: 2 } : {})
2258
+ }, [a("ul", null, [(S(!0), i(e, null, E(C.value, (e) => (S(), i("li", { key: e.id }, [s(wt, {
2223
2259
  feature: e,
2224
- "josm-target": n.josmTarget
2260
+ "josm-target": c.josmTarget
2225
2261
  }, o({ _: 2 }, [t.$slots["object-detail"] ? {
2226
2262
  name: "object-detail",
2227
2263
  fn: P(() => [D(t.$slots, "object-detail", {
2228
2264
  feature: e,
2229
- index: n.index
2265
+ index: c.index
2230
2266
  }, void 0, !0)]),
2231
2267
  key: "0"
2232
2268
  } : void 0]), 1032, ["feature", "josm-target"])]))), 128))])], 4)) : r("", !0),
2233
- w.value ? r("", !0) : (S(), i("div", {
2269
+ T.value ? r("", !0) : (S(), i("div", {
2234
2270
  key: 2,
2235
- class: g(["after-list", { "list--wide": A.value }]),
2236
- style: v(T.value ? { gridColumnStart: f.value } : O.value ? { gridColumnStart: 2 } : {})
2237
- }, [a("ul", null, [O.value ? (S(), i("li", ni, [s(Tt, {
2238
- feature: C.value[0],
2239
- "josm-target": n.josmTarget
2271
+ class: g(["after-list", { "list--wide": j.value }]),
2272
+ style: v(O.value ? { gridColumnStart: m.value } : A.value ? { gridColumnStart: 2 } : {})
2273
+ }, [a("ul", null, [A.value ? (S(), i("li", ni, [s(wt, {
2274
+ feature: w.value[0],
2275
+ "josm-target": c.josmTarget
2240
2276
  }, {
2241
2277
  "object-detail": P(() => [D(t.$slots, "object-detail", {
2242
- feature: x.value[0],
2243
- index: n.index
2278
+ feature: C.value[0],
2279
+ index: c.index
2244
2280
  }, void 0, !0)]),
2245
2281
  _: 3
2246
- }, 8, ["feature", "josm-target"])])) : A.value ? (S(), i("li", ri, [s(Tt, {
2247
- feature: C.value[0],
2248
- "josm-target": n.josmTarget
2282
+ }, 8, ["feature", "josm-target"])])) : j.value ? (S(), i("li", ri, [s(wt, {
2283
+ feature: w.value[0],
2284
+ "josm-target": c.josmTarget
2249
2285
  }, {
2250
- before: P(() => [s(Tt, {
2251
- feature: x.value[0],
2286
+ before: P(() => [s(wt, {
2287
+ feature: C.value[0],
2252
2288
  compact: !0
2253
2289
  }, null, 8, ["feature"])]),
2254
2290
  "object-detail": P(() => [D(t.$slots, "object-detail", {
2255
- feature: C.value[0],
2256
- index: n.index
2291
+ feature: w.value[0],
2292
+ index: c.index
2257
2293
  }, void 0, !0)]),
2258
2294
  _: 3
2259
- }, 8, ["feature", "josm-target"])])) : (S(!0), i(e, { key: 2 }, E(C.value, (e) => (S(), i("li", { key: e.id }, [s(Tt, {
2260
- feature: e,
2261
- "josm-target": n.josmTarget
2262
- }, o({ _: 2 }, [t.$slots["object-detail"] ? {
2295
+ }, 8, ["feature", "josm-target"])])) : (S(!0), i(e, { key: 2 }, E(w.value, (r) => (S(), i("li", { key: r.id }, [s(wt, {
2296
+ feature: r,
2297
+ "josm-target": c.josmTarget
2298
+ }, o({ _: 2 }, [ne.value.get(r.id)?.length ? {
2299
+ name: "before",
2300
+ fn: P(() => [(S(!0), i(e, null, E(ne.value.get(r.id), (e) => (S(), n(wt, {
2301
+ key: e.id,
2302
+ feature: e,
2303
+ compact: !0
2304
+ }, null, 8, ["feature"]))), 128))]),
2305
+ key: "0"
2306
+ } : void 0, t.$slots["object-detail"] ? {
2263
2307
  name: "object-detail",
2264
2308
  fn: P(() => [D(t.$slots, "object-detail", {
2265
- feature: e,
2266
- index: n.index
2309
+ feature: r,
2310
+ index: c.index
2267
2311
  }, void 0, !0)]),
2268
- key: "0"
2312
+ key: "1"
2269
2313
  } : void 0]), 1032, ["feature", "josm-target"])]))), 128))])], 6)),
2270
2314
  s(Ur, {
2271
- id: `${M(h)}-${c.index}`,
2272
- features: n.features,
2273
- bbox: M(_)?.bbox,
2274
- style: v({ gridColumnStart: m.value })
2315
+ id: `${M(_)}-${l.index}`,
2316
+ features: c.features,
2317
+ bbox: M(y)?.bbox,
2318
+ style: v({ gridColumnStart: h.value })
2275
2319
  }, null, 8, [
2276
2320
  "id",
2277
2321
  "features",
@@ -2280,7 +2324,7 @@ var Hr = ["id"], Ur = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2280
2324
  ])
2281
2325
  ])], 8, Wr));
2282
2326
  }
2283
- }), [["__scopeId", "data-v-34bae4ba"]]);
2327
+ }), [["__scopeId", "data-v-66fdcd7f"]]);
2284
2328
  //#endregion
2285
2329
  //#region src/utils/scrollToSection.ts
2286
2330
  function ai(e, t = {}) {
@@ -2293,61 +2337,69 @@ function ai(e, t = {}) {
2293
2337
  }
2294
2338
  //#endregion
2295
2339
  //#region src/components/LoCha/LoChaGroupList.vue?vue&type=script&setup=true&lang.ts
2296
- var oi = ["name"], si = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2340
+ var oi = ["name"], si = /* @__PURE__ */ Ct(/* @__PURE__ */ l({
2297
2341
  __name: "LoChaGroupList",
2298
2342
  props: { hash: {} },
2299
2343
  setup(t) {
2300
- ee((e) => ({ v32a2838c: M(l) }));
2301
- let n = t, { groups: r } = p(tt), c = p(nt), l = G.delete, u = T(), d = ne("listRef");
2302
- function f(e) {
2344
+ ee((e) => ({ v3a327003: M(l) }));
2345
+ let n = t, { groups: r } = p(et), c = p(tt), l = K.delete, u = T(), d = ne("listRef"), f = ne("scrollRef");
2346
+ N(r, () => {
2347
+ h(() => {
2348
+ f.value && (f.value.scrollTop = 0);
2349
+ });
2350
+ });
2351
+ function _(e) {
2303
2352
  return `locha-${c}-group-${e}`;
2304
2353
  }
2305
- function _() {
2354
+ function v() {
2306
2355
  return `hidden_josm_target_${c}`;
2307
2356
  }
2308
- let v = !1;
2309
- function b(e) {
2357
+ let b = !1;
2358
+ function C(e) {
2310
2359
  if (u.value === e) {
2311
- v = !0, u.value = void 0, history.replaceState(null, "", `${location.pathname}${location.search}`), window.dispatchEvent(new CustomEvent("locha-navigate", { detail: {
2360
+ b = !0, u.value = void 0, history.replaceState(null, "", `${location.pathname}${location.search}`), window.dispatchEvent(new CustomEvent("locha-navigate", { detail: {
2312
2361
  hash: void 0,
2313
2362
  instanceId: c
2314
2363
  } })), h(() => {
2315
- v = !1;
2364
+ b = !1;
2316
2365
  });
2317
2366
  return;
2318
2367
  }
2319
- v = !0, u.value = e, history.replaceState(null, "", e), window.dispatchEvent(new CustomEvent("locha-navigate", { detail: {
2368
+ b = !0, u.value = e, history.replaceState(null, "", e), window.dispatchEvent(new CustomEvent("locha-navigate", { detail: {
2320
2369
  hash: e,
2321
2370
  instanceId: c
2322
2371
  } })), h(() => {
2323
- v = !1, ai(e, { container: d.value ?? void 0 });
2372
+ b = !1, ai(e, { container: d.value ?? void 0 });
2324
2373
  });
2325
2374
  }
2326
- function C(e) {
2375
+ function w(e) {
2327
2376
  let { instanceId: t } = e.detail;
2328
2377
  t !== c && (u.value = void 0);
2329
2378
  }
2330
2379
  return N(() => n.hash, (e) => {
2331
- v || (u.value = e, e && h(() => ai(e, { container: d.value ?? void 0 })));
2380
+ b || (u.value = e, e && h(() => ai(e, { container: d.value ?? void 0 })));
2332
2381
  }, { immediate: !0 }), y(() => {
2333
- window.addEventListener("locha-navigate", C);
2382
+ window.addEventListener("locha-navigate", w);
2334
2383
  let e = window.location.hash;
2335
- e && !n.hash && b(e);
2384
+ e && !n.hash && C(e);
2336
2385
  }), x(() => {
2337
- window.removeEventListener("locha-navigate", C);
2386
+ window.removeEventListener("locha-navigate", w);
2338
2387
  }), (t, n) => (S(), i("div", {
2339
2388
  ref_key: "listRef",
2340
2389
  ref: d,
2341
2390
  class: "locha-group-list"
2342
- }, [a("ul", null, [(S(!0), i(e, null, E(M(r), (e, n) => (S(), i("li", {
2391
+ }, [a("ul", {
2392
+ ref_key: "scrollRef",
2393
+ ref: f
2394
+ }, [(S(!0), i(e, null, E(M(r), (e, n) => (S(), i("li", {
2343
2395
  key: n,
2344
- class: g({ selected: u.value === `#${f(n)}` })
2396
+ class: g({ selected: u.value === `#${_(n)}` })
2345
2397
  }, [s(ii, {
2346
- id: f(n),
2398
+ id: _(n),
2347
2399
  features: e,
2348
2400
  index: n,
2349
- "josm-target": _(),
2350
- onNavigate: b
2401
+ "josm-target": v(),
2402
+ onNavigate: C
2351
2403
  }, o({ _: 2 }, [
2352
2404
  t.$slots["object-detail"] ? {
2353
2405
  name: "object-detail",
@@ -2374,20 +2426,20 @@ var oi = ["name"], si = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2374
2426
  "features",
2375
2427
  "index",
2376
2428
  "josm-target"
2377
- ])], 2))), 128))]), a("iframe", {
2378
- name: _(),
2429
+ ])], 2))), 128))], 512), a("iframe", {
2430
+ name: v(),
2379
2431
  style: { display: "none" }
2380
2432
  }, null, 8, oi)], 512));
2381
2433
  }
2382
- }), [["__scopeId", "data-v-178acf78"]]), ci = {
2434
+ }), [["__scopeId", "data-v-ed63cb3b"]]), ci = {
2383
2435
  key: 0,
2384
2436
  class: "user-feedback"
2385
- }, li = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2437
+ }, li = /* @__PURE__ */ Ct(/* @__PURE__ */ l({
2386
2438
  __name: "LoCha",
2387
2439
  props: {
2388
2440
  id: {},
2389
2441
  data: {},
2390
- mapStyleUrl: { default: Zt },
2442
+ mapStyleUrl: { default: Xt },
2391
2443
  reasonCollapsed: {
2392
2444
  type: Boolean,
2393
2445
  default: !0
@@ -2396,13 +2448,13 @@ var oi = ["name"], si = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2396
2448
  },
2397
2449
  setup(e) {
2398
2450
  let r = e;
2399
- C(et, r.reasonCollapsed), C(nt, r.id), C(rt, r.mapStyleUrl);
2400
- let a = $e();
2401
- C(tt, a);
2402
- let { featureCount: s, groups: c, setLoCha: l } = a, u = t(() => c.value.length === 1);
2451
+ C($e, r.reasonCollapsed), C(tt, r.id), C(nt, r.mapStyleUrl);
2452
+ let a = Qe();
2453
+ C(et, a);
2454
+ let { featureCount: s, groups: c, setLoCha: l, resetLoCha: u } = a, d = t(() => c.value.length === 1);
2403
2455
  return N(() => r.data, (e) => {
2404
- e && l(e);
2405
- }, { immediate: !0 }), (t, r) => (S(), i("section", { class: g(["locha", { "locha--single": u.value }]) }, [M(s) ? (S(), n(si, {
2456
+ e ? l(e) : u();
2457
+ }, { immediate: !0 }), (t, r) => (S(), i("section", { class: g(["locha", { "locha--single": d.value }]) }, [M(s) ? (S(), n(si, {
2406
2458
  key: 1,
2407
2459
  hash: e.hash
2408
2460
  }, o({ _: 2 }, [
@@ -2428,7 +2480,7 @@ var oi = ["name"], si = /* @__PURE__ */ wt(/* @__PURE__ */ l({
2428
2480
  } : void 0
2429
2481
  ]), 1032, ["hash"])) : (S(), i("p", ci, " ⚠️ No data "))], 2));
2430
2482
  }
2431
- }), [["__scopeId", "data-v-791095c2"]]);
2483
+ }), [["__scopeId", "data-v-849ebbbc"]]);
2432
2484
  //#endregion
2433
2485
  export { li as LoCha, ai as scrollToSection };
2434
2486