@noego/forge 0.1.3 → 0.1.5

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/client.mjs CHANGED
@@ -1,26 +1,26 @@
1
- import { p as $t, a as E } from "./page.svelte-Bq1Q01H0.js";
2
- import { s as Ve } from "./page.svelte-Bq1Q01H0.js";
1
+ import { p as Ft, a as E } from "./page.svelte-Bq1Q01H0.js";
2
+ import { s as He } from "./page.svelte-Bq1Q01H0.js";
3
3
  import * as pt from "svelte/internal/client";
4
- import { hydrate as Ft } from "svelte";
5
- import Dt from "../src/components/RecursiveRender.svelte";
6
- function Gt(t) {
7
- const r = new $t(t);
4
+ import { hydrate as Dt } from "svelte";
5
+ import Gt from "../src/components/RecursiveRender.svelte";
6
+ function Vt(t) {
7
+ const r = new Ft(t);
8
8
  return (e) => r.match(e) || null;
9
9
  }
10
- function Vt(t) {
10
+ function Mt(t) {
11
11
  return t.map((r) => {
12
- const e = r.path, n = Gt(e);
12
+ const e = r.path, n = Vt(e);
13
13
  return { pattern: e, parser: n };
14
14
  });
15
15
  }
16
- function G() {
17
- return G = Object.assign ? Object.assign.bind() : function(t) {
16
+ function M() {
17
+ return M = Object.assign ? Object.assign.bind() : function(t) {
18
18
  for (var r = 1; r < arguments.length; r++) {
19
19
  var e = arguments[r];
20
20
  for (var n in e) ({}).hasOwnProperty.call(e, n) && (t[n] = e[n]);
21
21
  }
22
22
  return t;
23
- }, G.apply(null, arguments);
23
+ }, M.apply(null, arguments);
24
24
  }
25
25
  var j;
26
26
  (function(t) {
@@ -31,7 +31,7 @@ var at = process.env.NODE_ENV !== "production" ? function(t) {
31
31
  } : function(t) {
32
32
  return t;
33
33
  };
34
- function Mt(t, r) {
34
+ function Ht(t, r) {
35
35
  {
36
36
  typeof console < "u" && console.warn(r);
37
37
  try {
@@ -40,8 +40,8 @@ function Mt(t, r) {
40
40
  }
41
41
  }
42
42
  }
43
- var st = "beforeunload", Ht = "popstate";
44
- function Wt(t) {
43
+ var st = "beforeunload", Wt = "popstate";
44
+ function zt(t) {
45
45
  t === void 0 && (t = {});
46
46
  var r = t, e = r.window, n = e === void 0 ? document.defaultView : e, o = n.history;
47
47
  function i() {
@@ -67,11 +67,11 @@ function Wt(t) {
67
67
  action: p,
68
68
  location: x,
69
69
  retry: function() {
70
- U(O * -1);
70
+ L(O * -1);
71
71
  }
72
- }, U(O));
72
+ }, L(O));
73
73
  } else
74
- process.env.NODE_ENV !== "production" && Mt(
74
+ process.env.NODE_ENV !== "production" && Ht(
75
75
  !1,
76
76
  // TODO: Write up a doc that explains our blocking strategy in
77
77
  // detail and link to it here so people can understand better what
@@ -82,22 +82,22 @@ function Wt(t) {
82
82
  A(p);
83
83
  }
84
84
  }
85
- n.addEventListener(Ht, c);
85
+ n.addEventListener(Wt, c);
86
86
  var s = j.Pop, u = i(), f = u[0], h = u[1], d = ut(), l = ut();
87
- f == null && (f = 0, o.replaceState(G({}, o.state, {
87
+ f == null && (f = 0, o.replaceState(M({}, o.state, {
88
88
  idx: f
89
89
  }), ""));
90
90
  function y(p) {
91
- return typeof p == "string" ? p : Yt(p);
91
+ return typeof p == "string" ? p : Bt(p);
92
92
  }
93
93
  function w(p, m) {
94
- return m === void 0 && (m = null), at(G({
94
+ return m === void 0 && (m = null), at(M({
95
95
  pathname: h.pathname,
96
96
  hash: "",
97
97
  search: ""
98
- }, typeof p == "string" ? Bt(p) : p, {
98
+ }, typeof p == "string" ? Kt(p) : p, {
99
99
  state: m,
100
- key: zt()
100
+ key: Yt()
101
101
  }));
102
102
  }
103
103
  function S(p, m) {
@@ -128,11 +128,11 @@ function Wt(t) {
128
128
  ot(p, m);
129
129
  }
130
130
  if (v(_, x, O)) {
131
- var T = S(x, f + 1), Y = T[0], C = T[1];
131
+ var T = S(x, f + 1), Y = T[0], $ = T[1];
132
132
  try {
133
- o.pushState(Y, "", C);
133
+ o.pushState(Y, "", $);
134
134
  } catch {
135
- n.location.assign(C);
135
+ n.location.assign($);
136
136
  }
137
137
  A(_);
138
138
  }
@@ -143,14 +143,14 @@ function Wt(t) {
143
143
  it(p, m);
144
144
  }
145
145
  if (v(_, x, O)) {
146
- var T = S(x, f), Y = T[0], C = T[1];
147
- o.replaceState(Y, "", C), A(_);
146
+ var T = S(x, f), Y = T[0], $ = T[1];
147
+ o.replaceState(Y, "", $), A(_);
148
148
  }
149
149
  }
150
- function U(p) {
150
+ function L(p) {
151
151
  o.go(p);
152
152
  }
153
- var qt = {
153
+ var $t = {
154
154
  get action() {
155
155
  return s;
156
156
  },
@@ -160,12 +160,12 @@ function Wt(t) {
160
160
  createHref: y,
161
161
  push: ot,
162
162
  replace: it,
163
- go: U,
163
+ go: L,
164
164
  back: function() {
165
- U(-1);
165
+ L(-1);
166
166
  },
167
167
  forward: function() {
168
- U(1);
168
+ L(1);
169
169
  },
170
170
  listen: function(m) {
171
171
  return d.push(m);
@@ -177,7 +177,7 @@ function Wt(t) {
177
177
  };
178
178
  }
179
179
  };
180
- return qt;
180
+ return $t;
181
181
  }
182
182
  function ct(t) {
183
183
  t.preventDefault(), t.returnValue = "";
@@ -202,14 +202,14 @@ function ut() {
202
202
  }
203
203
  };
204
204
  }
205
- function zt() {
205
+ function Yt() {
206
206
  return Math.random().toString(36).substr(2, 8);
207
207
  }
208
- function Yt(t) {
208
+ function Bt(t) {
209
209
  var r = t.pathname, e = r === void 0 ? "/" : r, n = t.search, o = n === void 0 ? "" : n, i = t.hash, a = i === void 0 ? "" : i;
210
210
  return o && o !== "?" && (e += o.charAt(0) === "?" ? o : "?" + o), a && a !== "#" && (e += a.charAt(0) === "#" ? a : "#" + a), e;
211
211
  }
212
- function Bt(t) {
212
+ function Kt(t) {
213
213
  var r = {};
214
214
  if (t) {
215
215
  var e = t.indexOf("#");
@@ -226,7 +226,7 @@ var Q = function(t, r) {
226
226
  for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
227
227
  }, Q(t, r);
228
228
  };
229
- function N(t, r) {
229
+ function C(t, r) {
230
230
  if (typeof r != "function" && r !== null)
231
231
  throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
232
232
  Q(t, r);
@@ -322,7 +322,7 @@ function vt(t, r) {
322
322
  return { value: u[0] ? u[1] : void 0, done: !0 };
323
323
  }
324
324
  }
325
- function L(t) {
325
+ function U(t) {
326
326
  var r = typeof Symbol == "function" && Symbol.iterator, e = r && t[r], n = 0;
327
327
  if (e) return e.call(t);
328
328
  if (t && typeof t.length == "number") return {
@@ -357,7 +357,7 @@ function Z(t, r, e) {
357
357
  function k(t) {
358
358
  return this instanceof k ? (this.v = t, this) : new k(t);
359
359
  }
360
- function Kt(t, r, e) {
360
+ function Qt(t, r, e) {
361
361
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
362
362
  var n = e.apply(t, r || []), o, i = [];
363
363
  return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), c("next"), c("throw"), c("return", a), o[Symbol.asyncIterator] = function() {
@@ -395,10 +395,10 @@ function Kt(t, r, e) {
395
395
  l(y), i.shift(), i.length && s(i[0][0], i[0][1]);
396
396
  }
397
397
  }
398
- function Qt(t) {
398
+ function Xt(t) {
399
399
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
400
400
  var r = t[Symbol.asyncIterator], e;
401
- return r ? r.call(t) : (t = typeof L == "function" ? L(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
401
+ return r ? r.call(t) : (t = typeof U == "function" ? U(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
402
402
  return this;
403
403
  }, e);
404
404
  function n(i) {
@@ -438,7 +438,7 @@ function tt(t, r) {
438
438
  0 <= e && t.splice(e, 1);
439
439
  }
440
440
  }
441
- var H = function() {
441
+ var W = function() {
442
442
  function t(r) {
443
443
  this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
444
444
  }
@@ -450,7 +450,7 @@ var H = function() {
450
450
  if (a)
451
451
  if (this._parentage = null, Array.isArray(a))
452
452
  try {
453
- for (var c = L(a), s = c.next(); !s.done; s = c.next()) {
453
+ for (var c = U(a), s = c.next(); !s.done; s = c.next()) {
454
454
  var u = s.value;
455
455
  u.remove(this);
456
456
  }
@@ -476,7 +476,7 @@ var H = function() {
476
476
  if (h) {
477
477
  this._finalizers = null;
478
478
  try {
479
- for (var d = L(h), l = d.next(); !l.done; l = d.next()) {
479
+ for (var d = U(h), l = d.next(); !l.done; l = d.next()) {
480
480
  var y = l.value;
481
481
  try {
482
482
  lt(y);
@@ -526,16 +526,16 @@ var H = function() {
526
526
  var r = new t();
527
527
  return r.closed = !0, r;
528
528
  }(), t;
529
- }(), wt = H.EMPTY;
529
+ }(), wt = W.EMPTY;
530
530
  function mt(t) {
531
- return t instanceof H || t && "closed" in t && g(t.remove) && g(t.add) && g(t.unsubscribe);
531
+ return t instanceof W || t && "closed" in t && g(t.remove) && g(t.add) && g(t.unsubscribe);
532
532
  }
533
533
  function lt(t) {
534
534
  g(t) ? t() : t.unsubscribe();
535
535
  }
536
- var Xt = {
536
+ var Zt = {
537
537
  Promise: void 0
538
- }, Zt = {
538
+ }, te = {
539
539
  setTimeout: function(t, r) {
540
540
  for (var e = [], n = 2; n < arguments.length; n++)
541
541
  e[n - 2] = arguments[n];
@@ -547,20 +547,20 @@ var Xt = {
547
547
  delegate: void 0
548
548
  };
549
549
  function bt(t) {
550
- Zt.setTimeout(function() {
550
+ te.setTimeout(function() {
551
551
  throw t;
552
552
  });
553
553
  }
554
554
  function ft() {
555
555
  }
556
- function F(t) {
556
+ function G(t) {
557
557
  t();
558
558
  }
559
559
  var rt = function(t) {
560
- N(r, t);
560
+ C(r, t);
561
561
  function r(e) {
562
562
  var n = t.call(this) || this;
563
- return n.isStopped = !1, e ? (n.destination = e, mt(e) && e.add(n)) : n.destination = re, n;
563
+ return n.isStopped = !1, e ? (n.destination = e, mt(e) && e.add(n)) : n.destination = ne, n;
564
564
  }
565
565
  return r.create = function(e, n, o) {
566
566
  return new et(e, n, o);
@@ -587,7 +587,7 @@ var rt = function(t) {
587
587
  this.unsubscribe();
588
588
  }
589
589
  }, r;
590
- }(H), te = function() {
590
+ }(W), ee = function() {
591
591
  function t(r) {
592
592
  this.partialObserver = r;
593
593
  }
@@ -597,7 +597,7 @@ var rt = function(t) {
597
597
  try {
598
598
  e.next(r);
599
599
  } catch (n) {
600
- q(n);
600
+ F(n);
601
601
  }
602
602
  }, t.prototype.error = function(r) {
603
603
  var e = this.partialObserver;
@@ -605,50 +605,50 @@ var rt = function(t) {
605
605
  try {
606
606
  e.error(r);
607
607
  } catch (n) {
608
- q(n);
608
+ F(n);
609
609
  }
610
610
  else
611
- q(r);
611
+ F(r);
612
612
  }, t.prototype.complete = function() {
613
613
  var r = this.partialObserver;
614
614
  if (r.complete)
615
615
  try {
616
616
  r.complete();
617
617
  } catch (e) {
618
- q(e);
618
+ F(e);
619
619
  }
620
620
  }, t;
621
621
  }(), et = function(t) {
622
- N(r, t);
622
+ C(r, t);
623
623
  function r(e, n, o) {
624
624
  var i = t.call(this) || this, a;
625
625
  return g(e) || !e ? a = {
626
626
  next: e ?? void 0,
627
627
  error: n ?? void 0,
628
628
  complete: o ?? void 0
629
- } : a = e, i.destination = new te(a), i;
629
+ } : a = e, i.destination = new ee(a), i;
630
630
  }
631
631
  return r;
632
632
  }(rt);
633
- function q(t) {
633
+ function F(t) {
634
634
  bt(t);
635
635
  }
636
- function ee(t) {
636
+ function re(t) {
637
637
  throw t;
638
638
  }
639
- var re = {
639
+ var ne = {
640
640
  closed: !0,
641
641
  next: ft,
642
- error: ee,
642
+ error: re,
643
643
  complete: ft
644
644
  }, nt = function() {
645
645
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
646
646
  }();
647
- function ne(t) {
647
+ function gt(t) {
648
648
  return t;
649
649
  }
650
650
  function oe(t) {
651
- return t.length === 0 ? ne : t.length === 1 ? t[0] : function(e) {
651
+ return t.length === 0 ? gt : t.length === 1 ? t[0] : function(e) {
652
652
  return t.reduce(function(n, o) {
653
653
  return o(n);
654
654
  }, e);
@@ -663,7 +663,7 @@ var P = function() {
663
663
  return e.source = this, e.operator = r, e;
664
664
  }, t.prototype.subscribe = function(r, e, n) {
665
665
  var o = this, i = ae(r) ? r : new et(r, e, n);
666
- return F(function() {
666
+ return G(function() {
667
667
  var a = o, c = a.operator, s = a.source;
668
668
  i.add(c ? c.call(i, s) : s ? o._subscribe(i) : o._trySubscribe(i));
669
669
  }), i;
@@ -716,7 +716,7 @@ var P = function() {
716
716
  }();
717
717
  function ht(t) {
718
718
  var r;
719
- return (r = t ?? Xt.Promise) !== null && r !== void 0 ? r : Promise;
719
+ return (r = t ?? Zt.Promise) !== null && r !== void 0 ? r : Promise;
720
720
  }
721
721
  function ie(t) {
722
722
  return t && g(t.next) && g(t.error) && g(t.complete);
@@ -727,7 +727,7 @@ function ae(t) {
727
727
  function se(t) {
728
728
  return g(t == null ? void 0 : t.lift);
729
729
  }
730
- function W(t) {
730
+ function q(t) {
731
731
  return function(r) {
732
732
  if (se(r))
733
733
  return r.lift(function(e) {
@@ -740,11 +740,11 @@ function W(t) {
740
740
  throw new TypeError("Unable to lift unknown Observable type");
741
741
  };
742
742
  }
743
- function V(t, r, e, n, o) {
743
+ function N(t, r, e, n, o) {
744
744
  return new ce(t, r, e, n, o);
745
745
  }
746
746
  var ce = function(t) {
747
- N(r, t);
747
+ C(r, t);
748
748
  function r(e, n, o, i, a, c) {
749
749
  var s = t.call(this, e) || this;
750
750
  return s.onFinalize = a, s.shouldUnsubscribe = c, s._next = n ? function(u) {
@@ -782,8 +782,8 @@ var ce = function(t) {
782
782
  return function() {
783
783
  t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
784
784
  };
785
- }), gt = function(t) {
786
- N(r, t);
785
+ }), St = function(t) {
786
+ C(r, t);
787
787
  function r() {
788
788
  var e = t.call(this) || this;
789
789
  return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
@@ -796,12 +796,12 @@ var ce = function(t) {
796
796
  throw new ue();
797
797
  }, r.prototype.next = function(e) {
798
798
  var n = this;
799
- F(function() {
799
+ G(function() {
800
800
  var o, i;
801
801
  if (n._throwIfClosed(), !n.isStopped) {
802
802
  n.currentObservers || (n.currentObservers = Array.from(n.observers));
803
803
  try {
804
- for (var a = L(n.currentObservers), c = a.next(); !c.done; c = a.next()) {
804
+ for (var a = U(n.currentObservers), c = a.next(); !c.done; c = a.next()) {
805
805
  var s = c.value;
806
806
  s.next(e);
807
807
  }
@@ -818,7 +818,7 @@ var ce = function(t) {
818
818
  });
819
819
  }, r.prototype.error = function(e) {
820
820
  var n = this;
821
- F(function() {
821
+ G(function() {
822
822
  if (n._throwIfClosed(), !n.isStopped) {
823
823
  n.hasError = n.isStopped = !0, n.thrownError = e;
824
824
  for (var o = n.observers; o.length; )
@@ -827,7 +827,7 @@ var ce = function(t) {
827
827
  });
828
828
  }, r.prototype.complete = function() {
829
829
  var e = this;
830
- F(function() {
830
+ G(function() {
831
831
  if (e._throwIfClosed(), !e.isStopped) {
832
832
  e.isStopped = !0;
833
833
  for (var n = e.observers; n.length; )
@@ -849,7 +849,7 @@ var ce = function(t) {
849
849
  return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
850
850
  }, r.prototype._innerSubscribe = function(e) {
851
851
  var n = this, o = this, i = o.hasError, a = o.isStopped, c = o.observers;
852
- return i || a ? wt : (this.currentObservers = null, c.push(e), new H(function() {
852
+ return i || a ? wt : (this.currentObservers = null, c.push(e), new W(function() {
853
853
  n.currentObservers = null, tt(c, e);
854
854
  }));
855
855
  }, r.prototype._checkFinalizedStatuses = function(e) {
@@ -862,7 +862,7 @@ var ce = function(t) {
862
862
  return new dt(e, n);
863
863
  }, r;
864
864
  }(P), dt = function(t) {
865
- N(r, t);
865
+ C(r, t);
866
866
  function r(e, n) {
867
867
  var o = t.call(this) || this;
868
868
  return o.destination = e, o.source = n, o;
@@ -880,30 +880,30 @@ var ce = function(t) {
880
880
  var n, o;
881
881
  return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e)) !== null && o !== void 0 ? o : wt;
882
882
  }, r;
883
- }(gt), St = function(t) {
883
+ }(St), _t = function(t) {
884
884
  return t && typeof t.length == "number" && typeof t != "function";
885
885
  };
886
- function _t(t) {
886
+ function Et(t) {
887
887
  return g(t == null ? void 0 : t.then);
888
888
  }
889
- function Et(t) {
889
+ function Ot(t) {
890
890
  return g(t[nt]);
891
891
  }
892
- function Ot(t) {
892
+ function Pt(t) {
893
893
  return Symbol.asyncIterator && g(t == null ? void 0 : t[Symbol.asyncIterator]);
894
894
  }
895
- function Pt(t) {
895
+ function xt(t) {
896
896
  return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
897
897
  }
898
898
  function le() {
899
899
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
900
900
  }
901
- var xt = le();
902
- function It(t) {
903
- return g(t == null ? void 0 : t[xt]);
904
- }
901
+ var It = le();
905
902
  function At(t) {
906
- return Kt(this, arguments, function() {
903
+ return g(t == null ? void 0 : t[It]);
904
+ }
905
+ function Tt(t) {
906
+ return Qt(this, arguments, function() {
907
907
  var e, n, o, i;
908
908
  return vt(this, function(a) {
909
909
  switch (a.label) {
@@ -933,27 +933,27 @@ function At(t) {
933
933
  });
934
934
  });
935
935
  }
936
- function Tt(t) {
936
+ function Rt(t) {
937
937
  return g(t == null ? void 0 : t.getReader);
938
938
  }
939
939
  function z(t) {
940
940
  if (t instanceof P)
941
941
  return t;
942
942
  if (t != null) {
943
- if (Et(t))
943
+ if (Ot(t))
944
944
  return fe(t);
945
- if (St(t))
946
- return he(t);
947
945
  if (_t(t))
946
+ return he(t);
947
+ if (Et(t))
948
948
  return de(t);
949
- if (Ot(t))
950
- return Rt(t);
951
- if (It(t))
949
+ if (Pt(t))
950
+ return jt(t);
951
+ if (At(t))
952
952
  return pe(t);
953
- if (Tt(t))
953
+ if (Rt(t))
954
954
  return ve(t);
955
955
  }
956
- throw Pt(t);
956
+ throw xt(t);
957
957
  }
958
958
  function fe(t) {
959
959
  return new P(function(r) {
@@ -983,7 +983,7 @@ function pe(t) {
983
983
  return new P(function(r) {
984
984
  var e, n;
985
985
  try {
986
- for (var o = L(t), i = o.next(); !i.done; i = o.next()) {
986
+ for (var o = U(t), i = o.next(); !i.done; i = o.next()) {
987
987
  var a = i.value;
988
988
  if (r.next(a), r.closed)
989
989
  return;
@@ -1000,7 +1000,7 @@ function pe(t) {
1000
1000
  r.complete();
1001
1001
  });
1002
1002
  }
1003
- function Rt(t) {
1003
+ function jt(t) {
1004
1004
  return new P(function(r) {
1005
1005
  ye(t, r).catch(function(e) {
1006
1006
  return r.error(e);
@@ -1008,7 +1008,7 @@ function Rt(t) {
1008
1008
  });
1009
1009
  }
1010
1010
  function ve(t) {
1011
- return Rt(At(t));
1011
+ return jt(Tt(t));
1012
1012
  }
1013
1013
  function ye(t, r) {
1014
1014
  var e, n, o, i;
@@ -1017,7 +1017,7 @@ function ye(t, r) {
1017
1017
  return vt(this, function(s) {
1018
1018
  switch (s.label) {
1019
1019
  case 0:
1020
- s.trys.push([0, 5, 6, 11]), e = Qt(t), s.label = 1;
1020
+ s.trys.push([0, 5, 6, 11]), e = Xt(t), s.label = 1;
1021
1021
  case 1:
1022
1022
  return [4, e.next()];
1023
1023
  case 2:
@@ -1056,9 +1056,9 @@ function I(t, r, e, n, o) {
1056
1056
  if (t.add(i), !o)
1057
1057
  return i;
1058
1058
  }
1059
- function jt(t, r) {
1060
- return r === void 0 && (r = 0), W(function(e, n) {
1061
- e.subscribe(V(n, function(o) {
1059
+ function kt(t, r) {
1060
+ return r === void 0 && (r = 0), q(function(e, n) {
1061
+ e.subscribe(N(n, function(o) {
1062
1062
  return I(n, t, function() {
1063
1063
  return n.next(o);
1064
1064
  }, r);
@@ -1073,18 +1073,18 @@ function jt(t, r) {
1073
1073
  }));
1074
1074
  });
1075
1075
  }
1076
- function kt(t, r) {
1077
- return r === void 0 && (r = 0), W(function(e, n) {
1076
+ function Ut(t, r) {
1077
+ return r === void 0 && (r = 0), q(function(e, n) {
1078
1078
  n.add(t.schedule(function() {
1079
1079
  return e.subscribe(n);
1080
1080
  }, r));
1081
1081
  });
1082
1082
  }
1083
1083
  function we(t, r) {
1084
- return z(t).pipe(kt(r), jt(r));
1084
+ return z(t).pipe(Ut(r), kt(r));
1085
1085
  }
1086
1086
  function me(t, r) {
1087
- return z(t).pipe(kt(r), jt(r));
1087
+ return z(t).pipe(Ut(r), kt(r));
1088
1088
  }
1089
1089
  function be(t, r) {
1090
1090
  return new P(function(e) {
@@ -1098,7 +1098,7 @@ function ge(t, r) {
1098
1098
  return new P(function(e) {
1099
1099
  var n;
1100
1100
  return I(e, r, function() {
1101
- n = t[xt](), I(e, r, function() {
1101
+ n = t[It](), I(e, r, function() {
1102
1102
  var o, i, a;
1103
1103
  try {
1104
1104
  o = n.next(), i = o.value, a = o.done;
@@ -1128,45 +1128,57 @@ function Lt(t, r) {
1128
1128
  });
1129
1129
  }
1130
1130
  function Se(t, r) {
1131
- return Lt(At(t), r);
1131
+ return Lt(Tt(t), r);
1132
1132
  }
1133
1133
  function _e(t, r) {
1134
1134
  if (t != null) {
1135
- if (Et(t))
1135
+ if (Ot(t))
1136
1136
  return we(t, r);
1137
- if (St(t))
1138
- return be(t, r);
1139
1137
  if (_t(t))
1138
+ return be(t, r);
1139
+ if (Et(t))
1140
1140
  return me(t, r);
1141
- if (Ot(t))
1141
+ if (Pt(t))
1142
1142
  return Lt(t, r);
1143
- if (It(t))
1143
+ if (At(t))
1144
1144
  return ge(t, r);
1145
- if (Tt(t))
1145
+ if (Rt(t))
1146
1146
  return Se(t, r);
1147
1147
  }
1148
- throw Pt(t);
1148
+ throw xt(t);
1149
1149
  }
1150
1150
  function Ee(t, r) {
1151
1151
  return r ? _e(t, r) : z(t);
1152
1152
  }
1153
1153
  function Oe(t, r) {
1154
- return W(function(e, n) {
1154
+ return q(function(e, n) {
1155
1155
  var o = 0;
1156
- e.subscribe(V(n, function(i) {
1156
+ e.subscribe(N(n, function(i) {
1157
1157
  return t.call(r, i, o++) && n.next(i);
1158
1158
  }));
1159
1159
  });
1160
1160
  }
1161
1161
  function Pe(t, r) {
1162
- return W(function(e, n) {
1162
+ return r === void 0 && (r = gt), t = t ?? xe, q(function(e, n) {
1163
+ var o, i = !0;
1164
+ e.subscribe(N(n, function(a) {
1165
+ var c = r(a);
1166
+ (i || !t(o, c)) && (i = !1, o = c, n.next(a));
1167
+ }));
1168
+ });
1169
+ }
1170
+ function xe(t, r) {
1171
+ return t === r;
1172
+ }
1173
+ function Ie(t, r) {
1174
+ return q(function(e, n) {
1163
1175
  var o = null, i = 0, a = !1, c = function() {
1164
1176
  return a && !o && n.complete();
1165
1177
  };
1166
- e.subscribe(V(n, function(s) {
1178
+ e.subscribe(N(n, function(s) {
1167
1179
  o == null || o.unsubscribe();
1168
1180
  var u = 0, f = i++;
1169
- z(t(s, f)).subscribe(o = V(n, function(h) {
1181
+ z(t(s, f)).subscribe(o = N(n, function(h) {
1170
1182
  return n.next(r ? r(s, h, f, u++) : h);
1171
1183
  }, function() {
1172
1184
  o = null, c();
@@ -1176,16 +1188,17 @@ function Pe(t, r) {
1176
1188
  }));
1177
1189
  });
1178
1190
  }
1179
- const xe = Wt(), Ut = new gt();
1180
- let Nt = null;
1181
- Ut.pipe(
1182
- Oe((t) => t.url === Nt && !t.update ? (console.log("[NAVIGATION] Skipping duplicate navigation to", t.url), !1) : !0),
1183
- Pe((t) => Ee(Te(t)))
1191
+ const Ae = zt(), Nt = new St();
1192
+ let Ct = null;
1193
+ Nt.pipe(
1194
+ Pe((t, r) => t.url === r.url && !r.update),
1195
+ Oe((t) => t.url === Ct && !t.update ? (console.log("[NAVIGATION] Skipping duplicate navigation to", t.url), !1) : !0),
1196
+ Ie((t) => Ee(je(t)))
1184
1197
  ).subscribe({
1185
1198
  error: (t) => console.error("[NAVIGATION] Stream error:", t)
1186
1199
  });
1187
- function Ie(t) {
1188
- Ut.next(t);
1200
+ function Te(t) {
1201
+ Nt.next(t);
1189
1202
  }
1190
1203
  const b = pt.proxy({
1191
1204
  layouts: [],
@@ -1196,17 +1209,17 @@ const b = pt.proxy({
1196
1209
  query: null,
1197
1210
  page: E
1198
1211
  });
1199
- function M(...t) {
1212
+ function H(...t) {
1200
1213
  let r = t.map((e, n) => n === 0 ? e.replace(/\/+$/, "") : e.replace(/^\/+|\/+$/g, "")).join("/");
1201
1214
  return r.startsWith("/") || (r = "/" + r), r.split("?")[0];
1202
1215
  }
1203
- async function Ae(t, r, e, n, o, i) {
1216
+ async function Re(t, r, e, n, o, i) {
1204
1217
  try {
1205
1218
  const a = typeof r == "string" && r.indexOf("assets") !== -1, c = (e.layout || []).map((h) => {
1206
- let d = M(r, h).toString();
1219
+ let d = H(r, h).toString();
1207
1220
  return a && (d = d.endsWith(".svelte") ? d.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(d) ? d : d + ".js"), d;
1208
1221
  });
1209
- let s = M(r, e.view).toString();
1222
+ let s = H(r, e.view).toString();
1210
1223
  a && (s = s.endsWith(".svelte") ? s.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(s) ? s : s + ".js");
1211
1224
  const u = await Promise.all(c.map((h) => import(
1212
1225
  /* @vite-ignore */
@@ -1217,13 +1230,13 @@ async function Ae(t, r, e, n, o, i) {
1217
1230
  /* @vite-ignore */
1218
1231
  s
1219
1232
  ).then((h) => h.default);
1220
- b.layouts = u, b.view = f, b.params = n, b.data = window.__INITIAL_DATA__, b.urlParams = o, b.query = i, Ft(Dt, { target: t, props: b });
1233
+ b.layouts = u, b.view = f, b.params = n, b.data = window.__INITIAL_DATA__, b.urlParams = o, b.query = i, Dt(Gt, { target: t, props: b });
1221
1234
  } catch (a) {
1222
1235
  console.error("Client-side route loading failed:", a);
1223
1236
  }
1224
1237
  }
1225
- function $(t, r, e, n, o, i, a = !1, c = !0) {
1226
- Ie({
1238
+ function D(t, r, e, n, o, i, a = !1, c = !0) {
1239
+ Te({
1227
1240
  url: t,
1228
1241
  base_path: r,
1229
1242
  route: e,
@@ -1234,7 +1247,7 @@ function $(t, r, e, n, o, i, a = !1, c = !0) {
1234
1247
  update: c
1235
1248
  });
1236
1249
  }
1237
- async function Te(t) {
1250
+ async function je(t) {
1238
1251
  const {
1239
1252
  url: r,
1240
1253
  base_path: e,
@@ -1262,7 +1275,7 @@ async function Te(t) {
1262
1275
  Accept: "application/json"
1263
1276
  }
1264
1277
  };
1265
- if (S[Ct] = !0, await fetch(r, S).then((v) => {
1278
+ if (S[qt] = !0, await fetch(r, S).then((v) => {
1266
1279
  if (console.log("[NAVIGATION] Fetch response", {
1267
1280
  url: r,
1268
1281
  ok: v.ok,
@@ -1283,10 +1296,10 @@ async function Te(t) {
1283
1296
  }
1284
1297
  }
1285
1298
  const h = typeof e == "string" && e.indexOf("assets") !== -1, d = (n.layout || []).map((S) => {
1286
- let v = M(e, S).toString();
1299
+ let v = H(e, S).toString();
1287
1300
  return h && (v = v.endsWith(".svelte") ? v.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(v) ? v : v + ".js"), v;
1288
1301
  });
1289
- let l = M(e, n.view).toString();
1302
+ let l = H(e, n.view).toString();
1290
1303
  h && (l = l.endsWith(".svelte") ? l.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(l) ? l : l + ".js");
1291
1304
  const y = await Promise.all(d.map((S) => import(
1292
1305
  /* @vite-ignore */
@@ -1295,16 +1308,16 @@ async function Te(t) {
1295
1308
  /* @vite-ignore */
1296
1309
  l
1297
1310
  ).then((S) => S.default);
1298
- c ? (b.data = u, b.params = o, b.layouts = y, b.view = w, b.urlParams = i, b.query = a) : (console.log("[NAVIGATION] No server loading needed for", r), b.data = { layout: [], view: {} }, b.params = o, b.layouts = y, b.view = w, b.urlParams = i, b.query = a), window && window.scroll(0, 0), s && xe.push(r), Nt = r;
1311
+ c ? (b.data = u, b.params = o, b.layouts = y, b.view = w, b.urlParams = i, b.query = a) : (console.log("[NAVIGATION] No server loading needed for", r), b.data = { layout: [], view: {} }, b.params = o, b.layouts = y, b.view = w, b.urlParams = i, b.query = a), window && window.scroll(0, 0), s && Ae.push(r), Ct = r;
1299
1312
  } catch (u) {
1300
1313
  console.error("Client-side navigation failed for URL:", r, u);
1301
1314
  }
1302
1315
  }
1303
1316
  const R = pt.proxy({});
1304
- async function Re() {
1317
+ async function ke() {
1305
1318
  Object.assign(R, window.__MANIFEST__);
1306
1319
  }
1307
- function je(t, r, e) {
1320
+ function Ue(t, r, e) {
1308
1321
  if (!document) {
1309
1322
  console.error("Document not found");
1310
1323
  return;
@@ -1328,7 +1341,7 @@ function je(t, r, e) {
1328
1341
  requires_server_data: v,
1329
1342
  manifest_store: R,
1330
1343
  middleware: h.middleware
1331
- }), $(s, t, h, S, l, w, v);
1344
+ }), D(s, t, h, S, l, w, v);
1332
1345
  } else
1333
1346
  console.log("No matching route found for URL:", s, "- using fallback navigation");
1334
1347
  }
@@ -1341,7 +1354,7 @@ function je(t, r, e) {
1341
1354
  const s = e.find((y) => y.parser(o) && y.pattern === c.path), u = (s == null ? void 0 : s.parser(o)) || {}, f = new URLSearchParams(window.location.search), h = Object.fromEntries(f.entries()) || {};
1342
1355
  E.params = u, E.query = h;
1343
1356
  const d = { ...u, ...h }, l = R[s == null ? void 0 : s.pattern];
1344
- $(i, t, c, d, u, h, l, !1);
1357
+ D(i, t, c, d, u, h, l, !1);
1345
1358
  } else
1346
1359
  console.log("No matching route found for popstate navigation to:", o, "- using fallback navigation"), window.location.href = o;
1347
1360
  }), function() {
@@ -1363,7 +1376,7 @@ function je(t, r, e) {
1363
1376
  const s = e.find((y) => y.parser(i) && y.pattern === c.path), u = s == null ? void 0 : s.parser(i), f = new URLSearchParams(o.split("?")[1] || ""), h = Object.fromEntries(f.entries());
1364
1377
  E.url = o, E.pathname = window.location.pathname, Object.assign(E.params, u), Object.assign(E.query, h);
1365
1378
  const d = { ...u, ...h }, l = R[s == null ? void 0 : s.pattern];
1366
- $(o, t, c, d, u, h, l, !1);
1379
+ D(o, t, c, d, u, h, l, !1);
1367
1380
  } else
1368
1381
  console.log("No matching route found for pushstate to:", i, "- using fallback navigation"), window.location.href = i;
1369
1382
  }), window.addEventListener("replacestate", (n) => {
@@ -1372,14 +1385,14 @@ function je(t, r, e) {
1372
1385
  const a = "get", c = r.find((s) => s.method.toLowerCase() === a && e.find((u) => u.parser(i) && u.pattern === s.path));
1373
1386
  if (c) {
1374
1387
  const s = e.find((y) => y.parser(i) && y.pattern === c.path), u = (s == null ? void 0 : s.parser(i)) || {}, f = new URLSearchParams(o.split("?")[1] || ""), h = Object.fromEntries(f.entries()) || {}, d = { ...u, ...h }, l = R[s == null ? void 0 : s.pattern];
1375
- $(o, t, c, d, u, h, l, !1);
1388
+ D(o, t, c, d, u, h, l, !1);
1376
1389
  } else
1377
1390
  console.log("No matching route found for replacestate to:", i, "- using fallback navigation"), window.location.href = i;
1378
1391
  });
1379
1392
  }
1380
- const Ct = Symbol("forge-load-function");
1381
- let D = [], J = null;
1382
- function ke(t) {
1393
+ const qt = Symbol("forge-load-function");
1394
+ let V = [], K = null;
1395
+ function Le(t) {
1383
1396
  try {
1384
1397
  const r = new URL(t, window.location.origin);
1385
1398
  return r.origin === window.location.origin && !r.pathname.startsWith("/api/");
@@ -1387,10 +1400,10 @@ function ke(t) {
1387
1400
  return !t.startsWith("/api/");
1388
1401
  }
1389
1402
  }
1390
- function Le() {
1391
- typeof window < "u" && !J && (J = window.fetch, window.fetch = async function(t, r = {}) {
1403
+ function Ne() {
1404
+ typeof window < "u" && !K && (K = window.fetch, window.fetch = async function(t, r = {}) {
1392
1405
  let e = { ...r };
1393
- for (const i of D)
1406
+ for (const i of V)
1394
1407
  try {
1395
1408
  if (i.length === 2) {
1396
1409
  const a = new Headers(e.headers), c = Object.fromEntries(a.entries());
@@ -1417,13 +1430,13 @@ function Le() {
1417
1430
  } catch (a) {
1418
1431
  throw console.error("🔴 Middleware error:", a), a;
1419
1432
  }
1420
- const n = e == null ? void 0 : e[Ct];
1433
+ const n = e == null ? void 0 : e[qt];
1421
1434
  console.log("[FETCH OVERRIDE] Request", {
1422
1435
  url: t,
1423
1436
  hasForgeSymbol: n,
1424
1437
  headers: e == null ? void 0 : e.headers
1425
1438
  });
1426
- const o = await J(t, e);
1439
+ const o = await K(t, e);
1427
1440
  if (console.log("[FETCH OVERRIDE] Response", {
1428
1441
  url: t,
1429
1442
  responseUrl: o.url,
@@ -1437,7 +1450,7 @@ function Le() {
1437
1450
  requested: i,
1438
1451
  final: a,
1439
1452
  redirected: o.redirected
1440
- }), ke(a)) {
1453
+ }), Le(a)) {
1441
1454
  const c = new URL(a), s = c.pathname + c.search;
1442
1455
  return console.log("[FORGE REDIRECT] Using pushState for SPA navigation to:", s, "from:", a), history.pushState(null, "", s), new Response(JSON.stringify({ layout: [], view: {} }), {
1443
1456
  status: 200,
@@ -1448,54 +1461,54 @@ function Le() {
1448
1461
  return o;
1449
1462
  });
1450
1463
  }
1451
- Le();
1452
- const $e = {
1464
+ Ne();
1465
+ const De = {
1453
1466
  /**
1454
1467
  * Add middleware to the fetch pipeline
1455
1468
  */
1456
1469
  configUpdate(t) {
1457
1470
  if (typeof t != "function")
1458
1471
  throw new Error("Middleware must be a function");
1459
- D.push(t);
1472
+ V.push(t);
1460
1473
  },
1461
1474
  /**
1462
1475
  * Reset all middleware
1463
1476
  */
1464
1477
  reset() {
1465
- D.length = 0;
1478
+ V.length = 0;
1466
1479
  },
1467
1480
  /**
1468
1481
  * Get current middleware count (for debugging)
1469
1482
  */
1470
1483
  getMiddlewareCount() {
1471
- return D.length;
1484
+ return V.length;
1472
1485
  }
1473
1486
  };
1474
- let K;
1475
- async function Fe(t, r) {
1487
+ let J;
1488
+ async function Ge(t, r) {
1476
1489
  let e = window.__COMPONENT_DIR__ || r.component_dir;
1477
1490
  if (!e && typeof e != "string")
1478
1491
  throw new Error("No component directory provided");
1479
1492
  let n = window.__ROUTING__;
1480
- if (K = Vt(n), window && window.location) {
1481
- const o = (window.location.pathname || "/").split("?")[0], i = K.find((c) => c.parser(o));
1493
+ if (J = Mt(n), window && window.location) {
1494
+ const o = (window.location.pathname || "/").split("?")[0], i = J.find((c) => c.parser(o));
1482
1495
  let a = i ? n.find((c) => c.path === i.pattern) : null;
1483
1496
  if (i && a) {
1484
1497
  const c = i.parser(o) || {}, s = new URLSearchParams(window.location.search), u = Object.fromEntries(s.entries()) || {}, f = { ...c, ...u };
1485
- Re(), Ae(t, e, a, f, c, u), je(e, n, K);
1498
+ ke(), Re(t, e, a, f, c, u), Ue(e, n, J);
1486
1499
  } else
1487
1500
  console.warn("No matching route found for:", o);
1488
1501
  }
1489
1502
  }
1490
1503
  export {
1491
1504
  R as MANIFEST_STORE,
1492
- je as bootstrap_events,
1493
- Fe as createApp,
1494
- $e as fetch,
1495
- Ae as loadRoute,
1505
+ Ue as bootstrap_events,
1506
+ Ge as createApp,
1507
+ De as fetch,
1508
+ Re as loadRoute,
1496
1509
  E as page,
1497
- Ve as shadowUrl,
1498
- Re as updateManifestStore,
1499
- $ as updateRoute
1510
+ He as shadowUrl,
1511
+ ke as updateManifestStore,
1512
+ D as updateRoute
1500
1513
  };
1501
1514
  //# sourceMappingURL=client.mjs.map