@opentrainticketing/netex-deckplan-editor 1.0.8 → 1.0.9

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as se, ref as $, computed as ae, resolveComponent as oe, createBlock as D, openBlock as m, withCtx as ve, createVNode as G, createElementBlock as k, createCommentVNode as be, Fragment as z, renderList as j, createElementVNode as S, withDirectives as me, toDisplayString as Z, vModelText as We, normalizeClass as le, vModelDynamic as st, vModelCheckbox as nt, watch as Ue, nextTick as it, reactive as Ae, mergeProps as rt, withModifiers as we } from "vue";
1
+ import { defineComponent as ne, ref as $, computed as le, resolveComponent as ae, createBlock as D, openBlock as m, withCtx as ve, createVNode as G, createElementBlock as k, createCommentVNode as be, Fragment as z, renderList as j, createElementVNode as w, withDirectives as me, toDisplayString as Z, vModelText as We, normalizeClass as te, vModelDynamic as st, vModelCheckbox as nt, watch as Ue, nextTick as it, reactive as Ae, mergeProps as rt, withModifiers as we } from "vue";
2
2
  const qe = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", ot = qe + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", at = "[" + qe + "][" + ot + "]*", lt = new RegExp("^" + at + "$");
3
3
  function Be(t, e) {
4
4
  const s = [];
@@ -651,7 +651,7 @@ const $t = function(t) {
651
651
  for (let o = 0; o < t.length; o++)
652
652
  if (t[o] === "<")
653
653
  if (t[o + 1] === "/") {
654
- const a = te(t, ">", o, "Closing Tag is not closed.");
654
+ const a = se(t, ">", o, "Closing Tag is not closed.");
655
655
  let l = t.substring(o + 2, a).trim();
656
656
  if (this.options.removeNSPrefix) {
657
657
  const f = l.indexOf(":");
@@ -672,7 +672,7 @@ const $t = function(t) {
672
672
  }
673
673
  o = a.closeIndex + 1;
674
674
  } else if (t.substr(o + 1, 3) === "!--") {
675
- const a = te(t, "-->", o + 4, "Comment is not closed.");
675
+ const a = se(t, "-->", o + 4, "Comment is not closed.");
676
676
  if (this.options.commentPropName) {
677
677
  const l = t.substring(o + 4, a - 2);
678
678
  n = this.saveTextToParentTag(n, s, i), s.add(this.options.commentPropName, [{ [this.options.textNodeName]: l }]);
@@ -682,7 +682,7 @@ const $t = function(t) {
682
682
  const a = r.readDocType(t, o);
683
683
  this.docTypeEntities = a.entities, o = a.i;
684
684
  } else if (t.substr(o + 1, 2) === "![") {
685
- const a = te(t, "]]>", o, "CDATA is not closed.") - 2, l = t.substring(o + 9, a);
685
+ const a = se(t, "]]>", o, "CDATA is not closed.") - 2, l = t.substring(o + 9, a);
686
686
  n = this.saveTextToParentTag(n, s, i);
687
687
  let h = this.parseTextData(l, s.tagname, i, !0, !1, !0, !0);
688
688
  h == null && (h = ""), this.options.cdataPropName ? s.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : s.add(this.options.textNodeName, h), o = a + 2;
@@ -691,15 +691,15 @@ const $t = function(t) {
691
691
  const h = a.rawTagName;
692
692
  let d = a.tagExp, f = a.attrExpPresent, y = a.closeIndex;
693
693
  if (this.options.transformTagName) {
694
- const w = this.options.transformTagName(l);
695
- d === l && (d = w), l = w;
694
+ const S = this.options.transformTagName(l);
695
+ d === l && (d = S), l = S;
696
696
  }
697
697
  s && n && s.tagname !== "!xml" && (n = this.saveTextToParentTag(n, s, i, !1));
698
698
  const x = s;
699
699
  x && this.options.unpairedTags.indexOf(x.tagname) !== -1 && (s = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), l !== e.tagname && (i += i ? "." + l : l);
700
700
  const V = o;
701
701
  if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, i, l)) {
702
- let w = "";
702
+ let S = "";
703
703
  if (d.length > 0 && d.lastIndexOf("/") === d.length - 1)
704
704
  l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), i = i.substr(0, i.length - 1), d = l) : d = d.substr(0, d.length - 1), o = a.closeIndex;
705
705
  else if (this.options.unpairedTags.indexOf(l) !== -1)
@@ -707,24 +707,24 @@ const $t = function(t) {
707
707
  else {
708
708
  const B = this.readStopNodeData(t, h, y + 1);
709
709
  if (!B) throw new Error(`Unexpected end of ${h}`);
710
- o = B.i, w = B.tagContent;
710
+ o = B.i, S = B.tagContent;
711
711
  }
712
712
  const F = new ee(l);
713
713
  l !== d && f && (F[":@"] = this.buildAttributesMap(
714
714
  d,
715
715
  i
716
- )), w && (w = this.parseTextData(w, l, i, !0, f, !0, !0)), i = i.substr(0, i.lastIndexOf(".")), F.add(this.options.textNodeName, w), this.addChild(s, F, i, V);
716
+ )), S && (S = this.parseTextData(S, l, i, !0, f, !0, !0)), i = i.substr(0, i.lastIndexOf(".")), F.add(this.options.textNodeName, S), this.addChild(s, F, i, V);
717
717
  } else {
718
718
  if (d.length > 0 && d.lastIndexOf("/") === d.length - 1) {
719
719
  if (l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), i = i.substr(0, i.length - 1), d = l) : d = d.substr(0, d.length - 1), this.options.transformTagName) {
720
720
  const F = this.options.transformTagName(l);
721
721
  d === l && (d = F), l = F;
722
722
  }
723
- const w = new ee(l);
724
- l !== d && f && (w[":@"] = this.buildAttributesMap(d, i)), this.addChild(s, w, i, V), i = i.substr(0, i.lastIndexOf("."));
723
+ const S = new ee(l);
724
+ l !== d && f && (S[":@"] = this.buildAttributesMap(d, i)), this.addChild(s, S, i, V), i = i.substr(0, i.lastIndexOf("."));
725
725
  } else {
726
- const w = new ee(l);
727
- this.tagsNodeStack.push(s), l !== d && f && (w[":@"] = this.buildAttributesMap(d, i)), this.addChild(s, w, i, V), s = w;
726
+ const S = new ee(l);
727
+ this.tagsNodeStack.push(s), l !== d && f && (S[":@"] = this.buildAttributesMap(d, i)), this.addChild(s, S, i, V), s = S;
728
728
  }
729
729
  n = "", o = y;
730
730
  }
