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