@argon-router/core 0.1.3 → 0.2.0

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