jaxs 0.8.0 → 0.9.1

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