jaxs 0.6.2 → 0.7.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/jaxs.d.ts +722 -943
- package/dist/jaxs.js +785 -1039
- package/dist/jaxs.umd.cjs +1 -1157
- package/package.json +3 -3
package/dist/jaxs.js
CHANGED
|
@@ -1,742 +1,634 @@
|
|
|
1
|
-
const Z = (e, t) => t.createElement(e),
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
rt = (e, t) => !!(nt[e] || (e === 'a' && t === y)),
|
|
96
|
-
ot = (e, t, s) => {
|
|
97
|
-
const n = s.createElementNS(y, e)
|
|
98
|
-
for (const r in t)
|
|
99
|
-
r === '__self' ||
|
|
100
|
-
r === 'xmlns' ||
|
|
101
|
-
n.setAttributeNS(null, r, t[r].toString())
|
|
102
|
-
return n
|
|
103
|
-
},
|
|
104
|
-
it = (e) => e.namespaceURI === y,
|
|
105
|
-
ut = (e, t) => t.createTextNode(e)
|
|
1
|
+
const Z = (e, t) => t.createElement(e), tt = (e, t) => {
|
|
2
|
+
for (const s in t) {
|
|
3
|
+
if (s === "__self") continue;
|
|
4
|
+
const r = t[s].toString();
|
|
5
|
+
if (s === "value") {
|
|
6
|
+
const n = e;
|
|
7
|
+
n.value !== r && (n.value = r);
|
|
8
|
+
} else
|
|
9
|
+
e.setAttribute(s, r);
|
|
10
|
+
}
|
|
11
|
+
}, et = (e, t, s) => {
|
|
12
|
+
const r = {};
|
|
13
|
+
for (const n in t) {
|
|
14
|
+
const o = t[n], a = (l) => s(o, l);
|
|
15
|
+
e.addEventListener(n, a), r[n] = {
|
|
16
|
+
domEvent: n,
|
|
17
|
+
busEvent: o,
|
|
18
|
+
listener: a
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
e.eventMaps = r;
|
|
22
|
+
}, st = (e, t, s, r) => {
|
|
23
|
+
const n = Z(e, r.document);
|
|
24
|
+
return tt(n, t), et(n, s, r.publish), n;
|
|
25
|
+
}, y = "http://www.w3.org/2000/svg", rt = {
|
|
26
|
+
animate: !0,
|
|
27
|
+
animateMotion: !0,
|
|
28
|
+
animateTransform: !0,
|
|
29
|
+
circle: !0,
|
|
30
|
+
clipPath: !0,
|
|
31
|
+
defs: !0,
|
|
32
|
+
desc: !0,
|
|
33
|
+
ellipse: !0,
|
|
34
|
+
feBlend: !0,
|
|
35
|
+
feColorMatrix: !0,
|
|
36
|
+
feComponentTransfer: !0,
|
|
37
|
+
feComposite: !0,
|
|
38
|
+
feConvolveMatrix: !0,
|
|
39
|
+
feDiffuseLighting: !0,
|
|
40
|
+
feDisplacementMap: !0,
|
|
41
|
+
feDistantLight: !0,
|
|
42
|
+
feDropShadow: !0,
|
|
43
|
+
feFlood: !0,
|
|
44
|
+
feFuncA: !0,
|
|
45
|
+
feFuncB: !0,
|
|
46
|
+
feFuncG: !0,
|
|
47
|
+
feFuncR: !0,
|
|
48
|
+
feGaussianBlur: !0,
|
|
49
|
+
feImage: !0,
|
|
50
|
+
feMerge: !0,
|
|
51
|
+
feMergeNode: !0,
|
|
52
|
+
feMorphology: !0,
|
|
53
|
+
feOffset: !0,
|
|
54
|
+
fePointLight: !0,
|
|
55
|
+
feSpecularLighting: !0,
|
|
56
|
+
feSpotLight: !0,
|
|
57
|
+
feTile: !0,
|
|
58
|
+
feTurbulence: !0,
|
|
59
|
+
filter: !0,
|
|
60
|
+
foreignObject: !0,
|
|
61
|
+
g: !0,
|
|
62
|
+
image: !0,
|
|
63
|
+
line: !0,
|
|
64
|
+
linearGradient: !0,
|
|
65
|
+
marker: !0,
|
|
66
|
+
mask: !0,
|
|
67
|
+
metadata: !0,
|
|
68
|
+
mpath: !0,
|
|
69
|
+
path: !0,
|
|
70
|
+
pattern: !0,
|
|
71
|
+
polygon: !0,
|
|
72
|
+
polyline: !0,
|
|
73
|
+
radialGradient: !0,
|
|
74
|
+
rect: !0,
|
|
75
|
+
script: !0,
|
|
76
|
+
set: !0,
|
|
77
|
+
stop: !0,
|
|
78
|
+
style: !0,
|
|
79
|
+
svg: !0,
|
|
80
|
+
switch: !0,
|
|
81
|
+
symbol: !0,
|
|
82
|
+
text: !0,
|
|
83
|
+
textPath: !0,
|
|
84
|
+
title: !0,
|
|
85
|
+
tspan: !0,
|
|
86
|
+
use: !0,
|
|
87
|
+
view: !0
|
|
88
|
+
}, nt = (e, t) => !!(rt[e] || e === "a" && t === y), ot = (e, t, s) => {
|
|
89
|
+
const r = s.createElementNS(y, e);
|
|
90
|
+
for (const n in t)
|
|
91
|
+
n === "__self" || n === "xmlns" || r.setAttributeNS(null, n, t[n].toString());
|
|
92
|
+
return r;
|
|
93
|
+
}, it = (e) => e.namespaceURI === y, ut = (e, t) => t.createTextNode(e);
|
|
106
94
|
class at {
|
|
107
95
|
constructor(t) {
|
|
108
|
-
this.value = t.toString()
|
|
96
|
+
this.value = t.toString();
|
|
109
97
|
}
|
|
110
98
|
render(t) {
|
|
111
|
-
const s = ut(this.value, t.document)
|
|
112
|
-
return
|
|
99
|
+
const s = ut(this.value, t.document);
|
|
100
|
+
return s.__jsx = "TextNode", [s];
|
|
113
101
|
}
|
|
114
102
|
}
|
|
115
|
-
const ct = (e) => typeof e ==
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const o = e[r]
|
|
126
|
-
if (r.match(/^on.+/i)) {
|
|
127
|
-
const a = r.slice(2).toLowerCase()
|
|
128
|
-
n[a] = o ? o.toString() : ''
|
|
129
|
-
} else {
|
|
130
|
-
if (o === !1) continue
|
|
131
|
-
r === '__source' ? (s.__source = e.__source) : (s[r] = ft(r, o, t))
|
|
132
|
-
}
|
|
103
|
+
const ct = (e) => typeof e == "string" || typeof e == "number", lt = (e) => new at(e), ht = (e) => ct(e) ? lt(e) : e, dt = (e) => pt(e).map(ht).flat(), pt = (e) => Array.isArray(e) ? e.flat() : e ? [e] : [], T = (e, t = {}) => e || t.children || [], mt = (e, t = "") => {
|
|
104
|
+
const s = {}, r = {};
|
|
105
|
+
for (const n in e) {
|
|
106
|
+
const o = e[n];
|
|
107
|
+
if (n.match(/^on.+/i)) {
|
|
108
|
+
const a = n.slice(2).toLowerCase();
|
|
109
|
+
r[a] = o ? o.toString() : "";
|
|
110
|
+
} else {
|
|
111
|
+
if (o === !1) continue;
|
|
112
|
+
n === "__source" ? s.__source = e.__source : s[n] = ft(n, o, t);
|
|
133
113
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
? O(n, e, t, s)
|
|
150
|
-
: (n.render(e, t).forEach((r) => s.push(r)), s)
|
|
151
|
-
: s
|
|
152
|
-
class M {
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
attributes: s,
|
|
117
|
+
events: r
|
|
118
|
+
};
|
|
119
|
+
}, ft = (e, t, s = "") => t == null ? s : t.toString(), bt = (e, t) => {
|
|
120
|
+
const s = e || {}, r = T(t, s);
|
|
121
|
+
return s.children = s.children || r, s;
|
|
122
|
+
}, j = (e, t, s, r = []) => e.reduce(vt(t, s), r).flat(), vt = (e, t) => (s, r) => r ? Array.isArray(r) ? j(
|
|
123
|
+
r,
|
|
124
|
+
e,
|
|
125
|
+
t,
|
|
126
|
+
s
|
|
127
|
+
) : (r.render(e, t).forEach((n) => s.push(n)), s) : s;
|
|
128
|
+
class O {
|
|
153
129
|
constructor(t) {
|
|
154
|
-
this.collection = dt(t)
|
|
130
|
+
this.collection = dt(t);
|
|
155
131
|
}
|
|
156
132
|
render(t, s) {
|
|
157
|
-
this.parentElement = s
|
|
158
|
-
const
|
|
159
|
-
return this.attachToParent(
|
|
133
|
+
this.parentElement = s;
|
|
134
|
+
const r = this.generateDom(t);
|
|
135
|
+
return this.attachToParent(r), r;
|
|
160
136
|
}
|
|
161
137
|
generateDom(t) {
|
|
162
|
-
return
|
|
138
|
+
return j(this.collection, t, this.parentElement);
|
|
163
139
|
}
|
|
164
140
|
attachToParent(t) {
|
|
165
|
-
if (this.parentElement === void 0) return
|
|
166
|
-
const s = this.parentElement
|
|
167
|
-
t.forEach((
|
|
141
|
+
if (this.parentElement === void 0) return;
|
|
142
|
+
const s = this.parentElement;
|
|
143
|
+
t.forEach((r) => s.appendChild(r));
|
|
168
144
|
}
|
|
169
145
|
}
|
|
170
146
|
class gt {
|
|
171
147
|
constructor(t, s) {
|
|
172
|
-
|
|
148
|
+
this.type = t, this.attributes = s;
|
|
173
149
|
}
|
|
174
150
|
generate() {
|
|
175
|
-
return (
|
|
176
|
-
this.attributes.key || this.sourceKey() || this.createKeyFromAttributes()
|
|
177
|
-
)
|
|
151
|
+
return this.attributes.key || this.sourceKey() || this.createKeyFromAttributes();
|
|
178
152
|
}
|
|
179
153
|
sourceKey() {
|
|
180
154
|
if (this.attributes.__source) {
|
|
181
|
-
const {
|
|
182
|
-
|
|
183
|
-
lineNumber: s,
|
|
184
|
-
columnNumber: n,
|
|
185
|
-
} = this.attributes.__source
|
|
186
|
-
return `${t}:${s}:${n}`
|
|
155
|
+
const { fileName: t, lineNumber: s, columnNumber: r } = this.attributes.__source;
|
|
156
|
+
return `${t}:${s}:${r}`;
|
|
187
157
|
}
|
|
188
158
|
}
|
|
189
159
|
createKeyFromAttributes() {
|
|
190
|
-
const t = this.attributes.id ? `#${this.attributes.id}` :
|
|
191
|
-
|
|
192
|
-
n = this.attributes.name ? `[name=${this.attributes.name}]` : ''
|
|
193
|
-
return `${this.type}${t}${s}${n}`
|
|
160
|
+
const t = this.attributes.id ? `#${this.attributes.id}` : "", s = this.attributes.type ? `[type=${this.attributes.type}]` : "", r = this.attributes.name ? `[name=${this.attributes.name}]` : "";
|
|
161
|
+
return `${this.type}${t}${s}${r}`;
|
|
194
162
|
}
|
|
195
163
|
}
|
|
196
164
|
class yt {
|
|
197
|
-
constructor(t, s,
|
|
198
|
-
this.type = t
|
|
199
|
-
const { events:
|
|
200
|
-
|
|
201
|
-
(this.attributes = o),
|
|
202
|
-
(this.isSvg = rt(this.type, this.attributes.xmlns)),
|
|
203
|
-
(this.children = new M(n))
|
|
165
|
+
constructor(t, s, r = []) {
|
|
166
|
+
this.type = t;
|
|
167
|
+
const { events: n, attributes: o } = mt(s);
|
|
168
|
+
this.events = n, this.attributes = o, this.isSvg = nt(this.type, this.attributes.xmlns), this.children = new O(r);
|
|
204
169
|
}
|
|
205
170
|
render(t) {
|
|
206
|
-
const s = this.generateDom(t)
|
|
207
|
-
return s ? (this.children.render(t, s), [s]) : []
|
|
171
|
+
const s = this.generateDom(t);
|
|
172
|
+
return s ? (this.children.render(t, s), [s]) : [];
|
|
208
173
|
}
|
|
209
174
|
generateDom(t) {
|
|
210
|
-
return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t)
|
|
175
|
+
return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t);
|
|
211
176
|
}
|
|
212
177
|
generateHtmlDom(t) {
|
|
213
|
-
const s = st(
|
|
214
|
-
|
|
178
|
+
const s = st(
|
|
179
|
+
this.type,
|
|
180
|
+
this.attributes,
|
|
181
|
+
this.events,
|
|
182
|
+
t
|
|
183
|
+
);
|
|
184
|
+
return s.__jsx = this.jsxKey(), s;
|
|
215
185
|
}
|
|
216
186
|
generateSvgDom(t) {
|
|
217
|
-
const s = ot(this.type, this.attributes, t.document)
|
|
218
|
-
return
|
|
187
|
+
const s = ot(this.type, this.attributes, t.document);
|
|
188
|
+
return s.__jsx = this.jsxKey(), s;
|
|
219
189
|
}
|
|
220
190
|
jsxKey() {
|
|
221
|
-
return new gt(this.type, this.attributes).generate()
|
|
191
|
+
return new gt(this.type, this.attributes).generate();
|
|
222
192
|
}
|
|
223
193
|
}
|
|
224
|
-
const Et = (e, t, ...s) =>
|
|
225
|
-
typeof e == 'string' ? new yt(e, t, s) : e(bt(t, s))
|
|
194
|
+
const Et = (e, t, ...s) => typeof e == "string" ? new yt(e, t, s) : e(bt(t, s));
|
|
226
195
|
Et.fragment = (e, t) => {
|
|
227
|
-
const s =
|
|
228
|
-
return new
|
|
229
|
-
}
|
|
196
|
+
const s = T(t, e);
|
|
197
|
+
return new O(s);
|
|
198
|
+
};
|
|
230
199
|
class xt {
|
|
231
|
-
constructor(t, s,
|
|
232
|
-
|
|
233
|
-
(this.selector = s),
|
|
234
|
-
(this.renderKit = n),
|
|
235
|
-
(this.dom = [])
|
|
200
|
+
constructor(t, s, r) {
|
|
201
|
+
this.template = t, this.selector = s, this.renderKit = r, this.dom = [];
|
|
236
202
|
}
|
|
237
203
|
renderAndAttach(t) {
|
|
238
|
-
|
|
239
|
-
(this.dom = this.render({ ...t, parent: this.parentElement })),
|
|
240
|
-
this.parentElement && this.attach()
|
|
204
|
+
this.parentElement = this.getParentElement(), this.dom = this.render({ ...t, parent: this.parentElement }), this.parentElement && this.attach();
|
|
241
205
|
}
|
|
242
206
|
render(t) {
|
|
243
|
-
return this.template.render(t)
|
|
207
|
+
return this.template.render(t);
|
|
244
208
|
}
|
|
245
209
|
attach() {
|
|
246
|
-
this.parentElement && (this.parentElement.innerHTML =
|
|
247
|
-
this.
|
|
248
|
-
|
|
249
|
-
})
|
|
210
|
+
this.parentElement && (this.parentElement.innerHTML = ""), this.dom.forEach((t) => {
|
|
211
|
+
this.parentElement && this.parentElement.appendChild(t);
|
|
212
|
+
});
|
|
250
213
|
}
|
|
251
214
|
getParentElement() {
|
|
252
|
-
return this.renderKit.document.querySelector(this.selector)
|
|
215
|
+
return this.renderKit.document.querySelector(this.selector);
|
|
253
216
|
}
|
|
254
217
|
}
|
|
255
218
|
const At = (e, t, s) => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
m
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
E(s,
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
c = {
|
|
311
|
-
host: o,
|
|
312
|
-
path: u,
|
|
313
|
-
query: d,
|
|
314
|
-
}
|
|
315
|
-
s.store('route').update(c), n($, c)
|
|
316
|
-
},
|
|
317
|
-
B = (e) => {
|
|
318
|
-
const { subscribe: t } = e
|
|
319
|
-
t(k, F),
|
|
320
|
-
t(T, (s, n) => {
|
|
321
|
-
E(s, n)
|
|
322
|
-
})
|
|
323
|
-
},
|
|
324
|
-
V = (e) => {
|
|
325
|
-
const { publish: t, subscribe: s, state: n, window: r } = e
|
|
326
|
-
D(n), r.addEventListener('popstate', () => t(m, null)), s(m, z)
|
|
327
|
-
},
|
|
328
|
-
K = (e) => {
|
|
329
|
-
setTimeout(() => e.publish(m, null), 0)
|
|
330
|
-
},
|
|
331
|
-
R = (e) => {
|
|
332
|
-
V(e), B(e), K(e)
|
|
333
|
-
},
|
|
334
|
-
wt = /* @__PURE__ */ Object.freeze(
|
|
335
|
-
/* @__PURE__ */ Object.defineProperty(
|
|
336
|
-
{
|
|
337
|
-
__proto__: null,
|
|
338
|
-
publishLocation: K,
|
|
339
|
-
startNavigation: R,
|
|
340
|
-
subscribeToHistoryChange: V,
|
|
341
|
-
subscribeToNavigation: B,
|
|
342
|
-
},
|
|
343
|
-
Symbol.toStringTag,
|
|
344
|
-
{ value: 'Module' },
|
|
345
|
-
),
|
|
346
|
-
)
|
|
219
|
+
const r = new xt(e, t, s);
|
|
220
|
+
return r.renderAndAttach(s), r;
|
|
221
|
+
}, M = "go-to-href", k = "go-to", m = "navigation:location-change", $ = "navigation:route-change", wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
222
|
+
__proto__: null,
|
|
223
|
+
linkNavigationEvent: M,
|
|
224
|
+
locationChangeEvent: m,
|
|
225
|
+
navigationEvent: k,
|
|
226
|
+
routeChangeEvent: $
|
|
227
|
+
}, Symbol.toStringTag, { value: "Module" })), D = (e) => {
|
|
228
|
+
e.create("route", {
|
|
229
|
+
host: "",
|
|
230
|
+
path: "",
|
|
231
|
+
query: {}
|
|
232
|
+
});
|
|
233
|
+
}, P = (e) => {
|
|
234
|
+
const t = e.closest("[href]");
|
|
235
|
+
return t && t.getAttribute("href") || "";
|
|
236
|
+
}, E = (e, { publish: t, window: s }) => {
|
|
237
|
+
s.history.pushState(null, "", e), t(m, null);
|
|
238
|
+
}, F = (e, t) => {
|
|
239
|
+
if (!e || !e.target) return;
|
|
240
|
+
e.preventDefault();
|
|
241
|
+
const s = P(e.target);
|
|
242
|
+
E(s, t);
|
|
243
|
+
}, L = (e) => e.replace(/^\?/, "").split("&").reduce((t, s) => {
|
|
244
|
+
if (!s) return t;
|
|
245
|
+
const r = s.split("=");
|
|
246
|
+
return t[r[0]] = r[1], t;
|
|
247
|
+
}, {}), z = (e, t) => {
|
|
248
|
+
const { state: s, publish: r, window: n } = t, { host: o, pathname: a, search: l } = n.location, u = a, d = L(l), c = {
|
|
249
|
+
host: o,
|
|
250
|
+
path: u,
|
|
251
|
+
query: d
|
|
252
|
+
};
|
|
253
|
+
s.store("route").update(c), r($, c);
|
|
254
|
+
}, B = (e) => {
|
|
255
|
+
const { subscribe: t } = e;
|
|
256
|
+
t(M, F), t(k, (s, r) => {
|
|
257
|
+
E(s, r);
|
|
258
|
+
});
|
|
259
|
+
}, V = (e) => {
|
|
260
|
+
const { publish: t, subscribe: s, state: r, window: n } = e;
|
|
261
|
+
D(r), n.addEventListener("popstate", () => t(m, null)), s(m, z);
|
|
262
|
+
}, K = (e) => {
|
|
263
|
+
setTimeout(() => e.publish(m, null), 0);
|
|
264
|
+
}, R = (e) => {
|
|
265
|
+
V(e), B(e), K(e);
|
|
266
|
+
}, Nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
267
|
+
__proto__: null,
|
|
268
|
+
publishLocation: K,
|
|
269
|
+
startNavigation: R,
|
|
270
|
+
subscribeToHistoryChange: V,
|
|
271
|
+
subscribeToNavigation: B
|
|
272
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
347
273
|
class U {
|
|
348
|
-
constructor({
|
|
349
|
-
window
|
|
350
|
-
document: s,
|
|
351
|
-
publish: n,
|
|
352
|
-
subscribe: r,
|
|
353
|
-
bus: o,
|
|
354
|
-
state: a,
|
|
355
|
-
renderKit: l,
|
|
356
|
-
}) {
|
|
357
|
-
;(this.window = t),
|
|
358
|
-
(this.document = s),
|
|
359
|
-
(this.publish = n),
|
|
360
|
-
(this.subscribe = r),
|
|
361
|
-
(this.bus = o),
|
|
362
|
-
(this.state = a),
|
|
363
|
-
(this.renderKit = l),
|
|
364
|
-
(this.roots = [])
|
|
274
|
+
constructor({ window: t, document: s, publish: r, subscribe: n, bus: o, state: a, renderKit: l }) {
|
|
275
|
+
this.window = t, this.document = s, this.publish = r, this.subscribe = n, this.bus = o, this.state = a, this.renderKit = l, this.roots = [];
|
|
365
276
|
}
|
|
366
277
|
render(t, s) {
|
|
367
|
-
const
|
|
368
|
-
return this.roots.push(
|
|
278
|
+
const r = At(t, s, this.renderKit);
|
|
279
|
+
return this.roots.push(r), r;
|
|
369
280
|
}
|
|
370
281
|
startNavigation() {
|
|
371
|
-
R(this)
|
|
282
|
+
R(this);
|
|
372
283
|
}
|
|
373
284
|
}
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
},
|
|
380
|
-
Symbol.toStringTag,
|
|
381
|
-
{ value: 'Module' },
|
|
382
|
-
),
|
|
383
|
-
)
|
|
384
|
-
class q {
|
|
285
|
+
const $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
286
|
+
__proto__: null,
|
|
287
|
+
App: U
|
|
288
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
289
|
+
class C {
|
|
385
290
|
constructor() {
|
|
386
|
-
this.lookup = {}
|
|
291
|
+
this.lookup = {};
|
|
387
292
|
}
|
|
388
|
-
add(t, s,
|
|
389
|
-
this.ensureArrayFor(t)
|
|
390
|
-
const
|
|
293
|
+
add(t, s, r) {
|
|
294
|
+
this.ensureArrayFor(t);
|
|
295
|
+
const n = {
|
|
391
296
|
listener: s,
|
|
392
|
-
index:
|
|
393
|
-
matcher: t
|
|
394
|
-
}
|
|
395
|
-
return this.lookup[t].push(
|
|
297
|
+
index: r,
|
|
298
|
+
matcher: t
|
|
299
|
+
};
|
|
300
|
+
return this.lookup[t].push(n), () => this.remove(n);
|
|
396
301
|
}
|
|
397
302
|
remove(t) {
|
|
398
|
-
this.lookup[t.matcher] &&
|
|
399
|
-
(this.lookup[t.matcher] = this.lookup[t.matcher].reduce(
|
|
400
|
-
(s, n) => (n !== t && s.push(n), s),
|
|
401
|
-
[],
|
|
402
|
-
))
|
|
303
|
+
this.lookup[t.matcher] && (this.lookup[t.matcher] = this.lookup[t.matcher].reduce((s, r) => (r !== t && s.push(r), s), []));
|
|
403
304
|
}
|
|
404
305
|
matches(t) {
|
|
405
|
-
return this.lookup[t] || []
|
|
306
|
+
return this.lookup[t] || [];
|
|
406
307
|
}
|
|
407
308
|
ensureArrayFor(t) {
|
|
408
|
-
this.lookup[t] || (this.lookup[t] = [])
|
|
309
|
+
this.lookup[t] || (this.lookup[t] = []);
|
|
409
310
|
}
|
|
410
311
|
}
|
|
411
312
|
class I {
|
|
412
313
|
constructor() {
|
|
413
|
-
this.lookup = []
|
|
314
|
+
this.lookup = [];
|
|
414
315
|
}
|
|
415
|
-
add(t, s,
|
|
416
|
-
const
|
|
316
|
+
add(t, s, r) {
|
|
317
|
+
const n = {
|
|
417
318
|
listener: s,
|
|
418
|
-
index:
|
|
419
|
-
matcher: t
|
|
420
|
-
}
|
|
421
|
-
return this.lookup.push(
|
|
319
|
+
index: r,
|
|
320
|
+
matcher: t
|
|
321
|
+
};
|
|
322
|
+
return this.lookup.push(n), () => this.remove(n);
|
|
422
323
|
}
|
|
423
324
|
remove(t) {
|
|
424
|
-
this.lookup = this.lookup.reduce((s,
|
|
325
|
+
this.lookup = this.lookup.reduce((s, r) => (r !== t && s.push(r), s), []);
|
|
425
326
|
}
|
|
426
327
|
matches(t) {
|
|
427
|
-
return this.lookup.filter(
|
|
328
|
+
return this.lookup.filter(
|
|
329
|
+
(s) => s.matcher.test(t)
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
class _t {
|
|
334
|
+
constructor({
|
|
335
|
+
publish: t,
|
|
336
|
+
event: s,
|
|
337
|
+
payload: r,
|
|
338
|
+
timer: n
|
|
339
|
+
}) {
|
|
340
|
+
this.setNewTimeout = () => {
|
|
341
|
+
this.stopped || setTimeout(() => {
|
|
342
|
+
this.publishEvent(), this.setNewTimeout();
|
|
343
|
+
}, this.calculateNextTime());
|
|
344
|
+
}, this.calculateNextTime = () => this.timer({
|
|
345
|
+
timeDiff: this.diff(),
|
|
346
|
+
callCount: this.callCount,
|
|
347
|
+
stop: this.stop
|
|
348
|
+
}), this.publish = t, this.event = s, this.payload = r || null, this.stop = this.stopTimeout.bind(this), this.stopped = !1, this.timer = n, this.startedAt = (/* @__PURE__ */ new Date()).getTime(), this.callCount = 0;
|
|
349
|
+
}
|
|
350
|
+
start() {
|
|
351
|
+
this.setNewTimeout();
|
|
352
|
+
}
|
|
353
|
+
diff() {
|
|
354
|
+
return (/* @__PURE__ */ new Date()).getTime() - this.startedAt;
|
|
355
|
+
}
|
|
356
|
+
stopTimeout() {
|
|
357
|
+
this.stopped = !0, this.timeoutId && clearTimeout(this.timeoutId);
|
|
358
|
+
}
|
|
359
|
+
publishEvent() {
|
|
360
|
+
this.stopped || (this.callCount += 1, this.publish(this.event, this.payload));
|
|
428
361
|
}
|
|
429
362
|
}
|
|
430
|
-
|
|
363
|
+
const St = (e) => {
|
|
364
|
+
const { offset: t, period: s } = e, r = ({ callCount: n }) => t && n == 0 ? t : s;
|
|
365
|
+
return {
|
|
366
|
+
event: e.event,
|
|
367
|
+
publish: e.publish,
|
|
368
|
+
payload: e.payload,
|
|
369
|
+
timer: r
|
|
370
|
+
};
|
|
371
|
+
}, Tt = (e) => {
|
|
372
|
+
let t;
|
|
373
|
+
"timer" in e ? t = e : t = St(
|
|
374
|
+
e
|
|
375
|
+
);
|
|
376
|
+
const s = new _t(t);
|
|
377
|
+
return s.start(), s.stop;
|
|
378
|
+
};
|
|
379
|
+
class q {
|
|
431
380
|
constructor() {
|
|
432
|
-
|
|
433
|
-
(this.fuzzySubscriptions = new I()),
|
|
434
|
-
(this.currentIndex = 0)
|
|
381
|
+
this.exactSubscriptions = new C(), this.fuzzySubscriptions = new I(), this.currentIndex = 0;
|
|
435
382
|
}
|
|
436
383
|
subscribe(t, s) {
|
|
437
|
-
let
|
|
438
|
-
return (
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
384
|
+
let r;
|
|
385
|
+
return typeof t == "string" ? r = this.exactSubscriptions.add(
|
|
386
|
+
t,
|
|
387
|
+
s,
|
|
388
|
+
this.currentIndex
|
|
389
|
+
) : r = this.fuzzySubscriptions.add(
|
|
390
|
+
t,
|
|
391
|
+
s,
|
|
392
|
+
this.currentIndex
|
|
393
|
+
), this.currentIndex += 1, r;
|
|
445
394
|
}
|
|
446
395
|
publish(t, s) {
|
|
447
|
-
|
|
396
|
+
[
|
|
448
397
|
...this.exactSubscriptions.matches(t),
|
|
449
|
-
...this.fuzzySubscriptions.matches(t)
|
|
450
|
-
]
|
|
451
|
-
.
|
|
452
|
-
|
|
453
|
-
r.listener(s, this.listenerOptions(t))
|
|
454
|
-
})
|
|
398
|
+
...this.fuzzySubscriptions.matches(t)
|
|
399
|
+
].sort((n, o) => n.index - o.index).forEach((n) => {
|
|
400
|
+
n.listener(s, this.listenerOptions(t));
|
|
401
|
+
});
|
|
455
402
|
}
|
|
456
403
|
addListenerOptions(t) {
|
|
457
|
-
this.options = t
|
|
404
|
+
this.options = t;
|
|
458
405
|
}
|
|
459
406
|
listenerOptions(t) {
|
|
460
407
|
return {
|
|
461
408
|
eventName: t,
|
|
462
409
|
...this.options,
|
|
463
|
-
publish: this.publish.bind(this)
|
|
464
|
-
}
|
|
410
|
+
publish: this.publish.bind(this)
|
|
411
|
+
};
|
|
465
412
|
}
|
|
466
413
|
}
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
f = (e) => Array.isArray(e),
|
|
489
|
-
v = (e) => e !== null && !f(e) && typeof e == 'object',
|
|
490
|
-
Nt = (e, t) => e === t,
|
|
491
|
-
St = (e, t) => Object.keys(e).length === Object.keys(t).length,
|
|
492
|
-
jt = (e, t) =>
|
|
493
|
-
!(v(e) && v(t)) || !St(e, t)
|
|
494
|
-
? !1
|
|
495
|
-
: Object.keys(e).every((s) => {
|
|
496
|
-
const n = e[s],
|
|
497
|
-
r = t[s]
|
|
498
|
-
return x(n, r)
|
|
499
|
-
}),
|
|
500
|
-
Ot = (e, t) =>
|
|
501
|
-
!(f(e) && f(t)) || e.length !== t.length
|
|
502
|
-
? !1
|
|
503
|
-
: e.every((s, n) => {
|
|
504
|
-
const r = t[n]
|
|
505
|
-
return x(s, r)
|
|
506
|
-
}),
|
|
507
|
-
x = (e, t) => (v(e) ? jt(e, t) : f(e) ? Ot(e, t) : Nt(e, t))
|
|
414
|
+
const J = () => {
|
|
415
|
+
const e = new q();
|
|
416
|
+
return {
|
|
417
|
+
bus: e,
|
|
418
|
+
publish: (r, n) => e.publish(r, n),
|
|
419
|
+
subscribe: (r, n) => e.subscribe(r, n)
|
|
420
|
+
};
|
|
421
|
+
}, De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
422
|
+
__proto__: null,
|
|
423
|
+
ExactSubscriptions: C,
|
|
424
|
+
FuzzySubscriptions: I,
|
|
425
|
+
JaxsBus: q,
|
|
426
|
+
createBus: J,
|
|
427
|
+
publishPeriodically: Tt
|
|
428
|
+
}, Symbol.toStringTag, { value: "Module" })), f = (e) => Array.isArray(e), v = (e) => e !== null && !f(e) && typeof e == "object", jt = (e, t) => e === t, Ot = (e, t) => Object.keys(e).length === Object.keys(t).length, Mt = (e, t) => !(v(e) && v(t)) || !Ot(e, t) ? !1 : Object.keys(e).every((s) => {
|
|
429
|
+
const r = e[s], n = t[s];
|
|
430
|
+
return x(r, n);
|
|
431
|
+
}), kt = (e, t) => !(f(e) && f(t)) || e.length !== t.length ? !1 : e.every((s, r) => {
|
|
432
|
+
const n = t[r];
|
|
433
|
+
return x(s, n);
|
|
434
|
+
}), x = (e, t) => v(e) ? Mt(e, t) : f(e) ? kt(e, t) : jt(e, t);
|
|
508
435
|
class g {
|
|
509
436
|
constructor(t) {
|
|
510
|
-
|
|
511
|
-
(this.parent = t.parent),
|
|
512
|
-
(this._value = t.value),
|
|
513
|
-
(this.initialValue = structuredClone(t.value))
|
|
437
|
+
this.name = t.name, this.parent = t.parent, this._value = t.value, this.initialValue = structuredClone(t.value);
|
|
514
438
|
}
|
|
515
439
|
get value() {
|
|
516
|
-
return this._value
|
|
440
|
+
return this._value;
|
|
517
441
|
}
|
|
518
442
|
set value(t) {
|
|
519
|
-
throw new Error(
|
|
443
|
+
throw new Error("Cannot set value directly. Use an updater!");
|
|
520
444
|
}
|
|
521
445
|
reset() {
|
|
522
|
-
this._value = this.initialValue
|
|
446
|
+
this._value = this.initialValue;
|
|
523
447
|
}
|
|
524
448
|
update(t) {
|
|
525
|
-
if (typeof t ==
|
|
526
|
-
const s = this.getUpdatedValue(t)
|
|
527
|
-
this.updateValue(s)
|
|
528
|
-
} else
|
|
449
|
+
if (typeof t == "function") {
|
|
450
|
+
const s = this.getUpdatedValue(t);
|
|
451
|
+
this.updateValue(s);
|
|
452
|
+
} else
|
|
453
|
+
this.updateValue(t);
|
|
529
454
|
}
|
|
530
455
|
updateValue(t) {
|
|
531
|
-
x(this._value, t) || (
|
|
456
|
+
x(this._value, t) || (this._value = t, this.parent.notify(this.name));
|
|
532
457
|
}
|
|
533
458
|
getUpdatedValue(t) {
|
|
534
|
-
return t(this.value)
|
|
459
|
+
return t(this.value);
|
|
535
460
|
}
|
|
536
461
|
}
|
|
537
462
|
class A {
|
|
538
463
|
constructor(t) {
|
|
539
|
-
this.store = t
|
|
464
|
+
this.store = t;
|
|
540
465
|
}
|
|
541
466
|
update(t) {
|
|
542
|
-
this.store.update(t)
|
|
467
|
+
this.store.update(t);
|
|
543
468
|
}
|
|
544
469
|
reset() {
|
|
545
|
-
this.store.update(this.store.initialValue)
|
|
470
|
+
this.store.update(this.store.initialValue);
|
|
546
471
|
}
|
|
547
472
|
get value() {
|
|
548
|
-
return this.store.value
|
|
473
|
+
return this.store.value;
|
|
549
474
|
}
|
|
550
475
|
}
|
|
551
|
-
class
|
|
476
|
+
class $t extends A {
|
|
552
477
|
updateAttribute(t, s) {
|
|
553
|
-
const
|
|
554
|
-
|
|
478
|
+
const r = { ...this.value };
|
|
479
|
+
r[t] = s, this.update(r);
|
|
555
480
|
}
|
|
556
481
|
resetAttribute(t) {
|
|
557
|
-
const s = { ...this.value },
|
|
558
|
-
|
|
559
|
-
;(s[t] = n), this.update(s)
|
|
482
|
+
const s = { ...this.value }, r = this.store.initialValue[t];
|
|
483
|
+
s[t] = r, this.update(s);
|
|
560
484
|
}
|
|
561
485
|
}
|
|
562
|
-
const
|
|
563
|
-
class
|
|
486
|
+
const Dt = (e) => new $t(e);
|
|
487
|
+
class Pt extends A {
|
|
564
488
|
push(t) {
|
|
565
|
-
const s = [...this.value, t]
|
|
566
|
-
this.update(s)
|
|
489
|
+
const s = [...this.value, t];
|
|
490
|
+
this.update(s);
|
|
567
491
|
}
|
|
568
492
|
pop() {
|
|
569
|
-
const t = [...this.value],
|
|
570
|
-
|
|
571
|
-
return this.update(t), s
|
|
493
|
+
const t = [...this.value], s = t.pop();
|
|
494
|
+
return this.update(t), s;
|
|
572
495
|
}
|
|
573
496
|
unshift(t) {
|
|
574
|
-
const s = [t, ...this.value]
|
|
575
|
-
this.update(s)
|
|
497
|
+
const s = [t, ...this.value];
|
|
498
|
+
this.update(s);
|
|
576
499
|
}
|
|
577
500
|
shift() {
|
|
578
|
-
const t = [...this.value],
|
|
579
|
-
|
|
580
|
-
return this.update(t), s
|
|
501
|
+
const t = [...this.value], s = t.shift();
|
|
502
|
+
return this.update(t), s;
|
|
581
503
|
}
|
|
582
504
|
addSorter(t, s) {
|
|
583
505
|
this[t] = () => {
|
|
584
|
-
this.sortBy(s)
|
|
585
|
-
}
|
|
506
|
+
this.sortBy(s);
|
|
507
|
+
};
|
|
586
508
|
}
|
|
587
509
|
sortBy(t) {
|
|
588
|
-
const s = [...this.value]
|
|
589
|
-
s.sort(t), this.update(s)
|
|
510
|
+
const s = [...this.value];
|
|
511
|
+
s.sort(t), this.update(s);
|
|
590
512
|
}
|
|
591
513
|
insertAt(t, s) {
|
|
592
|
-
const
|
|
593
|
-
|
|
514
|
+
const r = [...this.value];
|
|
515
|
+
r.splice(t, 0, s), this.update(r);
|
|
594
516
|
}
|
|
595
517
|
remove(t) {
|
|
596
|
-
const s = this.value.reduce((
|
|
597
|
-
this.update(s)
|
|
518
|
+
const s = this.value.reduce((r, n) => (n !== t && r.push(n), r), []);
|
|
519
|
+
this.update(s);
|
|
598
520
|
}
|
|
599
521
|
removeBy(t) {
|
|
600
|
-
const s = this.value.reduce((
|
|
601
|
-
this.update(s)
|
|
522
|
+
const s = this.value.reduce((r, n) => (t(n) || r.push(n), r), []);
|
|
523
|
+
this.update(s);
|
|
602
524
|
}
|
|
603
525
|
}
|
|
604
|
-
const
|
|
605
|
-
class
|
|
526
|
+
const Ft = (e) => new Pt(e);
|
|
527
|
+
class Lt extends A {
|
|
606
528
|
toggle() {
|
|
607
|
-
const t = !this.value
|
|
608
|
-
this.update(t)
|
|
529
|
+
const t = !this.value;
|
|
530
|
+
this.update(t);
|
|
609
531
|
}
|
|
610
532
|
setTrue() {
|
|
611
|
-
this.update(!0)
|
|
533
|
+
this.update(!0);
|
|
612
534
|
}
|
|
613
535
|
setFalse() {
|
|
614
|
-
this.update(!1)
|
|
536
|
+
this.update(!1);
|
|
615
537
|
}
|
|
616
538
|
}
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
},
|
|
623
|
-
_ = 'state'
|
|
539
|
+
const zt = (e) => new Lt(e), Bt = {
|
|
540
|
+
object: Dt,
|
|
541
|
+
list: Ft,
|
|
542
|
+
boolean: zt
|
|
543
|
+
}, w = "state";
|
|
624
544
|
class G {
|
|
625
545
|
constructor(t) {
|
|
626
|
-
|
|
627
|
-
(this.stores = {}),
|
|
628
|
-
(this.eventNamePrefix = _),
|
|
629
|
-
(this.notifications = /* @__PURE__ */ new Set()),
|
|
630
|
-
(this.inTransaction = !1)
|
|
546
|
+
this.publisher = t, this.stores = {}, this.eventNamePrefix = w, this.notifications = /* @__PURE__ */ new Set(), this.inTransaction = !1;
|
|
631
547
|
}
|
|
632
548
|
create(t, s) {
|
|
633
|
-
const
|
|
549
|
+
const r = new g({
|
|
634
550
|
name: t,
|
|
635
551
|
parent: this,
|
|
636
|
-
value: s
|
|
637
|
-
})
|
|
638
|
-
return
|
|
552
|
+
value: s
|
|
553
|
+
});
|
|
554
|
+
return this.stores[t] = r, r;
|
|
639
555
|
}
|
|
640
556
|
store(t) {
|
|
641
|
-
return (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
value: void 0,
|
|
647
|
-
})
|
|
648
|
-
)
|
|
557
|
+
return this.stores[t] || new g({
|
|
558
|
+
name: t,
|
|
559
|
+
parent: this,
|
|
560
|
+
value: void 0
|
|
561
|
+
});
|
|
649
562
|
}
|
|
650
563
|
get(t) {
|
|
651
|
-
return this.store(t).value
|
|
564
|
+
return this.store(t).value;
|
|
652
565
|
}
|
|
653
566
|
getAll(t) {
|
|
654
|
-
return t.reduce((s,
|
|
567
|
+
return t.reduce((s, r) => (s[r] = this.get(r), s), {});
|
|
655
568
|
}
|
|
656
569
|
notify(t) {
|
|
657
|
-
this.inTransaction ? this.notifications.add(t) : this.publish(t)
|
|
570
|
+
this.inTransaction ? this.notifications.add(t) : this.publish(t);
|
|
658
571
|
}
|
|
659
572
|
update(t, s) {
|
|
660
|
-
this.store(t).update(s)
|
|
573
|
+
this.store(t).update(s);
|
|
661
574
|
}
|
|
662
575
|
transaction(t) {
|
|
663
|
-
|
|
664
|
-
t(this.stores),
|
|
665
|
-
(this.inTransaction = !1),
|
|
666
|
-
this.publishAll()
|
|
576
|
+
this.inTransaction = !0, t(this.stores), this.inTransaction = !1, this.publishAll();
|
|
667
577
|
}
|
|
668
578
|
publishAll() {
|
|
669
579
|
this.notifications.forEach((t) => {
|
|
670
|
-
this.publish(t)
|
|
671
|
-
}),
|
|
672
|
-
this.notifications.clear()
|
|
580
|
+
this.publish(t);
|
|
581
|
+
}), this.notifications.clear();
|
|
673
582
|
}
|
|
674
583
|
publish(t) {
|
|
675
584
|
this.publisher(this.event(t), {
|
|
676
585
|
state: this,
|
|
677
|
-
store: this.store(t)
|
|
678
|
-
})
|
|
586
|
+
store: this.store(t)
|
|
587
|
+
});
|
|
679
588
|
}
|
|
680
589
|
event(t) {
|
|
681
|
-
return `${this.eventNamePrefix}:${t}
|
|
590
|
+
return `${this.eventNamePrefix}:${t}`;
|
|
682
591
|
}
|
|
683
592
|
}
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
updaters: Ft,
|
|
694
|
-
},
|
|
695
|
-
Symbol.toStringTag,
|
|
696
|
-
{ value: 'Module' },
|
|
697
|
-
),
|
|
698
|
-
)
|
|
699
|
-
class Lt {
|
|
593
|
+
const H = (e) => new G(e), Pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
594
|
+
__proto__: null,
|
|
595
|
+
State: G,
|
|
596
|
+
Store: g,
|
|
597
|
+
createState: H,
|
|
598
|
+
eventName: w,
|
|
599
|
+
updaters: Bt
|
|
600
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
601
|
+
class Vt {
|
|
700
602
|
constructor(t) {
|
|
701
|
-
this.setupDomEnvironment(t)
|
|
603
|
+
this.setupDomEnvironment(t);
|
|
702
604
|
}
|
|
703
605
|
setup() {
|
|
704
|
-
return (
|
|
705
|
-
this.
|
|
706
|
-
this.
|
|
707
|
-
this.
|
|
708
|
-
this.
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
subscribe: this.subscribe,
|
|
714
|
-
bus: this.bus,
|
|
715
|
-
state: this.state,
|
|
716
|
-
renderKit: this.renderKit,
|
|
717
|
-
})
|
|
718
|
-
)
|
|
606
|
+
return this.setupBus(), this.setupState(), this.addBusOptions(), this.setRenderKit(), new U({
|
|
607
|
+
window: this.window,
|
|
608
|
+
document: this.document,
|
|
609
|
+
publish: this.publish,
|
|
610
|
+
subscribe: this.subscribe,
|
|
611
|
+
bus: this.bus,
|
|
612
|
+
state: this.state,
|
|
613
|
+
renderKit: this.renderKit
|
|
614
|
+
});
|
|
719
615
|
}
|
|
720
616
|
setupDomEnvironment(t) {
|
|
721
|
-
t.window
|
|
722
|
-
? ((this.window = t.window), (this.document = this.window.document))
|
|
723
|
-
: t.document
|
|
724
|
-
? ((this.window = t.document.defaultView), (this.document = t.document))
|
|
725
|
-
: ((this.window = window), (this.document = document))
|
|
617
|
+
t.window ? (this.window = t.window, this.document = this.window.document) : t.document ? (this.window = t.document.defaultView, this.document = t.document) : (this.window = window, this.document = document);
|
|
726
618
|
}
|
|
727
619
|
setupBus() {
|
|
728
|
-
const { publish: t, subscribe: s, bus:
|
|
729
|
-
|
|
620
|
+
const { publish: t, subscribe: s, bus: r } = J();
|
|
621
|
+
this.publish = t, this.subscribe = s, this.bus = r;
|
|
730
622
|
}
|
|
731
623
|
setupState() {
|
|
732
|
-
this.state =
|
|
624
|
+
this.state = H(this.publish);
|
|
733
625
|
}
|
|
734
626
|
addBusOptions() {
|
|
735
627
|
this.bus.addListenerOptions({
|
|
736
628
|
state: this.state,
|
|
737
629
|
document: this.document,
|
|
738
|
-
window: this.window
|
|
739
|
-
})
|
|
630
|
+
window: this.window
|
|
631
|
+
});
|
|
740
632
|
}
|
|
741
633
|
setRenderKit() {
|
|
742
634
|
this.renderKit = {
|
|
@@ -744,543 +636,397 @@ class Lt {
|
|
|
744
636
|
subscribe: this.subscribe,
|
|
745
637
|
state: this.state,
|
|
746
638
|
document: this.document,
|
|
747
|
-
window: this.window
|
|
748
|
-
}
|
|
639
|
+
window: this.window
|
|
640
|
+
};
|
|
749
641
|
}
|
|
750
642
|
}
|
|
751
|
-
const
|
|
752
|
-
const s = new
|
|
753
|
-
return s.startNavigation(), s
|
|
754
|
-
}
|
|
755
|
-
var i = /* @__PURE__ */ ((e) => (
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
data: s,
|
|
819
|
-
type: i.addEvent,
|
|
820
|
-
}),
|
|
821
|
-
It = (e, t, s) => ({
|
|
822
|
-
source: e,
|
|
823
|
-
target: t,
|
|
824
|
-
data: s,
|
|
825
|
-
type: i.updateEvent,
|
|
826
|
-
}),
|
|
827
|
-
w = (e) => ({
|
|
828
|
-
source: e,
|
|
829
|
-
target: e,
|
|
830
|
-
// for type crap only
|
|
831
|
-
type: i.removeNode,
|
|
832
|
-
data: {},
|
|
833
|
-
}),
|
|
834
|
-
b = (e, t) => ({
|
|
835
|
-
target: e,
|
|
836
|
-
source: e,
|
|
837
|
-
// for type crap only
|
|
838
|
-
type: i.insertNode,
|
|
839
|
-
data: t,
|
|
840
|
-
}),
|
|
841
|
-
Jt = (e, t, s) => ({
|
|
842
|
-
source: e,
|
|
843
|
-
target: t,
|
|
844
|
-
type: i.changeValue,
|
|
845
|
-
data: s,
|
|
846
|
-
}),
|
|
847
|
-
Ht = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
|
|
848
|
-
N = { index: -1 }
|
|
849
|
-
class Gt {
|
|
643
|
+
const Fe = (e = {}) => {
|
|
644
|
+
const s = new Vt(e).setup();
|
|
645
|
+
return s.startNavigation(), s;
|
|
646
|
+
};
|
|
647
|
+
var i = /* @__PURE__ */ ((e) => (e[e.removeNode = 0] = "removeNode", e[e.insertNode = 1] = "insertNode", e[e.replaceNode = 2] = "replaceNode", e[e.removeAttribute = 3] = "removeAttribute", e[e.addAttribute = 4] = "addAttribute", e[e.updateAttribute = 5] = "updateAttribute", e[e.removeEvent = 6] = "removeEvent", e[e.addEvent = 7] = "addEvent", e[e.updateEvent = 8] = "updateEvent", e[e.changeValue = 9] = "changeValue", e[e.changeText = 10] = "changeText", e))(i || {});
|
|
648
|
+
const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
649
|
+
__proto__: null,
|
|
650
|
+
ChangeInstructionTypes: i
|
|
651
|
+
}, Symbol.toStringTag, { value: "Module" })), Kt = (e, t) => ({
|
|
652
|
+
source: e,
|
|
653
|
+
target: t,
|
|
654
|
+
type: i.changeText,
|
|
655
|
+
data: {}
|
|
656
|
+
}), Rt = (e, t) => ({
|
|
657
|
+
source: e,
|
|
658
|
+
target: t,
|
|
659
|
+
type: i.replaceNode,
|
|
660
|
+
data: {}
|
|
661
|
+
}), Ut = (e, t, s) => ({
|
|
662
|
+
source: e,
|
|
663
|
+
target: t,
|
|
664
|
+
data: s,
|
|
665
|
+
type: i.removeAttribute
|
|
666
|
+
}), Ct = (e, t, s) => ({
|
|
667
|
+
source: e,
|
|
668
|
+
target: t,
|
|
669
|
+
data: s,
|
|
670
|
+
type: i.addAttribute
|
|
671
|
+
}), It = (e, t, s) => ({
|
|
672
|
+
source: e,
|
|
673
|
+
target: t,
|
|
674
|
+
data: s,
|
|
675
|
+
type: i.updateAttribute
|
|
676
|
+
}), qt = (e, t, s) => ({
|
|
677
|
+
source: e,
|
|
678
|
+
target: t,
|
|
679
|
+
data: s,
|
|
680
|
+
type: i.removeEvent
|
|
681
|
+
}), Jt = (e, t, s) => ({
|
|
682
|
+
source: e,
|
|
683
|
+
target: t,
|
|
684
|
+
data: s,
|
|
685
|
+
type: i.addEvent
|
|
686
|
+
}), Gt = (e, t, s) => ({
|
|
687
|
+
source: e,
|
|
688
|
+
target: t,
|
|
689
|
+
data: s,
|
|
690
|
+
type: i.updateEvent
|
|
691
|
+
}), N = (e) => ({
|
|
692
|
+
source: e,
|
|
693
|
+
target: e,
|
|
694
|
+
// for type crap only
|
|
695
|
+
type: i.removeNode,
|
|
696
|
+
data: {}
|
|
697
|
+
}), b = (e, t) => ({
|
|
698
|
+
target: e,
|
|
699
|
+
source: e,
|
|
700
|
+
// for type crap only
|
|
701
|
+
type: i.insertNode,
|
|
702
|
+
data: t
|
|
703
|
+
}), Ht = (e, t, s) => ({
|
|
704
|
+
source: e,
|
|
705
|
+
target: t,
|
|
706
|
+
type: i.changeValue,
|
|
707
|
+
data: s
|
|
708
|
+
}), Qt = (e, t) => e.type > t.type ? 1 : e.type < t.type ? -1 : 0, _ = { index: -1 };
|
|
709
|
+
class Wt {
|
|
850
710
|
constructor() {
|
|
851
|
-
this.map = {}
|
|
711
|
+
this.map = {};
|
|
852
712
|
}
|
|
853
713
|
populate(t) {
|
|
854
|
-
t.forEach((s,
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}))
|
|
862
|
-
})
|
|
714
|
+
t.forEach((s, r) => {
|
|
715
|
+
const n = s.__jsx;
|
|
716
|
+
n && (this.map[n] = this.map[n] || [], this.map[n].push({
|
|
717
|
+
element: s,
|
|
718
|
+
index: r
|
|
719
|
+
}));
|
|
720
|
+
});
|
|
863
721
|
}
|
|
864
722
|
pullMatch(t) {
|
|
865
|
-
const s = t && t.__jsx
|
|
866
|
-
return !s || !(this.map[s] && this.map[s].length) ?
|
|
723
|
+
const s = t && t.__jsx;
|
|
724
|
+
return !s || !(this.map[s] && this.map[s].length) ? _ : this.map[s].shift();
|
|
867
725
|
}
|
|
868
726
|
clear(t) {
|
|
869
|
-
const s = t && t.__jsx
|
|
870
|
-
if (!(s && this.map[s] && this.map[s].length)) return
|
|
871
|
-
const
|
|
872
|
-
this.map[s] =
|
|
727
|
+
const s = t && t.__jsx;
|
|
728
|
+
if (!(s && this.map[s] && this.map[s].length)) return;
|
|
729
|
+
const r = this.map[s];
|
|
730
|
+
this.map[s] = r.reduce((n, o) => (o.element !== t && n.push(o), n), []);
|
|
873
731
|
}
|
|
874
732
|
check(t) {
|
|
875
|
-
const s = t && t.__jsx
|
|
876
|
-
return s && this.map[s] ? this.map[s].length > 0 : !1
|
|
733
|
+
const s = t && t.__jsx;
|
|
734
|
+
return s && this.map[s] ? this.map[s].length > 0 : !1;
|
|
877
735
|
}
|
|
878
736
|
remaining() {
|
|
879
|
-
return Object.values(this.map).flat()
|
|
737
|
+
return Object.values(this.map).flat();
|
|
880
738
|
}
|
|
881
739
|
}
|
|
882
740
|
const S = (e) => {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
for (d = 0; d < l; d++) {
|
|
898
|
-
const p = a.item(d)
|
|
899
|
-
if (p && h.name == p.name) {
|
|
900
|
-
c = p
|
|
901
|
-
break
|
|
902
|
-
}
|
|
741
|
+
const t = new Wt();
|
|
742
|
+
return t.populate(e), t;
|
|
743
|
+
}, Q = (e, t, s = !1) => {
|
|
744
|
+
const r = [], n = e.attributes, o = n.length, a = t.attributes, l = a.length;
|
|
745
|
+
let u, d, c;
|
|
746
|
+
for (u = 0; u < o; u++) {
|
|
747
|
+
c = null;
|
|
748
|
+
const h = n.item(u);
|
|
749
|
+
if (h) {
|
|
750
|
+
for (d = 0; d < l; d++) {
|
|
751
|
+
const p = a.item(d);
|
|
752
|
+
if (p && h.name == p.name) {
|
|
753
|
+
c = p;
|
|
754
|
+
break;
|
|
903
755
|
}
|
|
904
|
-
c
|
|
905
|
-
? h.value !== c.value &&
|
|
906
|
-
n.push(
|
|
907
|
-
Rt(e, t, {
|
|
908
|
-
name: h.name,
|
|
909
|
-
value: c.value,
|
|
910
|
-
isSvg: s,
|
|
911
|
-
}),
|
|
912
|
-
)
|
|
913
|
-
: n.push(Vt(e, t, { name: h.name, isSvg: s }))
|
|
914
756
|
}
|
|
757
|
+
c ? h.value !== c.value && r.push(
|
|
758
|
+
It(e, t, {
|
|
759
|
+
name: h.name,
|
|
760
|
+
value: c.value,
|
|
761
|
+
isSvg: s
|
|
762
|
+
})
|
|
763
|
+
) : r.push(
|
|
764
|
+
Ut(e, t, { name: h.name, isSvg: s })
|
|
765
|
+
);
|
|
915
766
|
}
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
767
|
+
}
|
|
768
|
+
for (u = 0; u < l; u++) {
|
|
769
|
+
c = null;
|
|
770
|
+
const h = a.item(u);
|
|
771
|
+
if (h) {
|
|
772
|
+
for (d = 0; d < o; d++) {
|
|
773
|
+
const p = n.item(d);
|
|
774
|
+
if (p && p.name == h.name) {
|
|
775
|
+
c = p;
|
|
776
|
+
break;
|
|
926
777
|
}
|
|
927
|
-
c ||
|
|
928
|
-
n.push(
|
|
929
|
-
Kt(e, t, {
|
|
930
|
-
name: h.name,
|
|
931
|
-
value: h.value,
|
|
932
|
-
isSvg: s,
|
|
933
|
-
}),
|
|
934
|
-
)
|
|
935
778
|
}
|
|
779
|
+
c || r.push(
|
|
780
|
+
Ct(e, t, {
|
|
781
|
+
name: h.name,
|
|
782
|
+
value: h.value,
|
|
783
|
+
isSvg: s
|
|
784
|
+
})
|
|
785
|
+
);
|
|
936
786
|
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
},
|
|
979
|
-
Qt = (e) => e.tagName !== 'INPUT',
|
|
980
|
-
Wt = (e, t) => e.value === t.value,
|
|
981
|
-
Xt = (e, t) => {
|
|
982
|
-
if (Qt(e) || Wt(e, t)) return []
|
|
983
|
-
const s = e,
|
|
984
|
-
n = t
|
|
985
|
-
return [Jt(s, n, { name: 'value', value: n.value })]
|
|
986
|
-
},
|
|
987
|
-
Yt = (e, t) => {
|
|
988
|
-
const s = Q(e, t),
|
|
989
|
-
n = Ct(e, t),
|
|
990
|
-
r = Xt(e, t)
|
|
991
|
-
return s.concat(n).concat(r)
|
|
992
|
-
},
|
|
993
|
-
Zt = (e, t) => Q(e, t, !0),
|
|
994
|
-
te = (e, t) => (e.textContent !== t.textContent ? [zt(e, t)] : []),
|
|
995
|
-
ee = (e, t, s) => {
|
|
996
|
-
let n = []
|
|
997
|
-
if (e.nodeType === 1 && it(e)) {
|
|
998
|
-
const r = e,
|
|
999
|
-
o = t,
|
|
1000
|
-
a = Zt(r, o),
|
|
1001
|
-
l = s(r.childNodes, o.childNodes, r)
|
|
1002
|
-
n = a.concat(l)
|
|
1003
|
-
} else if (e.nodeType === 1) {
|
|
1004
|
-
const r = e,
|
|
1005
|
-
o = t,
|
|
1006
|
-
a = Yt(r, o),
|
|
1007
|
-
l = s(r.childNodes, o.childNodes, r)
|
|
1008
|
-
n = a.concat(l)
|
|
1009
|
-
} else e.nodeType === 3 && (n = te(e, t))
|
|
1010
|
-
return n
|
|
1011
|
-
},
|
|
1012
|
-
W = (e, t, s) => {
|
|
1013
|
-
const n = [],
|
|
1014
|
-
r = se(e, t),
|
|
1015
|
-
o = S(e),
|
|
1016
|
-
a = S(t),
|
|
1017
|
-
l = []
|
|
1018
|
-
let u = 0
|
|
1019
|
-
for (; u < r; u++) {
|
|
1020
|
-
const c = e[u],
|
|
1021
|
-
h = t[u]
|
|
1022
|
-
if (h && a.check(h)) {
|
|
1023
|
-
const p = o.pullMatch(h)
|
|
1024
|
-
a.clear(h),
|
|
1025
|
-
p.element
|
|
1026
|
-
? (p.index !== u &&
|
|
1027
|
-
n.push(
|
|
1028
|
-
b(p.element, {
|
|
1029
|
-
parent: s,
|
|
1030
|
-
index: u,
|
|
1031
|
-
}),
|
|
1032
|
-
),
|
|
1033
|
-
l.push({
|
|
1034
|
-
source: p.element,
|
|
1035
|
-
target: h,
|
|
1036
|
-
}))
|
|
1037
|
-
: c
|
|
1038
|
-
? a.check(c)
|
|
1039
|
-
? n.push(b(h, { parent: s, index: u }))
|
|
1040
|
-
: (o.clear(c), n.push(Bt(c, h)))
|
|
1041
|
-
: n.push(b(h, { parent: s, index: u }))
|
|
1042
|
-
} else c && o.pullMatch(c).element && n.push(w(c))
|
|
1043
|
-
}
|
|
1044
|
-
o.remaining().forEach(({ element: c }) => {
|
|
1045
|
-
n.push(w(c))
|
|
1046
|
-
})
|
|
1047
|
-
const d = l.reduce(
|
|
1048
|
-
(c, { source: h, target: p }) => c.concat(ee(h, p, W)),
|
|
1049
|
-
[],
|
|
1050
|
-
)
|
|
1051
|
-
return n.concat(d).sort(Ht)
|
|
1052
|
-
},
|
|
1053
|
-
se = (e, t) => {
|
|
1054
|
-
const s = e.length,
|
|
1055
|
-
n = t.length
|
|
1056
|
-
return s > n ? s : n
|
|
1057
|
-
},
|
|
1058
|
-
ne = (e, t, s) => {
|
|
1059
|
-
const n = W(e, t, s)
|
|
1060
|
-
return (
|
|
1061
|
-
n.forEach((r) => {
|
|
1062
|
-
re(r)
|
|
1063
|
-
}),
|
|
787
|
+
}
|
|
788
|
+
return r;
|
|
789
|
+
}, Xt = (e, t) => {
|
|
790
|
+
const s = [], r = e.eventMaps, n = t.eventMaps, o = Object.keys(r), a = Object.keys(n);
|
|
791
|
+
return o.forEach((l) => {
|
|
792
|
+
const u = r[l], d = n[l];
|
|
793
|
+
d ? d.busEvent !== u.busEvent && s.push(
|
|
794
|
+
Gt(e, t, {
|
|
795
|
+
name: l,
|
|
796
|
+
targetValue: d.listener,
|
|
797
|
+
sourceValue: u.listener
|
|
798
|
+
})
|
|
799
|
+
) : s.push(
|
|
800
|
+
qt(e, t, {
|
|
801
|
+
name: u.domEvent,
|
|
802
|
+
value: u.listener
|
|
803
|
+
})
|
|
804
|
+
);
|
|
805
|
+
}), a.forEach((l) => {
|
|
806
|
+
const u = r[l], d = n[l];
|
|
807
|
+
u || s.push(
|
|
808
|
+
Jt(e, t, {
|
|
809
|
+
name: d.domEvent,
|
|
810
|
+
value: d.listener
|
|
811
|
+
})
|
|
812
|
+
);
|
|
813
|
+
}), s;
|
|
814
|
+
}, Yt = (e) => e.tagName !== "INPUT", Zt = (e, t) => e.value === t.value, te = (e, t) => {
|
|
815
|
+
if (Yt(e) || Zt(e, t))
|
|
816
|
+
return [];
|
|
817
|
+
const s = e, r = t;
|
|
818
|
+
return [Ht(s, r, { name: "value", value: r.value })];
|
|
819
|
+
}, ee = (e, t) => {
|
|
820
|
+
const s = Q(e, t), r = Xt(e, t), n = te(e, t);
|
|
821
|
+
return s.concat(r).concat(n);
|
|
822
|
+
}, se = (e, t) => Q(e, t, !0), re = (e, t) => e.textContent !== t.textContent ? [Kt(e, t)] : [], ne = (e, t, s) => {
|
|
823
|
+
let r = [];
|
|
824
|
+
if (e.nodeType === 1 && it(e)) {
|
|
825
|
+
const n = e, o = t, a = se(n, o), l = s(
|
|
826
|
+
n.childNodes,
|
|
827
|
+
o.childNodes,
|
|
1064
828
|
n
|
|
1065
|
-
)
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
ie = (e) => {
|
|
1072
|
-
const { source: t, target: s } = e
|
|
1073
|
-
t.nodeValue = s.textContent
|
|
1074
|
-
},
|
|
1075
|
-
ue = (e) => {
|
|
1076
|
-
const { source: t } = e
|
|
1077
|
-
t.remove()
|
|
1078
|
-
},
|
|
1079
|
-
ae = (e) => {
|
|
1080
|
-
const { target: t, data: s } = e,
|
|
1081
|
-
{ parent: n, index: r } = s,
|
|
1082
|
-
o = n.childNodes[r]
|
|
1083
|
-
o ? o && o !== t && n.insertBefore(t, o) : n.appendChild(t)
|
|
1084
|
-
},
|
|
1085
|
-
ce = (e) => {
|
|
1086
|
-
const { source: t, target: s } = e
|
|
1087
|
-
t.replaceWith(s)
|
|
1088
|
-
},
|
|
1089
|
-
le = (e) => {
|
|
1090
|
-
const { source: t, data: s } = e,
|
|
1091
|
-
{ name: n, isSvg: r } = s
|
|
1092
|
-
r ? t.removeAttributeNS(null, n) : t.removeAttribute(n)
|
|
1093
|
-
},
|
|
1094
|
-
X = (e) => {
|
|
1095
|
-
const { source: t, data: s } = e,
|
|
1096
|
-
{ name: n, value: r, isSvg: o } = s
|
|
1097
|
-
o ? t.setAttributeNS(null, n, r) : t.setAttribute(n, r)
|
|
1098
|
-
},
|
|
1099
|
-
he = (e) => {
|
|
1100
|
-
X(e)
|
|
1101
|
-
},
|
|
1102
|
-
de = (e) => {
|
|
1103
|
-
const t = e.data,
|
|
1104
|
-
s = e.source,
|
|
1105
|
-
{ name: n, value: r } = t
|
|
1106
|
-
s.removeEventListener(n, r)
|
|
1107
|
-
},
|
|
1108
|
-
pe = (e) => {
|
|
1109
|
-
const t = e.data,
|
|
1110
|
-
s = e.source,
|
|
1111
|
-
{ name: n, value: r } = t
|
|
1112
|
-
s.addEventListener(n, r)
|
|
1113
|
-
},
|
|
1114
|
-
me = (e) => {
|
|
1115
|
-
const t = e.data,
|
|
1116
|
-
s = e.source,
|
|
1117
|
-
{ name: n, sourceValue: r, targetValue: o } = t
|
|
1118
|
-
s.removeEventListener(n, r), s.addEventListener(n, o)
|
|
1119
|
-
},
|
|
1120
|
-
fe = (e) => {
|
|
1121
|
-
const t = e.data,
|
|
1122
|
-
s = e.source,
|
|
1123
|
-
{ value: n } = t
|
|
1124
|
-
s.value = n
|
|
1125
|
-
},
|
|
1126
|
-
be = {
|
|
1127
|
-
[i.changeText]: ie,
|
|
1128
|
-
[i.removeNode]: ue,
|
|
1129
|
-
[i.insertNode]: ae,
|
|
1130
|
-
[i.replaceNode]: ce,
|
|
1131
|
-
[i.removeAttribute]: le,
|
|
1132
|
-
[i.addAttribute]: X,
|
|
1133
|
-
[i.updateAttribute]: he,
|
|
1134
|
-
[i.removeEvent]: de,
|
|
1135
|
-
[i.addEvent]: pe,
|
|
1136
|
-
[i.updateEvent]: me,
|
|
1137
|
-
[i.changeValue]: fe,
|
|
1138
|
-
},
|
|
1139
|
-
ve = (e, t, s) => {
|
|
1140
|
-
const n = [...t]
|
|
1141
|
-
return (
|
|
1142
|
-
e.forEach((r) => {
|
|
1143
|
-
ge(r, n, s)
|
|
1144
|
-
}),
|
|
829
|
+
);
|
|
830
|
+
r = a.concat(l);
|
|
831
|
+
} else if (e.nodeType === 1) {
|
|
832
|
+
const n = e, o = t, a = ee(n, o), l = s(
|
|
833
|
+
n.childNodes,
|
|
834
|
+
o.childNodes,
|
|
1145
835
|
n
|
|
1146
|
-
)
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
(
|
|
1180
|
-
|
|
836
|
+
);
|
|
837
|
+
r = a.concat(l);
|
|
838
|
+
} else e.nodeType === 3 && (r = re(e, t));
|
|
839
|
+
return r;
|
|
840
|
+
}, W = (e, t, s) => {
|
|
841
|
+
const r = [], n = oe(e, t), o = S(e), a = S(t), l = [];
|
|
842
|
+
let u = 0;
|
|
843
|
+
for (; u < n; u++) {
|
|
844
|
+
const c = e[u], h = t[u];
|
|
845
|
+
if (h && a.check(h)) {
|
|
846
|
+
const p = o.pullMatch(h);
|
|
847
|
+
a.clear(h), p.element ? (p.index !== u && r.push(
|
|
848
|
+
b(p.element, {
|
|
849
|
+
parent: s,
|
|
850
|
+
index: u
|
|
851
|
+
})
|
|
852
|
+
), l.push({
|
|
853
|
+
source: p.element,
|
|
854
|
+
target: h
|
|
855
|
+
})) : c ? a.check(c) ? r.push(
|
|
856
|
+
b(h, { parent: s, index: u })
|
|
857
|
+
) : (o.clear(c), r.push(
|
|
858
|
+
Rt(c, h)
|
|
859
|
+
)) : r.push(
|
|
860
|
+
b(h, { parent: s, index: u })
|
|
861
|
+
);
|
|
862
|
+
} else c && o.pullMatch(c).element && r.push(N(c));
|
|
863
|
+
}
|
|
864
|
+
o.remaining().forEach(({ element: c }) => {
|
|
865
|
+
r.push(N(c));
|
|
866
|
+
});
|
|
867
|
+
const d = l.reduce(
|
|
868
|
+
(c, { source: h, target: p }) => c.concat(
|
|
869
|
+
ne(h, p, W)
|
|
870
|
+
),
|
|
871
|
+
[]
|
|
872
|
+
);
|
|
873
|
+
return r.concat(d).sort(Qt);
|
|
874
|
+
}, oe = (e, t) => {
|
|
875
|
+
const s = e.length, r = t.length;
|
|
876
|
+
return s > r ? s : r;
|
|
877
|
+
}, ie = (e, t, s) => {
|
|
878
|
+
const r = W(e, t, s);
|
|
879
|
+
return r.forEach((n) => {
|
|
880
|
+
ue(n);
|
|
881
|
+
}), r;
|
|
882
|
+
}, ue = (e) => {
|
|
883
|
+
(ye[e.type] || ae)(e);
|
|
884
|
+
}, ae = (e) => {
|
|
885
|
+
}, ce = (e) => {
|
|
886
|
+
const { source: t, target: s } = e;
|
|
887
|
+
t.nodeValue = s.textContent;
|
|
888
|
+
}, le = (e) => {
|
|
889
|
+
const { source: t } = e;
|
|
890
|
+
t.remove();
|
|
891
|
+
}, he = (e) => {
|
|
892
|
+
const { target: t, data: s } = e, { parent: r, index: n } = s, o = r.childNodes[n];
|
|
893
|
+
o ? o && o !== t && r.insertBefore(t, o) : r.appendChild(t);
|
|
894
|
+
}, de = (e) => {
|
|
895
|
+
const { source: t, target: s } = e;
|
|
896
|
+
t.replaceWith(s);
|
|
897
|
+
}, pe = (e) => {
|
|
898
|
+
const { source: t, data: s } = e, { name: r, isSvg: n } = s;
|
|
899
|
+
n ? t.removeAttributeNS(null, r) : t.removeAttribute(r);
|
|
900
|
+
}, X = (e) => {
|
|
901
|
+
const { source: t, data: s } = e, { name: r, value: n, isSvg: o } = s;
|
|
902
|
+
o ? t.setAttributeNS(null, r, n) : t.setAttribute(r, n);
|
|
903
|
+
}, me = (e) => {
|
|
904
|
+
X(e);
|
|
905
|
+
}, fe = (e) => {
|
|
906
|
+
const t = e.data, s = e.source, { name: r, value: n } = t;
|
|
907
|
+
s.removeEventListener(r, n);
|
|
908
|
+
}, be = (e) => {
|
|
909
|
+
const t = e.data, s = e.source, { name: r, value: n } = t;
|
|
910
|
+
s.addEventListener(r, n);
|
|
911
|
+
}, ve = (e) => {
|
|
912
|
+
const t = e.data, s = e.source, { name: r, sourceValue: n, targetValue: o } = t;
|
|
913
|
+
s.removeEventListener(r, n), s.addEventListener(r, o);
|
|
914
|
+
}, ge = (e) => {
|
|
915
|
+
const t = e.data, s = e.source, { value: r } = t;
|
|
916
|
+
s.value = r;
|
|
917
|
+
}, ye = {
|
|
918
|
+
[i.changeText]: ce,
|
|
919
|
+
[i.removeNode]: le,
|
|
920
|
+
[i.insertNode]: he,
|
|
921
|
+
[i.replaceNode]: de,
|
|
922
|
+
[i.removeAttribute]: pe,
|
|
923
|
+
[i.addAttribute]: X,
|
|
924
|
+
[i.updateAttribute]: me,
|
|
925
|
+
[i.removeEvent]: fe,
|
|
926
|
+
[i.addEvent]: be,
|
|
927
|
+
[i.updateEvent]: ve,
|
|
928
|
+
[i.changeValue]: ge
|
|
929
|
+
}, Ee = (e, t, s) => {
|
|
930
|
+
const r = [...t];
|
|
931
|
+
return e.forEach((n) => {
|
|
932
|
+
xe(n, r, s);
|
|
933
|
+
}), r;
|
|
934
|
+
}, xe = (e, t, s) => {
|
|
935
|
+
const r = _e[e.type];
|
|
936
|
+
r && r(e, t, s);
|
|
937
|
+
}, Ae = (e, t) => {
|
|
938
|
+
const { source: s } = e, r = t.indexOf(s);
|
|
939
|
+
r >= 0 && t.splice(r, 1);
|
|
940
|
+
}, we = (e, t, s) => {
|
|
941
|
+
const { target: r } = e, n = e.data, { index: o, parent: a } = n;
|
|
942
|
+
s === a && t.splice(o, 0, r);
|
|
943
|
+
}, Ne = (e, t) => {
|
|
944
|
+
const { target: s, source: r } = e, n = t.indexOf(r);
|
|
945
|
+
n >= 0 && (t[n] = s);
|
|
946
|
+
}, _e = {
|
|
947
|
+
[i.removeNode]: Ae,
|
|
948
|
+
[i.insertNode]: we,
|
|
949
|
+
[i.replaceNode]: Ne
|
|
950
|
+
};
|
|
951
|
+
class Se {
|
|
952
|
+
constructor({ Template: t, subscriptions: s, attributes: r, viewModel: n }) {
|
|
953
|
+
this.Template = t, this.viewModel = n, this.attributes = r, this.subscriptions = s, this.dom = [], this.parentElement = null;
|
|
1181
954
|
}
|
|
1182
955
|
render(t) {
|
|
1183
|
-
return (
|
|
1184
|
-
(this.parentElement = t.parent),
|
|
1185
|
-
(this.renderKit = t),
|
|
1186
|
-
this.subscribeForRerender(),
|
|
1187
|
-
(this.dom = this.generateDom(t)),
|
|
1188
|
-
this.dom
|
|
1189
|
-
)
|
|
956
|
+
return this.parentElement = t.parent, this.renderKit = t, this.subscribeForRerender(), this.dom = this.generateDom(t), this.dom;
|
|
1190
957
|
}
|
|
1191
958
|
generateDom(t) {
|
|
1192
959
|
const s = {
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
960
|
+
...this.attributes,
|
|
961
|
+
...this.viewModel(
|
|
962
|
+
t.state.getAll(this.subscriptions)
|
|
963
|
+
)
|
|
964
|
+
}, r = this.Template(s);
|
|
965
|
+
return r ? r.render(t) : [];
|
|
1198
966
|
}
|
|
1199
967
|
rerender() {
|
|
1200
968
|
if (!this.parentElement && this.dom[0]) {
|
|
1201
|
-
const
|
|
1202
|
-
this.parentElement =
|
|
969
|
+
const r = this.dom[0].parentElement;
|
|
970
|
+
this.parentElement = r;
|
|
1203
971
|
}
|
|
1204
|
-
const t = this.generateDom(this.renderKit),
|
|
1205
|
-
|
|
1206
|
-
|
|
972
|
+
const t = this.generateDom(this.renderKit), s = ie(
|
|
973
|
+
this.dom,
|
|
974
|
+
t,
|
|
975
|
+
this.parentElement
|
|
976
|
+
);
|
|
977
|
+
this.dom = Ee(
|
|
978
|
+
s,
|
|
979
|
+
this.dom,
|
|
980
|
+
this.parentElement
|
|
981
|
+
);
|
|
1207
982
|
}
|
|
1208
983
|
subscribeForRerender() {
|
|
1209
|
-
const { subscribe: t } = this.renderKit
|
|
984
|
+
const { subscribe: t } = this.renderKit;
|
|
1210
985
|
this.subscriptions.forEach((s) => {
|
|
1211
|
-
t(this.eventName(s), () => this.rerender())
|
|
1212
|
-
})
|
|
986
|
+
t(this.eventName(s), () => this.rerender());
|
|
987
|
+
});
|
|
1213
988
|
}
|
|
1214
989
|
eventName(t) {
|
|
1215
|
-
return `${
|
|
990
|
+
return `${w}:${t}`;
|
|
1216
991
|
}
|
|
1217
992
|
}
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
)
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
je = () => !0,
|
|
1247
|
-
Y =
|
|
1248
|
-
(e) =>
|
|
1249
|
-
({ route: t }) => {
|
|
1250
|
-
const s = e.find((n) => n.match(t))
|
|
1251
|
-
return s && s.Partial
|
|
1252
|
-
},
|
|
1253
|
-
Fe = /* @__PURE__ */ Object.freeze(
|
|
1254
|
-
/* @__PURE__ */ Object.defineProperty(
|
|
1255
|
-
{
|
|
1256
|
-
__proto__: null,
|
|
1257
|
-
buildRouter: Y,
|
|
1258
|
-
catchAll: je,
|
|
1259
|
-
exactPathMatch: Se,
|
|
1260
|
-
},
|
|
1261
|
-
Symbol.toStringTag,
|
|
1262
|
-
{ value: 'Module' },
|
|
1263
|
-
),
|
|
1264
|
-
),
|
|
1265
|
-
Oe = () => ({
|
|
1266
|
-
render: (e, t) => [],
|
|
1267
|
-
}),
|
|
1268
|
-
Le = (e) => {
|
|
1269
|
-
const t = Y(e)
|
|
1270
|
-
return Ne({
|
|
1271
|
-
Template: ({ route: n }) => (t({ route: n }) || Oe)(),
|
|
1272
|
-
subscriptions: ['route'],
|
|
1273
|
-
})
|
|
1274
|
-
}
|
|
993
|
+
const Te = (e) => e, je = ({
|
|
994
|
+
Template: e,
|
|
995
|
+
viewModel: t,
|
|
996
|
+
subscriptions: s
|
|
997
|
+
}) => (s = s || [], t = t || Te, (r) => new Se({ Template: e, viewModel: t, subscriptions: s, attributes: r })), ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
998
|
+
__proto__: null,
|
|
999
|
+
createRouteState: D,
|
|
1000
|
+
events: wt,
|
|
1001
|
+
extractQueryParams: L,
|
|
1002
|
+
findHref: P,
|
|
1003
|
+
navigate: E,
|
|
1004
|
+
onLinkClick: F,
|
|
1005
|
+
onLocationChange: z,
|
|
1006
|
+
start: Nt
|
|
1007
|
+
}, Symbol.toStringTag, { value: "Module" })), Oe = (e) => ({ path: t }) => t === e, Me = () => !0, Y = (e) => ({ route: t }) => {
|
|
1008
|
+
const s = e.find((r) => r.match(t));
|
|
1009
|
+
return s && s.Partial;
|
|
1010
|
+
}, Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1011
|
+
__proto__: null,
|
|
1012
|
+
buildRouter: Y,
|
|
1013
|
+
catchAll: Me,
|
|
1014
|
+
exactPathMatch: Oe
|
|
1015
|
+
}, Symbol.toStringTag, { value: "Module" })), ke = () => ({
|
|
1016
|
+
render: (e, t) => []
|
|
1017
|
+
}), Ve = (e) => {
|
|
1018
|
+
const t = Y(e);
|
|
1019
|
+
return je({ Template: ({ route: r }) => (t({ route: r }) || ke)(), subscriptions: ["route"] });
|
|
1020
|
+
};
|
|
1275
1021
|
export {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1022
|
+
Le as JaxsTypes,
|
|
1023
|
+
$e as appBuilding,
|
|
1024
|
+
je as bind,
|
|
1025
|
+
Fe as createApp,
|
|
1280
1026
|
Et as jsx,
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
}
|
|
1027
|
+
De as messageBus,
|
|
1028
|
+
ze as navigation,
|
|
1029
|
+
Ve as routedView,
|
|
1030
|
+
Be as routing,
|
|
1031
|
+
Pe as state
|
|
1032
|
+
};
|