@noego/forge 0.0.24 → 0.0.25

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,77 +1,77 @@
1
- import { p as B, a as E } from "./page.svelte-Bq1Q01H0.js";
2
- import { s as yt } from "./page.svelte-Bq1Q01H0.js";
3
- import * as W from "svelte/internal/client";
4
- import { hydrate as J } from "svelte";
5
- import Y from "../src/components/RecursiveRender.svelte";
6
- function K(t) {
7
- const i = new B(t);
8
- return (n) => i.match(n) || null;
9
- }
10
- function Q(t) {
11
- return t.map((i) => {
12
- const n = i.path, r = K(n);
13
- return { pattern: n, parser: r };
1
+ import { p as $t, a as E } from "./page.svelte-Bq1Q01H0.js";
2
+ import { s as Ve } from "./page.svelte-Bq1Q01H0.js";
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);
8
+ return (e) => r.match(e) || null;
9
+ }
10
+ function Vt(t) {
11
+ return t.map((r) => {
12
+ const e = r.path, n = Gt(e);
13
+ return { pattern: e, parser: n };
14
14
  });
15
15
  }
16
- function U() {
17
- return U = Object.assign ? Object.assign.bind() : function(t) {
18
- for (var i = 1; i < arguments.length; i++) {
19
- var n = arguments[i];
20
- for (var r in n) ({}).hasOwnProperty.call(n, r) && (t[r] = n[r]);
16
+ function G() {
17
+ return G = Object.assign ? Object.assign.bind() : function(t) {
18
+ for (var r = 1; r < arguments.length; r++) {
19
+ var e = arguments[r];
20
+ for (var n in e) ({}).hasOwnProperty.call(e, n) && (t[n] = e[n]);
21
21
  }
22
22
  return t;
23
- }, U.apply(null, arguments);
23
+ }, G.apply(null, arguments);
24
24
  }
25
- var S;
25
+ var j;
26
26
  (function(t) {
27
27
  t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
28
- })(S || (S = {}));
29
- var V = process.env.NODE_ENV !== "production" ? function(t) {
28
+ })(j || (j = {}));
29
+ var at = process.env.NODE_ENV !== "production" ? function(t) {
30
30
  return Object.freeze(t);
31
31
  } : function(t) {
32
32
  return t;
33
33
  };
34
- function X(t, i) {
34
+ function Mt(t, r) {
35
35
  {
36
- typeof console < "u" && console.warn(i);
36
+ typeof console < "u" && console.warn(r);
37
37
  try {
38
- throw new Error(i);
38
+ throw new Error(r);
39
39
  } catch {
40
40
  }
41
41
  }
42
42
  }
43
- var F = "beforeunload", Z = "popstate";
44
- function tt(t) {
43
+ var st = "beforeunload", Ht = "popstate";
44
+ function Wt(t) {
45
45
  t === void 0 && (t = {});
46
- var i = t, n = i.window, r = n === void 0 ? document.defaultView : n, o = r.history;
47
- function a() {
48
- var d = r.location, m = d.pathname, P = d.search, b = d.hash, O = o.state || {};
49
- return [O.idx, V({
46
+ var r = t, e = r.window, n = e === void 0 ? document.defaultView : e, o = n.history;
47
+ function i() {
48
+ var p = n.location, m = p.pathname, _ = p.search, x = p.hash, O = o.state || {};
49
+ return [O.idx, at({
50
50
  pathname: m,
51
- search: P,
52
- hash: b,
51
+ search: _,
52
+ hash: x,
53
53
  state: O.usr || null,
54
54
  key: O.key || "default"
55
55
  })];
56
56
  }
57
- var s = null;
58
- function l() {
59
- if (s)
60
- h.call(s), s = null;
57
+ var a = null;
58
+ function c() {
59
+ if (a)
60
+ l.call(a), a = null;
61
61
  else {
62
- var d = S.Pop, m = a(), P = m[0], b = m[1];
63
- if (h.length)
64
- if (P != null) {
65
- var O = f - P;
66
- O && (s = {
67
- action: d,
68
- location: b,
62
+ var p = j.Pop, m = i(), _ = m[0], x = m[1];
63
+ if (l.length)
64
+ if (_ != null) {
65
+ var O = f - _;
66
+ O && (a = {
67
+ action: p,
68
+ location: x,
69
69
  retry: function() {
70
- j(O * -1);
70
+ U(O * -1);
71
71
  }
72
- }, j(O));
72
+ }, U(O));
73
73
  } else
74
- process.env.NODE_ENV !== "production" && X(
74
+ process.env.NODE_ENV !== "production" && Mt(
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
@@ -79,147 +79,1115 @@ function tt(t) {
79
79
  "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
80
80
  );
81
81
  else
82
- R(d);
82
+ A(p);
83
83
  }
84
84
  }
85
- r.addEventListener(Z, l);
86
- var e = S.Pop, u = a(), f = u[0], p = u[1], c = M(), h = M();
87
- f == null && (f = 0, o.replaceState(U({}, o.state, {
85
+ n.addEventListener(Ht, c);
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, {
88
88
  idx: f
89
89
  }), ""));
90
- function y(d) {
91
- return typeof d == "string" ? d : nt(d);
90
+ function y(p) {
91
+ return typeof p == "string" ? p : Yt(p);
92
92
  }
93
- function v(d, m) {
94
- return m === void 0 && (m = null), V(U({
95
- pathname: p.pathname,
93
+ function w(p, m) {
94
+ return m === void 0 && (m = null), at(G({
95
+ pathname: h.pathname,
96
96
  hash: "",
97
97
  search: ""
98
- }, typeof d == "string" ? rt(d) : d, {
98
+ }, typeof p == "string" ? Bt(p) : p, {
99
99
  state: m,
100
- key: et()
100
+ key: zt()
101
101
  }));
102
102
  }
103
- function w(d, m) {
103
+ function S(p, m) {
104
104
  return [{
105
- usr: d.state,
106
- key: d.key,
105
+ usr: p.state,
106
+ key: p.key,
107
107
  idx: m
108
- }, y(d)];
108
+ }, y(p)];
109
109
  }
110
- function L(d, m, P) {
111
- return !h.length || (h.call({
112
- action: d,
110
+ function v(p, m, _) {
111
+ return !l.length || (l.call({
112
+ action: p,
113
113
  location: m,
114
- retry: P
114
+ retry: _
115
115
  }), !1);
116
116
  }
117
- function R(d) {
118
- e = d;
119
- var m = a();
120
- f = m[0], p = m[1], c.call({
121
- action: e,
122
- location: p
117
+ function A(p) {
118
+ s = p;
119
+ var m = i();
120
+ f = m[0], h = m[1], d.call({
121
+ action: s,
122
+ location: h
123
123
  });
124
124
  }
125
- function x(d, m) {
126
- var P = S.Push, b = v(d, m);
125
+ function ot(p, m) {
126
+ var _ = j.Push, x = w(p, m);
127
127
  function O() {
128
- x(d, m);
128
+ ot(p, m);
129
129
  }
130
- if (L(P, b, O)) {
131
- var _ = w(b, f + 1), I = _[0], A = _[1];
130
+ if (v(_, x, O)) {
131
+ var T = S(x, f + 1), Y = T[0], C = T[1];
132
132
  try {
133
- o.pushState(I, "", A);
133
+ o.pushState(Y, "", C);
134
134
  } catch {
135
- r.location.assign(A);
135
+ n.location.assign(C);
136
136
  }
137
- R(P);
137
+ A(_);
138
138
  }
139
139
  }
140
- function D(d, m) {
141
- var P = S.Replace, b = v(d, m);
140
+ function it(p, m) {
141
+ var _ = j.Replace, x = w(p, m);
142
142
  function O() {
143
- D(d, m);
143
+ it(p, m);
144
144
  }
145
- if (L(P, b, O)) {
146
- var _ = w(b, f), I = _[0], A = _[1];
147
- o.replaceState(I, "", A), R(P);
145
+ if (v(_, x, O)) {
146
+ var T = S(x, f), Y = T[0], C = T[1];
147
+ o.replaceState(Y, "", C), A(_);
148
148
  }
149
149
  }
150
- function j(d) {
151
- o.go(d);
150
+ function U(p) {
151
+ o.go(p);
152
152
  }
153
- var z = {
153
+ var qt = {
154
154
  get action() {
155
- return e;
155
+ return s;
156
156
  },
157
157
  get location() {
158
- return p;
158
+ return h;
159
159
  },
160
160
  createHref: y,
161
- push: x,
162
- replace: D,
163
- go: j,
161
+ push: ot,
162
+ replace: it,
163
+ go: U,
164
164
  back: function() {
165
- j(-1);
165
+ U(-1);
166
166
  },
167
167
  forward: function() {
168
- j(1);
168
+ U(1);
169
169
  },
170
170
  listen: function(m) {
171
- return c.push(m);
171
+ return d.push(m);
172
172
  },
173
173
  block: function(m) {
174
- var P = h.push(m);
175
- return h.length === 1 && r.addEventListener(F, G), function() {
176
- P(), h.length || r.removeEventListener(F, G);
174
+ var _ = l.push(m);
175
+ return l.length === 1 && n.addEventListener(st, ct), function() {
176
+ _(), l.length || n.removeEventListener(st, ct);
177
177
  };
178
178
  }
179
179
  };
180
- return z;
180
+ return qt;
181
181
  }
182
- function G(t) {
182
+ function ct(t) {
183
183
  t.preventDefault(), t.returnValue = "";
184
184
  }
185
- function M() {
185
+ function ut() {
186
186
  var t = [];
187
187
  return {
188
188
  get length() {
189
189
  return t.length;
190
190
  },
191
- push: function(n) {
192
- return t.push(n), function() {
193
- t = t.filter(function(r) {
194
- return r !== n;
191
+ push: function(e) {
192
+ return t.push(e), function() {
193
+ t = t.filter(function(n) {
194
+ return n !== e;
195
195
  });
196
196
  };
197
197
  },
198
- call: function(n) {
199
- t.forEach(function(r) {
200
- return r && r(n);
198
+ call: function(e) {
199
+ t.forEach(function(n) {
200
+ return n && n(e);
201
201
  });
202
202
  }
203
203
  };
204
204
  }
205
- function et() {
205
+ function zt() {
206
206
  return Math.random().toString(36).substr(2, 8);
207
207
  }
208
- function nt(t) {
209
- var i = t.pathname, n = i === void 0 ? "/" : i, r = t.search, o = r === void 0 ? "" : r, a = t.hash, s = a === void 0 ? "" : a;
210
- return o && o !== "?" && (n += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (n += s.charAt(0) === "#" ? s : "#" + s), n;
208
+ function Yt(t) {
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
+ return o && o !== "?" && (e += o.charAt(0) === "?" ? o : "?" + o), a && a !== "#" && (e += a.charAt(0) === "#" ? a : "#" + a), e;
211
211
  }
212
- function rt(t) {
213
- var i = {};
212
+ function Bt(t) {
213
+ var r = {};
214
214
  if (t) {
215
- var n = t.indexOf("#");
216
- n >= 0 && (i.hash = t.substr(n), t = t.substr(0, n));
217
- var r = t.indexOf("?");
218
- r >= 0 && (i.search = t.substr(r), t = t.substr(0, r)), t && (i.pathname = t);
215
+ var e = t.indexOf("#");
216
+ e >= 0 && (r.hash = t.substr(e), t = t.substr(0, e));
217
+ var n = t.indexOf("?");
218
+ n >= 0 && (r.search = t.substr(n), t = t.substr(0, n)), t && (r.pathname = t);
219
+ }
220
+ return r;
221
+ }
222
+ var Q = function(t, r) {
223
+ return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
224
+ e.__proto__ = n;
225
+ } || function(e, n) {
226
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
227
+ }, Q(t, r);
228
+ };
229
+ function N(t, r) {
230
+ if (typeof r != "function" && r !== null)
231
+ throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
232
+ Q(t, r);
233
+ function e() {
234
+ this.constructor = t;
235
+ }
236
+ t.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e());
237
+ }
238
+ function Jt(t, r, e, n) {
239
+ function o(i) {
240
+ return i instanceof e ? i : new e(function(a) {
241
+ a(i);
242
+ });
243
+ }
244
+ return new (e || (e = Promise))(function(i, a) {
245
+ function c(f) {
246
+ try {
247
+ u(n.next(f));
248
+ } catch (h) {
249
+ a(h);
250
+ }
251
+ }
252
+ function s(f) {
253
+ try {
254
+ u(n.throw(f));
255
+ } catch (h) {
256
+ a(h);
257
+ }
258
+ }
259
+ function u(f) {
260
+ f.done ? i(f.value) : o(f.value).then(c, s);
261
+ }
262
+ u((n = n.apply(t, r || [])).next());
263
+ });
264
+ }
265
+ function vt(t, r) {
266
+ var e = { label: 0, sent: function() {
267
+ if (i[0] & 1) throw i[1];
268
+ return i[1];
269
+ }, trys: [], ops: [] }, n, o, i, a = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
270
+ return a.next = c(0), a.throw = c(1), a.return = c(2), typeof Symbol == "function" && (a[Symbol.iterator] = function() {
271
+ return this;
272
+ }), a;
273
+ function c(u) {
274
+ return function(f) {
275
+ return s([u, f]);
276
+ };
277
+ }
278
+ function s(u) {
279
+ if (n) throw new TypeError("Generator is already executing.");
280
+ for (; a && (a = 0, u[0] && (e = 0)), e; ) try {
281
+ if (n = 1, o && (i = u[0] & 2 ? o.return : u[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, u[1])).done) return i;
282
+ switch (o = 0, i && (u = [u[0] & 2, i.value]), u[0]) {
283
+ case 0:
284
+ case 1:
285
+ i = u;
286
+ break;
287
+ case 4:
288
+ return e.label++, { value: u[1], done: !1 };
289
+ case 5:
290
+ e.label++, o = u[1], u = [0];
291
+ continue;
292
+ case 7:
293
+ u = e.ops.pop(), e.trys.pop();
294
+ continue;
295
+ default:
296
+ if (i = e.trys, !(i = i.length > 0 && i[i.length - 1]) && (u[0] === 6 || u[0] === 2)) {
297
+ e = 0;
298
+ continue;
299
+ }
300
+ if (u[0] === 3 && (!i || u[1] > i[0] && u[1] < i[3])) {
301
+ e.label = u[1];
302
+ break;
303
+ }
304
+ if (u[0] === 6 && e.label < i[1]) {
305
+ e.label = i[1], i = u;
306
+ break;
307
+ }
308
+ if (i && e.label < i[2]) {
309
+ e.label = i[2], e.ops.push(u);
310
+ break;
311
+ }
312
+ i[2] && e.ops.pop(), e.trys.pop();
313
+ continue;
314
+ }
315
+ u = r.call(t, e);
316
+ } catch (f) {
317
+ u = [6, f], o = 0;
318
+ } finally {
319
+ n = i = 0;
320
+ }
321
+ if (u[0] & 5) throw u[1];
322
+ return { value: u[0] ? u[1] : void 0, done: !0 };
323
+ }
324
+ }
325
+ function L(t) {
326
+ var r = typeof Symbol == "function" && Symbol.iterator, e = r && t[r], n = 0;
327
+ if (e) return e.call(t);
328
+ if (t && typeof t.length == "number") return {
329
+ next: function() {
330
+ return t && n >= t.length && (t = void 0), { value: t && t[n++], done: !t };
331
+ }
332
+ };
333
+ throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
334
+ }
335
+ function X(t, r) {
336
+ var e = typeof Symbol == "function" && t[Symbol.iterator];
337
+ if (!e) return t;
338
+ var n = e.call(t), o, i = [], a;
339
+ try {
340
+ for (; (r === void 0 || r-- > 0) && !(o = n.next()).done; ) i.push(o.value);
341
+ } catch (c) {
342
+ a = { error: c };
343
+ } finally {
344
+ try {
345
+ o && !o.done && (e = n.return) && e.call(n);
346
+ } finally {
347
+ if (a) throw a.error;
348
+ }
219
349
  }
220
350
  return i;
221
351
  }
222
- const ot = tt(), g = W.proxy({
352
+ function Z(t, r, e) {
353
+ if (e || arguments.length === 2) for (var n = 0, o = r.length, i; n < o; n++)
354
+ (i || !(n in r)) && (i || (i = Array.prototype.slice.call(r, 0, n)), i[n] = r[n]);
355
+ return t.concat(i || Array.prototype.slice.call(r));
356
+ }
357
+ function k(t) {
358
+ return this instanceof k ? (this.v = t, this) : new k(t);
359
+ }
360
+ function Kt(t, r, e) {
361
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
362
+ var n = e.apply(t, r || []), o, i = [];
363
+ return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), c("next"), c("throw"), c("return", a), o[Symbol.asyncIterator] = function() {
364
+ return this;
365
+ }, o;
366
+ function a(l) {
367
+ return function(y) {
368
+ return Promise.resolve(y).then(l, h);
369
+ };
370
+ }
371
+ function c(l, y) {
372
+ n[l] && (o[l] = function(w) {
373
+ return new Promise(function(S, v) {
374
+ i.push([l, w, S, v]) > 1 || s(l, w);
375
+ });
376
+ }, y && (o[l] = y(o[l])));
377
+ }
378
+ function s(l, y) {
379
+ try {
380
+ u(n[l](y));
381
+ } catch (w) {
382
+ d(i[0][3], w);
383
+ }
384
+ }
385
+ function u(l) {
386
+ l.value instanceof k ? Promise.resolve(l.value.v).then(f, h) : d(i[0][2], l);
387
+ }
388
+ function f(l) {
389
+ s("next", l);
390
+ }
391
+ function h(l) {
392
+ s("throw", l);
393
+ }
394
+ function d(l, y) {
395
+ l(y), i.shift(), i.length && s(i[0][0], i[0][1]);
396
+ }
397
+ }
398
+ function Qt(t) {
399
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
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() {
402
+ return this;
403
+ }, e);
404
+ function n(i) {
405
+ e[i] = t[i] && function(a) {
406
+ return new Promise(function(c, s) {
407
+ a = t[i](a), o(c, s, a.done, a.value);
408
+ });
409
+ };
410
+ }
411
+ function o(i, a, c, s) {
412
+ Promise.resolve(s).then(function(u) {
413
+ i({ value: u, done: c });
414
+ }, a);
415
+ }
416
+ }
417
+ function g(t) {
418
+ return typeof t == "function";
419
+ }
420
+ function yt(t) {
421
+ var r = function(n) {
422
+ Error.call(n), n.stack = new Error().stack;
423
+ }, e = t(r);
424
+ return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
425
+ }
426
+ var B = yt(function(t) {
427
+ return function(e) {
428
+ t(this), this.message = e ? e.length + ` errors occurred during unsubscription:
429
+ ` + e.map(function(n, o) {
430
+ return o + 1 + ") " + n.toString();
431
+ }).join(`
432
+ `) : "", this.name = "UnsubscriptionError", this.errors = e;
433
+ };
434
+ });
435
+ function tt(t, r) {
436
+ if (t) {
437
+ var e = t.indexOf(r);
438
+ 0 <= e && t.splice(e, 1);
439
+ }
440
+ }
441
+ var H = function() {
442
+ function t(r) {
443
+ this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
444
+ }
445
+ return t.prototype.unsubscribe = function() {
446
+ var r, e, n, o, i;
447
+ if (!this.closed) {
448
+ this.closed = !0;
449
+ var a = this._parentage;
450
+ if (a)
451
+ if (this._parentage = null, Array.isArray(a))
452
+ try {
453
+ for (var c = L(a), s = c.next(); !s.done; s = c.next()) {
454
+ var u = s.value;
455
+ u.remove(this);
456
+ }
457
+ } catch (w) {
458
+ r = { error: w };
459
+ } finally {
460
+ try {
461
+ s && !s.done && (e = c.return) && e.call(c);
462
+ } finally {
463
+ if (r) throw r.error;
464
+ }
465
+ }
466
+ else
467
+ a.remove(this);
468
+ var f = this.initialTeardown;
469
+ if (g(f))
470
+ try {
471
+ f();
472
+ } catch (w) {
473
+ i = w instanceof B ? w.errors : [w];
474
+ }
475
+ var h = this._finalizers;
476
+ if (h) {
477
+ this._finalizers = null;
478
+ try {
479
+ for (var d = L(h), l = d.next(); !l.done; l = d.next()) {
480
+ var y = l.value;
481
+ try {
482
+ lt(y);
483
+ } catch (w) {
484
+ i = i ?? [], w instanceof B ? i = Z(Z([], X(i)), X(w.errors)) : i.push(w);
485
+ }
486
+ }
487
+ } catch (w) {
488
+ n = { error: w };
489
+ } finally {
490
+ try {
491
+ l && !l.done && (o = d.return) && o.call(d);
492
+ } finally {
493
+ if (n) throw n.error;
494
+ }
495
+ }
496
+ }
497
+ if (i)
498
+ throw new B(i);
499
+ }
500
+ }, t.prototype.add = function(r) {
501
+ var e;
502
+ if (r && r !== this)
503
+ if (this.closed)
504
+ lt(r);
505
+ else {
506
+ if (r instanceof t) {
507
+ if (r.closed || r._hasParent(this))
508
+ return;
509
+ r._addParent(this);
510
+ }
511
+ (this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(r);
512
+ }
513
+ }, t.prototype._hasParent = function(r) {
514
+ var e = this._parentage;
515
+ return e === r || Array.isArray(e) && e.includes(r);
516
+ }, t.prototype._addParent = function(r) {
517
+ var e = this._parentage;
518
+ this._parentage = Array.isArray(e) ? (e.push(r), e) : e ? [e, r] : r;
519
+ }, t.prototype._removeParent = function(r) {
520
+ var e = this._parentage;
521
+ e === r ? this._parentage = null : Array.isArray(e) && tt(e, r);
522
+ }, t.prototype.remove = function(r) {
523
+ var e = this._finalizers;
524
+ e && tt(e, r), r instanceof t && r._removeParent(this);
525
+ }, t.EMPTY = function() {
526
+ var r = new t();
527
+ return r.closed = !0, r;
528
+ }(), t;
529
+ }(), wt = H.EMPTY;
530
+ function mt(t) {
531
+ return t instanceof H || t && "closed" in t && g(t.remove) && g(t.add) && g(t.unsubscribe);
532
+ }
533
+ function lt(t) {
534
+ g(t) ? t() : t.unsubscribe();
535
+ }
536
+ var Xt = {
537
+ Promise: void 0
538
+ }, Zt = {
539
+ setTimeout: function(t, r) {
540
+ for (var e = [], n = 2; n < arguments.length; n++)
541
+ e[n - 2] = arguments[n];
542
+ return setTimeout.apply(void 0, Z([t, r], X(e)));
543
+ },
544
+ clearTimeout: function(t) {
545
+ return clearTimeout(t);
546
+ },
547
+ delegate: void 0
548
+ };
549
+ function bt(t) {
550
+ Zt.setTimeout(function() {
551
+ throw t;
552
+ });
553
+ }
554
+ function ft() {
555
+ }
556
+ function F(t) {
557
+ t();
558
+ }
559
+ var rt = function(t) {
560
+ N(r, t);
561
+ function r(e) {
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;
564
+ }
565
+ return r.create = function(e, n, o) {
566
+ return new et(e, n, o);
567
+ }, r.prototype.next = function(e) {
568
+ this.isStopped || this._next(e);
569
+ }, r.prototype.error = function(e) {
570
+ this.isStopped || (this.isStopped = !0, this._error(e));
571
+ }, r.prototype.complete = function() {
572
+ this.isStopped || (this.isStopped = !0, this._complete());
573
+ }, r.prototype.unsubscribe = function() {
574
+ this.closed || (this.isStopped = !0, t.prototype.unsubscribe.call(this), this.destination = null);
575
+ }, r.prototype._next = function(e) {
576
+ this.destination.next(e);
577
+ }, r.prototype._error = function(e) {
578
+ try {
579
+ this.destination.error(e);
580
+ } finally {
581
+ this.unsubscribe();
582
+ }
583
+ }, r.prototype._complete = function() {
584
+ try {
585
+ this.destination.complete();
586
+ } finally {
587
+ this.unsubscribe();
588
+ }
589
+ }, r;
590
+ }(H), te = function() {
591
+ function t(r) {
592
+ this.partialObserver = r;
593
+ }
594
+ return t.prototype.next = function(r) {
595
+ var e = this.partialObserver;
596
+ if (e.next)
597
+ try {
598
+ e.next(r);
599
+ } catch (n) {
600
+ q(n);
601
+ }
602
+ }, t.prototype.error = function(r) {
603
+ var e = this.partialObserver;
604
+ if (e.error)
605
+ try {
606
+ e.error(r);
607
+ } catch (n) {
608
+ q(n);
609
+ }
610
+ else
611
+ q(r);
612
+ }, t.prototype.complete = function() {
613
+ var r = this.partialObserver;
614
+ if (r.complete)
615
+ try {
616
+ r.complete();
617
+ } catch (e) {
618
+ q(e);
619
+ }
620
+ }, t;
621
+ }(), et = function(t) {
622
+ N(r, t);
623
+ function r(e, n, o) {
624
+ var i = t.call(this) || this, a;
625
+ return g(e) || !e ? a = {
626
+ next: e ?? void 0,
627
+ error: n ?? void 0,
628
+ complete: o ?? void 0
629
+ } : a = e, i.destination = new te(a), i;
630
+ }
631
+ return r;
632
+ }(rt);
633
+ function q(t) {
634
+ bt(t);
635
+ }
636
+ function ee(t) {
637
+ throw t;
638
+ }
639
+ var re = {
640
+ closed: !0,
641
+ next: ft,
642
+ error: ee,
643
+ complete: ft
644
+ }, nt = function() {
645
+ return typeof Symbol == "function" && Symbol.observable || "@@observable";
646
+ }();
647
+ function ne(t) {
648
+ return t;
649
+ }
650
+ function oe(t) {
651
+ return t.length === 0 ? ne : t.length === 1 ? t[0] : function(e) {
652
+ return t.reduce(function(n, o) {
653
+ return o(n);
654
+ }, e);
655
+ };
656
+ }
657
+ var P = function() {
658
+ function t(r) {
659
+ r && (this._subscribe = r);
660
+ }
661
+ return t.prototype.lift = function(r) {
662
+ var e = new t();
663
+ return e.source = this, e.operator = r, e;
664
+ }, t.prototype.subscribe = function(r, e, n) {
665
+ var o = this, i = ae(r) ? r : new et(r, e, n);
666
+ return F(function() {
667
+ var a = o, c = a.operator, s = a.source;
668
+ i.add(c ? c.call(i, s) : s ? o._subscribe(i) : o._trySubscribe(i));
669
+ }), i;
670
+ }, t.prototype._trySubscribe = function(r) {
671
+ try {
672
+ return this._subscribe(r);
673
+ } catch (e) {
674
+ r.error(e);
675
+ }
676
+ }, t.prototype.forEach = function(r, e) {
677
+ var n = this;
678
+ return e = ht(e), new e(function(o, i) {
679
+ var a = new et({
680
+ next: function(c) {
681
+ try {
682
+ r(c);
683
+ } catch (s) {
684
+ i(s), a.unsubscribe();
685
+ }
686
+ },
687
+ error: i,
688
+ complete: o
689
+ });
690
+ n.subscribe(a);
691
+ });
692
+ }, t.prototype._subscribe = function(r) {
693
+ var e;
694
+ return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(r);
695
+ }, t.prototype[nt] = function() {
696
+ return this;
697
+ }, t.prototype.pipe = function() {
698
+ for (var r = [], e = 0; e < arguments.length; e++)
699
+ r[e] = arguments[e];
700
+ return oe(r)(this);
701
+ }, t.prototype.toPromise = function(r) {
702
+ var e = this;
703
+ return r = ht(r), new r(function(n, o) {
704
+ var i;
705
+ e.subscribe(function(a) {
706
+ return i = a;
707
+ }, function(a) {
708
+ return o(a);
709
+ }, function() {
710
+ return n(i);
711
+ });
712
+ });
713
+ }, t.create = function(r) {
714
+ return new t(r);
715
+ }, t;
716
+ }();
717
+ function ht(t) {
718
+ var r;
719
+ return (r = t ?? Xt.Promise) !== null && r !== void 0 ? r : Promise;
720
+ }
721
+ function ie(t) {
722
+ return t && g(t.next) && g(t.error) && g(t.complete);
723
+ }
724
+ function ae(t) {
725
+ return t && t instanceof rt || ie(t) && mt(t);
726
+ }
727
+ function se(t) {
728
+ return g(t == null ? void 0 : t.lift);
729
+ }
730
+ function W(t) {
731
+ return function(r) {
732
+ if (se(r))
733
+ return r.lift(function(e) {
734
+ try {
735
+ return t(e, this);
736
+ } catch (n) {
737
+ this.error(n);
738
+ }
739
+ });
740
+ throw new TypeError("Unable to lift unknown Observable type");
741
+ };
742
+ }
743
+ function V(t, r, e, n, o) {
744
+ return new ce(t, r, e, n, o);
745
+ }
746
+ var ce = function(t) {
747
+ N(r, t);
748
+ function r(e, n, o, i, a, c) {
749
+ var s = t.call(this, e) || this;
750
+ return s.onFinalize = a, s.shouldUnsubscribe = c, s._next = n ? function(u) {
751
+ try {
752
+ n(u);
753
+ } catch (f) {
754
+ e.error(f);
755
+ }
756
+ } : t.prototype._next, s._error = i ? function(u) {
757
+ try {
758
+ i(u);
759
+ } catch (f) {
760
+ e.error(f);
761
+ } finally {
762
+ this.unsubscribe();
763
+ }
764
+ } : t.prototype._error, s._complete = o ? function() {
765
+ try {
766
+ o();
767
+ } catch (u) {
768
+ e.error(u);
769
+ } finally {
770
+ this.unsubscribe();
771
+ }
772
+ } : t.prototype._complete, s;
773
+ }
774
+ return r.prototype.unsubscribe = function() {
775
+ var e;
776
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
777
+ var n = this.closed;
778
+ t.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
779
+ }
780
+ }, r;
781
+ }(rt), ue = yt(function(t) {
782
+ return function() {
783
+ t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
784
+ };
785
+ }), gt = function(t) {
786
+ N(r, t);
787
+ function r() {
788
+ var e = t.call(this) || this;
789
+ return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
790
+ }
791
+ return r.prototype.lift = function(e) {
792
+ var n = new dt(this, this);
793
+ return n.operator = e, n;
794
+ }, r.prototype._throwIfClosed = function() {
795
+ if (this.closed)
796
+ throw new ue();
797
+ }, r.prototype.next = function(e) {
798
+ var n = this;
799
+ F(function() {
800
+ var o, i;
801
+ if (n._throwIfClosed(), !n.isStopped) {
802
+ n.currentObservers || (n.currentObservers = Array.from(n.observers));
803
+ try {
804
+ for (var a = L(n.currentObservers), c = a.next(); !c.done; c = a.next()) {
805
+ var s = c.value;
806
+ s.next(e);
807
+ }
808
+ } catch (u) {
809
+ o = { error: u };
810
+ } finally {
811
+ try {
812
+ c && !c.done && (i = a.return) && i.call(a);
813
+ } finally {
814
+ if (o) throw o.error;
815
+ }
816
+ }
817
+ }
818
+ });
819
+ }, r.prototype.error = function(e) {
820
+ var n = this;
821
+ F(function() {
822
+ if (n._throwIfClosed(), !n.isStopped) {
823
+ n.hasError = n.isStopped = !0, n.thrownError = e;
824
+ for (var o = n.observers; o.length; )
825
+ o.shift().error(e);
826
+ }
827
+ });
828
+ }, r.prototype.complete = function() {
829
+ var e = this;
830
+ F(function() {
831
+ if (e._throwIfClosed(), !e.isStopped) {
832
+ e.isStopped = !0;
833
+ for (var n = e.observers; n.length; )
834
+ n.shift().complete();
835
+ }
836
+ });
837
+ }, r.prototype.unsubscribe = function() {
838
+ this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
839
+ }, Object.defineProperty(r.prototype, "observed", {
840
+ get: function() {
841
+ var e;
842
+ return ((e = this.observers) === null || e === void 0 ? void 0 : e.length) > 0;
843
+ },
844
+ enumerable: !1,
845
+ configurable: !0
846
+ }), r.prototype._trySubscribe = function(e) {
847
+ return this._throwIfClosed(), t.prototype._trySubscribe.call(this, e);
848
+ }, r.prototype._subscribe = function(e) {
849
+ return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
850
+ }, r.prototype._innerSubscribe = function(e) {
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() {
853
+ n.currentObservers = null, tt(c, e);
854
+ }));
855
+ }, r.prototype._checkFinalizedStatuses = function(e) {
856
+ var n = this, o = n.hasError, i = n.thrownError, a = n.isStopped;
857
+ o ? e.error(i) : a && e.complete();
858
+ }, r.prototype.asObservable = function() {
859
+ var e = new P();
860
+ return e.source = this, e;
861
+ }, r.create = function(e, n) {
862
+ return new dt(e, n);
863
+ }, r;
864
+ }(P), dt = function(t) {
865
+ N(r, t);
866
+ function r(e, n) {
867
+ var o = t.call(this) || this;
868
+ return o.destination = e, o.source = n, o;
869
+ }
870
+ return r.prototype.next = function(e) {
871
+ var n, o;
872
+ (o = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || o === void 0 || o.call(n, e);
873
+ }, r.prototype.error = function(e) {
874
+ var n, o;
875
+ (o = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || o === void 0 || o.call(n, e);
876
+ }, r.prototype.complete = function() {
877
+ var e, n;
878
+ (n = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || n === void 0 || n.call(e);
879
+ }, r.prototype._subscribe = function(e) {
880
+ var n, o;
881
+ return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(e)) !== null && o !== void 0 ? o : wt;
882
+ }, r;
883
+ }(gt), St = function(t) {
884
+ return t && typeof t.length == "number" && typeof t != "function";
885
+ };
886
+ function _t(t) {
887
+ return g(t == null ? void 0 : t.then);
888
+ }
889
+ function Et(t) {
890
+ return g(t[nt]);
891
+ }
892
+ function Ot(t) {
893
+ return Symbol.asyncIterator && g(t == null ? void 0 : t[Symbol.asyncIterator]);
894
+ }
895
+ function Pt(t) {
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
+ }
898
+ function le() {
899
+ return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
900
+ }
901
+ var xt = le();
902
+ function It(t) {
903
+ return g(t == null ? void 0 : t[xt]);
904
+ }
905
+ function At(t) {
906
+ return Kt(this, arguments, function() {
907
+ var e, n, o, i;
908
+ return vt(this, function(a) {
909
+ switch (a.label) {
910
+ case 0:
911
+ e = t.getReader(), a.label = 1;
912
+ case 1:
913
+ a.trys.push([1, , 9, 10]), a.label = 2;
914
+ case 2:
915
+ return [4, k(e.read())];
916
+ case 3:
917
+ return n = a.sent(), o = n.value, i = n.done, i ? [4, k(void 0)] : [3, 5];
918
+ case 4:
919
+ return [2, a.sent()];
920
+ case 5:
921
+ return [4, k(o)];
922
+ case 6:
923
+ return [4, a.sent()];
924
+ case 7:
925
+ return a.sent(), [3, 2];
926
+ case 8:
927
+ return [3, 10];
928
+ case 9:
929
+ return e.releaseLock(), [7];
930
+ case 10:
931
+ return [2];
932
+ }
933
+ });
934
+ });
935
+ }
936
+ function Tt(t) {
937
+ return g(t == null ? void 0 : t.getReader);
938
+ }
939
+ function z(t) {
940
+ if (t instanceof P)
941
+ return t;
942
+ if (t != null) {
943
+ if (Et(t))
944
+ return fe(t);
945
+ if (St(t))
946
+ return he(t);
947
+ if (_t(t))
948
+ return de(t);
949
+ if (Ot(t))
950
+ return Rt(t);
951
+ if (It(t))
952
+ return pe(t);
953
+ if (Tt(t))
954
+ return ve(t);
955
+ }
956
+ throw Pt(t);
957
+ }
958
+ function fe(t) {
959
+ return new P(function(r) {
960
+ var e = t[nt]();
961
+ if (g(e.subscribe))
962
+ return e.subscribe(r);
963
+ throw new TypeError("Provided object does not correctly implement Symbol.observable");
964
+ });
965
+ }
966
+ function he(t) {
967
+ return new P(function(r) {
968
+ for (var e = 0; e < t.length && !r.closed; e++)
969
+ r.next(t[e]);
970
+ r.complete();
971
+ });
972
+ }
973
+ function de(t) {
974
+ return new P(function(r) {
975
+ t.then(function(e) {
976
+ r.closed || (r.next(e), r.complete());
977
+ }, function(e) {
978
+ return r.error(e);
979
+ }).then(null, bt);
980
+ });
981
+ }
982
+ function pe(t) {
983
+ return new P(function(r) {
984
+ var e, n;
985
+ try {
986
+ for (var o = L(t), i = o.next(); !i.done; i = o.next()) {
987
+ var a = i.value;
988
+ if (r.next(a), r.closed)
989
+ return;
990
+ }
991
+ } catch (c) {
992
+ e = { error: c };
993
+ } finally {
994
+ try {
995
+ i && !i.done && (n = o.return) && n.call(o);
996
+ } finally {
997
+ if (e) throw e.error;
998
+ }
999
+ }
1000
+ r.complete();
1001
+ });
1002
+ }
1003
+ function Rt(t) {
1004
+ return new P(function(r) {
1005
+ ye(t, r).catch(function(e) {
1006
+ return r.error(e);
1007
+ });
1008
+ });
1009
+ }
1010
+ function ve(t) {
1011
+ return Rt(At(t));
1012
+ }
1013
+ function ye(t, r) {
1014
+ var e, n, o, i;
1015
+ return Jt(this, void 0, void 0, function() {
1016
+ var a, c;
1017
+ return vt(this, function(s) {
1018
+ switch (s.label) {
1019
+ case 0:
1020
+ s.trys.push([0, 5, 6, 11]), e = Qt(t), s.label = 1;
1021
+ case 1:
1022
+ return [4, e.next()];
1023
+ case 2:
1024
+ if (n = s.sent(), !!n.done) return [3, 4];
1025
+ if (a = n.value, r.next(a), r.closed)
1026
+ return [2];
1027
+ s.label = 3;
1028
+ case 3:
1029
+ return [3, 1];
1030
+ case 4:
1031
+ return [3, 11];
1032
+ case 5:
1033
+ return c = s.sent(), o = { error: c }, [3, 11];
1034
+ case 6:
1035
+ return s.trys.push([6, , 9, 10]), n && !n.done && (i = e.return) ? [4, i.call(e)] : [3, 8];
1036
+ case 7:
1037
+ s.sent(), s.label = 8;
1038
+ case 8:
1039
+ return [3, 10];
1040
+ case 9:
1041
+ if (o) throw o.error;
1042
+ return [7];
1043
+ case 10:
1044
+ return [7];
1045
+ case 11:
1046
+ return r.complete(), [2];
1047
+ }
1048
+ });
1049
+ });
1050
+ }
1051
+ function I(t, r, e, n, o) {
1052
+ n === void 0 && (n = 0), o === void 0 && (o = !1);
1053
+ var i = r.schedule(function() {
1054
+ e(), o ? t.add(this.schedule(null, n)) : this.unsubscribe();
1055
+ }, n);
1056
+ if (t.add(i), !o)
1057
+ return i;
1058
+ }
1059
+ function jt(t, r) {
1060
+ return r === void 0 && (r = 0), W(function(e, n) {
1061
+ e.subscribe(V(n, function(o) {
1062
+ return I(n, t, function() {
1063
+ return n.next(o);
1064
+ }, r);
1065
+ }, function() {
1066
+ return I(n, t, function() {
1067
+ return n.complete();
1068
+ }, r);
1069
+ }, function(o) {
1070
+ return I(n, t, function() {
1071
+ return n.error(o);
1072
+ }, r);
1073
+ }));
1074
+ });
1075
+ }
1076
+ function kt(t, r) {
1077
+ return r === void 0 && (r = 0), W(function(e, n) {
1078
+ n.add(t.schedule(function() {
1079
+ return e.subscribe(n);
1080
+ }, r));
1081
+ });
1082
+ }
1083
+ function we(t, r) {
1084
+ return z(t).pipe(kt(r), jt(r));
1085
+ }
1086
+ function me(t, r) {
1087
+ return z(t).pipe(kt(r), jt(r));
1088
+ }
1089
+ function be(t, r) {
1090
+ return new P(function(e) {
1091
+ var n = 0;
1092
+ return r.schedule(function() {
1093
+ n === t.length ? e.complete() : (e.next(t[n++]), e.closed || this.schedule());
1094
+ });
1095
+ });
1096
+ }
1097
+ function ge(t, r) {
1098
+ return new P(function(e) {
1099
+ var n;
1100
+ return I(e, r, function() {
1101
+ n = t[xt](), I(e, r, function() {
1102
+ var o, i, a;
1103
+ try {
1104
+ o = n.next(), i = o.value, a = o.done;
1105
+ } catch (c) {
1106
+ e.error(c);
1107
+ return;
1108
+ }
1109
+ a ? e.complete() : e.next(i);
1110
+ }, 0, !0);
1111
+ }), function() {
1112
+ return g(n == null ? void 0 : n.return) && n.return();
1113
+ };
1114
+ });
1115
+ }
1116
+ function Lt(t, r) {
1117
+ if (!t)
1118
+ throw new Error("Iterable cannot be null");
1119
+ return new P(function(e) {
1120
+ I(e, r, function() {
1121
+ var n = t[Symbol.asyncIterator]();
1122
+ I(e, r, function() {
1123
+ n.next().then(function(o) {
1124
+ o.done ? e.complete() : e.next(o.value);
1125
+ });
1126
+ }, 0, !0);
1127
+ });
1128
+ });
1129
+ }
1130
+ function Se(t, r) {
1131
+ return Lt(At(t), r);
1132
+ }
1133
+ function _e(t, r) {
1134
+ if (t != null) {
1135
+ if (Et(t))
1136
+ return we(t, r);
1137
+ if (St(t))
1138
+ return be(t, r);
1139
+ if (_t(t))
1140
+ return me(t, r);
1141
+ if (Ot(t))
1142
+ return Lt(t, r);
1143
+ if (It(t))
1144
+ return ge(t, r);
1145
+ if (Tt(t))
1146
+ return Se(t, r);
1147
+ }
1148
+ throw Pt(t);
1149
+ }
1150
+ function Ee(t, r) {
1151
+ return r ? _e(t, r) : z(t);
1152
+ }
1153
+ function Oe(t, r) {
1154
+ return W(function(e, n) {
1155
+ var o = 0;
1156
+ e.subscribe(V(n, function(i) {
1157
+ return t.call(r, i, o++) && n.next(i);
1158
+ }));
1159
+ });
1160
+ }
1161
+ function Pe(t, r) {
1162
+ return W(function(e, n) {
1163
+ var o = null, i = 0, a = !1, c = function() {
1164
+ return a && !o && n.complete();
1165
+ };
1166
+ e.subscribe(V(n, function(s) {
1167
+ o == null || o.unsubscribe();
1168
+ var u = 0, f = i++;
1169
+ z(t(s, f)).subscribe(o = V(n, function(h) {
1170
+ return n.next(r ? r(s, h, f, u++) : h);
1171
+ }, function() {
1172
+ o = null, c();
1173
+ }));
1174
+ }, function() {
1175
+ a = !0, c();
1176
+ }));
1177
+ });
1178
+ }
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)))
1184
+ ).subscribe({
1185
+ error: (t) => console.error("[NAVIGATION] Stream error:", t)
1186
+ });
1187
+ function Ie(t) {
1188
+ Ut.next(t);
1189
+ }
1190
+ const b = pt.proxy({
223
1191
  layouts: [],
224
1192
  view: null,
225
1193
  data: null,
@@ -228,192 +1196,214 @@ const ot = tt(), g = W.proxy({
228
1196
  query: null,
229
1197
  page: E
230
1198
  });
231
- function C(...t) {
232
- let i = t.map((n, r) => r === 0 ? n.replace(/\/+$/, "") : n.replace(/^\/+|\/+$/g, "")).join("/");
233
- return i.startsWith("/") || (i = "/" + i), i.split("?")[0];
1199
+ function M(...t) {
1200
+ let r = t.map((e, n) => n === 0 ? e.replace(/\/+$/, "") : e.replace(/^\/+|\/+$/g, "")).join("/");
1201
+ return r.startsWith("/") || (r = "/" + r), r.split("?")[0];
234
1202
  }
235
- async function at(t, i, n, r, o, a) {
1203
+ async function Ae(t, r, e, n, o, i) {
236
1204
  try {
237
- const s = typeof i == "string" && i.indexOf("assets") !== -1, l = (n.layout || []).map((p) => {
238
- let c = C(i, p).toString();
239
- return s && (c = c.endsWith(".svelte") ? c.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(c) ? c : c + ".js"), c;
1205
+ const a = typeof r == "string" && r.indexOf("assets") !== -1, c = (e.layout || []).map((h) => {
1206
+ let d = M(r, h).toString();
1207
+ return a && (d = d.endsWith(".svelte") ? d.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(d) ? d : d + ".js"), d;
240
1208
  });
241
- let e = C(i, n.view).toString();
242
- s && (e = e.endsWith(".svelte") ? e.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(e) ? e : e + ".js");
243
- const u = await Promise.all(l.map((p) => import(
1209
+ let s = M(r, e.view).toString();
1210
+ a && (s = s.endsWith(".svelte") ? s.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(s) ? s : s + ".js");
1211
+ const u = await Promise.all(c.map((h) => import(
244
1212
  /* @vite-ignore */
245
- p
246
- ).then((c) => c.default)));
247
- e.startsWith("/") || (e = "/" + e);
1213
+ h
1214
+ ).then((d) => d.default)));
1215
+ s.startsWith("/") || (s = "/" + s);
248
1216
  const f = await import(
249
1217
  /* @vite-ignore */
250
- e
251
- ).then((p) => p.default);
252
- g.layouts = u, g.view = f, g.params = r, g.data = window.__INITIAL_DATA__, g.urlParams = o, g.query = a, J(Y, { target: t, props: g });
253
- } catch (s) {
254
- console.error("Client-side route loading failed:", s);
1218
+ s
1219
+ ).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 });
1221
+ } catch (a) {
1222
+ console.error("Client-side route loading failed:", a);
255
1223
  }
256
1224
  }
257
- async function T(t, i, n, r, o, a, s = !1, l = !0) {
258
- console.log("[NAVIGATION] updateRoute called", {
1225
+ function $(t, r, e, n, o, i, a = !1, c = !0) {
1226
+ Ie({
259
1227
  url: t,
260
- server_loading: s,
1228
+ base_path: r,
1229
+ route: e,
1230
+ params: n,
1231
+ urlParams: o,
1232
+ query: i,
1233
+ server_loading: a,
1234
+ update: c
1235
+ });
1236
+ }
1237
+ async function Te(t) {
1238
+ const {
1239
+ url: r,
1240
+ base_path: e,
1241
+ route: n,
1242
+ params: o,
1243
+ urlParams: i,
1244
+ query: a,
1245
+ server_loading: c,
1246
+ update: s
1247
+ } = t;
1248
+ console.log("[NAVIGATION] updateRoute called", {
1249
+ url: r,
1250
+ server_loading: c,
261
1251
  route_path: n.path,
262
1252
  route_middleware: n.middleware
263
1253
  });
264
1254
  try {
265
- let e = null, u = !1;
266
- if (s) {
267
- console.log("[NAVIGATION] Making server fetch FIRST for", t);
268
- const v = {
1255
+ let u = null, f = !1;
1256
+ if (c) {
1257
+ console.log("[NAVIGATION] Making server fetch FIRST for", r);
1258
+ const S = {
269
1259
  method: n.method,
270
1260
  headers: {
271
1261
  "Content-Type": "application/json",
272
1262
  Accept: "application/json"
273
1263
  }
274
1264
  };
275
- if (v[H] = !0, await fetch(t, v).then((w) => {
1265
+ if (S[Ct] = !0, await fetch(r, S).then((v) => {
276
1266
  if (console.log("[NAVIGATION] Fetch response", {
277
- url: t,
278
- ok: w.ok,
279
- status: w.status,
280
- type: w.type,
281
- redirected: w.redirected,
282
- finalUrl: w.url
283
- }), w.redirected)
284
- return console.log("[NAVIGATION] Redirect detected, not loading components"), u = !0, null;
285
- if (w.ok)
286
- return w.json();
1267
+ url: r,
1268
+ ok: v.ok,
1269
+ status: v.status,
1270
+ type: v.type,
1271
+ redirected: v.redirected,
1272
+ finalUrl: v.url
1273
+ }), v.redirected)
1274
+ return console.log("[NAVIGATION] Redirect detected, not loading components"), f = !0, null;
1275
+ if (v.ok)
1276
+ return v.json();
287
1277
  throw new Error("Network response was not ok");
288
- }).then((w) => {
289
- e = w;
290
- }), u) {
1278
+ }).then((v) => {
1279
+ u = v;
1280
+ }), f) {
291
1281
  console.log("[NAVIGATION] Exiting early due to redirect");
292
1282
  return;
293
1283
  }
294
1284
  }
295
- const f = typeof i == "string" && i.indexOf("assets") !== -1, p = (n.layout || []).map((v) => {
296
- let w = C(i, v).toString();
297
- return f && (w = w.endsWith(".svelte") ? w.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(w) ? w : w + ".js"), w;
1285
+ const h = typeof e == "string" && e.indexOf("assets") !== -1, d = (n.layout || []).map((S) => {
1286
+ let v = M(e, S).toString();
1287
+ return h && (v = v.endsWith(".svelte") ? v.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(v) ? v : v + ".js"), v;
298
1288
  });
299
- let c = C(i, n.view).toString();
300
- f && (c = c.endsWith(".svelte") ? c.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(c) ? c : c + ".js");
301
- const h = await Promise.all(p.map((v) => import(
1289
+ let l = M(e, n.view).toString();
1290
+ h && (l = l.endsWith(".svelte") ? l.replace(/\.svelte$/, ".js") : /[.][a-z]+$/.test(l) ? l : l + ".js");
1291
+ const y = await Promise.all(d.map((S) => import(
302
1292
  /* @vite-ignore */
303
- v
304
- ).then((w) => w.default))), y = await import(
1293
+ S
1294
+ ).then((v) => v.default))), w = await import(
305
1295
  /* @vite-ignore */
306
- c
307
- ).then((v) => v.default);
308
- s ? (g.data = e, g.params = r, g.layouts = h, g.view = y, g.urlParams = o, g.query = a) : (console.log("[NAVIGATION] No server loading needed for", t), g.data = { layout: [], view: {} }, g.params = r, g.layouts = h, g.view = y, g.urlParams = o, g.query = a), window && window.scroll(0, 0), l && ot.push(t);
309
- } catch (e) {
310
- console.error("Client-side navigation failed for URL:", t, e);
1296
+ l
1297
+ ).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;
1299
+ } catch (u) {
1300
+ console.error("Client-side navigation failed for URL:", r, u);
311
1301
  }
312
1302
  }
313
- const N = W.proxy({});
314
- async function it() {
315
- Object.assign(N, window.__MANIFEST__);
1303
+ const R = pt.proxy({});
1304
+ async function Re() {
1305
+ Object.assign(R, window.__MANIFEST__);
316
1306
  }
317
- function st(t, i, n) {
1307
+ function je(t, r, e) {
318
1308
  if (!document) {
319
1309
  console.error("Document not found");
320
1310
  return;
321
1311
  }
322
- document.addEventListener("click", (r) => {
323
- var s, l;
324
- const o = window.location.pathname, a = ((s = r.target) == null ? void 0 : s.tagName) === "A" ? r.target : (l = r.target) == null ? void 0 : l.closest("A");
325
- if (a) {
326
- let e = a.getAttribute("href");
327
- if (o === e) {
328
- r.preventDefault();
1312
+ document.addEventListener("click", (n) => {
1313
+ var a, c;
1314
+ const o = window.location.pathname, i = ((a = n.target) == null ? void 0 : a.tagName) === "A" ? n.target : (c = n.target) == null ? void 0 : c.closest("A");
1315
+ if (i) {
1316
+ let s = i.getAttribute("href");
1317
+ if (o === s) {
1318
+ n.preventDefault();
329
1319
  return;
330
1320
  }
331
- if (e && e.startsWith("/") || e.startsWith(".")) {
332
- const u = e.split("?")[0], f = a.getAttribute("method") || "get", p = i.find((c) => c.method.toLowerCase() === f && n.find((h) => h.parser(u) && h.pattern === c.path));
333
- if (p) {
334
- r.preventDefault();
335
- const c = n.find((R) => R.parser(u) && R.pattern === p.path), h = (c == null ? void 0 : c.parser(u)) || {}, y = new URLSearchParams(e.split("?")[1] || ""), v = Object.fromEntries(y.entries()) || {}, w = { ...h, ...v }, L = N[c == null ? void 0 : c.pattern];
336
- console.log("[EVENTS] Navigation to", e, {
337
- pattern: c == null ? void 0 : c.pattern,
338
- requires_server_data: L,
339
- manifest_store: N,
340
- middleware: p.middleware
341
- }), T(e, t, p, w, h, v, L);
1321
+ if (s && s.startsWith("/") || s.startsWith(".")) {
1322
+ const u = s.split("?")[0], f = i.getAttribute("method") || "get", h = r.find((d) => d.method.toLowerCase() === f && e.find((l) => l.parser(u) && l.pattern === d.path));
1323
+ if (h) {
1324
+ n.preventDefault();
1325
+ const d = e.find((A) => A.parser(u) && A.pattern === h.path), l = (d == null ? void 0 : d.parser(u)) || {}, y = new URLSearchParams(s.split("?")[1] || ""), w = Object.fromEntries(y.entries()) || {}, S = { ...l, ...w }, v = R[d == null ? void 0 : d.pattern];
1326
+ console.log("[EVENTS] Navigation to", s, {
1327
+ pattern: d == null ? void 0 : d.pattern,
1328
+ requires_server_data: v,
1329
+ manifest_store: R,
1330
+ middleware: h.middleware
1331
+ }), $(s, t, h, S, l, w, v);
342
1332
  } else
343
- console.log("No matching route found for URL:", e, "- using fallback navigation");
1333
+ console.log("No matching route found for URL:", s, "- using fallback navigation");
344
1334
  }
345
1335
  }
346
- }), window.addEventListener("popstate", (r) => {
347
- const o = window.location.pathname, a = window.location.pathname + window.location.search;
348
- E.url = a, E.pathname = window.location.pathname;
349
- const s = "get", l = i.find((e) => e.method.toLowerCase() === s && n.find((u) => u.parser(o) && u.pattern === e.path));
350
- if (l) {
351
- const e = n.find((y) => y.parser(o) && y.pattern === l.path), u = (e == null ? void 0 : e.parser(o)) || {}, f = new URLSearchParams(window.location.search), p = Object.fromEntries(f.entries()) || {};
352
- E.params = u, E.query = p;
353
- const c = { ...u, ...p }, h = N[e == null ? void 0 : e.pattern];
354
- T(a, t, l, c, u, p, h, !1);
1336
+ }), window.addEventListener("popstate", (n) => {
1337
+ const o = window.location.pathname, i = window.location.pathname + window.location.search;
1338
+ E.url = i, E.pathname = window.location.pathname;
1339
+ const a = "get", c = r.find((s) => s.method.toLowerCase() === a && e.find((u) => u.parser(o) && u.pattern === s.path));
1340
+ if (c) {
1341
+ 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
+ E.params = u, E.query = h;
1343
+ const d = { ...u, ...h }, l = R[s == null ? void 0 : s.pattern];
1344
+ $(i, t, c, d, u, h, l, !1);
355
1345
  } else
356
1346
  console.log("No matching route found for popstate navigation to:", o, "- using fallback navigation"), window.location.href = o;
357
1347
  }), function() {
358
- const r = history.pushState, o = history.replaceState;
359
- history.pushState = function(...a) {
360
- const s = r.apply(this, a), l = new Event("pushstate");
361
- return l.state = a[0], l.url = a[2], window.dispatchEvent(l), s;
362
- }, history.replaceState = function(...a) {
363
- const s = o.apply(this, a), l = a[2], e = window.location.pathname;
364
- if ((l ? new URL(l, window.location.origin).pathname : e) !== e) {
1348
+ const n = history.pushState, o = history.replaceState;
1349
+ history.pushState = function(...i) {
1350
+ const a = n.apply(this, i), c = new Event("pushstate");
1351
+ return c.state = i[0], c.url = i[2], window.dispatchEvent(c), a;
1352
+ }, history.replaceState = function(...i) {
1353
+ const a = o.apply(this, i), c = i[2], s = window.location.pathname;
1354
+ if ((c ? new URL(c, window.location.origin).pathname : s) !== s) {
365
1355
  const f = new Event("replacestate");
366
- f.state = a[0], f.url = a[2], window.dispatchEvent(f);
1356
+ f.state = i[0], f.url = i[2], window.dispatchEvent(f);
367
1357
  }
368
- return s;
1358
+ return a;
369
1359
  };
370
- }(), window.addEventListener("pushstate", (r) => {
371
- const o = r.url || window.location.pathname + window.location.search, a = o.split("?")[0], s = "get", l = i.find((e) => e.method.toLowerCase() === s && n.find((u) => u.parser(a) && u.pattern === e.path));
372
- if (l) {
373
- const e = n.find((y) => y.parser(a) && y.pattern === l.path), u = e == null ? void 0 : e.parser(a), f = new URLSearchParams(o.split("?")[1] || ""), p = Object.fromEntries(f.entries());
374
- E.url = o, E.pathname = window.location.pathname, Object.assign(E.params, u), Object.assign(E.query, p);
375
- const c = { ...u, ...p }, h = N[e == null ? void 0 : e.pattern];
376
- T(o, t, l, c, u, p, h, !1);
1360
+ }(), window.addEventListener("pushstate", (n) => {
1361
+ const o = n.url || window.location.pathname + window.location.search, i = o.split("?")[0], a = "get", c = r.find((s) => s.method.toLowerCase() === a && e.find((u) => u.parser(i) && u.pattern === s.path));
1362
+ if (c) {
1363
+ 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
+ E.url = o, E.pathname = window.location.pathname, Object.assign(E.params, u), Object.assign(E.query, h);
1365
+ const d = { ...u, ...h }, l = R[s == null ? void 0 : s.pattern];
1366
+ $(o, t, c, d, u, h, l, !1);
377
1367
  } else
378
- console.log("No matching route found for pushstate to:", a, "- using fallback navigation"), window.location.href = a;
379
- }), window.addEventListener("replacestate", (r) => {
380
- const o = r.url || window.location.pathname + window.location.search, a = o.split("?")[0];
1368
+ console.log("No matching route found for pushstate to:", i, "- using fallback navigation"), window.location.href = i;
1369
+ }), window.addEventListener("replacestate", (n) => {
1370
+ const o = n.url || window.location.pathname + window.location.search, i = o.split("?")[0];
381
1371
  E.url = o, E.pathname = window.location.pathname, E.query = Object.fromEntries(new URLSearchParams(o.split("?")[1] || ""));
382
- const s = "get", l = i.find((e) => e.method.toLowerCase() === s && n.find((u) => u.parser(a) && u.pattern === e.path));
383
- if (l) {
384
- const e = n.find((y) => y.parser(a) && y.pattern === l.path), u = (e == null ? void 0 : e.parser(a)) || {}, f = new URLSearchParams(o.split("?")[1] || ""), p = Object.fromEntries(f.entries()) || {}, c = { ...u, ...p }, h = N[e == null ? void 0 : e.pattern];
385
- T(o, t, l, c, u, p, h, !1);
1372
+ const a = "get", c = r.find((s) => s.method.toLowerCase() === a && e.find((u) => u.parser(i) && u.pattern === s.path));
1373
+ if (c) {
1374
+ 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);
386
1376
  } else
387
- console.log("No matching route found for replacestate to:", a, "- using fallback navigation"), window.location.href = a;
1377
+ console.log("No matching route found for replacestate to:", i, "- using fallback navigation"), window.location.href = i;
388
1378
  });
389
1379
  }
390
- const H = Symbol("forge-load-function");
391
- let k = [], q = null;
392
- function ct(t) {
1380
+ const Ct = Symbol("forge-load-function");
1381
+ let D = [], J = null;
1382
+ function ke(t) {
393
1383
  try {
394
- const i = new URL(t, window.location.origin);
395
- return i.origin === window.location.origin && !i.pathname.startsWith("/api/");
1384
+ const r = new URL(t, window.location.origin);
1385
+ return r.origin === window.location.origin && !r.pathname.startsWith("/api/");
396
1386
  } catch {
397
1387
  return !t.startsWith("/api/");
398
1388
  }
399
1389
  }
400
- function lt() {
401
- typeof window < "u" && !q && (q = window.fetch, window.fetch = async function(t, i = {}) {
402
- let n = { ...i };
403
- for (const a of k)
1390
+ function Le() {
1391
+ typeof window < "u" && !J && (J = window.fetch, window.fetch = async function(t, r = {}) {
1392
+ let e = { ...r };
1393
+ for (const i of D)
404
1394
  try {
405
- if (a.length === 2) {
406
- const s = new Headers(n.headers), l = Object.fromEntries(s.entries());
407
- await new Promise((e, u) => {
1395
+ if (i.length === 2) {
1396
+ const a = new Headers(e.headers), c = Object.fromEntries(a.entries());
1397
+ await new Promise((s, u) => {
408
1398
  try {
409
- a(l, (f) => {
1399
+ i(c, (f) => {
410
1400
  if (f)
411
1401
  u(f);
412
1402
  else {
413
- const p = new Headers();
414
- Object.entries(l).forEach(([c, h]) => {
415
- h !== void 0 && p.set(c, h);
416
- }), n.headers = p, e();
1403
+ const h = new Headers();
1404
+ Object.entries(c).forEach(([d, l]) => {
1405
+ l !== void 0 && h.set(d, l);
1406
+ }), e.headers = h, s();
417
1407
  }
418
1408
  });
419
1409
  } catch (f) {
@@ -421,35 +1411,35 @@ function lt() {
421
1411
  }
422
1412
  });
423
1413
  } else {
424
- const s = await a(n, t);
425
- s && typeof s == "object" && (n = s);
1414
+ const a = await i(e, t);
1415
+ a && typeof a == "object" && (e = a);
426
1416
  }
427
- } catch (s) {
428
- throw console.error("🔴 Middleware error:", s), s;
1417
+ } catch (a) {
1418
+ throw console.error("🔴 Middleware error:", a), a;
429
1419
  }
430
- const r = n == null ? void 0 : n[H];
1420
+ const n = e == null ? void 0 : e[Ct];
431
1421
  console.log("[FETCH OVERRIDE] Request", {
432
1422
  url: t,
433
- hasForgeSymbol: r,
434
- headers: n == null ? void 0 : n.headers
1423
+ hasForgeSymbol: n,
1424
+ headers: e == null ? void 0 : e.headers
435
1425
  });
436
- const o = await q(t, n);
1426
+ const o = await J(t, e);
437
1427
  if (console.log("[FETCH OVERRIDE] Response", {
438
1428
  url: t,
439
1429
  responseUrl: o.url,
440
1430
  redirected: o.redirected,
441
1431
  status: o.status,
442
1432
  type: o.type,
443
- hasForgeSymbol: r
444
- }), r && o.redirected) {
445
- const a = typeof t == "string" ? t : t.url, s = o.url;
1433
+ hasForgeSymbol: n
1434
+ }), n && o.redirected) {
1435
+ const i = typeof t == "string" ? t : t.url, a = o.url;
446
1436
  if (console.log("[FORGE REDIRECT] Detected redirect", {
447
- requested: a,
448
- final: s,
1437
+ requested: i,
1438
+ final: a,
449
1439
  redirected: o.redirected
450
- }), ct(s)) {
451
- const l = new URL(s), e = l.pathname + l.search;
452
- return console.log("[FORGE REDIRECT] Using pushState for SPA navigation to:", e, "from:", s), history.pushState(null, "", e), new Response(JSON.stringify({ layout: [], view: {} }), {
1440
+ }), ke(a)) {
1441
+ const c = new URL(a), s = c.pathname + c.search;
1442
+ return console.log("[FORGE REDIRECT] Using pushState for SPA navigation to:", s, "from:", a), history.pushState(null, "", s), new Response(JSON.stringify({ layout: [], view: {} }), {
453
1443
  status: 200,
454
1444
  headers: { "Content-Type": "application/json" }
455
1445
  });
@@ -458,54 +1448,54 @@ function lt() {
458
1448
  return o;
459
1449
  });
460
1450
  }
461
- lt();
462
- const ht = {
1451
+ Le();
1452
+ const $e = {
463
1453
  /**
464
1454
  * Add middleware to the fetch pipeline
465
1455
  */
466
1456
  configUpdate(t) {
467
1457
  if (typeof t != "function")
468
1458
  throw new Error("Middleware must be a function");
469
- k.push(t);
1459
+ D.push(t);
470
1460
  },
471
1461
  /**
472
1462
  * Reset all middleware
473
1463
  */
474
1464
  reset() {
475
- k.length = 0;
1465
+ D.length = 0;
476
1466
  },
477
1467
  /**
478
1468
  * Get current middleware count (for debugging)
479
1469
  */
480
1470
  getMiddlewareCount() {
481
- return k.length;
1471
+ return D.length;
482
1472
  }
483
1473
  };
484
- let $;
485
- async function wt(t, i) {
486
- let n = window.__COMPONENT_DIR__ || i.component_dir;
487
- if (!n && typeof n != "string")
1474
+ let K;
1475
+ async function Fe(t, r) {
1476
+ let e = window.__COMPONENT_DIR__ || r.component_dir;
1477
+ if (!e && typeof e != "string")
488
1478
  throw new Error("No component directory provided");
489
- let r = window.__ROUTING__;
490
- if ($ = Q(r), window && window.location) {
491
- const o = (window.location.pathname || "/").split("?")[0], a = $.find((l) => l.parser(o));
492
- let s = a ? r.find((l) => l.path === a.pattern) : null;
493
- if (a && s) {
494
- const l = a.parser(o) || {}, e = new URLSearchParams(window.location.search), u = Object.fromEntries(e.entries()) || {}, f = { ...l, ...u };
495
- it(), at(t, n, s, f, l, u), st(n, r, $);
1479
+ 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));
1482
+ let a = i ? n.find((c) => c.path === i.pattern) : null;
1483
+ if (i && a) {
1484
+ 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);
496
1486
  } else
497
1487
  console.warn("No matching route found for:", o);
498
1488
  }
499
1489
  }
500
1490
  export {
501
- N as MANIFEST_STORE,
502
- st as bootstrap_events,
503
- wt as createApp,
504
- ht as fetch,
505
- at as loadRoute,
1491
+ R as MANIFEST_STORE,
1492
+ je as bootstrap_events,
1493
+ Fe as createApp,
1494
+ $e as fetch,
1495
+ Ae as loadRoute,
506
1496
  E as page,
507
- yt as shadowUrl,
508
- it as updateManifestStore,
509
- T as updateRoute
1497
+ Ve as shadowUrl,
1498
+ Re as updateManifestStore,
1499
+ $ as updateRoute
510
1500
  };
511
1501
  //# sourceMappingURL=client.mjs.map