@@ -794,7 +794,7 @@ function qt(t, e, s = ">") {
794
794
  i += o;
795
795
  }
796
796
  }
797
- function te(t, e, s, n) {
797
+ function se(t, e, s, n) {
798
798
  const i = t.indexOf(e, s);
799
799
  if (i === -1)
800
800
  throw new Error(n);
@@ -826,7 +826,7 @@ function Bt(t, e, s) {
826
826
  for (; s < t.length; s++)
827
827
  if (t[s] === "<")
828
828
  if (t[s + 1] === "/") {
829
- const r = te(t, ">", s, `${e} is not closed`);
829
+ const r = se(t, ">", s, `${e} is not closed`);
830
830
  if (t.substring(s + 2, r).trim() === e && (i--, i === 0))
831
831
  return {
832
832
  tagContent: t.substring(n, s),
@@ -834,11 +834,11 @@ function Bt(t, e, s) {
834
834
  };
835
835
  s = r;
836
836
  } else if (t[s + 1] === "?")
837
- s = te(t, "?>", s + 1, "StopNode is not closed.");
837
+ s = se(t, "?>", s + 1, "StopNode is not closed.");
838
838
  else if (t.substr(s + 1, 3) === "!--")
839
- s = te(t, "-->", s + 3, "StopNode is not closed.");
839
+ s = se(t, "-->", s + 3, "StopNode is not closed.");
840
840
  else if (t.substr(s + 1, 2) === "![")
841
- s = te(t, "]]>", s, "StopNode is not closed.") - 2;
841
+ s = se(t, "]]>", s, "StopNode is not closed.") - 2;
842
842
  else {
843
843
  const r = Ne(t, s, ">");
844
844
  r && ((r && r.tagName) === e && r.tagExp[r.tagExp.length - 1] !== "/" && i++, s = r.closeIndex);
@@ -972,8 +972,8 @@ function Ge(t, e, s, n) {
972
972
  continue;
973
973
  } else if (a[0] === "?") {
974
974
  const x = Oe(c[":@"], e), V = a === "?xml" ? "" : n;
975
- let w = c[a][0][e.textNodeName];
976
- w = w.length !== 0 ? " " + w : "", i += V + `<${a}${w}${x}?>`, r = !0;
975
+ let S = c[a][0][e.textNodeName];
976
+ S = S.length !== 0 ? " " + S : "", i += V + `<${a}${S}${x}?>`, r = !0;
977
977
  continue;
978
978
  }
979
979
  let h = n;
@@ -1321,13 +1321,13 @@ class Ke {
1321
1321
  IsEmergencyExit: y,
1322
1322
  HasDoor: x,
1323
1323
  IsAutomatic: V,
1324
- Centroid: w = void 0
1324
+ Centroid: S = void 0
1325
1325
  // sensorInEntrance,
1326
1326
  }) {
1327
1327
  this.attr_id = e, this.attr_version = s, this.Name = n ? new je(n) : void 0, this.Label = i?.text_value, this.Width = r?.text_value, this.Height = o?.text_value, this.actualVehicleEquipments = P(
1328
1328
  c?.ActualVehicleEquipment,
1329
1329
  ge
1330
- ), this.PublicUse = a?.text_value, this.VehicleSide = l?.text_value, this.SequenceFromFront = h?.text_value, this.HeightFromGround = d?.text_value, this.DeckEntranceType = f?.text_value, this.IsEmergencyExit = y?.text_value, this.HasDoor = x?.text_value, this.IsAutomatic = V?.text_value, this.Centroid = w ? Q.fromXML(w) : void 0;
1330
+ ), this.PublicUse = a?.text_value, this.VehicleSide = l?.text_value, this.SequenceFromFront = h?.text_value, this.HeightFromGround = d?.text_value, this.DeckEntranceType = f?.text_value, this.IsEmergencyExit = y?.text_value, this.HasDoor = x?.text_value, this.IsAutomatic = V?.text_value, this.Centroid = S ? Q.fromXML(S) : void 0;
1331
1331
  }
1332
1332
  toXML() {
1333
1333
  return {
@@ -1723,13 +1723,13 @@ class W {
1723
1723
  ServiceFacilitySetRef: x,
1724
1724
  // spotAffinities,
1725
1725
  Centroid: V,
1726
- Polygon: w,
1726
+ Polygon: S,
1727
1727
  PublicUse: F,
1728
1728
  TotalCapacity: B,
1729
1729
  FareClass: de,
1730
- AirConditioned: ne
1730
+ AirConditioned: ie
1731
1731
  }) {
1732
- this.attr_id = e, this.attr_version = s, this.Name = n, this.SmokingAllowed = i, this.StandingAllowed = r, this.PassengerSpaceType = o, this.passengerSpots = c ? Object.entries(c).flatMap(([H, b]) => H === "PassengerSpot" ? P(b, ce) : H === "PassengerSpotRef" ? P(b, gs) : []) : [], this.luggageSpots = a ? Object.entries(a).flatMap(([H, b]) => H === "LuggageSpot" ? P(b, hs) : H === "LuggageSpotRef" ? P(b, fs) : []) : [], this.deckEntrances = P(l?.PassengerEntrance, Ke), this.deckEntranceUsage = P(h?.DeckEntranceUsage, ls), this.deckEntranceCouples = P(d?.DeckEntranceCouple, rs), this.deckSpaceCapacities = P(f?.DeckSpaceCapacity, cs), this.actualVehicleEquipments = P(y?.ActualVehicleEquipment, ge), this.ServiceFacilitySetRef = x ? new ps(x) : void 0, this.Centroid = V ? Q.fromXML(V) : void 0, this.Polygon = w ? new Je(w) : void 0, this.PublicUse = F?.text_value, this.TotalCapacity = B?.text_value, this.FareClass = de?.text_value, this.AirConditioned = ne?.text_value;
1732
+ this.attr_id = e, this.attr_version = s, this.Name = n, this.SmokingAllowed = i, this.StandingAllowed = r, this.PassengerSpaceType = o, this.passengerSpots = c ? Object.entries(c).flatMap(([H, b]) => H === "PassengerSpot" ? P(b, ce) : H === "PassengerSpotRef" ? P(b, gs) : []) : [], this.luggageSpots = a ? Object.entries(a).flatMap(([H, b]) => H === "LuggageSpot" ? P(b, hs) : H === "LuggageSpotRef" ? P(b, fs) : []) : [], this.deckEntrances = P(l?.PassengerEntrance, Ke), this.deckEntranceUsage = P(h?.DeckEntranceUsage, ls), this.deckEntranceCouples = P(d?.DeckEntranceCouple, rs), this.deckSpaceCapacities = P(f?.DeckSpaceCapacity, cs), this.actualVehicleEquipments = P(y?.ActualVehicleEquipment, ge), this.ServiceFacilitySetRef = x ? new ps(x) : void 0, this.Centroid = V ? Q.fromXML(V) : void 0, this.Polygon = S ? new Je(S) : void 0, this.PublicUse = F?.text_value, this.TotalCapacity = B?.text_value, this.FareClass = de?.text_value, this.AirConditioned = ie?.text_value;
1733
1733
  }
1734
1734
  toXML() {
1735
1735
  return {
@@ -1835,7 +1835,7 @@ class De {
1835
1835
  };
1836
1836
  }
1837
1837
  }
1838
- const et = /* @__PURE__ */ se({
1838
+ const et = /* @__PURE__ */ ne({
1839
1839
  __name: "DeckVisualization",
1840
1840
  props: {
1841
1841
  deck: {
@@ -1856,10 +1856,10 @@ const et = /* @__PURE__ */ se({
1856
1856
  },
1857
1857
  emits: ["select", "area-select"],
1858
1858
  setup(t, { emit: e }) {
1859
- const s = t, n = e, i = $(null), r = $(!1), o = $({ x: 0, y: 0 }), c = $([]), a = $(/* @__PURE__ */ new Map()), l = ae(() => s.deck.deckspaces?.flatMap((u) => u instanceof W ? u.passengerSpots?.filter((g) => g instanceof ce) || [] : []).map((u) => {
1859
+ const s = t, n = e, i = $(null), r = $(!1), o = $({ x: 0, y: 0 }), c = $([]), a = $(/* @__PURE__ */ new Map()), l = le(() => s.deck.deckspaces?.flatMap((u) => u instanceof W ? u.passengerSpots?.filter((g) => g instanceof ce) || [] : []).map((u) => {
1860
1860
  const g = u;
1861
1861
  return g.availability = s.availability && u.attr_id ? fe[s.availability[u.attr_id] ?? "Undefined"] : fe.Undefined, g;
1862
- }) || []), h = ae(() => s.deck.deckspaces?.flatMap((u) => u instanceof W ? u.deckEntrances || [] : []) || []), d = (u) => s.selectedElements.includes(u) ? {
1862
+ }) || []), h = le(() => s.deck.deckspaces?.flatMap((u) => u instanceof W ? u.deckEntrances || [] : []) || []), d = (u) => s.selectedElements.includes(u) ? {
1863
1863
  stroke: "#68a691",
1864
1864
  strokeWidth: 3
1865
1865
  } : {}, f = (u, g) => {
@@ -1894,7 +1894,7 @@ const et = /* @__PURE__ */ se({
1894
1894
  E.invert();
1895
1895
  const N = E.point(p);
1896
1896
  i.value.width = N.x - o.value.x, i.value.height = N.y - o.value.y;
1897
- }, w = () => {
1897
+ }, S = () => {
1898
1898
  if (!r.value) return;
1899
1899
  r.value = !1;
1900
1900
  const u = i.value;
@@ -1935,29 +1935,29 @@ const et = /* @__PURE__ */ se({
1935
1935
  s.selectedElements.forEach((Y) => {
1936
1936
  if (Y !== g && Y instanceof ce) {
1937
1937
  const X = a.value.get(Y);
1938
- X && ne(Y, X.x + _, X.y + M);
1938
+ X && ie(Y, X.x + _, X.y + M);
1939
1939
  }
1940
1940
  });
1941
1941
  }
1942
1942
  }, de = (u, g) => {
1943
1943
  c.value = [];
1944
1944
  const p = u.target.x(), E = u.target.y();
1945
- ne(g, p, E), a.value.clear();
1946
- }, ne = (u, g, p) => {
1945
+ ie(g, p, E), a.value.clear();
1946
+ }, ie = (u, g, p) => {
1947
1947
  u.Centroid ? (u.Centroid.x = (g - 5) / s.scale + u.Width / 2, u.Centroid.y = (p - 5) / s.scale + u.Length / 2) : u.Centroid = new Q(
1948
1948
  (g - 5) / s.scale + u.Width / 2,
1949
1949
  (p - 5) / s.scale + u.Length / 2
1950
1950
  );
1951
1951
  }, H = (u, g) => {
1952
1952
  const p = u.target.x(), E = u.target.y(), N = s.deck.Width * s.scale, I = s.deck.Length * s.scale, A = g.getShape(s.scale, s.deck.Length, s.deck.Width), C = A.width, v = A.height, L = 5, _ = 5, M = L + I, Y = _ + N, X = p + C / 2, xe = E + v / 2, Ce = Math.abs(X - L), Te = Math.abs(X - M), Pe = Math.abs(xe - _), Le = Math.abs(xe - Y), pe = Math.min(Ce, Te, Pe, Le);
1953
- let ie = p, re = E;
1954
- pe === Pe ? (re = _, ie = Math.max(L, Math.min(p, M - C))) : pe === Le ? (re = Y - v, ie = Math.max(L, Math.min(p, M - C))) : pe === Ce ? (ie = L, re = N / 2 + 5 - v / 2) : pe === Te && (ie = M - C, re = N / 2 + 5 - v / 2), u.target.x(ie), u.target.y(re), g.Centroid || (g.Centroid = new Q(0, 0)), g.Centroid.x = ie / s.scale, g.Centroid.y = re / s.scale;
1953
+ let re = p, oe = E;
1954
+ pe === Pe ? (oe = _, re = Math.max(L, Math.min(p, M - C))) : pe === Le ? (oe = Y - v, re = Math.max(L, Math.min(p, M - C))) : pe === Ce ? (re = L, oe = N / 2 + 5 - v / 2) : pe === Te && (re = M - C, oe = N / 2 + 5 - v / 2), u.target.x(re), u.target.y(oe), g.Centroid || (g.Centroid = new Q(0, 0)), g.Centroid.x = re / s.scale, g.Centroid.y = oe / s.scale;
1955
1955
  }, b = (u, g) => {
1956
1956
  const p = u.target.x(), E = u.target.y(), N = s.deck.Width * s.scale, I = s.deck.Length * s.scale, A = g.getShape(s.scale, s.deck.Length, s.deck.Width), C = A.width, v = A.height, L = 5, _ = 5, M = L + I, Y = _ + N, X = 1;
1957
1957
  Math.abs(E - _) < X ? (g.VehicleSide = "leftSide", g.SequenceFromFront = (p - L + C / 2) / s.scale) : Math.abs(E - (Y - v)) < X ? (g.VehicleSide = "rightSide", g.SequenceFromFront = (p - L + C / 2) / s.scale) : Math.abs(p - L) < X ? (g.VehicleSide = "front", g.SequenceFromFront = 0) : Math.abs(p - (M - C)) < X && (g.VehicleSide = "back", g.SequenceFromFront = s.deck.Length);
1958
1958
  };
1959
1959
  return (u, g) => {
1960
- const p = oe("v-rect"), E = oe("v-text"), N = oe("v-group"), I = oe("v-line"), A = oe("v-layer"), C = oe("v-stage");
1960
+ const p = ae("v-rect"), E = ae("v-text"), N = ae("v-group"), I = ae("v-line"), A = ae("v-layer"), C = ae("v-stage");
1961
1961
  return m(), D(C, {
1962
1962
  config: f(t.deck, t.scale)
1963
1963
  }, {
@@ -1979,7 +1979,7 @@ const et = /* @__PURE__ */ se({
1979
1979
  },
1980
1980
  onMousedown: x,
1981
1981
  onMousemove: V,
1982
- onMouseup: w
1982
+ onMouseup: S
1983
1983
  }, null, 8, ["config"]),
1984
1984
  (m(!0), k(z, null, j(l.value, (v, L) => (m(), D(N, {
1985
1985
  key: `seats-${L}`,
@@ -2060,7 +2060,7 @@ const et = /* @__PURE__ */ se({
2060
2060
  }, 8, ["config"]);
2061
2061
  };
2062
2062
  }
2063
- }), ms = { class: "flex flex-col h-full" }, bs = { class: "flex p-4 w-full items-center justify-center gap-10" }, ys = { for: "scale-slider" }, Es = { style: { display: "flex", "flex-direction": "row", "overflow-x": "auto", gap: "20px", padding: "20px" } }, ws = ["onClick"], tt = /* @__PURE__ */ se({
2063
+ }), ms = { class: "flex flex-col h-full" }, bs = { class: "flex p-4 w-full items-center justify-center gap-10" }, ys = { for: "scale-slider" }, Es = { style: { display: "flex", "flex-direction": "row", "overflow-x": "auto", gap: "20px", padding: "20px" } }, ws = ["onClick"], tt = /* @__PURE__ */ ne({
2064
2064
  __name: "WagonVisualization",
2065
2065
  props: {
2066
2066
  deckPlans: {
@@ -2075,9 +2075,9 @@ const et = /* @__PURE__ */ se({
2075
2075
  setup(t) {
2076
2076
  const e = $(20);
2077
2077
  return (s, n) => (m(), k("div", ms, [
2078
- S("div", bs, [
2079
- S("label", ys, "Scale: " + Z(e.value), 1),
2080
- me(S("input", {
2078
+ w("div", bs, [
2079
+ w("label", ys, "Scale: " + Z(e.value), 1),
2080
+ me(w("input", {
2081
2081
  id: "scale-slider",
2082
2082
  type: "range",
2083
2083
  min: "10",
@@ -2092,17 +2092,17 @@ const et = /* @__PURE__ */ se({
2092
2092
  ]
2093
2093
  ])
2094
2094
  ]),
2095
- S("div", Es, [
2095
+ w("div", Es, [
2096
2096
  (m(!0), k(z, null, j(t.deckPlans, (i, r) => (m(), k("div", {
2097
2097
  key: `deckplan-${r}`
2098
2098
  }, [
2099
- S("h3", null, Z(i.attr_id), 1),
2099
+ w("h3", null, Z(i.attr_id), 1),
2100
2100
  (m(!0), k(z, null, j(i.decks, (o, c) => (m(), k("div", {
2101
2101
  key: `deck-${c}`
2102
2102
  }, [
2103
- S("h4", {
2103
+ w("h4", {
2104
2104
  onClick: (a) => s.$emit("select", { element: o, ctrlKey: !1 }),
2105
- class: le(`${t.selectedElements.includes(o) ? "text-ott-accent" : ""} cursor-pointer`)
2105
+ class: te(`${t.selectedElements.includes(o) ? "text-ott-accent" : ""} cursor-pointer`)
2106
2106
  }, Z(o.Name), 11, ws),
2107
2107
  G(et, {
2108
2108
  deck: o,
@@ -2116,7 +2116,7 @@ const et = /* @__PURE__ */ se({
2116
2116
  ])
2117
2117
  ]));
2118
2118
  }
2119
- }), Ss = { class: "bg-ott-bg-primary p-4" }, Ns = { class: "flex justify-between items-center mb-4" }, ks = { key: 0 }, _s = ["for"], xs = ["id", "onUpdate:modelValue", "type"], Cs = ["id", "onUpdate:modelValue"], Ts = { key: 2 }, Ps = ["id", "onUpdate:modelValue"], Ls = { key: 3 }, As = { key: 4 }, Is = { key: 1 }, Ms = /* @__PURE__ */ se({
2119
+ }), Ss = { class: "bg-ott-bg-primary p-4" }, Ns = { class: "flex justify-between items-center mb-4" }, ks = { key: 0 }, _s = ["for"], xs = ["id", "onUpdate:modelValue", "type"], Cs = ["id", "onUpdate:modelValue"], Ts = { key: 2 }, Ps = ["id", "onUpdate:modelValue"], Ls = { key: 3 }, As = { key: 4 }, Is = { key: 1 }, Ms = /* @__PURE__ */ ne({
2120
2120
  __name: "ObjectProperties",
2121
2121
  props: {
2122
2122
  element: {
@@ -2127,8 +2127,8 @@ const et = /* @__PURE__ */ se({
2127
2127
  emits: ["delete"],
2128
2128
  setup(t) {
2129
2129
  return (e, s) => (m(), k("div", Ss, [
2130
- S("div", Ns, [
2131
- s[1] || (s[1] = S("h3", { class: "font-bold" }, "Properties", -1)),
2130
+ w("div", Ns, [
2131
+ s[1] || (s[1] = w("h3", { class: "font-bold" }, "Properties", -1)),
2132
2132
  t.element ? (m(), k("button", {
2133
2133
  key: 0,
2134
2134
  class: "ott-button border-ott-error! text-ott-error!",
@@ -2140,7 +2140,7 @@ const et = /* @__PURE__ */ se({
2140
2140
  key: i,
2141
2141
  class: "flex items-center mb-10"
2142
2142
  }, [
2143
- S("label", {
2143
+ w("label", {
2144
2144
  for: i,
2145
2145
  class: "min-w-[150px] font-bold"
2146
2146
  }, Z(i), 9, _s),
@@ -2159,7 +2159,7 @@ const et = /* @__PURE__ */ se({
2159
2159
  }, null, 8, Cs)), [
2160
2160
  [nt, t.element[i]]
2161
2161
  ]) : n && typeof n == "object" && n.value !== void 0 ? (m(), k("span", Ts, [
2162
- me(S("input", {
2162
+ me(w("input", {
2163
2163
  id: i,
2164
2164
  "onUpdate:modelValue": (r) => n.value = r,
2165
2165
  type: "text"
@@ -2169,7 +2169,7 @@ const et = /* @__PURE__ */ se({
2169
2169
  ])) : n && Array.isArray(n) ? (m(), k("span", Ls, Z(n.length) + " elements ", 1)) : (m(), k("span", As, Z(n), 1))
2170
2170
  ]))), 128))
2171
2171
  ])) : (m(), k("div", Is, [...s[2] || (s[2] = [
2172
- S("p", null, "Select an element to view properties.", -1)
2172
+ w("p", null, "Select an element to view properties.", -1)
2173
2173
  ])]))
2174
2174
  ]));
2175
2175
  }
@@ -2178,25 +2178,25 @@ const et = /* @__PURE__ */ se({
2178
2178
  for (const [n, i] of e)
2179
2179
  s[n] = i;
2180
2180
  return s;
2181
- }, Rs = /* @__PURE__ */ Vs(Ms, [["__scopeId", "data-v-1987e529"]]), Os = { class: "flex flex-col gap-2 p-4 bg-white flex-1" }, $s = { class: "flex flex-col gap-2" }, Fs = /* @__PURE__ */ se({
2181
+ }, Rs = /* @__PURE__ */ Vs(Ms, [["__scopeId", "data-v-1987e529"]]), Os = { class: "flex flex-col gap-2 p-4 bg-white flex-1" }, $s = { class: "flex flex-col gap-2" }, Fs = /* @__PURE__ */ ne({
2182
2182
  __name: "ElementCatalog",
2183
2183
  emits: ["add-seat", "add-door"],
2184
2184
  setup(t) {
2185
2185
  return (e, s) => (m(), k("div", Os, [
2186
- s[2] || (s[2] = S("h3", { class: "font-bold mb-2" }, "Catalog", -1)),
2187
- S("div", $s, [
2188
- S("button", {
2186
+ s[2] || (s[2] = w("h3", { class: "font-bold mb-2" }, "Catalog", -1)),
2187
+ w("div", $s, [
2188
+ w("button", {
2189
2189
  class: "ott-button w-fit text-left",
2190
2190
  onClick: s[0] || (s[0] = (n) => e.$emit("add-seat"))
2191
2191
  }, " + Add Seat "),
2192
- S("button", {
2192
+ w("button", {
2193
2193
  class: "ott-button w-fit text-left",
2194
2194
  onClick: s[1] || (s[1] = (n) => e.$emit("add-door"))
2195
2195
  }, " + Add Door ")
2196
2196
  ])
2197
2197
  ]));
2198
2198
  }
2199
- }), Xs = { class: "h-full overflow-y-auto bg-gray-100 p-4 font-mono text-sm" }, Ws = ["id"], Us = /* @__PURE__ */ se({
2199
+ }), Xs = { class: "h-full overflow-y-auto bg-gray-100 p-4 font-mono text-sm" }, Ws = ["id"], Us = /* @__PURE__ */ ne({
2200
2200
  __name: "XmlViewer",
2201
2201
  props: {
2202
2202
  xml: {
@@ -2209,7 +2209,7 @@ const et = /* @__PURE__ */ se({
2209
2209
  }
2210
2210
  },
2211
2211
  setup(t) {
2212
- const e = t, s = ae(() => e.xml.split(`
2212
+ const e = t, s = le(() => e.xml.split(`
2213
2213
  `)), n = $(null), i = (o) => n.value ? o >= n.value.start && o <= n.value.end : !1, r = () => {
2214
2214
  if (!e.selectedId) {
2215
2215
  n.value = null;
@@ -2251,9 +2251,9 @@ const et = /* @__PURE__ */ se({
2251
2251
  (m(!0), k(z, null, j(s.value, (a, l) => (m(), k("div", {
2252
2252
  key: l,
2253
2253
  id: `line-${l}`,
2254
- class: le({ "bg-yellow-200": i(l) })
2254
+ class: te({ "bg-yellow-200": i(l) })
2255
2255
  }, [
2256
- S("pre", null, Z(a), 1)
2256
+ w("pre", null, Z(a), 1)
2257
2257
  ], 10, Ws))), 128))
2258
2258
  ]));
2259
2259
  }
@@ -2263,11 +2263,11 @@ const et = /* @__PURE__ */ se({
2263
2263
  attributeNamePrefix: "attr_",
2264
2264
  removeNSPrefix: !0
2265
2265
  }).parse(t);
2266
- return console.log(s), P(
2266
+ return P(
2267
2267
  s.PublicationDelivery.dataObjects.CompositeFrame.frames.ResourceFrame.deckPlans.DeckPlan,
2268
2268
  De
2269
2269
  );
2270
- }, Bs = { class: "flex flex-col h-full" }, Hs = { class: "p-4 border-b border-b-ott-bg-dark flex gap-2 items-center bg-ott-bg-primary" }, Ys = { class: "flex-1 flex overflow-hidden" }, Gs = { class: "flex-1 overflow-hidden" }, zs = { class: "flex flex-row h-75 border-t border-ott-bg-dark" }, js = /* @__PURE__ */ se({
2270
+ }, Bs = { class: "flex flex-col h-full" }, Hs = { class: "p-4 border-b border-b-ott-bg-dark flex gap-2 items-center bg-ott-bg-primary" }, Ys = { class: "flex-1 flex overflow-hidden" }, Gs = { class: "flex-1 overflow-hidden" }, zs = { class: "flex flex-row h-75 border-t border-ott-bg-dark" }, js = /* @__PURE__ */ ne({
2271
2271
  __name: "DeckplanEditor",
2272
2272
  setup(t, { expose: e }) {
2273
2273
  const s = $(null), n = $([]), i = $([]), r = $(null), o = $(!1), c = $(""), a = () => {
@@ -2330,7 +2330,7 @@ const et = /* @__PURE__ */ se({
2330
2330
  p.href = URL.createObjectURL(g), p.download = "Demo.xml", p.click();
2331
2331
  }
2332
2332
  }
2333
- const V = () => n.value.length > 0 && n.value[0]?.decks.length && n.value[0]?.decks?.length > 0 ? n.value[0].decks[0] : null, w = () => {
2333
+ const V = () => n.value.length > 0 && n.value[0]?.decks.length && n.value[0]?.decks?.length > 0 ? n.value[0].decks[0] : null, S = () => {
2334
2334
  const b = V();
2335
2335
  if (!b) return;
2336
2336
  const u = b.deckspaces?.find((p) => p instanceof W);
@@ -2408,7 +2408,7 @@ const et = /* @__PURE__ */ se({
2408
2408
  format: !0
2409
2409
  }).build(r.value)) : null;
2410
2410
  }
2411
- function ne() {
2411
+ function ie() {
2412
2412
  return new W({
2413
2413
  attr_id: `ps-${Date.now()}`,
2414
2414
  attr_version: "1",
@@ -2460,7 +2460,7 @@ const et = /* @__PURE__ */ se({
2460
2460
  p.forEach((E) => {
2461
2461
  E.decks.forEach((N) => {
2462
2462
  if (!N.deckspaces || N.deckspaces.length === 0) {
2463
- N.deckspaces = [ne()];
2463
+ N.deckspaces = [ie()];
2464
2464
  return;
2465
2465
  }
2466
2466
  const I = [];
@@ -2474,8 +2474,8 @@ const et = /* @__PURE__ */ se({
2474
2474
  exportXml: de,
2475
2475
  loadXml: H
2476
2476
  }), (b, u) => (m(), k("div", Bs, [
2477
- S("div", Hs, [
2478
- S("input", {
2477
+ w("div", Hs, [
2478
+ w("input", {
2479
2479
  ref: "inputRef",
2480
2480
  class: "ott-button",
2481
2481
  type: "file",
@@ -2483,21 +2483,21 @@ const et = /* @__PURE__ */ se({
2483
2483
  onChange: f,
2484
2484
  accept: "text/xml"
2485
2485
  }, null, 544),
2486
- S("button", {
2486
+ w("button", {
2487
2487
  onClick: y,
2488
2488
  class: "ott-button"
2489
2489
  }, "Load"),
2490
- S("button", {
2490
+ w("button", {
2491
2491
  onClick: x,
2492
2492
  class: "ott-button"
2493
2493
  }, "Save"),
2494
- S("button", {
2494
+ w("button", {
2495
2495
  onClick: l,
2496
- class: le(["ott-button", { "bg-ott-accent text-white": o.value }])
2496
+ class: te(["ott-button", { "bg-ott-accent text-white": o.value }])
2497
2497
  }, "XML", 2)
2498
2498
  ]),
2499
- S("div", Ys, [
2500
- S("div", Gs, [
2499
+ w("div", Ys, [
2500
+ w("div", Gs, [
2501
2501
  n.value.length > 0 ? (m(), D(tt, {
2502
2502
  key: 0,
2503
2503
  deckPlans: n.value,
@@ -2513,7 +2513,7 @@ const et = /* @__PURE__ */ se({
2513
2513
  class: "w-1/3 border-l border-ott-bg-dark"
2514
2514
  }, null, 8, ["xml", "selectedId"])) : be("", !0)
2515
2515
  ]),
2516
- S("div", zs, [
2516
+ w("div", zs, [
2517
2517
  G(Rs, {
2518
2518
  element: i.value.length === 1 ? i.value[0] : null,
2519
2519
  class: "flex-1 overflow-y-auto",
@@ -2521,7 +2521,7 @@ const et = /* @__PURE__ */ se({
2521
2521
  }, null, 8, ["element"]),
2522
2522
  G(Fs, {
2523
2523
  class: "w-50 border-l border-ott-bg-dark",
2524
- onAddSeat: w,
2524
+ onAddSeat: S,
2525
2525
  onAddDoor: F
2526
2526
  })
2527
2527
  ])
@@ -2532,22 +2532,23 @@ const et = /* @__PURE__ */ se({
2532
2532
  DeckVisualization: et,
2533
2533
  DeckplanEditor: js,
2534
2534
  WagonVisualization: tt
2535
- }, Symbol.toStringTag, { value: "Module" })), Ks = ["width", "height"], Zs = ["transform", "onClick"], Qs = ["transform"], Js = ["width", "height"], Ds = ["x", "width", "height"], en = ["x", "y", "font-size"], tn = ["transform", "onClick"], sn = ["width", "height"], nn = /* @__PURE__ */ se({
2535
+ }, Symbol.toStringTag, { value: "Module" })), Ks = ["width", "height"], Zs = ["transform"], Qs = ["transform", "onClick"], Js = ["transform"], Ds = ["width", "height"], en = ["x", "width", "height"], tn = ["transform"], sn = ["x", "y", "font-size"], nn = ["transform", "onClick"], rn = ["width", "height"], on = /* @__PURE__ */ ne({
2536
2536
  __name: "DeckRendering",
2537
2537
  props: {
2538
2538
  deck: { type: Object, required: !0 },
2539
2539
  scale: { type: Number, required: !0 },
2540
2540
  availability: {
2541
2541
  type: Object
2542
- }
2542
+ },
2543
+ vertical: { type: Boolean, default: !1 }
2543
2544
  },
2544
2545
  emits: ["select"],
2545
2546
  setup(t, { emit: e }) {
2546
- const s = t, n = Ae(/* @__PURE__ */ new Map()), i = Ae(/* @__PURE__ */ new Map()), r = e, o = ae(() => s.deck.deckspaces?.flatMap((h) => h instanceof W ? h.passengerSpots?.filter((d) => d instanceof ce) || [] : []).map((h) => (h.availability = s.availability && h.attr_id ? fe[s.availability[h.attr_id] ?? "Undefined"] : fe.Undefined, h)) || []), c = ae(
2547
+ const s = t, n = Ae(/* @__PURE__ */ new Map()), i = Ae(/* @__PURE__ */ new Map()), r = e, o = le(() => s.deck.deckspaces?.flatMap((h) => h instanceof W ? h.passengerSpots?.filter((d) => d instanceof ce) || [] : []).map((h) => (h.availability = s.availability && h.attr_id ? fe[s.availability[h.attr_id] ?? "Undefined"] : fe.Undefined, h)) || []), c = le(
2547
2548
  () => s.deck.deckspaces?.flatMap(
2548
2549
  (h) => h instanceof W ? h.deckEntrances ?? [] : []
2549
2550
  ) ?? []
2550
- ), a = ae(() => {
2551
+ ), a = le(() => {
2551
2552
  const { width: h, height: d } = s.deck.getBoundingBox();
2552
2553
  return {
2553
2554
  width: h * s.scale + 10,
@@ -2558,86 +2559,104 @@ const et = /* @__PURE__ */ se({
2558
2559
  r("select", { element: d, ctrlKey: h.ctrlKey || h.metaKey });
2559
2560
  }
2560
2561
  return (h, d) => (m(), k("svg", {
2561
- width: a.value.width,
2562
- height: a.value.height,
2562
+ width: t.vertical ? a.value.height : a.value.width,
2563
+ height: t.vertical ? a.value.width : a.value.height,
2563
2564
  class: "vehicle-frame",
2564
2565
  style: { "user-select": "none" }
2565
2566
  }, [
2566
- S("rect", rt({ ...t.deck.getShape(t.scale), y: 5 }, {
2567
- onClick: d[0] || (d[0] = we((f) => l(f, t.deck), ["stop"])),
2568
- class: "vehicle-deck"
2569
- }), null, 16),
2570
- (m(!0), k(z, null, j(o.value, (f, y) => (m(), k("g", {
2571
- key: `seat-${y}`,
2572
- transform: `translate(${n.get(f)?.x ?? f.getShape(t.scale).x},
2573
- ${n.get(f)?.y ?? f.getShape(t.scale).y})`,
2574
- onClick: we((x) => l(x, f), ["stop"]),
2575
- class: le(`seat ${f.getClasses()}`)
2567
+ w("g", {
2568
+ class: te(`${t.vertical ? "vehicle-frame--vertical" : ""}`),
2569
+ transform: `rotate(
2570
+ ${t.vertical ? 90 : 0},
2571
+ ${a.value.height / 2},
2572
+ ${a.value.height / 2}
2573
+ )`
2576
2574
  }, [
2577
- S("g", {
2578
- class: "seat__container",
2579
- transform: `rotate( ${f.Orientation === "forwards" ? 180 : 0}, ${f.getShape(t.scale).width / 2}, ${f.getShape(t.scale).height / 2})`
2575
+ w("rect", rt({ ...t.deck.getShape(t.scale), y: 5 }, {
2576
+ onClick: d[0] || (d[0] = we((f) => l(f, t.deck), ["stop"])),
2577
+ class: "vehicle-deck"
2578
+ }), null, 16),
2579
+ (m(!0), k(z, null, j(o.value, (f, y) => (m(), k("g", {
2580
+ key: `seat-${y}`,
2581
+ transform: `translate(${n.get(f)?.x ?? f.getShape(t.scale).x},
2582
+ ${n.get(f)?.y ?? f.getShape(t.scale).y})`,
2583
+ onClick: we((x) => l(x, f), ["stop"]),
2584
+ class: te(`seat ${f.getClasses()}`)
2580
2585
  }, [
2581
- S("rect", {
2582
- width: f.getShape(t.scale).width,
2583
- height: f.getShape(t.scale).height,
2584
- class: le("seat__base")
2585
- }, null, 8, Js),
2586
- S("rect", {
2587
- x: f.getShape(t.scale).width * 0.9,
2588
- y: "0",
2589
- width: f.getShape(t.scale).width * 0.2,
2590
- height: f.getShape(t.scale).height,
2591
- rx: "6",
2592
- ry: "6",
2593
- class: le(["seat__backrest", "seat__backrest"]),
2594
- "pointer-events": "none"
2595
- }, null, 8, Ds)
2596
- ], 8, Qs),
2597
- S("text", {
2598
- x: f.getShape(t.scale).width / 2,
2599
- y: f.getShape(t.scale).height / 2,
2600
- "text-anchor": "middle",
2601
- "dominant-baseline": "middle",
2602
- class: "seat__text",
2603
- "font-size": Math.max(
2604
- Math.min(f.getShape(t.scale).width, f.getShape(t.scale).height) / 3,
2605
- 10
2606
- ),
2607
- "pointer-events": "none"
2608
- }, Z(f.Label), 9, en)
2609
- ], 10, Zs))), 128)),
2610
- (m(!0), k(z, null, j(c.value, (f, y) => (m(), k("g", {
2611
- key: `entrance-${y}`,
2612
- transform: `translate(${i.get(f)?.x ?? f.getShape(t.scale, t.deck.Length, t.deck.Width).x},
2613
- ${i.get(f)?.y ?? f.getShape(t.scale, t.deck.Length, t.deck.Width).y})`,
2614
- onClick: we((x) => l(x, f), ["stop"])
2615
- }, [
2616
- S("rect", {
2617
- width: f.getShape(t.scale, t.deck.Length, t.deck.Width).width,
2618
- height: f.getShape(t.scale, t.deck.Length, t.deck.Width).height,
2619
- class: "door"
2620
- }, null, 8, sn)
2621
- ], 8, tn))), 128))
2586
+ w("g", {
2587
+ class: "seat__container",
2588
+ transform: `rotate( ${f.Orientation === "forwards" ? 180 : 0}, ${f.getShape(t.scale).width / 2}, ${f.getShape(t.scale).height / 2})`
2589
+ }, [
2590
+ w("rect", {
2591
+ width: f.getShape(t.scale).width,
2592
+ height: f.getShape(t.scale).height,
2593
+ class: te("seat__base")
2594
+ }, null, 8, Ds),
2595
+ w("rect", {
2596
+ x: f.getShape(t.scale).width * 0.9,
2597
+ y: "0",
2598
+ width: f.getShape(t.scale).width * 0.2,
2599
+ height: f.getShape(t.scale).height,
2600
+ rx: "6",
2601
+ ry: "6",
2602
+ class: te(["seat__backrest", "seat__backrest"]),
2603
+ "pointer-events": "none"
2604
+ }, null, 8, en)
2605
+ ], 8, Js),
2606
+ w("g", {
2607
+ class: "seat__text-container",
2608
+ transform: `rotate(
2609
+ ${t.vertical ? -90 : 0},
2610
+ ${f.getShape(t.scale).width / 2},
2611
+ ${f.getShape(t.scale).height / 2}
2612
+ )`
2613
+ }, [
2614
+ w("text", {
2615
+ x: f.getShape(t.scale).width / 2,
2616
+ y: f.getShape(t.scale).height / 2,
2617
+ "text-anchor": "middle",
2618
+ "dominant-baseline": "middle",
2619
+ class: "seat__text",
2620
+ "font-size": Math.max(
2621
+ Math.min(f.getShape(t.scale).width, f.getShape(t.scale).height) / 3,
2622
+ 10
2623
+ ),
2624
+ "pointer-events": "none"
2625
+ }, Z(f.Label), 9, sn)
2626
+ ], 8, tn)
2627
+ ], 10, Qs))), 128)),
2628
+ (m(!0), k(z, null, j(c.value, (f, y) => (m(), k("g", {
2629
+ key: `entrance-${y}`,
2630
+ transform: `translate(${i.get(f)?.x ?? f.getShape(t.scale, t.deck.Length, t.deck.Width).x},
2631
+ ${i.get(f)?.y ?? f.getShape(t.scale, t.deck.Length, t.deck.Width).y})`,
2632
+ onClick: we((x) => l(x, f), ["stop"])
2633
+ }, [
2634
+ w("rect", {
2635
+ width: f.getShape(t.scale, t.deck.Length, t.deck.Width).width,
2636
+ height: f.getShape(t.scale, t.deck.Length, t.deck.Width).height,
2637
+ class: "door"
2638
+ }, null, 8, rn)
2639
+ ], 8, nn))), 128))
2640
+ ], 10, Zs)
2622
2641
  ], 8, Ks));
2623
2642
  }
2624
2643
  }), Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2625
2644
  __proto__: null,
2626
- DeckplanRenderer: nn
2645
+ DeckplanRenderer: on
2627
2646
  }, Symbol.toStringTag, { value: "Module" }));
2628
- function rn(t) {
2647
+ function an(t) {
2629
2648
  for (const e in Fe)
2630
2649
  t.component(e, Fe[e]);
2631
2650
  for (const e in Xe)
2632
2651
  t.component(e, Xe[e]);
2633
2652
  }
2634
- const an = { install: rn };
2653
+ const cn = { install: an };
2635
2654
  export {
2636
2655
  et as DeckVisualization,
2637
2656
  js as DeckplanEditor,
2638
- nn as DeckplanRenderer,
2657
+ on as DeckplanRenderer,
2639
2658
  fe as PassengerSpotAvailability,
2640
2659
  tt as WagonVisualization,
2641
- an as default,
2660
+ cn as default,
2642
2661
  qs as parseNeTEx
2643
2662
  };