@shane_il/pulse 0.1.2 → 0.3.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/README.md +20 -167
- package/dist/connect.d.ts +1 -0
- package/dist/devtools/core.d.ts +47 -0
- package/dist/devtools/index.d.ts +9 -0
- package/dist/devtools/panel/actions-tab.d.ts +10 -0
- package/dist/devtools/panel/components-tab.d.ts +5 -0
- package/dist/devtools/panel/panel.d.ts +24 -0
- package/dist/devtools/panel/stores-tab.d.ts +7 -0
- package/dist/devtools/panel/styles.d.ts +41 -0
- package/dist/devtools/time-travel.d.ts +11 -0
- package/dist/devtools.cjs +2 -0
- package/dist/devtools.cjs.map +1 -0
- package/dist/devtools.js +1218 -0
- package/dist/devtools.js.map +1 -0
- package/dist/diff.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/middleware.d.ts +36 -0
- package/dist/patch.d.ts +2 -2
- package/dist/pulse.cjs +1 -1
- package/dist/pulse.cjs.map +1 -1
- package/dist/pulse.js +472 -366
- package/dist/pulse.js.map +1 -1
- package/dist/store.d.ts +4 -0
- package/package.json +14 -2
package/dist/pulse.js
CHANGED
|
@@ -1,152 +1,188 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
function
|
|
1
|
+
var st = Object.defineProperty;
|
|
2
|
+
var ot = (t, e, s) => e in t ? st(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var T = (t, e, s) => ot(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
const G = Symbol("TEXT_NODE"), rt = Symbol("FRAGMENT");
|
|
5
|
+
function $(t) {
|
|
6
6
|
return {
|
|
7
|
-
type:
|
|
7
|
+
type: G,
|
|
8
8
|
props: { nodeValue: String(t) },
|
|
9
9
|
children: [],
|
|
10
10
|
key: null
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return t == null || typeof t == "boolean" ? null : typeof t == "string" || typeof t == "number" ?
|
|
13
|
+
function ct(t) {
|
|
14
|
+
return t == null || typeof t == "boolean" ? null : typeof t == "string" || typeof t == "number" ? $(t) : t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function J(t) {
|
|
17
17
|
const e = [];
|
|
18
18
|
for (const s of t)
|
|
19
19
|
if (Array.isArray(s))
|
|
20
|
-
e.push(...
|
|
20
|
+
e.push(...J(s));
|
|
21
21
|
else {
|
|
22
|
-
const n =
|
|
22
|
+
const n = ct(s);
|
|
23
23
|
n !== null && e.push(n);
|
|
24
24
|
}
|
|
25
25
|
return e;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function K(t, e, ...s) {
|
|
28
28
|
e = e || {};
|
|
29
29
|
const n = e.key ?? null;
|
|
30
30
|
e.key !== void 0 && (e = { ...e }, delete e.key);
|
|
31
|
-
const
|
|
32
|
-
return { type: t, props: e, children:
|
|
31
|
+
const r = J(s);
|
|
32
|
+
return { type: t, props: e, children: r, key: n };
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function it(t) {
|
|
35
35
|
let e = t.state;
|
|
36
|
-
const s = t.actions, n = /* @__PURE__ */ new Set();
|
|
36
|
+
const s = t.actions, n = /* @__PURE__ */ new Set(), r = t.middleware;
|
|
37
37
|
function o() {
|
|
38
38
|
return e;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
function c() {
|
|
41
|
+
for (const u of n)
|
|
42
|
+
u(e);
|
|
43
|
+
}
|
|
44
|
+
function l(u, d) {
|
|
45
|
+
const g = s[u];
|
|
46
|
+
if (!g)
|
|
47
|
+
throw new Error(`[pulse] Unknown action: "${u}"`);
|
|
48
|
+
const b = g(e, d);
|
|
49
|
+
b !== e && (e = b, c());
|
|
50
|
+
}
|
|
51
|
+
function a(u, d) {
|
|
52
|
+
if (u === "__devtools_replace__") {
|
|
53
|
+
e = d, c();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const g = s[u];
|
|
57
|
+
if (!g)
|
|
58
|
+
throw new Error(`[pulse] Unknown action: "${u}"`);
|
|
59
|
+
const b = {
|
|
60
|
+
store: h,
|
|
61
|
+
actionName: u,
|
|
62
|
+
payload: d,
|
|
63
|
+
prevState: e,
|
|
64
|
+
nextState: void 0
|
|
65
|
+
};
|
|
66
|
+
let I = 0;
|
|
67
|
+
function x() {
|
|
68
|
+
if (I < r.length) {
|
|
69
|
+
const f = r[I++];
|
|
70
|
+
f(b, x);
|
|
71
|
+
} else {
|
|
72
|
+
const f = g(b.prevState, b.payload);
|
|
73
|
+
b.nextState = f, f !== e && (e = f, c());
|
|
74
|
+
}
|
|
49
75
|
}
|
|
76
|
+
x();
|
|
50
77
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
78
|
+
const i = r && r.length > 0 ? a : l;
|
|
79
|
+
function p(u) {
|
|
80
|
+
return n.add(u), () => {
|
|
81
|
+
n.delete(u);
|
|
54
82
|
};
|
|
55
83
|
}
|
|
56
|
-
function
|
|
57
|
-
return { store:
|
|
84
|
+
function y(u) {
|
|
85
|
+
return { store: h, selector: u };
|
|
58
86
|
}
|
|
59
|
-
const
|
|
60
|
-
|
|
87
|
+
const h = {
|
|
88
|
+
getState: o,
|
|
89
|
+
dispatch: i,
|
|
90
|
+
subscribe: p,
|
|
91
|
+
select: y
|
|
92
|
+
};
|
|
93
|
+
return t.name && (h.name = t.name), h;
|
|
61
94
|
}
|
|
62
|
-
let
|
|
63
|
-
const
|
|
64
|
-
function
|
|
65
|
-
|
|
95
|
+
let U = !1;
|
|
96
|
+
const N = /* @__PURE__ */ new Set();
|
|
97
|
+
function at(t) {
|
|
98
|
+
N.add(t), U || (U = !0, queueMicrotask(lt));
|
|
66
99
|
}
|
|
67
|
-
function
|
|
68
|
-
const t = [...
|
|
69
|
-
|
|
100
|
+
function lt() {
|
|
101
|
+
const t = [...N];
|
|
102
|
+
N.clear(), U = !1;
|
|
70
103
|
for (const e of t)
|
|
71
104
|
e();
|
|
72
105
|
}
|
|
73
|
-
function
|
|
74
|
-
const t = [...
|
|
75
|
-
|
|
106
|
+
function _t() {
|
|
107
|
+
const t = [...N];
|
|
108
|
+
N.clear(), U = !1;
|
|
76
109
|
for (const e of t)
|
|
77
110
|
e();
|
|
78
111
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
112
|
+
const Y = Symbol("PULSE_CONNECTED"), H = globalThis;
|
|
113
|
+
H.__PULSE_HOOKS__ || (H.__PULSE_HOOKS__ = { onMount: null, onUnmount: null });
|
|
114
|
+
const M = H.__PULSE_HOOKS__;
|
|
115
|
+
function ut(t, e) {
|
|
81
116
|
return function(n) {
|
|
82
|
-
const
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
for (const
|
|
86
|
-
const { store: i, selector:
|
|
87
|
-
a
|
|
117
|
+
const r = t || {};
|
|
118
|
+
function o(c) {
|
|
119
|
+
const l = {};
|
|
120
|
+
for (const a in r) {
|
|
121
|
+
const { store: i, selector: p } = r[a];
|
|
122
|
+
l[a] = p(i.getState());
|
|
88
123
|
}
|
|
89
|
-
return n({ ...
|
|
124
|
+
return n({ ...l, ...c });
|
|
90
125
|
}
|
|
91
|
-
return
|
|
126
|
+
return o[Y] = !0, o._bindings = r, o._innerComponent = n, e && (o._lifecycle = e), o.displayName = `Connected(${n.displayName || n.name || "Anonymous"})`, o;
|
|
92
127
|
};
|
|
93
128
|
}
|
|
94
|
-
class
|
|
129
|
+
class ft {
|
|
95
130
|
constructor(e, s) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
131
|
+
T(this, "connectedFn");
|
|
132
|
+
T(this, "props");
|
|
133
|
+
T(this, "prevSelected");
|
|
134
|
+
T(this, "unsubscribers");
|
|
135
|
+
T(this, "lastVTree");
|
|
136
|
+
T(this, "parentDom");
|
|
137
|
+
T(this, "_renderCallback");
|
|
138
|
+
T(this, "_mountCleanup");
|
|
104
139
|
this.connectedFn = e, this.props = s, this.prevSelected = {}, this.unsubscribers = [], this.lastVTree = null, this.parentDom = null, this._renderCallback = null, this._mountCleanup = null;
|
|
105
140
|
}
|
|
106
141
|
mount(e, s) {
|
|
107
|
-
var
|
|
142
|
+
var o;
|
|
108
143
|
this.parentDom = e, this._renderCallback = s;
|
|
109
144
|
const n = this.connectedFn._bindings;
|
|
110
145
|
for (const c in n) {
|
|
111
|
-
const { store:
|
|
112
|
-
this.prevSelected[c] = l
|
|
146
|
+
const { store: l, selector: a } = n[c];
|
|
147
|
+
this.prevSelected[c] = a(l.getState());
|
|
113
148
|
}
|
|
114
149
|
for (const c in n) {
|
|
115
|
-
const { store:
|
|
150
|
+
const { store: l } = n[c], a = l.subscribe(() => {
|
|
116
151
|
this._onStoreChange();
|
|
117
152
|
});
|
|
118
|
-
this.unsubscribers.push(
|
|
153
|
+
this.unsubscribers.push(a);
|
|
119
154
|
}
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const c =
|
|
123
|
-
dom: (
|
|
155
|
+
const r = this.connectedFn._lifecycle;
|
|
156
|
+
if (r != null && r.onMount) {
|
|
157
|
+
const c = r.onMount({
|
|
158
|
+
dom: (o = this.lastVTree) == null ? void 0 : o._dom,
|
|
124
159
|
props: this.props
|
|
125
160
|
});
|
|
126
161
|
typeof c == "function" && (this._mountCleanup = c);
|
|
127
162
|
}
|
|
163
|
+
M.onMount && M.onMount(this);
|
|
128
164
|
}
|
|
129
165
|
_onStoreChange() {
|
|
130
166
|
const e = this.connectedFn._bindings;
|
|
131
167
|
let s = !1;
|
|
132
168
|
for (const n in e) {
|
|
133
|
-
const { store:
|
|
134
|
-
if (!
|
|
169
|
+
const { store: r, selector: o } = e[n], c = o(r.getState());
|
|
170
|
+
if (!pt(c, this.prevSelected[n])) {
|
|
135
171
|
s = !0;
|
|
136
172
|
break;
|
|
137
173
|
}
|
|
138
174
|
}
|
|
139
|
-
s &&
|
|
175
|
+
s && at(this._renderCallback);
|
|
140
176
|
}
|
|
141
177
|
updateSelected() {
|
|
142
178
|
const e = this.connectedFn._bindings;
|
|
143
179
|
for (const s in e) {
|
|
144
|
-
const { store: n, selector:
|
|
145
|
-
this.prevSelected[s] =
|
|
180
|
+
const { store: n, selector: r } = e[s];
|
|
181
|
+
this.prevSelected[s] = r(n.getState());
|
|
146
182
|
}
|
|
147
183
|
}
|
|
148
184
|
unmount() {
|
|
149
|
-
this._mountCleanup && (this._mountCleanup(), this._mountCleanup = null);
|
|
185
|
+
M.onUnmount && M.onUnmount(this), this._mountCleanup && (this._mountCleanup(), this._mountCleanup = null);
|
|
150
186
|
const e = this.connectedFn._lifecycle;
|
|
151
187
|
e != null && e.onDestroy && e.onDestroy({ props: this.props });
|
|
152
188
|
for (const s of this.unsubscribers)
|
|
@@ -154,17 +190,17 @@ class it {
|
|
|
154
190
|
this.unsubscribers = [], this._renderCallback = null;
|
|
155
191
|
}
|
|
156
192
|
}
|
|
157
|
-
function
|
|
193
|
+
function pt(t, e) {
|
|
158
194
|
if (Object.is(t, e)) return !0;
|
|
159
195
|
if (typeof t != "object" || typeof e != "object" || t === null || e === null) return !1;
|
|
160
196
|
const s = Object.keys(t), n = Object.keys(e);
|
|
161
197
|
if (s.length !== n.length) return !1;
|
|
162
|
-
for (const
|
|
163
|
-
if (!Object.prototype.hasOwnProperty.call(e,
|
|
198
|
+
for (const r of s)
|
|
199
|
+
if (!Object.prototype.hasOwnProperty.call(e, r) || !Object.is(t[r], e[r]))
|
|
164
200
|
return !1;
|
|
165
201
|
return !0;
|
|
166
202
|
}
|
|
167
|
-
const
|
|
203
|
+
const m = {
|
|
168
204
|
CREATE: "CREATE",
|
|
169
205
|
REMOVE: "REMOVE",
|
|
170
206
|
REPLACE: "REPLACE",
|
|
@@ -173,310 +209,344 @@ const y = {
|
|
|
173
209
|
MOVE: "MOVE",
|
|
174
210
|
CHILDREN: "CHILDREN"
|
|
175
211
|
};
|
|
176
|
-
function
|
|
212
|
+
function w(t, e) {
|
|
177
213
|
if (e == null && t == null) return [];
|
|
178
|
-
if (e == null) return [{ type:
|
|
179
|
-
if (t == null) return [{ type:
|
|
214
|
+
if (e == null) return [{ type: m.REMOVE, target: t }];
|
|
215
|
+
if (t == null) return [{ type: m.CREATE, newVNode: e }];
|
|
180
216
|
if (t.type !== e.type)
|
|
181
|
-
return [{ type:
|
|
182
|
-
if (e._dom = t._dom, t.type ===
|
|
183
|
-
return t.props.nodeValue !== e.props.nodeValue ? [{ type:
|
|
184
|
-
const s = [], n =
|
|
185
|
-
n && s.push({ type:
|
|
186
|
-
const
|
|
187
|
-
return
|
|
188
|
-
}
|
|
189
|
-
function
|
|
217
|
+
return [{ type: m.REPLACE, oldVNode: t, newVNode: e }];
|
|
218
|
+
if (e._dom = t._dom, t.type === G)
|
|
219
|
+
return t.props.nodeValue !== e.props.nodeValue ? [{ type: m.TEXT, oldVNode: t, newVNode: e }] : [];
|
|
220
|
+
const s = [], n = ht(t.props, e.props);
|
|
221
|
+
n && s.push({ type: m.UPDATE, target: t, propPatches: n });
|
|
222
|
+
const r = dt(t.children, e.children);
|
|
223
|
+
return r.length && s.push({ type: m.CHILDREN, parent: t, childPatches: r }), s;
|
|
224
|
+
}
|
|
225
|
+
function ht(t, e) {
|
|
190
226
|
const s = {}, n = [];
|
|
191
|
-
let
|
|
192
|
-
for (const
|
|
193
|
-
|
|
194
|
-
for (const
|
|
195
|
-
|
|
196
|
-
return
|
|
197
|
-
}
|
|
198
|
-
function
|
|
227
|
+
let r = !1;
|
|
228
|
+
for (const o in e)
|
|
229
|
+
o !== "children" && t[o] !== e[o] && (s[o] = e[o], r = !0);
|
|
230
|
+
for (const o in t)
|
|
231
|
+
o !== "children" && (o in e || (n.push(o), r = !0));
|
|
232
|
+
return r ? { set: s, remove: n } : null;
|
|
233
|
+
}
|
|
234
|
+
function P(t, e) {
|
|
199
235
|
return t == null || e == null ? !1 : t.type === e.type && t.key === e.key;
|
|
200
236
|
}
|
|
201
|
-
function
|
|
237
|
+
function X(t, e) {
|
|
202
238
|
const s = /* @__PURE__ */ new Set();
|
|
203
|
-
let n = 0,
|
|
204
|
-
for (const
|
|
205
|
-
|
|
206
|
-
`[pulse] Duplicate key "${String(
|
|
207
|
-
), s.add(
|
|
208
|
-
n > 0 &&
|
|
209
|
-
`[pulse] Mixed keyed and unkeyed children in ${e} list (${n} keyed, ${
|
|
239
|
+
let n = 0, r = 0;
|
|
240
|
+
for (const o of t)
|
|
241
|
+
o != null && (o.key != null ? (n++, s.has(o.key) && console.warn(
|
|
242
|
+
`[pulse] Duplicate key "${String(o.key)}" in ${e} children. Keys must be unique among siblings.`
|
|
243
|
+
), s.add(o.key)) : r++);
|
|
244
|
+
n > 0 && r > 0 && console.warn(
|
|
245
|
+
`[pulse] Mixed keyed and unkeyed children in ${e} list (${n} keyed, ${r} unkeyed). Either all children should have keys or none should.`
|
|
210
246
|
);
|
|
211
247
|
}
|
|
212
|
-
function
|
|
213
|
-
var
|
|
214
|
-
process.env.NODE_ENV !== "production" && (
|
|
248
|
+
function dt(t, e) {
|
|
249
|
+
var y;
|
|
250
|
+
process.env.NODE_ENV !== "production" && (X(t, "old"), X(e, "new"));
|
|
215
251
|
const s = [];
|
|
216
|
-
let n = 0,
|
|
217
|
-
for (; n <=
|
|
218
|
-
if (
|
|
219
|
-
|
|
252
|
+
let n = 0, r = t.length - 1, o = 0, c = e.length - 1, l = t[n], a = t[r], i = e[o], p = e[c];
|
|
253
|
+
for (; n <= r && o <= c; ) {
|
|
254
|
+
if (l == null) {
|
|
255
|
+
l = t[++n];
|
|
220
256
|
continue;
|
|
221
257
|
}
|
|
222
|
-
if (
|
|
223
|
-
|
|
258
|
+
if (a == null) {
|
|
259
|
+
a = t[--r];
|
|
224
260
|
continue;
|
|
225
261
|
}
|
|
226
|
-
if (
|
|
227
|
-
s.push(...
|
|
228
|
-
else if (
|
|
229
|
-
s.push(...
|
|
230
|
-
else if (
|
|
231
|
-
s.push({
|
|
232
|
-
type: y.MOVE,
|
|
233
|
-
vnode: a,
|
|
234
|
-
anchor: t[o + 1] || null,
|
|
235
|
-
childPatches: k(a, u)
|
|
236
|
-
}), a = t[++n], u = e[--c];
|
|
237
|
-
else if (O(l, i))
|
|
262
|
+
if (P(l, i))
|
|
263
|
+
s.push(...w(l, i)), l = t[++n], i = e[++o];
|
|
264
|
+
else if (P(a, p))
|
|
265
|
+
s.push(...w(a, p)), a = t[--r], p = e[--c];
|
|
266
|
+
else if (P(l, p))
|
|
238
267
|
s.push({
|
|
239
|
-
type:
|
|
268
|
+
type: m.MOVE,
|
|
240
269
|
vnode: l,
|
|
241
|
-
anchor:
|
|
242
|
-
childPatches:
|
|
243
|
-
}), l = t[
|
|
270
|
+
anchor: t[r + 1] || null,
|
|
271
|
+
childPatches: w(l, p)
|
|
272
|
+
}), l = t[++n], p = e[--c];
|
|
273
|
+
else if (P(a, i))
|
|
274
|
+
s.push({
|
|
275
|
+
type: m.MOVE,
|
|
276
|
+
vnode: a,
|
|
277
|
+
anchor: l,
|
|
278
|
+
childPatches: w(a, i)
|
|
279
|
+
}), a = t[--r], i = e[++o];
|
|
244
280
|
else
|
|
245
281
|
break;
|
|
246
282
|
}
|
|
247
|
-
if (n <=
|
|
248
|
-
const
|
|
249
|
-
for (let
|
|
250
|
-
const
|
|
251
|
-
|
|
283
|
+
if (n <= r && o <= c) {
|
|
284
|
+
const h = /* @__PURE__ */ new Map();
|
|
285
|
+
for (let u = n; u <= r; u++) {
|
|
286
|
+
const d = (y = t[u]) == null ? void 0 : y.key;
|
|
287
|
+
d != null && h.set(d, u);
|
|
252
288
|
}
|
|
253
|
-
for (;
|
|
254
|
-
i = e[
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
289
|
+
for (; o <= c; ) {
|
|
290
|
+
i = e[o];
|
|
291
|
+
const u = i.key != null ? h.get(i.key) : void 0;
|
|
292
|
+
if (u !== void 0) {
|
|
293
|
+
const d = t[u];
|
|
258
294
|
s.push({
|
|
259
|
-
type:
|
|
260
|
-
vnode:
|
|
295
|
+
type: m.MOVE,
|
|
296
|
+
vnode: d,
|
|
261
297
|
anchor: t[n] || null,
|
|
262
|
-
childPatches:
|
|
263
|
-
}), t[
|
|
298
|
+
childPatches: w(d, i)
|
|
299
|
+
}), t[u] = null, h.delete(i.key);
|
|
264
300
|
} else
|
|
265
301
|
s.push({
|
|
266
|
-
type:
|
|
302
|
+
type: m.CREATE,
|
|
267
303
|
newVNode: i,
|
|
268
304
|
anchor: t[n] || null
|
|
269
305
|
});
|
|
270
|
-
|
|
306
|
+
o++;
|
|
271
307
|
}
|
|
272
|
-
for (let
|
|
273
|
-
t[
|
|
308
|
+
for (let u = n; u <= r; u++)
|
|
309
|
+
t[u] != null && s.push({ type: m.REMOVE, target: t[u] });
|
|
274
310
|
}
|
|
275
|
-
if (n >
|
|
276
|
-
const
|
|
277
|
-
for (let
|
|
278
|
-
s.push({ type:
|
|
279
|
-
} else if (
|
|
280
|
-
for (let
|
|
281
|
-
t[
|
|
311
|
+
if (n > r) {
|
|
312
|
+
const h = e[c + 1] || null;
|
|
313
|
+
for (let u = o; u <= c; u++)
|
|
314
|
+
s.push({ type: m.CREATE, newVNode: e[u], anchor: h });
|
|
315
|
+
} else if (o > c)
|
|
316
|
+
for (let h = n; h <= r; h++)
|
|
317
|
+
t[h] != null && s.push({ type: m.REMOVE, target: t[h] });
|
|
282
318
|
return s;
|
|
283
319
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
320
|
+
const Z = "http://www.w3.org/2000/svg";
|
|
321
|
+
function A(t, e) {
|
|
322
|
+
if (t.type === G) {
|
|
323
|
+
const n = document.createTextNode(t.props.nodeValue);
|
|
324
|
+
return t._dom = n, n;
|
|
288
325
|
}
|
|
289
|
-
if (t.type ===
|
|
290
|
-
const
|
|
291
|
-
for (const
|
|
292
|
-
|
|
293
|
-
return t._dom =
|
|
326
|
+
if (t.type === rt) {
|
|
327
|
+
const n = document.createDocumentFragment();
|
|
328
|
+
for (const r of t.children)
|
|
329
|
+
n.appendChild(A(r, e));
|
|
330
|
+
return t._dom = n, n;
|
|
294
331
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
332
|
+
t.type === "svg" ? e = Z : t.type === "foreignObject" && (e = void 0);
|
|
333
|
+
const s = e ? document.createElementNS(e, t.type) : document.createElement(t.type);
|
|
334
|
+
mt(s, {}, t.props);
|
|
335
|
+
for (const n of t.children)
|
|
336
|
+
s.appendChild(A(n, e));
|
|
337
|
+
return t._dom = s, s;
|
|
338
|
+
}
|
|
339
|
+
function mt(t, e, s) {
|
|
302
340
|
for (const n in e)
|
|
303
|
-
n === "children" || n === "key" || n in s ||
|
|
341
|
+
n === "children" || n === "key" || n in s || tt(t, n, e[n]);
|
|
304
342
|
for (const n in s)
|
|
305
|
-
n === "children" || n === "key" || e[n] !== s[n] &&
|
|
343
|
+
n === "children" || n === "key" || e[n] !== s[n] && v(t, n, s[n], e[n]);
|
|
306
344
|
}
|
|
307
|
-
function
|
|
345
|
+
function v(t, e, s, n) {
|
|
308
346
|
if (e.startsWith("on")) {
|
|
309
|
-
const
|
|
310
|
-
n && t.removeEventListener(
|
|
311
|
-
} else if (e === "className")
|
|
312
|
-
t.className = s || "";
|
|
347
|
+
const r = e.slice(2).toLowerCase();
|
|
348
|
+
n && t.removeEventListener(r, n), s && t.addEventListener(r, s);
|
|
349
|
+
} else if (e === "className" || e === "class")
|
|
350
|
+
t instanceof SVGElement ? t.setAttribute("class", s || "") : t.className = s || "";
|
|
313
351
|
else if (e === "style" && typeof s == "object") {
|
|
314
352
|
if (typeof n == "object" && n)
|
|
315
|
-
for (const
|
|
316
|
-
|
|
353
|
+
for (const r in n)
|
|
354
|
+
r in s || (t.style[r] = "");
|
|
317
355
|
Object.assign(t.style, s);
|
|
318
|
-
} else
|
|
356
|
+
} else if (e === "dangerouslySetInnerHTML")
|
|
357
|
+
s && typeof s.__html == "string" && (t.innerHTML = s.__html);
|
|
358
|
+
else if (e === "ref")
|
|
359
|
+
typeof s == "function" && s(t);
|
|
360
|
+
else if (e in t && !(t instanceof SVGElement))
|
|
361
|
+
try {
|
|
362
|
+
t[e] = s ?? "";
|
|
363
|
+
} catch {
|
|
364
|
+
t.setAttribute(e, s);
|
|
365
|
+
}
|
|
366
|
+
else s === !0 ? t.setAttribute(e, "") : s === !1 || s == null ? t.removeAttribute(e) : t.setAttribute(e, s);
|
|
367
|
+
}
|
|
368
|
+
function tt(t, e, s) {
|
|
369
|
+
if (e.startsWith("on"))
|
|
370
|
+
t.removeEventListener(e.slice(2).toLowerCase(), s);
|
|
371
|
+
else if (e === "dangerouslySetInnerHTML")
|
|
372
|
+
t.innerHTML = "";
|
|
373
|
+
else if (e === "className" || e === "class")
|
|
374
|
+
t instanceof SVGElement ? t.removeAttribute("class") : t.className = "";
|
|
375
|
+
else if (e in t && !(t instanceof SVGElement))
|
|
376
|
+
try {
|
|
377
|
+
t[e] = "";
|
|
378
|
+
} catch {
|
|
379
|
+
t.removeAttribute(e);
|
|
380
|
+
}
|
|
381
|
+
else
|
|
382
|
+
t.removeAttribute(e);
|
|
319
383
|
}
|
|
320
|
-
function
|
|
321
|
-
|
|
384
|
+
function z(t) {
|
|
385
|
+
return t instanceof SVGElement ? Z : void 0;
|
|
322
386
|
}
|
|
323
387
|
function R(t, e) {
|
|
324
|
-
var s, n,
|
|
325
|
-
for (const
|
|
326
|
-
switch (
|
|
327
|
-
case
|
|
328
|
-
const c =
|
|
329
|
-
(s =
|
|
388
|
+
var s, n, r;
|
|
389
|
+
for (const o of e)
|
|
390
|
+
switch (o.type) {
|
|
391
|
+
case m.CREATE: {
|
|
392
|
+
const c = A(o.newVNode, z(t));
|
|
393
|
+
(s = o.anchor) != null && s._dom ? t.insertBefore(c, o.anchor._dom) : t.appendChild(c);
|
|
330
394
|
break;
|
|
331
395
|
}
|
|
332
|
-
case
|
|
333
|
-
const c =
|
|
396
|
+
case m.REMOVE: {
|
|
397
|
+
const c = o.target._dom;
|
|
334
398
|
c != null && c.parentNode && c.parentNode.removeChild(c);
|
|
335
399
|
break;
|
|
336
400
|
}
|
|
337
|
-
case
|
|
338
|
-
const c =
|
|
339
|
-
|
|
401
|
+
case m.REPLACE: {
|
|
402
|
+
const c = o.oldVNode._dom, l = c == null ? void 0 : c.parentNode, a = A(
|
|
403
|
+
o.newVNode,
|
|
404
|
+
l ? z(l) : void 0
|
|
405
|
+
);
|
|
406
|
+
l && l.replaceChild(a, c);
|
|
340
407
|
break;
|
|
341
408
|
}
|
|
342
|
-
case
|
|
343
|
-
const c =
|
|
344
|
-
for (const i of
|
|
345
|
-
|
|
346
|
-
for (const i in
|
|
347
|
-
|
|
409
|
+
case m.UPDATE: {
|
|
410
|
+
const c = o.target._dom, { set: l, remove: a } = o.propPatches;
|
|
411
|
+
for (const i of a)
|
|
412
|
+
tt(c, i, o.target.props[i]);
|
|
413
|
+
for (const i in l)
|
|
414
|
+
v(c, i, l[i], o.target.props[i]);
|
|
348
415
|
break;
|
|
349
416
|
}
|
|
350
|
-
case
|
|
351
|
-
const c =
|
|
352
|
-
c && (c.nodeValue =
|
|
417
|
+
case m.TEXT: {
|
|
418
|
+
const c = o.oldVNode._dom;
|
|
419
|
+
c && (c.nodeValue = o.newVNode.props.nodeValue);
|
|
353
420
|
break;
|
|
354
421
|
}
|
|
355
|
-
case
|
|
356
|
-
const c =
|
|
357
|
-
c && ((n =
|
|
422
|
+
case m.MOVE: {
|
|
423
|
+
const c = o.vnode._dom;
|
|
424
|
+
c && ((n = o.anchor) != null && n._dom ? t.insertBefore(c, o.anchor._dom) : t.appendChild(c)), (r = o.childPatches) != null && r.length && c && R(c, o.childPatches);
|
|
358
425
|
break;
|
|
359
426
|
}
|
|
360
|
-
case
|
|
361
|
-
const c =
|
|
362
|
-
c &&
|
|
427
|
+
case m.CHILDREN: {
|
|
428
|
+
const c = o.parent._dom;
|
|
429
|
+
c && o.childPatches.length && R(c, o.childPatches);
|
|
363
430
|
break;
|
|
364
431
|
}
|
|
365
432
|
}
|
|
366
433
|
}
|
|
367
|
-
const
|
|
368
|
-
function
|
|
369
|
-
const s =
|
|
434
|
+
const F = /* @__PURE__ */ new WeakMap();
|
|
435
|
+
function Et(t, e) {
|
|
436
|
+
const s = F.get(e);
|
|
370
437
|
if (s) {
|
|
371
|
-
const n =
|
|
372
|
-
C(s.vTree,
|
|
373
|
-
const
|
|
374
|
-
R(e,
|
|
438
|
+
const n = k(t, e), r = [];
|
|
439
|
+
C(s.vTree, r);
|
|
440
|
+
const o = w(s.vTree, n);
|
|
441
|
+
R(e, o);
|
|
375
442
|
const c = [];
|
|
376
443
|
n && C(n, c);
|
|
377
|
-
const
|
|
378
|
-
for (const i of
|
|
379
|
-
|
|
380
|
-
const
|
|
444
|
+
const l = new Set(c);
|
|
445
|
+
for (const i of r)
|
|
446
|
+
l.has(i) || i.unmount();
|
|
447
|
+
const a = new Set(r);
|
|
381
448
|
for (const i of c)
|
|
382
|
-
|
|
383
|
-
|
|
449
|
+
a.has(i) || i.mount(e, () => D(i, e));
|
|
450
|
+
F.set(e, { vTree: n });
|
|
384
451
|
} else {
|
|
385
|
-
const n =
|
|
452
|
+
const n = k(t, e);
|
|
386
453
|
if (!n) return;
|
|
387
|
-
const
|
|
388
|
-
e.appendChild(
|
|
389
|
-
const
|
|
390
|
-
C(n,
|
|
391
|
-
for (const c of
|
|
392
|
-
c.mount(e, () =>
|
|
393
|
-
|
|
454
|
+
const r = A(n);
|
|
455
|
+
e.appendChild(r);
|
|
456
|
+
const o = [];
|
|
457
|
+
C(n, o);
|
|
458
|
+
for (const c of o)
|
|
459
|
+
c.mount(e, () => D(c, e));
|
|
460
|
+
F.set(e, { vTree: n });
|
|
394
461
|
}
|
|
395
462
|
}
|
|
396
|
-
function
|
|
463
|
+
function k(t, e) {
|
|
397
464
|
var s;
|
|
398
465
|
if (t == null) return null;
|
|
399
466
|
if (typeof t.type == "function") {
|
|
400
|
-
if (t.type[
|
|
401
|
-
const
|
|
467
|
+
if (t.type[Y]) {
|
|
468
|
+
const r = t.type._lifecycle;
|
|
402
469
|
try {
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
470
|
+
const o = new ft(t.type, t.props), c = t.type(t.props), a = k(c, e) ?? $("");
|
|
471
|
+
if (a._instance) {
|
|
405
472
|
const i = {
|
|
406
473
|
type: "div",
|
|
407
474
|
props: { style: { display: "contents" } },
|
|
408
|
-
children: [
|
|
475
|
+
children: [a],
|
|
409
476
|
key: t.key
|
|
410
477
|
};
|
|
411
|
-
return i._instance =
|
|
478
|
+
return i._instance = o, o.lastVTree = i, i;
|
|
412
479
|
}
|
|
413
|
-
return
|
|
414
|
-
} catch (
|
|
415
|
-
if (
|
|
416
|
-
const c =
|
|
417
|
-
|
|
480
|
+
return a._instance = o, o.lastVTree = a, a;
|
|
481
|
+
} catch (o) {
|
|
482
|
+
if (r != null && r.onError) {
|
|
483
|
+
const c = r.onError({
|
|
484
|
+
error: o,
|
|
485
|
+
props: t.props
|
|
486
|
+
});
|
|
487
|
+
return k(c, e);
|
|
418
488
|
}
|
|
419
|
-
throw
|
|
489
|
+
throw o;
|
|
420
490
|
}
|
|
421
491
|
}
|
|
422
492
|
const n = t.type({ ...t.props, children: t.children });
|
|
423
|
-
return
|
|
493
|
+
return k(n, e);
|
|
424
494
|
}
|
|
425
|
-
return (s = t.children) != null && s.length && (t.children = t.children.map((n) =>
|
|
495
|
+
return (s = t.children) != null && s.length && (t.children = t.children.map((n) => k(n, e)).filter((n) => n != null)), t;
|
|
426
496
|
}
|
|
427
|
-
function
|
|
428
|
-
var
|
|
497
|
+
function D(t, e) {
|
|
498
|
+
var r, o;
|
|
429
499
|
if (!t._renderCallback) return;
|
|
430
500
|
const s = t.connectedFn, n = s._lifecycle;
|
|
431
501
|
try {
|
|
432
|
-
const c = s(t.props);
|
|
433
|
-
let
|
|
434
|
-
if (
|
|
502
|
+
const c = s(t.props), a = k(c, e) ?? $("");
|
|
503
|
+
let i;
|
|
504
|
+
if (a._instance && a._instance !== t ? (i = {
|
|
435
505
|
type: "div",
|
|
436
506
|
props: { style: { display: "contents" } },
|
|
437
|
-
children: [
|
|
507
|
+
children: [a],
|
|
438
508
|
key: null
|
|
439
|
-
}, i._instance = t) : (
|
|
440
|
-
|
|
441
|
-
const
|
|
442
|
-
R(
|
|
509
|
+
}, i._instance = t) : (a._instance = t, i = a), t.lastVTree) {
|
|
510
|
+
W(t.lastVTree, t);
|
|
511
|
+
const d = w(t.lastVTree, i), g = ((r = t.lastVTree._dom) == null ? void 0 : r.parentNode) || e;
|
|
512
|
+
R(g, d), i._dom || (i._dom = t.lastVTree._dom);
|
|
443
513
|
}
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
const
|
|
449
|
-
for (const
|
|
450
|
-
|
|
514
|
+
const p = [];
|
|
515
|
+
L(t.lastVTree, p, t);
|
|
516
|
+
const y = [];
|
|
517
|
+
L(i, y, t);
|
|
518
|
+
const h = new Set(y);
|
|
519
|
+
for (const d of p)
|
|
520
|
+
h.has(d) || d.unmount();
|
|
451
521
|
t.lastVTree = i;
|
|
452
|
-
const
|
|
453
|
-
for (const
|
|
454
|
-
|
|
522
|
+
const u = new Set(p);
|
|
523
|
+
for (const d of y)
|
|
524
|
+
u.has(d) || d.mount(e, () => D(d, e));
|
|
455
525
|
n != null && n.onUpdate && n.onUpdate({
|
|
456
526
|
dom: i == null ? void 0 : i._dom,
|
|
457
527
|
props: t.props
|
|
458
528
|
}), t.updateSelected();
|
|
459
529
|
} catch (c) {
|
|
460
530
|
if (n != null && n.onError) {
|
|
461
|
-
const
|
|
462
|
-
if (t.lastVTree &&
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
R(
|
|
531
|
+
const l = n.onError({ error: c, props: t.props }), a = k(l, e);
|
|
532
|
+
if (t.lastVTree && a) {
|
|
533
|
+
W(t.lastVTree, t);
|
|
534
|
+
const p = w(t.lastVTree, a), y = ((o = t.lastVTree._dom) == null ? void 0 : o.parentNode) || e;
|
|
535
|
+
R(y, p), a._dom || (a._dom = t.lastVTree._dom);
|
|
466
536
|
}
|
|
467
537
|
const i = [];
|
|
468
|
-
|
|
469
|
-
for (const
|
|
470
|
-
t.lastVTree =
|
|
538
|
+
L(t.lastVTree, i, t);
|
|
539
|
+
for (const p of i) p.unmount();
|
|
540
|
+
t.lastVTree = a, t.updateSelected();
|
|
471
541
|
} else
|
|
472
542
|
throw c;
|
|
473
543
|
}
|
|
474
544
|
}
|
|
475
|
-
function
|
|
545
|
+
function W(t, e) {
|
|
476
546
|
if (!(!t || !t.children))
|
|
477
547
|
for (let s = 0; s < t.children.length; s++) {
|
|
478
548
|
const n = t.children[s];
|
|
479
|
-
n._instance && n._instance !== e && n._instance.lastVTree && n._instance.lastVTree !== n && (t.children[s] = n._instance.lastVTree),
|
|
549
|
+
n._instance && n._instance !== e && n._instance.lastVTree && n._instance.lastVTree !== n && (t.children[s] = n._instance.lastVTree), W(t.children[s], e);
|
|
480
550
|
}
|
|
481
551
|
}
|
|
482
552
|
function C(t, e) {
|
|
@@ -484,148 +554,184 @@ function C(t, e) {
|
|
|
484
554
|
for (const s of t.children)
|
|
485
555
|
C(s, e);
|
|
486
556
|
}
|
|
487
|
-
function
|
|
557
|
+
function L(t, e, s) {
|
|
488
558
|
if (t && (t._instance && t._instance !== s && e.push(t._instance), t.children))
|
|
489
559
|
for (const n of t.children)
|
|
490
|
-
|
|
560
|
+
L(n, e, s);
|
|
491
561
|
}
|
|
492
|
-
function
|
|
562
|
+
function j(t) {
|
|
493
563
|
return t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t || "/";
|
|
494
564
|
}
|
|
495
|
-
function
|
|
565
|
+
function B(t) {
|
|
496
566
|
const e = {};
|
|
497
567
|
if (!t) return e;
|
|
498
568
|
const s = t.startsWith("?") ? t.slice(1) : t;
|
|
499
|
-
return s && new URLSearchParams(s).forEach((
|
|
500
|
-
e[
|
|
569
|
+
return s && new URLSearchParams(s).forEach((r, o) => {
|
|
570
|
+
e[o] = r;
|
|
501
571
|
}), e;
|
|
502
572
|
}
|
|
503
|
-
function
|
|
504
|
-
const s =
|
|
573
|
+
function et(t, e) {
|
|
574
|
+
const s = j(t), n = j(e);
|
|
505
575
|
if (n === "*")
|
|
506
576
|
return { params: { "*": s } };
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
577
|
+
const r = s === "/" ? [""] : s.split("/").slice(1), o = n === "/" ? [""] : n.split("/").slice(1);
|
|
578
|
+
if (o.length > 0 && o[o.length - 1] === "*") {
|
|
579
|
+
const a = o.slice(0, -1);
|
|
580
|
+
if (r.length < a.length) return null;
|
|
511
581
|
const i = {};
|
|
512
|
-
for (let
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
i[
|
|
516
|
-
else if (
|
|
582
|
+
for (let y = 0; y < a.length; y++) {
|
|
583
|
+
const h = a[y];
|
|
584
|
+
if (h.startsWith(":"))
|
|
585
|
+
i[h.slice(1)] = r[y];
|
|
586
|
+
else if (h !== r[y])
|
|
517
587
|
return null;
|
|
518
588
|
}
|
|
519
|
-
const
|
|
520
|
-
return i["*"] =
|
|
589
|
+
const p = r.slice(a.length).join("/");
|
|
590
|
+
return i["*"] = p, { params: i };
|
|
521
591
|
}
|
|
522
|
-
if (
|
|
523
|
-
const
|
|
524
|
-
for (let
|
|
525
|
-
const i =
|
|
592
|
+
if (r.length !== o.length) return null;
|
|
593
|
+
const l = {};
|
|
594
|
+
for (let a = 0; a < o.length; a++) {
|
|
595
|
+
const i = o[a];
|
|
526
596
|
if (i.startsWith(":"))
|
|
527
|
-
|
|
528
|
-
else if (i !==
|
|
597
|
+
l[i.slice(1)] = r[a];
|
|
598
|
+
else if (i !== r[a])
|
|
529
599
|
return null;
|
|
530
600
|
}
|
|
531
|
-
return { params:
|
|
601
|
+
return { params: l };
|
|
532
602
|
}
|
|
533
|
-
function
|
|
603
|
+
function Q(t, e) {
|
|
534
604
|
for (const s of e) {
|
|
535
|
-
const n =
|
|
605
|
+
const n = et(t, s.path);
|
|
536
606
|
if (n)
|
|
537
607
|
return { pattern: s.path, params: n.params };
|
|
538
608
|
}
|
|
539
609
|
return null;
|
|
540
610
|
}
|
|
541
|
-
function
|
|
542
|
-
const { routes: e, initialPath: s } = t, n = s ?? window.location.pathname,
|
|
611
|
+
function St(t) {
|
|
612
|
+
const { routes: e, initialPath: s } = t, n = s ?? window.location.pathname, r = s ? "" : window.location.search, o = j(n), c = B(r), l = Q(o, e), a = it({
|
|
543
613
|
state: {
|
|
544
|
-
path:
|
|
545
|
-
params: (
|
|
614
|
+
path: o,
|
|
615
|
+
params: (l == null ? void 0 : l.params) ?? {},
|
|
546
616
|
query: c,
|
|
547
|
-
matched: (
|
|
617
|
+
matched: (l == null ? void 0 : l.pattern) ?? null
|
|
548
618
|
},
|
|
549
619
|
actions: {
|
|
550
|
-
_sync: (
|
|
620
|
+
_sync: (f, _) => _
|
|
551
621
|
}
|
|
552
622
|
});
|
|
553
|
-
function i(
|
|
554
|
-
const
|
|
623
|
+
function i(f) {
|
|
624
|
+
const _ = f.indexOf("?"), V = j(
|
|
625
|
+
_ >= 0 ? f.slice(0, _) : f
|
|
626
|
+
), O = _ >= 0 ? f.slice(_ + 1) : "", E = B(O), S = Q(V, e);
|
|
555
627
|
return {
|
|
556
|
-
path:
|
|
557
|
-
params: (
|
|
558
|
-
query:
|
|
559
|
-
matched: (
|
|
628
|
+
path: V,
|
|
629
|
+
params: (S == null ? void 0 : S.params) ?? {},
|
|
630
|
+
query: E,
|
|
631
|
+
matched: (S == null ? void 0 : S.pattern) ?? null
|
|
560
632
|
};
|
|
561
633
|
}
|
|
562
|
-
function
|
|
563
|
-
const
|
|
564
|
-
window.history.pushState(null, "",
|
|
634
|
+
function p(f) {
|
|
635
|
+
const _ = i(f);
|
|
636
|
+
window.history.pushState(null, "", f), a.dispatch("_sync", _);
|
|
565
637
|
}
|
|
566
|
-
function
|
|
567
|
-
const
|
|
568
|
-
window.history.replaceState(null, "",
|
|
638
|
+
function y(f) {
|
|
639
|
+
const _ = i(f);
|
|
640
|
+
window.history.replaceState(null, "", f), a.dispatch("_sync", _);
|
|
569
641
|
}
|
|
570
|
-
function
|
|
642
|
+
function h() {
|
|
571
643
|
window.history.back();
|
|
572
644
|
}
|
|
573
|
-
function
|
|
645
|
+
function u() {
|
|
574
646
|
window.history.forward();
|
|
575
647
|
}
|
|
576
|
-
function
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
);
|
|
580
|
-
l.dispatch("_sync", d);
|
|
648
|
+
function d() {
|
|
649
|
+
const f = i(window.location.pathname + window.location.search);
|
|
650
|
+
a.dispatch("_sync", f);
|
|
581
651
|
}
|
|
582
|
-
window.addEventListener("popstate",
|
|
583
|
-
function
|
|
584
|
-
window.removeEventListener("popstate",
|
|
652
|
+
window.addEventListener("popstate", d);
|
|
653
|
+
function g() {
|
|
654
|
+
window.removeEventListener("popstate", d);
|
|
585
655
|
}
|
|
586
|
-
const
|
|
587
|
-
_path:
|
|
588
|
-
})(function(
|
|
589
|
-
const { _path:
|
|
590
|
-
return
|
|
656
|
+
const b = ut({
|
|
657
|
+
_path: a.select((f) => f.path)
|
|
658
|
+
})(function(_) {
|
|
659
|
+
const { _path: V, path: O, component: E, children: S, ...nt } = _, q = et(V, O);
|
|
660
|
+
return q ? E ? K(E, { ...nt, params: q.params }) : (S == null ? void 0 : S[0]) ?? null : null;
|
|
591
661
|
});
|
|
592
|
-
function
|
|
593
|
-
const { to:
|
|
594
|
-
return
|
|
662
|
+
function I(f) {
|
|
663
|
+
const { to: _, children: V, ...O } = f;
|
|
664
|
+
return K(
|
|
595
665
|
"a",
|
|
596
666
|
{
|
|
597
|
-
...
|
|
598
|
-
href:
|
|
599
|
-
onClick: (
|
|
600
|
-
|
|
667
|
+
...O,
|
|
668
|
+
href: _,
|
|
669
|
+
onClick: (E) => {
|
|
670
|
+
E.metaKey || E.ctrlKey || E.shiftKey || E.button !== 0 || (E.preventDefault(), p(_));
|
|
601
671
|
}
|
|
602
672
|
},
|
|
603
|
-
...
|
|
673
|
+
...V || []
|
|
604
674
|
);
|
|
605
675
|
}
|
|
606
|
-
function
|
|
607
|
-
return
|
|
676
|
+
function x(f) {
|
|
677
|
+
return y(f.to), null;
|
|
608
678
|
}
|
|
609
679
|
return {
|
|
610
|
-
store:
|
|
611
|
-
navigate:
|
|
612
|
-
redirect:
|
|
613
|
-
back:
|
|
614
|
-
forward:
|
|
615
|
-
destroy:
|
|
616
|
-
Route:
|
|
617
|
-
Link:
|
|
618
|
-
Redirect:
|
|
680
|
+
store: a,
|
|
681
|
+
navigate: p,
|
|
682
|
+
redirect: y,
|
|
683
|
+
back: h,
|
|
684
|
+
forward: u,
|
|
685
|
+
destroy: g,
|
|
686
|
+
Route: b,
|
|
687
|
+
Link: I,
|
|
688
|
+
Redirect: x
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
function gt() {
|
|
692
|
+
return (t, e) => {
|
|
693
|
+
const s = `[pulse] ${t.actionName}`;
|
|
694
|
+
console.group(s), console.log("prev state", t.prevState), console.log("payload", t.payload), e(), console.log("next state", t.nextState), console.groupEnd();
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
function bt(t, e) {
|
|
698
|
+
return async (...s) => {
|
|
699
|
+
e.start && t.dispatch(e.start);
|
|
700
|
+
try {
|
|
701
|
+
const n = await e.run(...s);
|
|
702
|
+
return t.dispatch(e.ok, n), n;
|
|
703
|
+
} catch (n) {
|
|
704
|
+
if (e.fail)
|
|
705
|
+
t.dispatch(e.fail, (n == null ? void 0 : n.message) ?? String(n));
|
|
706
|
+
else
|
|
707
|
+
throw n;
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
function Tt(t, e) {
|
|
713
|
+
const s = (e == null ? void 0 : e.maxEntries) ?? 1 / 0;
|
|
714
|
+
return (n, r) => {
|
|
715
|
+
r(), t.push({
|
|
716
|
+
actionName: n.actionName,
|
|
717
|
+
payload: n.payload,
|
|
718
|
+
prevState: n.prevState,
|
|
719
|
+
nextState: n.nextState ?? n.prevState,
|
|
720
|
+
timestamp: Date.now()
|
|
721
|
+
}), t.length > s && t.splice(0, t.length - s);
|
|
619
722
|
};
|
|
620
723
|
}
|
|
621
724
|
export {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
725
|
+
rt as Fragment,
|
|
726
|
+
Tt as actionHistory,
|
|
727
|
+
ut as connect,
|
|
728
|
+
bt as createAsyncAction,
|
|
729
|
+
K as createElement,
|
|
730
|
+
St as createRouter,
|
|
731
|
+
it as createStore,
|
|
732
|
+
_t as flushSync,
|
|
733
|
+
K as h,
|
|
734
|
+
gt as logger,
|
|
735
|
+
Et as render
|
|
630
736
|
};
|
|
631
737
|
//# sourceMappingURL=pulse.js.map
|