@argon-router/core 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { createEffect as R, createStore as A, createEvent as x, sample as w, split as ue, attach as z, scopeBind as le, withFactory as de } from "effector";
2
- import { spread as pe } from "patronum";
3
- function K(e, t) {
1
+ import { createEffect as V, createStore as L, createEvent as P, sample as $, split as xe, attach as Z, scopeBind as Fe, withFactory as je } from "effector";
2
+ import { spread as Se } from "patronum";
3
+ function ee(e, t) {
4
4
  var r = Object.keys(e);
5
5
  if (Object.getOwnPropertySymbols) {
6
6
  var n = Object.getOwnPropertySymbols(e);
@@ -10,491 +10,505 @@ function K(e, t) {
10
10
  }
11
11
  return r;
12
12
  }
13
- function T(e) {
13
+ function H(e) {
14
14
  for (var t = 1; t < arguments.length; t++) {
15
15
  var r = arguments[t] != null ? arguments[t] : {};
16
- t % 2 ? K(Object(r), !0).forEach(function(n) {
17
- me(e, n, r[n]);
18
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : K(Object(r)).forEach(function(n) {
16
+ t % 2 ? ee(Object(r), !0).forEach(function(n) {
17
+ $e(e, n, r[n]);
18
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ee(Object(r)).forEach(function(n) {
19
19
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
20
20
  });
21
21
  }
22
22
  return e;
23
23
  }
24
- function me(e, t, r) {
25
- return (t = ye(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
24
+ function $e(e, t, r) {
25
+ return (t = Ee(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
26
26
  }
27
- function ye(e) {
28
- var t = ge(e, "string");
27
+ function Ee(e) {
28
+ var t = Pe(e, "string");
29
29
  return typeof t == "symbol" ? t : t + "";
30
30
  }
31
- function ge(e, t) {
31
+ function Pe(e, t) {
32
32
  if (typeof e != "object" || !e) return e;
33
33
  var r = e[Symbol.toPrimitive];
34
34
  if (r !== void 0) {
35
- var n = r.call(e, t || "default");
35
+ var n = r.call(e, t);
36
36
  if (typeof n != "object") return n;
37
37
  throw new TypeError("@@toPrimitive must return a primitive value.");
38
38
  }
39
39
  return (t === "string" ? String : Number)(e);
40
40
  }
41
- function We(e) {
41
+ function er(e) {
42
42
  let t;
43
- const r = R(() => {
44
- var d;
45
- return (d = t) === null || d === void 0 ? void 0 : d();
43
+ const r = V(() => {
44
+ var O;
45
+ return (O = t) === null || O === void 0 ? void 0 : O();
46
46
  }, {
47
47
  name: "waitForAsyncBundleFx",
48
48
  sid: "tw7mq7"
49
- }), n = R(async () => {
50
- for (const O of (d = e.beforeOpen) !== null && d !== void 0 ? d : []) {
51
- var d;
52
- await O();
49
+ }), n = V(async () => {
50
+ for (const m of (O = e.beforeOpen) !== null && O !== void 0 ? O : []) {
51
+ var O;
52
+ await m();
53
53
  }
54
54
  }, {
55
55
  name: "beforeOpenFx",
56
56
  sid: "ls74w9"
57
- }), a = R(async (d) => {
57
+ }), a = V(async (O) => {
58
58
  await r(), await n();
59
- const O = e.parent;
60
- return O && await O.internal.openFx(T(T({}, d ?? {
59
+ const m = e.parent;
60
+ return m && await m.internal.openFx(H(H({}, O ?? {
61
61
  params: {}
62
62
  }), {}, {
63
63
  historyIgnore: !0
64
- })), d;
64
+ })), O;
65
65
  }, {
66
66
  name: "openFx",
67
67
  sid: "-hz9h5i"
68
- }), s = A({}, {
68
+ }), f = L({}, {
69
69
  name: "$params",
70
- sid: "gwsfoy"
71
- }), o = A(!1, {
70
+ sid: "rstqrf"
71
+ }), o = L(!1, {
72
72
  name: "$isOpened",
73
- sid: "ym3mgh"
74
- }), i = a.pending, c = x({
73
+ sid: "-zgx6q9"
74
+ }), l = a.pending, w = P({
75
75
  name: "open",
76
- sid: "-da1fdx"
77
- }), u = x({
76
+ sid: "-cby6lj"
77
+ }), j = P({
78
78
  name: "close",
79
- sid: "6wt8sn"
80
- }), m = x({
79
+ sid: "7uwhl1"
80
+ }), S = P({
81
81
  name: "opened",
82
- sid: "36opn9"
83
- }), y = x({
82
+ sid: "44ryfn"
83
+ }), E = P({
84
84
  name: "openedOnServer",
85
- sid: "-qpnfqf"
86
- }), h = x({
85
+ sid: "-prk6y1"
86
+ }), N = P({
87
87
  name: "openedOnClient",
88
- sid: "-qs3xog"
89
- }), F = x({
88
+ sid: "-fw2mlz"
89
+ }), I = P({
90
90
  name: "closed",
91
- sid: "2gopr"
91
+ sid: "10jxi5"
92
92
  });
93
- return w({
93
+ $({
94
94
  and: [{
95
- clock: c,
95
+ clock: w,
96
96
  target: a
97
97
  }],
98
98
  or: {
99
- sid: "t6sc35"
99
+ sid: "t7vx9v"
100
+ }
101
+ });
102
+ const U = {};
103
+ return $({
104
+ and: [{
105
+ clock: a.doneData,
106
+ fn: (O) => O && "params" in O ? H({}, O.params) : U,
107
+ target: f
108
+ }],
109
+ or: {
110
+ sid: "tna5vz"
100
111
  }
101
- }), ue({
112
+ }), xe({
102
113
  and: [{
103
114
  source: a.doneData,
104
115
  match: () => typeof window > "u" ? "server" : "client",
105
116
  cases: {
106
- server: y,
107
- client: h
117
+ server: E,
118
+ client: N
108
119
  }
109
120
  }],
110
121
  or: {
111
- sid: "t9jb1y"
122
+ sid: "u5fdgw"
112
123
  }
113
- }), w({
124
+ }), $({
114
125
  and: [{
115
- clock: [h, y],
116
- target: m
126
+ clock: [N, E],
127
+ target: S
117
128
  }],
118
129
  or: {
119
- sid: "tqkxg5"
130
+ sid: "ylqojg"
120
131
  }
121
- }), w({
132
+ }), $({
122
133
  and: [{
123
- clock: m,
134
+ clock: S,
124
135
  fn: () => !0,
125
136
  target: o
126
137
  }],
127
138
  or: {
128
- sid: "u4vkvj"
139
+ sid: "yohni9"
129
140
  }
130
- }), w({
141
+ }), $({
131
142
  and: [{
132
- clock: u,
133
- target: F
143
+ clock: j,
144
+ target: I
134
145
  }],
135
146
  or: {
136
- sid: "u86cfp"
147
+ sid: "z3c3j0"
137
148
  }
138
- }), w({
149
+ }), $({
139
150
  and: [{
140
- clock: F,
151
+ clock: I,
141
152
  fn: () => !1,
142
153
  target: o
143
154
  }],
144
155
  or: {
145
- sid: "ylqojg"
156
+ sid: "z632ht"
146
157
  }
147
158
  }), {
148
- $params: s,
159
+ $params: f,
149
160
  $isOpened: o,
150
- $isPending: i,
151
- open: c,
152
- closed: F,
153
- opened: m,
154
- openedOnClient: h,
155
- openedOnServer: y,
156
- internal: T({
157
- close: u,
161
+ $isPending: l,
162
+ open: w,
163
+ closed: I,
164
+ opened: S,
165
+ openedOnClient: N,
166
+ openedOnServer: E,
167
+ internal: H({
168
+ close: j,
158
169
  openFx: a,
159
- setAsyncImport: (d) => t = d
170
+ setAsyncImport: (O) => t = O
160
171
  }, e),
161
172
  "@@unitShape": () => ({
162
- params: s,
163
- isPending: i,
173
+ params: f,
174
+ isPending: l,
164
175
  isOpened: o,
165
- onOpen: c
176
+ onOpen: w
166
177
  })
167
178
  };
168
179
  }
169
- var E = {};
170
- Object.defineProperty(E, "__esModule", {
171
- value: !0
172
- });
173
- E.TokenData = void 0;
174
- E.parse = M;
175
- var he = E.compile = Se, be = E.match = je;
176
- E.pathToRegexp = ee;
177
- E.stringify = Ne;
178
- const _ = "/", q = (e) => e, Y = /^[$_\p{ID_Start}]$/u, L = /^[$\u200c\u200d\p{ID_Continue}]$/u, k = "https://git.new/pathToRegexpError", we = {
179
- // Groups.
180
- "{": "{",
181
- "}": "}",
182
- // Reserved.
183
- "(": "(",
184
- ")": ")",
185
- "[": "[",
186
- "]": "]",
187
- "+": "+",
188
- "?": "?",
189
- "!": "!"
190
- };
191
- function xe(e) {
192
- return e.replace(/[{}()\[\]+?!:*]/g, "\\$&");
180
+ function Ae(e) {
181
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
193
182
  }
194
- function $(e) {
195
- return e.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
196
- }
197
- function* Fe(e) {
198
- const t = [...e];
199
- let r = 0;
200
- function n() {
201
- let a = "";
202
- if (Y.test(t[++r]))
203
- for (a += t[r]; L.test(t[++r]); )
204
- a += t[r];
205
- else if (t[r] === '"') {
206
- let s = r;
207
- for (; r < t.length; ) {
208
- if (t[++r] === '"') {
209
- r++, s = 0;
210
- break;
183
+ var R = {}, re;
184
+ function ve() {
185
+ if (re) return R;
186
+ re = 1, Object.defineProperty(R, "__esModule", {
187
+ value: !0
188
+ }), R.TokenData = void 0, R.parse = E, R.compile = N, R.match = O, R.pathToRegexp = m, R.stringify = B;
189
+ const e = "/", t = (c) => c, r = /^[$_\p{ID_Start}]$/u, n = /^[$\u200c\u200d\p{ID_Continue}]$/u, a = "https://git.new/pathToRegexpError", f = {
190
+ // Groups.
191
+ "{": "{",
192
+ "}": "}",
193
+ // Reserved.
194
+ "(": "(",
195
+ ")": ")",
196
+ "[": "[",
197
+ "]": "]",
198
+ "+": "+",
199
+ "?": "?",
200
+ "!": "!"
201
+ };
202
+ function o(c) {
203
+ return c.replace(/[{}()\[\]+?!:*]/g, "\\$&");
204
+ }
205
+ function l(c) {
206
+ return c.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
207
+ }
208
+ function* w(c) {
209
+ const i = [...c];
210
+ let s = 0;
211
+ function y() {
212
+ let u = "";
213
+ if (r.test(i[++s]))
214
+ for (u += i[s]; n.test(i[++s]); )
215
+ u += i[s];
216
+ else if (i[s] === '"') {
217
+ let d = s;
218
+ for (; s < i.length; ) {
219
+ if (i[++s] === '"') {
220
+ s++, d = 0;
221
+ break;
222
+ }
223
+ i[s] === "\\" ? u += i[++s] : u += i[s];
211
224
  }
212
- t[r] === "\\" ? a += t[++r] : a += t[r];
225
+ if (d)
226
+ throw new TypeError(`Unterminated quote at ${d}: ${a}`);
213
227
  }
214
- if (s)
215
- throw new TypeError(`Unterminated quote at ${s}: ${k}`);
228
+ if (!u)
229
+ throw new TypeError(`Missing parameter name at ${s}: ${a}`);
230
+ return u;
216
231
  }
217
- if (!a)
218
- throw new TypeError(`Missing parameter name at ${r}: ${k}`);
219
- return a;
220
- }
221
- for (; r < t.length; ) {
222
- const a = t[r], s = we[a];
223
- if (s)
224
- yield {
225
- type: s,
226
- index: r++,
227
- value: a
228
- };
229
- else if (a === "\\")
230
- yield {
231
- type: "ESCAPED",
232
- index: r++,
233
- value: t[r++]
234
- };
235
- else if (a === ":") {
236
- const o = n();
237
- yield {
238
- type: "PARAM",
239
- index: r,
240
- value: o
241
- };
242
- } else if (a === "*") {
243
- const o = n();
244
- yield {
245
- type: "WILDCARD",
246
- index: r,
247
- value: o
248
- };
249
- } else
250
- yield {
251
- type: "CHAR",
252
- index: r,
253
- value: t[r++]
254
- };
232
+ for (; s < i.length; ) {
233
+ const u = i[s], d = f[u];
234
+ if (d)
235
+ yield {
236
+ type: d,
237
+ index: s++,
238
+ value: u
239
+ };
240
+ else if (u === "\\")
241
+ yield {
242
+ type: "ESCAPED",
243
+ index: s++,
244
+ value: i[s++]
245
+ };
246
+ else if (u === ":") {
247
+ const b = y();
248
+ yield {
249
+ type: "PARAM",
250
+ index: s,
251
+ value: b
252
+ };
253
+ } else if (u === "*") {
254
+ const b = y();
255
+ yield {
256
+ type: "WILDCARD",
257
+ index: s,
258
+ value: b
259
+ };
260
+ } else
261
+ yield {
262
+ type: "CHAR",
263
+ index: s,
264
+ value: i[s++]
265
+ };
266
+ }
267
+ return {
268
+ type: "END",
269
+ index: s,
270
+ value: ""
271
+ };
255
272
  }
256
- return {
257
- type: "END",
258
- index: r,
259
- value: ""
260
- };
261
- }
262
- class $e {
263
- constructor(t) {
264
- this.tokens = t;
273
+ class j {
274
+ constructor(i) {
275
+ this.tokens = i;
276
+ }
277
+ peek() {
278
+ if (!this._peek) {
279
+ const i = this.tokens.next();
280
+ this._peek = i.value;
281
+ }
282
+ return this._peek;
283
+ }
284
+ tryConsume(i) {
285
+ const s = this.peek();
286
+ if (s.type === i)
287
+ return this._peek = void 0, s.value;
288
+ }
289
+ consume(i) {
290
+ const s = this.tryConsume(i);
291
+ if (s !== void 0) return s;
292
+ const {
293
+ type: y,
294
+ index: u
295
+ } = this.peek();
296
+ throw new TypeError(`Unexpected ${y} at ${u}, expected ${i}: ${a}`);
297
+ }
298
+ text() {
299
+ let i = "", s;
300
+ for (; s = this.tryConsume("CHAR") || this.tryConsume("ESCAPED"); )
301
+ i += s;
302
+ return i;
303
+ }
265
304
  }
266
- peek() {
267
- if (!this._peek) {
268
- const t = this.tokens.next();
269
- this._peek = t.value;
305
+ class S {
306
+ constructor(i) {
307
+ this.tokens = i;
270
308
  }
271
- return this._peek;
272
309
  }
273
- tryConsume(t) {
274
- const r = this.peek();
275
- if (r.type === t)
276
- return this._peek = void 0, r.value;
310
+ R.TokenData = S;
311
+ function E(c, i = {}) {
312
+ const {
313
+ encodePath: s = t
314
+ } = i, y = new j(w(c));
315
+ function u(b) {
316
+ const g = [];
317
+ for (; ; ) {
318
+ const A = y.text();
319
+ A && g.push({
320
+ type: "text",
321
+ value: s(A)
322
+ });
323
+ const v = y.tryConsume("PARAM");
324
+ if (v) {
325
+ g.push({
326
+ type: "param",
327
+ name: v
328
+ });
329
+ continue;
330
+ }
331
+ const M = y.tryConsume("WILDCARD");
332
+ if (M) {
333
+ g.push({
334
+ type: "wildcard",
335
+ name: M
336
+ });
337
+ continue;
338
+ }
339
+ if (y.tryConsume("{")) {
340
+ g.push({
341
+ type: "group",
342
+ tokens: u("}")
343
+ });
344
+ continue;
345
+ }
346
+ return y.consume(b), g;
347
+ }
348
+ }
349
+ const d = u("END");
350
+ return new S(d);
277
351
  }
278
- consume(t) {
279
- const r = this.tryConsume(t);
280
- if (r !== void 0) return r;
352
+ function N(c, i = {}) {
281
353
  const {
282
- type: n,
283
- index: a
284
- } = this.peek();
285
- throw new TypeError(`Unexpected ${n} at ${a}, expected ${t}: ${k}`);
354
+ encode: s = encodeURIComponent,
355
+ delimiter: y = e
356
+ } = i, u = c instanceof S ? c : E(c, i), d = I(u.tokens, y, s);
357
+ return function(g = {}) {
358
+ const [A, ...v] = d(g);
359
+ if (v.length)
360
+ throw new TypeError(`Missing parameters: ${v.join(", ")}`);
361
+ return A;
362
+ };
286
363
  }
287
- text() {
288
- let t = "", r;
289
- for (; r = this.tryConsume("CHAR") || this.tryConsume("ESCAPED"); )
290
- t += r;
291
- return t;
364
+ function I(c, i, s) {
365
+ const y = c.map((u) => U(u, i, s));
366
+ return (u) => {
367
+ const d = [""];
368
+ for (const b of y) {
369
+ const [g, ...A] = b(u);
370
+ d[0] += g, d.push(...A);
371
+ }
372
+ return d;
373
+ };
292
374
  }
293
- }
294
- class P {
295
- constructor(t) {
296
- this.tokens = t;
375
+ function U(c, i, s) {
376
+ if (c.type === "text") return () => [c.value];
377
+ if (c.type === "group") {
378
+ const u = I(c.tokens, i, s);
379
+ return (d) => {
380
+ const [b, ...g] = u(d);
381
+ return g.length ? [""] : [b];
382
+ };
383
+ }
384
+ const y = s || t;
385
+ return c.type === "wildcard" && s !== !1 ? (u) => {
386
+ const d = u[c.name];
387
+ if (d == null) return ["", c.name];
388
+ if (!Array.isArray(d) || d.length === 0)
389
+ throw new TypeError(`Expected "${c.name}" to be a non-empty array`);
390
+ return [d.map((b, g) => {
391
+ if (typeof b != "string")
392
+ throw new TypeError(`Expected "${c.name}/${g}" to be a string`);
393
+ return y(b);
394
+ }).join(i)];
395
+ } : (u) => {
396
+ const d = u[c.name];
397
+ if (d == null) return ["", c.name];
398
+ if (typeof d != "string")
399
+ throw new TypeError(`Expected "${c.name}" to be a string`);
400
+ return [y(d)];
401
+ };
297
402
  }
298
- }
299
- E.TokenData = P;
300
- function M(e, t = {}) {
301
- const {
302
- encodePath: r = q
303
- } = t, n = new $e(Fe(e));
304
- function a(o) {
305
- const i = [];
306
- for (; ; ) {
307
- const c = n.text();
308
- c && i.push({
309
- type: "text",
310
- value: r(c)
311
- });
312
- const u = n.tryConsume("PARAM");
313
- if (u) {
314
- i.push({
315
- type: "param",
316
- name: u
317
- });
318
- continue;
403
+ function O(c, i = {}) {
404
+ const {
405
+ decode: s = decodeURIComponent,
406
+ delimiter: y = e
407
+ } = i, {
408
+ regexp: u,
409
+ keys: d
410
+ } = m(c, i), b = d.map((g) => s === !1 ? t : g.type === "param" ? s : (A) => A.split(y).map(s));
411
+ return function(A) {
412
+ const v = u.exec(A);
413
+ if (!v) return !1;
414
+ const M = v[0], C = /* @__PURE__ */ Object.create(null);
415
+ for (let T = 1; T < v.length; T++) {
416
+ if (v[T] === void 0) continue;
417
+ const _ = d[T - 1], K = b[T - 1];
418
+ C[_.name] = K(v[T]);
319
419
  }
320
- const m = n.tryConsume("WILDCARD");
321
- if (m) {
322
- i.push({
323
- type: "wildcard",
324
- name: m
325
- });
420
+ return {
421
+ path: M,
422
+ params: C
423
+ };
424
+ };
425
+ }
426
+ function m(c, i = {}) {
427
+ const {
428
+ delimiter: s = e,
429
+ end: y = !0,
430
+ sensitive: u = !1,
431
+ trailing: d = !0
432
+ } = i, b = [], g = [], A = u ? "" : "i", M = (Array.isArray(c) ? c : [c]).map((_) => _ instanceof S ? _ : E(_, i));
433
+ for (const {
434
+ tokens: _
435
+ } of M)
436
+ for (const K of h(_, 0, [])) {
437
+ const Oe = p(K, s, b);
438
+ g.push(Oe);
439
+ }
440
+ let C = `^(?:${g.join("|")})`;
441
+ return d && (C += `(?:${l(s)}$)?`), C += y ? "$" : `(?=${l(s)}|$)`, {
442
+ regexp: new RegExp(C, A),
443
+ keys: b
444
+ };
445
+ }
446
+ function* h(c, i, s) {
447
+ if (i === c.length)
448
+ return yield s;
449
+ const y = c[i];
450
+ if (y.type === "group") {
451
+ const u = s.slice();
452
+ for (const d of h(y.tokens, 0, u))
453
+ yield* h(c, i + 1, d);
454
+ } else
455
+ s.push(y);
456
+ yield* h(c, i + 1, s);
457
+ }
458
+ function p(c, i, s) {
459
+ let y = "", u = "", d = !0;
460
+ for (let b = 0; b < c.length; b++) {
461
+ const g = c[b];
462
+ if (g.type === "text") {
463
+ y += l(g.value), u += g.value, d || (d = g.value.includes(i));
326
464
  continue;
327
465
  }
328
- if (n.tryConsume("{")) {
329
- i.push({
330
- type: "group",
331
- tokens: a("}")
332
- });
466
+ if (g.type === "param" || g.type === "wildcard") {
467
+ if (!d && !u)
468
+ throw new TypeError(`Missing text after "${g.name}": ${a}`);
469
+ g.type === "param" ? y += `(${x(i, d ? "" : u)}+)` : y += "([\\s\\S]+)", s.push(g), u = "", d = !1;
333
470
  continue;
334
471
  }
335
- return n.consume(o), i;
336
472
  }
473
+ return y;
337
474
  }
338
- const s = a("END");
339
- return new P(s);
340
- }
341
- function Se(e, t = {}) {
342
- const {
343
- encode: r = encodeURIComponent,
344
- delimiter: n = _
345
- } = t, a = e instanceof P ? e : M(e, t), s = Z(a.tokens, n, r);
346
- return function(i = {}) {
347
- const [c, ...u] = s(i);
348
- if (u.length)
349
- throw new TypeError(`Missing parameters: ${u.join(", ")}`);
350
- return c;
351
- };
352
- }
353
- function Z(e, t, r) {
354
- const n = e.map((a) => Oe(a, t, r));
355
- return (a) => {
356
- const s = [""];
357
- for (const o of n) {
358
- const [i, ...c] = o(a);
359
- s[0] += i, s.push(...c);
360
- }
361
- return s;
362
- };
363
- }
364
- function Oe(e, t, r) {
365
- if (e.type === "text") return () => [e.value];
366
- if (e.type === "group") {
367
- const a = Z(e.tokens, t, r);
368
- return (s) => {
369
- const [o, ...i] = a(s);
370
- return i.length ? [""] : [o];
371
- };
475
+ function x(c, i) {
476
+ return i.length < 2 ? c.length < 2 ? `[^${l(c + i)}]` : `(?:(?!${l(c)})[^${l(i)}])` : c.length < 2 ? `(?:(?!${l(i)})[^${l(c)}])` : `(?:(?!${l(i)}|${l(c)})[\\s\\S])`;
372
477
  }
373
- const n = r || q;
374
- return e.type === "wildcard" && r !== !1 ? (a) => {
375
- const s = a[e.name];
376
- if (s == null) return ["", e.name];
377
- if (!Array.isArray(s) || s.length === 0)
378
- throw new TypeError(`Expected "${e.name}" to be a non-empty array`);
379
- return [s.map((o, i) => {
380
- if (typeof o != "string")
381
- throw new TypeError(`Expected "${e.name}/${i}" to be a string`);
382
- return n(o);
383
- }).join(t)];
384
- } : (a) => {
385
- const s = a[e.name];
386
- if (s == null) return ["", e.name];
387
- if (typeof s != "string")
388
- throw new TypeError(`Expected "${e.name}" to be a string`);
389
- return [n(s)];
390
- };
391
- }
392
- function je(e, t = {}) {
393
- const {
394
- decode: r = decodeURIComponent,
395
- delimiter: n = _
396
- } = t, {
397
- regexp: a,
398
- keys: s
399
- } = ee(e, t), o = s.map((i) => r === !1 ? q : i.type === "param" ? r : (c) => c.split(n).map(r));
400
- return function(c) {
401
- const u = a.exec(c);
402
- if (!u) return !1;
403
- const m = u[0], y = /* @__PURE__ */ Object.create(null);
404
- for (let h = 1; h < u.length; h++) {
405
- if (u[h] === void 0) continue;
406
- const F = s[h - 1], d = o[h - 1];
407
- y[F.name] = d(u[h]);
408
- }
409
- return {
410
- path: m,
411
- params: y
412
- };
413
- };
414
- }
415
- function ee(e, t = {}) {
416
- const {
417
- delimiter: r = _,
418
- end: n = !0,
419
- sensitive: a = !1,
420
- trailing: s = !0
421
- } = t, o = [], i = [], c = a ? "" : "i", m = (Array.isArray(e) ? e : [e]).map((F) => F instanceof P ? F : M(F, t));
422
- for (const {
423
- tokens: F
424
- } of m)
425
- for (const d of I(F, 0, [])) {
426
- const O = Ee(d, r, o);
427
- i.push(O);
428
- }
429
- let y = `^(?:${i.join("|")})`;
430
- return s && (y += `(?:${$(r)}$)?`), y += n ? "$" : `(?=${$(r)}|$)`, {
431
- regexp: new RegExp(y, c),
432
- keys: o
433
- };
434
- }
435
- function* I(e, t, r) {
436
- if (t === e.length)
437
- return yield r;
438
- const n = e[t];
439
- if (n.type === "group") {
440
- const a = r.slice();
441
- for (const s of I(n.tokens, 0, a))
442
- yield* I(e, t + 1, s);
443
- } else
444
- r.push(n);
445
- yield* I(e, t + 1, r);
446
- }
447
- function Ee(e, t, r) {
448
- let n = "", a = "", s = !0;
449
- for (let o = 0; o < e.length; o++) {
450
- const i = e[o];
451
- if (i.type === "text") {
452
- n += $(i.value), a += i.value, s || (s = i.value.includes(t));
453
- continue;
454
- }
455
- if (i.type === "param" || i.type === "wildcard") {
456
- if (!s && !a)
457
- throw new TypeError(`Missing text after "${i.name}": ${k}`);
458
- i.type === "param" ? n += `(${Ae(t, s ? "" : a)}+)` : n += "([\\s\\S]+)", r.push(i), a = "", s = !1;
459
- continue;
460
- }
478
+ function B(c) {
479
+ return c.tokens.map(function i(s, y, u) {
480
+ if (s.type === "text") return o(s.value);
481
+ if (s.type === "group")
482
+ return `{${s.tokens.map(i).join("")}}`;
483
+ const b = q(s.name) && z(u[y + 1]) ? s.name : JSON.stringify(s.name);
484
+ if (s.type === "param") return `:${b}`;
485
+ if (s.type === "wildcard") return `*${b}`;
486
+ throw new TypeError(`Unexpected token: ${s}`);
487
+ }).join("");
461
488
  }
462
- return n;
463
- }
464
- function Ae(e, t) {
465
- return t.length < 2 ? e.length < 2 ? `[^${$(e + t)}]` : `(?:(?!${$(e)})[^${$(t)}])` : e.length < 2 ? `(?:(?!${$(t)})[^${$(e)}])` : `(?:(?!${$(t)}|${$(e)})[\\s\\S])`;
466
- }
467
- function Ne(e) {
468
- return e.tokens.map(function t(r, n, a) {
469
- if (r.type === "text") return xe(r.value);
470
- if (r.type === "group")
471
- return `{${r.tokens.map(t).join("")}}`;
472
- const o = Re(r.name) && Ie(a[n + 1]) ? r.name : JSON.stringify(r.name);
473
- if (r.type === "param") return `:${o}`;
474
- if (r.type === "wildcard") return `*${o}`;
475
- throw new TypeError(`Unexpected token: ${r}`);
476
- }).join("");
477
- }
478
- function Re(e) {
479
- const [t, ...r] = e;
480
- return Y.test(t) ? r.every((n) => L.test(n)) : !1;
481
- }
482
- function Ie(e) {
483
- return (e == null ? void 0 : e.type) !== "text" ? !0 : !L.test(e.value[0]);
489
+ function q(c) {
490
+ const [i, ...s] = c;
491
+ return r.test(i) ? s.every((y) => n.test(y)) : !1;
492
+ }
493
+ function z(c) {
494
+ return (c == null ? void 0 : c.type) !== "text" ? !0 : !n.test(c.value[0]);
495
+ }
496
+ return R;
484
497
  }
485
- const ke = Symbol("any"), Pe = Symbol("number"), Ce = Symbol("string"), Te = Symbol("array"), j = {
486
- any: ke,
487
- number: Pe,
488
- string: Ce,
489
- array: Te
498
+ var te = ve();
499
+ const Ne = Symbol("any"), Re = Symbol("number"), De = Symbol("string"), Ie = Symbol("array"), k = {
500
+ any: Ne,
501
+ number: Re,
502
+ string: De,
503
+ array: Ie
490
504
  };
491
- function J(e, t) {
505
+ function ne(e, t) {
492
506
  for (const r of e)
493
507
  if (!t.includes(r))
494
508
  return !1;
495
509
  return !0;
496
510
  }
497
- function Q(e, t) {
511
+ function ae(e, t) {
498
512
  for (const r in t) {
499
513
  const n = t[r];
500
514
  if (Array.isArray(n) && (!e[r] || JSON.stringify(n) !== e[r]))
@@ -522,22 +536,22 @@ function Q(e, t) {
522
536
  }
523
537
  }
524
538
  switch (n) {
525
- case j.any: {
539
+ case k.any: {
526
540
  if (!e[r])
527
541
  return !1;
528
542
  break;
529
543
  }
530
- case j.string: {
544
+ case k.string: {
531
545
  if (!e[r] || Array.isArray(e[r]))
532
546
  return !1;
533
547
  break;
534
548
  }
535
- case j.array: {
549
+ case k.array: {
536
550
  if (!e[r] || !Array.isArray(e[r]))
537
551
  return !1;
538
552
  break;
539
553
  }
540
- case j.number: {
554
+ case k.number: {
541
555
  if (!e[r] || Array.isArray(e[r]) || isNaN(parseInt(e[r])) && isNaN(parseFloat(e[r])))
542
556
  return !1;
543
557
  break;
@@ -546,12 +560,12 @@ function Q(e, t) {
546
560
  }
547
561
  return !0;
548
562
  }
549
- function ve(e, t) {
563
+ function ke(e, t) {
550
564
  const r = {};
551
565
  for (const n in t) {
552
- const a = t[n], s = e[n];
566
+ const a = t[n], f = e[n];
553
567
  if (Array.isArray(a)) {
554
- r[n] = s === "1" || s === "true";
568
+ r[n] = f === "1" || f === "true";
555
569
  continue;
556
570
  }
557
571
  switch (typeof a) {
@@ -561,7 +575,7 @@ function ve(e, t) {
561
575
  break;
562
576
  }
563
577
  case "object": {
564
- r[n] = JSON.parse(s);
578
+ r[n] = JSON.parse(f);
565
579
  break;
566
580
  }
567
581
  case "string":
@@ -573,13 +587,13 @@ function ve(e, t) {
573
587
  }
574
588
  }
575
589
  switch (a) {
576
- case j.any:
577
- case j.string:
578
- case j.array: {
590
+ case k.any:
591
+ case k.string:
592
+ case k.array: {
579
593
  r[n] = e[n];
580
594
  break;
581
595
  }
582
- case j.number: {
596
+ case k.number: {
583
597
  const o = e[n];
584
598
  r[n] = isNaN(parseInt(o)) ? parseFloat(o) : parseInt(o);
585
599
  break;
@@ -588,56 +602,56 @@ function ve(e, t) {
588
602
  }
589
603
  return r;
590
604
  }
591
- function De(e, t) {
605
+ function Ce(e, t) {
592
606
  return (r) => {
593
607
  const {
594
608
  parameters: n,
595
609
  forRoutes: a
596
- } = r, s = x({
610
+ } = r, f = P({
597
611
  name: "entered",
598
612
  sid: "-d3obu6"
599
- }), o = x({
613
+ }), o = P({
600
614
  name: "exited",
601
615
  sid: "-xofyk3"
602
- }), i = x({
616
+ }), l = P({
603
617
  name: "exit",
604
618
  sid: "-673d76"
605
619
  });
606
- return w({
620
+ return $({
607
621
  and: [{
608
622
  source: {
609
623
  activeRoutes: e,
610
624
  query: t
611
625
  },
612
- filter: (c) => {
626
+ filter: (w) => {
613
627
  let {
614
- activeRoutes: u,
615
- query: m
616
- } = c;
617
- return (!a || J(a, u)) && Q(m, n);
628
+ activeRoutes: j,
629
+ query: S
630
+ } = w;
631
+ return (!a || ne(a, j)) && ae(S, n);
618
632
  },
619
- fn: (c) => {
633
+ fn: (w) => {
620
634
  let {
621
- query: u
622
- } = c;
623
- return ve(u, n);
635
+ query: j
636
+ } = w;
637
+ return ke(j, n);
624
638
  }
625
639
  }],
626
640
  or: {
627
641
  sid: "-so0f9q"
628
642
  }
629
- }), w({
643
+ }), $({
630
644
  and: [{
631
645
  source: {
632
646
  activeRoutes: e,
633
647
  query: t
634
648
  },
635
- filter: (c) => {
649
+ filter: (w) => {
636
650
  let {
637
- activeRoutes: u,
638
- query: m
639
- } = c;
640
- return !((!a || J(a, u)) && Q(m, n));
651
+ activeRoutes: j,
652
+ query: S
653
+ } = w;
654
+ return !((!a || ne(a, j)) && ae(S, n));
641
655
  },
642
656
  target: o
643
657
  }],
@@ -645,18 +659,45 @@ function De(e, t) {
645
659
  sid: "-s82e29"
646
660
  }
647
661
  }), {
648
- entered: s,
662
+ entered: f,
649
663
  exited: o,
650
- exit: i,
651
- getPayload: (c) => Object.entries(c).reduce((u, m) => {
652
- let [y, h] = m;
653
- return typeof n[y] == "symbol" ? u[y] = h : u[y] = n[y], u;
664
+ exit: l,
665
+ getPayload: (w) => Object.entries(w).reduce((j, S) => {
666
+ let [E, N] = S;
667
+ return typeof n[E] == "symbol" ? j[E] = N : j[E] = n[E], j;
654
668
  }, {})
655
669
  };
656
670
  };
657
671
  }
658
- const re = "%[a-f0-9]{2}", W = new RegExp("(" + re + ")|([^%]+?)", "gi"), G = new RegExp("(" + re + ")+", "gi");
659
- function D(e, t) {
672
+ var J, se;
673
+ function Te() {
674
+ return se || (se = 1, J = function e(t, r) {
675
+ if (t === r) return !0;
676
+ if (t && r && typeof t == "object" && typeof r == "object") {
677
+ if (t.constructor !== r.constructor) return !1;
678
+ var n, a, f;
679
+ if (Array.isArray(t)) {
680
+ if (n = t.length, n != r.length) return !1;
681
+ for (a = n; a-- !== 0; ) if (!e(t[a], r[a])) return !1;
682
+ return !0;
683
+ }
684
+ if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
685
+ if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
686
+ if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
687
+ if (f = Object.keys(t), n = f.length, n !== Object.keys(r).length) return !1;
688
+ for (a = n; a-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(r, f[a])) return !1;
689
+ for (a = n; a-- !== 0; ) {
690
+ var o = f[a];
691
+ if (!e(t[o], r[o])) return !1;
692
+ }
693
+ return !0;
694
+ }
695
+ return t !== t && r !== r;
696
+ }), J;
697
+ }
698
+ var _e = Te();
699
+ const Ue = /* @__PURE__ */ Ae(_e), le = "%[a-f0-9]{2}", oe = new RegExp("(" + le + ")|([^%]+?)", "gi"), ie = new RegExp("(" + le + ")+", "gi");
700
+ function W(e, t) {
660
701
  try {
661
702
  return [decodeURIComponent(e.join(""))];
662
703
  } catch {
@@ -665,32 +706,32 @@ function D(e, t) {
665
706
  return e;
666
707
  t = t || 1;
667
708
  const r = e.slice(0, t), n = e.slice(t);
668
- return Array.prototype.concat.call([], D(r), D(n));
709
+ return Array.prototype.concat.call([], W(r), W(n));
669
710
  }
670
- function Ue(e) {
711
+ function qe(e) {
671
712
  try {
672
713
  return decodeURIComponent(e);
673
714
  } catch {
674
- let t = e.match(W) || [];
715
+ let t = e.match(oe) || [];
675
716
  for (let r = 1; r < t.length; r++)
676
- e = D(t, r).join(""), t = e.match(W) || [];
717
+ e = W(t, r).join(""), t = e.match(oe) || [];
677
718
  return e;
678
719
  }
679
720
  }
680
- function _e(e) {
721
+ function Me(e) {
681
722
  const t = {
682
723
  "%FE%FF": "��",
683
724
  "%FF%FE": "��"
684
725
  };
685
- let r = G.exec(e);
726
+ let r = ie.exec(e);
686
727
  for (; r; ) {
687
728
  try {
688
729
  t[r[0]] = decodeURIComponent(r[0]);
689
730
  } catch {
690
- const a = Ue(r[0]);
731
+ const a = qe(r[0]);
691
732
  a !== r[0] && (t[r[0]] = a);
692
733
  }
693
- r = G.exec(e);
734
+ r = ie.exec(e);
694
735
  }
695
736
  t["%C2"] = "�";
696
737
  const n = Object.keys(t);
@@ -698,16 +739,16 @@ function _e(e) {
698
739
  e = e.replace(new RegExp(a, "g"), t[a]);
699
740
  return e;
700
741
  }
701
- function qe(e) {
742
+ function Le(e) {
702
743
  if (typeof e != "string")
703
744
  throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof e + "`");
704
745
  try {
705
746
  return decodeURIComponent(e);
706
747
  } catch {
707
- return _e(e);
748
+ return Me(e);
708
749
  }
709
750
  }
710
- function Le(e, t) {
751
+ function Be(e, t) {
711
752
  const r = {};
712
753
  if (Array.isArray(t))
713
754
  for (const n of t) {
@@ -718,13 +759,13 @@ function Le(e, t) {
718
759
  for (const n of Reflect.ownKeys(e)) {
719
760
  const a = Object.getOwnPropertyDescriptor(e, n);
720
761
  if (a.enumerable) {
721
- const s = e[n];
722
- t(n, s, e) && Object.defineProperty(r, n, a);
762
+ const f = e[n];
763
+ t(n, f, e) && Object.defineProperty(r, n, a);
723
764
  }
724
765
  }
725
766
  return r;
726
767
  }
727
- function te(e, t) {
768
+ function de(e, t) {
728
769
  if (!(typeof e == "string" && typeof t == "string"))
729
770
  throw new TypeError("Expected the arguments to be of type `string`");
730
771
  if (e === "" || t === "")
@@ -732,29 +773,29 @@ function te(e, t) {
732
773
  const r = e.indexOf(t);
733
774
  return r === -1 ? [] : [e.slice(0, r), e.slice(r + t.length)];
734
775
  }
735
- const Me = (e) => e == null, Be = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`), U = Symbol("encodeFragmentIdentifier");
736
- function He(e) {
776
+ const ze = (e) => e == null, He = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`), G = Symbol("encodeFragmentIdentifier");
777
+ function Ve(e) {
737
778
  switch (e.arrayFormat) {
738
779
  case "index":
739
780
  return (t) => (r, n) => {
740
781
  const a = r.length;
741
- return n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [p(t, e), "[", a, "]"].join("")] : [...r, [p(t, e), "[", p(a, e), "]=", p(n, e)].join("")];
782
+ return n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [F(t, e), "[", a, "]"].join("")] : [...r, [F(t, e), "[", F(a, e), "]=", F(n, e)].join("")];
742
783
  };
743
784
  case "bracket":
744
- return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [p(t, e), "[]"].join("")] : [...r, [p(t, e), "[]=", p(n, e)].join("")];
785
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [F(t, e), "[]"].join("")] : [...r, [F(t, e), "[]=", F(n, e)].join("")];
745
786
  case "colon-list-separator":
746
- return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [p(t, e), ":list="].join("")] : [...r, [p(t, e), ":list=", p(n, e)].join("")];
787
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, [F(t, e), ":list="].join("")] : [...r, [F(t, e), ":list=", F(n, e)].join("")];
747
788
  case "comma":
748
789
  case "separator":
749
790
  case "bracket-separator": {
750
791
  const t = e.arrayFormat === "bracket-separator" ? "[]=" : "=";
751
- return (r) => (n, a) => a === void 0 || e.skipNull && a === null || e.skipEmptyString && a === "" ? n : (a = a === null ? "" : a, n.length === 0 ? [[p(r, e), t, p(a, e)].join("")] : [[n, p(a, e)].join(e.arrayFormatSeparator)]);
792
+ return (r) => (n, a) => a === void 0 || e.skipNull && a === null || e.skipEmptyString && a === "" ? n : (a = a === null ? "" : a, n.length === 0 ? [[F(r, e), t, F(a, e)].join("")] : [[n, F(a, e)].join(e.arrayFormatSeparator)]);
752
793
  }
753
794
  default:
754
- return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, p(t, e)] : [...r, [p(t, e), "=", p(n, e)].join("")];
795
+ return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, F(t, e)] : [...r, [F(t, e), "=", F(n, e)].join("")];
755
796
  }
756
797
  }
757
- function Ve(e) {
798
+ function Ke(e) {
758
799
  let t;
759
800
  switch (e.arrayFormat) {
760
801
  case "index":
@@ -792,19 +833,19 @@ function Ve(e) {
792
833
  case "comma":
793
834
  case "separator":
794
835
  return (r, n, a) => {
795
- const s = typeof n == "string" && n.includes(e.arrayFormatSeparator), o = typeof n == "string" && !s && S(n, e).includes(e.arrayFormatSeparator);
796
- n = o ? S(n, e) : n;
797
- const i = s || o ? n.split(e.arrayFormatSeparator).map((c) => S(c, e)) : n === null ? n : S(n, e);
798
- a[r] = i;
836
+ const f = typeof n == "string" && n.includes(e.arrayFormatSeparator), o = typeof n == "string" && !f && D(n, e).includes(e.arrayFormatSeparator);
837
+ n = o ? D(n, e) : n;
838
+ const l = f || o ? n.split(e.arrayFormatSeparator).map((w) => D(w, e)) : n === null ? n : D(n, e);
839
+ a[r] = l;
799
840
  };
800
841
  case "bracket-separator":
801
842
  return (r, n, a) => {
802
- const s = /(\[])$/.test(r);
803
- if (r = r.replace(/\[]$/, ""), !s) {
804
- a[r] = n && S(n, e);
843
+ const f = /(\[])$/.test(r);
844
+ if (r = r.replace(/\[]$/, ""), !f) {
845
+ a[r] = n && D(n, e);
805
846
  return;
806
847
  }
807
- const o = n === null ? [] : S(n, e).split(e.arrayFormatSeparator);
848
+ const o = n === null ? [] : D(n, e).split(e.arrayFormatSeparator);
808
849
  if (a[r] === void 0) {
809
850
  a[r] = o;
810
851
  return;
@@ -821,37 +862,37 @@ function Ve(e) {
821
862
  };
822
863
  }
823
864
  }
824
- function ne(e) {
865
+ function pe(e) {
825
866
  if (typeof e != "string" || e.length !== 1)
826
867
  throw new TypeError("arrayFormatSeparator must be single character string");
827
868
  }
828
- function p(e, t) {
829
- return t.encode ? t.strict ? Be(e) : encodeURIComponent(e) : e;
869
+ function F(e, t) {
870
+ return t.encode ? t.strict ? He(e) : encodeURIComponent(e) : e;
830
871
  }
831
- function S(e, t) {
832
- return t.decode ? qe(e) : e;
872
+ function D(e, t) {
873
+ return t.decode ? Le(e) : e;
833
874
  }
834
- function ae(e) {
835
- return Array.isArray(e) ? e.sort() : typeof e == "object" ? ae(Object.keys(e)).sort((t, r) => Number(t) - Number(r)).map((t) => e[t]) : e;
875
+ function ye(e) {
876
+ return Array.isArray(e) ? e.sort() : typeof e == "object" ? ye(Object.keys(e)).sort((t, r) => Number(t) - Number(r)).map((t) => e[t]) : e;
836
877
  }
837
- function se(e) {
878
+ function me(e) {
838
879
  const t = e.indexOf("#");
839
880
  return t !== -1 && (e = e.slice(0, t)), e;
840
881
  }
841
- function ze(e) {
882
+ function Je(e) {
842
883
  let t = "";
843
884
  const r = e.indexOf("#");
844
885
  return r !== -1 && (t = e.slice(r)), t;
845
886
  }
846
- function X(e, t, r) {
887
+ function ce(e, t, r) {
847
888
  return r === "string" && typeof e == "string" ? e : typeof r == "function" && typeof e == "string" ? r(e) : t.parseBooleans && e !== null && (e.toLowerCase() === "true" || e.toLowerCase() === "false") ? e.toLowerCase() === "true" : r === "number" && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" || t.parseNumbers && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? Number(e) : e;
848
889
  }
849
- function B(e) {
850
- e = se(e);
890
+ function X(e) {
891
+ e = me(e);
851
892
  const t = e.indexOf("?");
852
893
  return t === -1 ? "" : e.slice(t + 1);
853
894
  }
854
- function H(e, t) {
895
+ function Y(e, t) {
855
896
  t = {
856
897
  decode: !0,
857
898
  sort: !0,
@@ -861,30 +902,30 @@ function H(e, t) {
861
902
  parseBooleans: !1,
862
903
  types: /* @__PURE__ */ Object.create(null),
863
904
  ...t
864
- }, ne(t.arrayFormatSeparator);
865
- const r = Ve(t), n = /* @__PURE__ */ Object.create(null);
905
+ }, pe(t.arrayFormatSeparator);
906
+ const r = Ke(t), n = /* @__PURE__ */ Object.create(null);
866
907
  if (typeof e != "string" || (e = e.trim().replace(/^[?#&]/, ""), !e))
867
908
  return n;
868
909
  for (const a of e.split("&")) {
869
910
  if (a === "")
870
911
  continue;
871
- const s = t.decode ? a.replaceAll("+", " ") : a;
872
- let [o, i] = te(s, "=");
873
- o === void 0 && (o = s), i = i === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(t.arrayFormat) ? i : S(i, t), r(S(o, t), i, n);
912
+ const f = t.decode ? a.replaceAll("+", " ") : a;
913
+ let [o, l] = de(f, "=");
914
+ o === void 0 && (o = f), l = l === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(t.arrayFormat) ? l : D(l, t), r(D(o, t), l, n);
874
915
  }
875
- for (const [a, s] of Object.entries(n))
876
- if (typeof s == "object" && s !== null && t.types[a] !== "string")
877
- for (const [o, i] of Object.entries(s)) {
878
- const c = t.types[a] ? t.types[a].replace("[]", "") : void 0;
879
- s[o] = X(i, t, c);
916
+ for (const [a, f] of Object.entries(n))
917
+ if (typeof f == "object" && f !== null && t.types[a] !== "string")
918
+ for (const [o, l] of Object.entries(f)) {
919
+ const w = t.types[a] ? t.types[a].replace("[]", "") : void 0;
920
+ f[o] = ce(l, t, w);
880
921
  }
881
- else typeof s == "object" && s !== null && t.types[a] === "string" ? n[a] = Object.values(s).join(t.arrayFormatSeparator) : n[a] = X(s, t, t.types[a]);
882
- return t.sort === !1 ? n : (t.sort === !0 ? Object.keys(n).sort() : Object.keys(n).sort(t.sort)).reduce((a, s) => {
883
- const o = n[s];
884
- return a[s] = o && typeof o == "object" && !Array.isArray(o) ? ae(o) : o, a;
922
+ else typeof f == "object" && f !== null && t.types[a] === "string" ? n[a] = Object.values(f).join(t.arrayFormatSeparator) : n[a] = ce(f, t, t.types[a]);
923
+ return t.sort === !1 ? n : (t.sort === !0 ? Object.keys(n).sort() : Object.keys(n).sort(t.sort)).reduce((a, f) => {
924
+ const o = n[f];
925
+ return a[f] = o && typeof o == "object" && !Array.isArray(o) ? ye(o) : o, a;
885
926
  }, /* @__PURE__ */ Object.create(null));
886
927
  }
887
- function oe(e, t) {
928
+ function ge(e, t) {
888
929
  if (!e)
889
930
  return "";
890
931
  t = {
@@ -893,202 +934,240 @@ function oe(e, t) {
893
934
  arrayFormat: "none",
894
935
  arrayFormatSeparator: ",",
895
936
  ...t
896
- }, ne(t.arrayFormatSeparator);
897
- const r = (o) => t.skipNull && Me(e[o]) || t.skipEmptyString && e[o] === "", n = He(t), a = {};
898
- for (const [o, i] of Object.entries(e))
899
- r(o) || (a[o] = i);
900
- const s = Object.keys(a);
901
- return t.sort !== !1 && s.sort(t.sort), s.map((o) => {
902
- const i = e[o];
903
- return i === void 0 ? "" : i === null ? p(o, t) : Array.isArray(i) ? i.length === 0 && t.arrayFormat === "bracket-separator" ? p(o, t) + "[]" : i.reduce(n(o), []).join("&") : p(o, t) + "=" + p(i, t);
937
+ }, pe(t.arrayFormatSeparator);
938
+ const r = (o) => t.skipNull && ze(e[o]) || t.skipEmptyString && e[o] === "", n = Ve(t), a = {};
939
+ for (const [o, l] of Object.entries(e))
940
+ r(o) || (a[o] = l);
941
+ const f = Object.keys(a);
942
+ return t.sort !== !1 && f.sort(t.sort), f.map((o) => {
943
+ const l = e[o];
944
+ return l === void 0 ? "" : l === null ? F(o, t) : Array.isArray(l) ? l.length === 0 && t.arrayFormat === "bracket-separator" ? F(o, t) + "[]" : l.reduce(n(o), []).join("&") : F(o, t) + "=" + F(l, t);
904
945
  }).filter((o) => o.length > 0).join("&");
905
946
  }
906
- function ie(e, t) {
947
+ function he(e, t) {
907
948
  var a;
908
949
  t = {
909
950
  decode: !0,
910
951
  ...t
911
952
  };
912
- let [r, n] = te(e, "#");
953
+ let [r, n] = de(e, "#");
913
954
  return r === void 0 && (r = e), {
914
955
  url: ((a = r == null ? void 0 : r.split("?")) == null ? void 0 : a[0]) ?? "",
915
- query: H(B(e), t),
956
+ query: Y(X(e), t),
916
957
  ...t && t.parseFragmentIdentifier && n ? {
917
- fragmentIdentifier: S(n, t)
958
+ fragmentIdentifier: D(n, t)
918
959
  } : {}
919
960
  };
920
961
  }
921
- function ce(e, t) {
962
+ function be(e, t) {
922
963
  t = {
923
964
  encode: !0,
924
965
  strict: !0,
925
- [U]: !0,
966
+ [G]: !0,
926
967
  ...t
927
968
  };
928
- const r = se(e.url).split("?")[0] || "", n = B(e.url), a = {
929
- ...H(n, {
969
+ const r = me(e.url).split("?")[0] || "", n = X(e.url), a = {
970
+ ...Y(n, {
930
971
  sort: !1
931
972
  }),
932
973
  ...e.query
933
974
  };
934
- let s = oe(a, t);
935
- s && (s = `?${s}`);
936
- let o = ze(e.url);
975
+ let f = ge(a, t);
976
+ f && (f = `?${f}`);
977
+ let o = Je(e.url);
937
978
  if (typeof e.fragmentIdentifier == "string") {
938
- const i = new URL(r);
939
- i.hash = e.fragmentIdentifier, o = t[U] ? i.hash : `#${e.fragmentIdentifier}`;
979
+ const l = new URL(r);
980
+ l.hash = e.fragmentIdentifier, o = t[G] ? l.hash : `#${e.fragmentIdentifier}`;
940
981
  }
941
- return `${r}${s}${o}`;
982
+ return `${r}${f}${o}`;
942
983
  }
943
- function fe(e, t, r) {
984
+ function we(e, t, r) {
944
985
  r = {
945
986
  parseFragmentIdentifier: !0,
946
- [U]: !1,
987
+ [G]: !1,
947
988
  ...r
948
989
  };
949
990
  const {
950
991
  url: n,
951
992
  query: a,
952
- fragmentIdentifier: s
953
- } = ie(e, r);
954
- return ce({
993
+ fragmentIdentifier: f
994
+ } = he(e, r);
995
+ return be({
955
996
  url: n,
956
- query: Le(a, t),
957
- fragmentIdentifier: s
997
+ query: Be(a, t),
998
+ fragmentIdentifier: f
958
999
  }, r);
959
1000
  }
960
- function Ke(e, t, r) {
961
- const n = Array.isArray(t) ? (a) => !t.includes(a) : (a, s) => !t(a, s);
962
- return fe(e, n, r);
1001
+ function Qe(e, t, r) {
1002
+ const n = Array.isArray(t) ? (a) => !t.includes(a) : (a, f) => !t(a, f);
1003
+ return we(e, n, r);
963
1004
  }
964
- const v = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1005
+ const Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
965
1006
  __proto__: null,
966
- exclude: Ke,
967
- extract: B,
968
- parse: H,
969
- parseUrl: ie,
970
- pick: fe,
971
- stringify: oe,
972
- stringifyUrl: ce
1007
+ exclude: Qe,
1008
+ extract: X,
1009
+ parse: Y,
1010
+ parseUrl: he,
1011
+ pick: we,
1012
+ stringify: ge,
1013
+ stringifyUrl: be
973
1014
  }, Symbol.toStringTag, { value: "Module" }));
1015
+ function fe(e, t) {
1016
+ var r = Object.keys(e);
1017
+ if (Object.getOwnPropertySymbols) {
1018
+ var n = Object.getOwnPropertySymbols(e);
1019
+ t && (n = n.filter(function(a) {
1020
+ return Object.getOwnPropertyDescriptor(e, a).enumerable;
1021
+ })), r.push.apply(r, n);
1022
+ }
1023
+ return r;
1024
+ }
1025
+ function ue(e) {
1026
+ for (var t = 1; t < arguments.length; t++) {
1027
+ var r = arguments[t] != null ? arguments[t] : {};
1028
+ t % 2 ? fe(Object(r), !0).forEach(function(n) {
1029
+ We(e, n, r[n]);
1030
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : fe(Object(r)).forEach(function(n) {
1031
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
1032
+ });
1033
+ }
1034
+ return e;
1035
+ }
1036
+ function We(e, t, r) {
1037
+ return (t = Ge(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
1038
+ }
974
1039
  function Ge(e) {
1040
+ var t = Xe(e, "string");
1041
+ return typeof t == "symbol" ? t : t + "";
1042
+ }
1043
+ function Xe(e, t) {
1044
+ if (typeof e != "object" || !e) return e;
1045
+ var r = e[Symbol.toPrimitive];
1046
+ if (r !== void 0) {
1047
+ var n = r.call(e, t);
1048
+ if (typeof n != "object") return n;
1049
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1050
+ }
1051
+ return (t === "string" ? String : Number)(e);
1052
+ }
1053
+ function rr(e) {
975
1054
  const {
976
1055
  base: t = "/",
977
1056
  routes: r
978
- } = e, n = A(null, {
1057
+ } = e, n = L(null, {
979
1058
  and: {
980
1059
  serialize: "ignore"
981
1060
  },
982
1061
  name: "$history",
983
- sid: "31majq"
984
- }), a = A([], {
1062
+ sid: "3inwxx"
1063
+ }), a = L([], {
985
1064
  and: {
986
1065
  serialize: "ignore"
987
1066
  },
988
1067
  name: "$activeRoutes",
989
- sid: "mastmv"
990
- }), s = A({}, {
1068
+ sid: "mrug12"
1069
+ }), f = L({}, {
991
1070
  name: "$query",
992
- sid: "4sjpht"
993
- }), o = A(null, {
1071
+ sid: "f7je63"
1072
+ }), o = L(null, {
994
1073
  name: "$path",
995
- sid: "wq6kyf"
996
- }), i = x({
1074
+ sid: "x787cm"
1075
+ }), l = P({
997
1076
  name: "setHistory",
998
- sid: "tco5ea"
999
- }), c = x({
1077
+ sid: "ttprsh"
1078
+ }), w = P({
1000
1079
  name: "navigate",
1001
- sid: "-6nqgd3"
1002
- }), u = x({
1080
+ sid: "-66otyw"
1081
+ }), j = P({
1003
1082
  name: "back",
1004
- sid: "-gxisi3"
1005
- }), m = x({
1083
+ sid: "-ggh63w"
1084
+ }), S = P({
1006
1085
  name: "forward",
1007
- sid: "-5nj6gd"
1008
- }), y = x({
1086
+ sid: "-56hk26"
1087
+ }), E = P({
1009
1088
  name: "locationUpdated",
1010
- sid: "enqpbn"
1011
- }), h = r.map((l) => {
1012
- let g = l;
1013
- const f = [];
1014
- for (f.unshift(g.internal.path); g.internal.parent; )
1015
- g = g.internal.parent, g.internal.path !== "/" && f.unshift(g.internal.path);
1016
- const b = t === "/" ? f.join("") : [t, ...f].join("");
1089
+ sid: "f4sbpu"
1090
+ }), N = r.map((m) => {
1091
+ let h = m;
1092
+ const p = [];
1093
+ for (p.unshift(h.internal.path); h.internal.parent; )
1094
+ h = h.internal.parent, h.internal.path !== "/" && p.unshift(h.internal.path);
1095
+ const x = t === "/" ? p.join("") : [t, ...p].join("");
1017
1096
  return {
1018
- route: l,
1019
- path: b,
1020
- toPath: he(b),
1021
- fromPath: be(b)
1097
+ route: m,
1098
+ path: x,
1099
+ toPath: te.compile(x),
1100
+ fromPath: te.match(x)
1022
1101
  };
1023
- }), F = z({
1102
+ }), I = Z({
1024
1103
  and: {
1025
1104
  source: {
1026
1105
  history: n
1027
1106
  },
1028
- effect: async (l, g) => {
1107
+ effect: async (m, h) => {
1029
1108
  let {
1030
- history: f
1031
- } = l, {
1032
- path: b,
1033
- query: C,
1034
- replace: N
1035
- } = g;
1036
- if (!f)
1109
+ history: p
1110
+ } = m, {
1111
+ path: x,
1112
+ query: B,
1113
+ replace: q
1114
+ } = h;
1115
+ if (!p)
1037
1116
  throw new Error("history not found");
1038
- const V = {
1039
- pathname: b,
1040
- search: "?".concat(v.stringify(C))
1117
+ const z = {
1118
+ pathname: x,
1119
+ search: "?".concat(Q.stringify(B))
1041
1120
  };
1042
- N ? f.replace(V) : f.push(V);
1121
+ q ? p.replace(z) : p.push(z);
1043
1122
  }
1044
1123
  },
1045
1124
  or: {
1046
1125
  name: "navigateFx",
1047
- sid: "e3jr9b"
1126
+ sid: "ekldni"
1048
1127
  }
1049
- }), d = R((l) => {
1050
- const g = le(y);
1051
- if (g({
1052
- pathname: l.location.pathname,
1053
- query: v.parse(l.location.search)
1054
- }), !l)
1128
+ }), U = V((m) => {
1129
+ const h = Fe(E);
1130
+ if (h({
1131
+ pathname: m.location.pathname,
1132
+ query: ue({}, Q.parse(m.location.search))
1133
+ }), !m)
1055
1134
  throw new Error();
1056
- l.listen((f) => {
1135
+ m.listen((p) => {
1057
1136
  let {
1058
- location: b
1059
- } = f;
1060
- g({
1061
- pathname: b.pathname,
1062
- query: v.parse(b.search)
1137
+ location: x
1138
+ } = p;
1139
+ h({
1140
+ pathname: x.pathname,
1141
+ query: ue({}, Q.parse(x.search))
1063
1142
  });
1064
1143
  });
1065
1144
  }, {
1066
1145
  name: "subscribeHistoryFx",
1067
- sid: "2h2oyo"
1068
- }), O = z({
1146
+ sid: "2y4bcv"
1147
+ }), O = Z({
1069
1148
  and: {
1070
1149
  source: {
1071
- query: s,
1150
+ query: f,
1072
1151
  path: o
1073
1152
  },
1074
- effect: async (l) => {
1153
+ effect: async (m) => {
1075
1154
  let {
1076
- query: g,
1077
- path: f
1078
- } = l;
1155
+ query: h,
1156
+ path: p
1157
+ } = m;
1079
1158
  for (const {
1080
- route: b,
1081
- fromPath: C
1082
- } of h) {
1083
- const N = C(f);
1084
- if (N)
1085
- await b.internal.openFx({
1086
- query: g,
1087
- params: N.params,
1159
+ route: x,
1160
+ fromPath: B
1161
+ } of N) {
1162
+ const q = B(p);
1163
+ if (q)
1164
+ await x.internal.openFx({
1165
+ query: h,
1166
+ params: q.params,
1088
1167
  historyIgnore: !0
1089
1168
  });
1090
1169
  else {
1091
- b.internal.close();
1170
+ x.internal.close();
1092
1171
  continue;
1093
1172
  }
1094
1173
  }
@@ -1096,85 +1175,93 @@ function Ge(e) {
1096
1175
  },
1097
1176
  or: {
1098
1177
  name: "openRoutesByPathFx",
1099
- sid: "-o9v4d"
1178
+ sid: "-788q6"
1100
1179
  }
1101
1180
  });
1102
1181
  for (const {
1103
- route: l,
1104
- toPath: g
1105
- } of h)
1106
- w({
1182
+ route: m,
1183
+ toPath: h
1184
+ } of N)
1185
+ $({
1107
1186
  and: [{
1108
- clock: l.opened,
1187
+ clock: m.opened,
1109
1188
  source: a,
1110
- filter: (f) => !f.includes(l),
1111
- fn: (f) => [...f, l],
1189
+ filter: (p) => !p.includes(m),
1190
+ fn: (p) => [...p, m],
1112
1191
  target: a
1113
1192
  }],
1114
1193
  or: {
1115
- sid: "f0qyp9"
1194
+ sid: "f1aram"
1116
1195
  }
1117
- }), w({
1196
+ }), $({
1118
1197
  and: [{
1119
- clock: l.opened,
1120
- filter: (f) => !(f != null && f.historyIgnore),
1121
- fn: (f) => {
1122
- var b;
1198
+ clock: m.opened,
1199
+ filter: (p) => !(p != null && p.historyIgnore),
1200
+ fn: (p) => {
1201
+ var x;
1123
1202
  return {
1124
- path: g(f && "params" in f ? f.params : void 0),
1125
- query: (b = f == null ? void 0 : f.query) !== null && b !== void 0 ? b : {},
1126
- replace: f == null ? void 0 : f.replace
1203
+ path: h(p && "params" in p ? p.params : void 0),
1204
+ query: (x = p == null ? void 0 : p.query) !== null && x !== void 0 ? x : {},
1205
+ replace: p == null ? void 0 : p.replace
1127
1206
  };
1128
1207
  },
1129
- target: c
1208
+ target: w
1130
1209
  }],
1131
1210
  or: {
1132
- sid: "fgozwq"
1211
+ sid: "fh8si3"
1133
1212
  }
1134
- }), w({
1213
+ }), $({
1135
1214
  and: [{
1136
- clock: l.closed,
1215
+ clock: m.closed,
1137
1216
  source: a,
1138
- fn: (f) => f.filter((b) => b !== l),
1217
+ fn: (p) => p.filter((x) => x !== m),
1139
1218
  target: a
1140
1219
  }],
1141
1220
  or: {
1142
- sid: "gc19qb"
1221
+ sid: "gcl2bo"
1143
1222
  }
1144
1223
  });
1145
- return w({
1224
+ return $({
1146
1225
  and: [{
1147
- clock: i,
1226
+ clock: l,
1148
1227
  target: n
1149
1228
  }],
1150
1229
  or: {
1151
- sid: "ggfmfh"
1230
+ sid: "gsj3hf"
1152
1231
  }
1153
- }), w({
1232
+ }), $({
1154
1233
  and: [{
1155
1234
  clock: n,
1156
1235
  filter: Boolean,
1157
- target: d
1236
+ target: U
1158
1237
  }],
1159
1238
  or: {
1160
- sid: "guq9uv"
1239
+ sid: "gva2g8"
1161
1240
  }
1162
- }), w({
1241
+ }), $({
1163
1242
  and: [{
1164
- clock: y,
1165
- fn: (l) => {
1166
- var g;
1167
- return {
1168
- path: l.pathname,
1169
- query: (g = l.query) !== null && g !== void 0 ? g : {}
1170
- };
1243
+ clock: E,
1244
+ source: {
1245
+ query: f,
1246
+ path: o
1247
+ },
1248
+ filter: (m, h) => {
1249
+ let {
1250
+ query: p,
1251
+ path: x
1252
+ } = m;
1253
+ return x !== h.pathname || !Ue(p, h.query);
1171
1254
  },
1172
- target: [de({
1173
- sid: "-3mx9rg",
1174
- fn: () => pe({
1255
+ fn: (m, h) => ({
1256
+ path: h.pathname,
1257
+ query: h.query
1258
+ }),
1259
+ target: [je({
1260
+ sid: "-396exf",
1261
+ fn: () => Se({
1175
1262
  targets: {
1176
1263
  path: o,
1177
- query: s
1264
+ query: f
1178
1265
  }
1179
1266
  }),
1180
1267
  name: "target",
@@ -1182,52 +1269,52 @@ function Ge(e) {
1182
1269
  }), O]
1183
1270
  }],
1184
1271
  or: {
1185
- sid: "h9kpvm"
1272
+ sid: "ha4igz"
1186
1273
  }
1187
- }), w({
1274
+ }), $({
1188
1275
  and: [{
1189
- clock: c,
1190
- target: F
1276
+ clock: w,
1277
+ target: I
1191
1278
  }],
1192
1279
  or: {
1193
- sid: "hugwfc"
1280
+ sid: "i87r9d"
1194
1281
  }
1195
- }), w({
1282
+ }), $({
1196
1283
  and: [{
1197
- clock: [s, o],
1284
+ clock: [f, o],
1198
1285
  source: {
1199
- query: s,
1286
+ query: f,
1200
1287
  path: o
1201
1288
  },
1202
- fn: (l) => l,
1203
- target: c
1289
+ fn: (m) => m,
1290
+ target: w
1204
1291
  }],
1205
1292
  or: {
1206
- sid: "i8rjuq"
1293
+ sid: "iayq86"
1207
1294
  }
1208
1295
  }), {
1209
- $query: s,
1296
+ $query: f,
1210
1297
  $path: o,
1211
1298
  $activeRoutes: a,
1212
- back: u,
1213
- forward: m,
1214
- navigate: c,
1299
+ back: j,
1300
+ forward: S,
1301
+ navigate: w,
1215
1302
  routes: r,
1216
- setHistory: i,
1217
- mappedRoutes: h,
1218
- trackQuery: De(a, s),
1303
+ setHistory: l,
1304
+ mappedRoutes: N,
1305
+ trackQuery: Ce(a, f),
1219
1306
  "@@unitShape": () => ({
1220
- query: s,
1307
+ query: f,
1221
1308
  path: o,
1222
1309
  activeRoutes: a,
1223
- onBack: u,
1224
- onForward: m,
1225
- onNavigate: c
1310
+ onBack: j,
1311
+ onForward: S,
1312
+ onNavigate: w
1226
1313
  })
1227
1314
  };
1228
1315
  }
1229
1316
  export {
1230
- We as createRoute,
1231
- Ge as createRouter,
1232
- j as parameters
1317
+ er as createRoute,
1318
+ rr as createRouter,
1319
+ k as parameters
1233
1320
  };