jaxs 0.9.3 → 0.9.4

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
@@ -11,17 +11,17 @@
11
11
  for (let s = e.length - 1; s >= 0; s--) e[s] === t && e.splice(s, 1)
12
12
  return e
13
13
  },
14
- j = (e, t) => {
14
+ O = (e, t) => {
15
15
  for (let s = e.length - 1; s >= 0; s--) t(e[s]) && e.splice(s, 1)
16
16
  return e
17
17
  },
18
- O = (e, t, s) => (e.splice(t, 0, s), e),
19
- M = (e, t) => (e.includes(t) || e.push(t), e),
20
- dt = {
18
+ M = (e, t, s) => (e.splice(t, 0, s), e),
19
+ k = (e, t) => (e.includes(t) || e.push(t), e),
20
+ pt = {
21
21
  remove: b,
22
- removeBy: j,
23
- insertAt: O,
24
- appendIfUnique: M,
22
+ removeBy: O,
23
+ insertAt: M,
24
+ appendIfUnique: k,
25
25
  push: (e, t) => e.push(t),
26
26
  pop: (e) => e.pop(),
27
27
  unshift: (e, t) => e.unshift(t),
@@ -29,7 +29,7 @@
29
29
  sortBy: (e, t) => e.sort(t),
30
30
  includes: (e, t) => e.includes(t),
31
31
  }
32
- class pt {
32
+ class ft {
33
33
  constructor(t) {
34
34
  this.store = t
35
35
  }
@@ -59,8 +59,8 @@
59
59
  return this.value === !1
60
60
  }
61
61
  }
62
- const v = (e) => new pt(e),
63
- ft = {
62
+ const v = (e) => new ft(e),
63
+ mt = {
64
64
  toggle: (e) => v(e).toggle(),
65
65
  setTrue: (e) => v(e).setTrue(),
66
66
  setFalse: (e) => v(e).setFalse(),
@@ -68,7 +68,7 @@
68
68
  isTrue: (e) => v(e).isTrue(),
69
69
  isFalse: (e) => v(e).isFalse(),
70
70
  }
71
- class mt {
71
+ class bt {
72
72
  constructor(t) {
73
73
  this.store = t
74
74
  }
@@ -105,14 +105,14 @@
105
105
  }
106
106
  insertAt(t, s) {
107
107
  const r = this.value
108
- O(r, t, s), this.update(r)
108
+ M(r, t, s), this.update(r)
109
109
  }
110
110
  remove(t) {
111
111
  const s = b(this.value, t)
112
112
  this.update(s)
113
113
  }
114
114
  removeBy(t) {
115
- const s = j(this.value, t)
115
+ const s = O(this.value, t)
116
116
  this.update(s)
117
117
  }
118
118
  includes(t) {
@@ -120,7 +120,7 @@
120
120
  }
121
121
  appendIfUnique(t) {
122
122
  const s = this.value
123
- M(s, t), this.update(s)
123
+ k(s, t), this.update(s)
124
124
  }
125
125
  findBy(t) {
126
126
  return this.value.find(t)
@@ -131,8 +131,8 @@
131
131
  n !== -1 && ((r[n] = s), this.update(r))
132
132
  }
133
133
  }
134
- const m = (e) => new mt(e),
135
- bt = {
134
+ const m = (e) => new bt(e),
135
+ vt = {
136
136
  push: (e, t) => m(e).push(t),
137
137
  pop: (e) => m(e).pop(),
138
138
  unshift: (e, t) => m(e).unshift(t),
@@ -147,7 +147,7 @@
147
147
  findBy: (e, t) => m(e).findBy(t),
148
148
  replace: (e, t, s) => m(e).replace(t, s),
149
149
  }
150
- class vt {
150
+ class yt {
151
151
  constructor(t) {
152
152
  this.store = t
153
153
  }
@@ -186,22 +186,22 @@
186
186
  return !!this.value[t]
187
187
  }
188
188
  }
189
- const y = (e) => new vt(e),
190
- yt = {
189
+ const y = (e) => new yt(e),
190
+ gt = {
191
191
  reset: (e) => y(e).reset(),
192
192
  resetAttribute: (e, t) => y(e).resetAttribute(t),
193
193
  updateAttribute: (e, t, s) => y(e).updateAttribute(t, s),
194
194
  updateAttributes: (e, t) => y(e).updateAttributes(t),
195
195
  attributeTruthy: (e, t) => y(e).attributeTruthy(t),
196
196
  },
197
- gt = (e) => typeof e == 'boolean',
198
- Et = (e) => typeof e == 'number',
199
- k = (e) => typeof e == 'string',
197
+ Et = (e) => typeof e == 'boolean',
198
+ At = (e) => typeof e == 'number',
199
+ $ = (e) => typeof e == 'string',
200
200
  g = (e) => Array.isArray(e),
201
201
  A = (e) => e !== null && !g(e) && typeof e == 'object',
202
- At = { boolean: gt, number: Et, string: k, array: g, object: A },
203
- wt = (e, t) => t.createElement(e),
204
- Nt = (e, t) => {
202
+ wt = { boolean: Et, number: At, string: $, array: g, object: A },
203
+ Nt = (e, t) => t.createElement(e),
204
+ St = (e, t) => {
205
205
  for (const s in t) {
206
206
  if (s === '__self') continue
207
207
  const r = t[s].toString()
@@ -209,25 +209,25 @@
209
209
  const n = e
210
210
  n.value !== r && (n.value = r)
211
211
  } else
212
- k(r) && r.trim() === '' ? e.removeAttribute(s) : e.setAttribute(s, r)
212
+ $(r) && r.trim() === '' ? e.removeAttribute(s) : e.setAttribute(s, r)
213
213
  }
214
214
  },
215
- St = (e, t, s) => {
215
+ _t = (e, t, s) => {
216
216
  const r = {}
217
217
  for (const n in t) {
218
218
  const i = t[n],
219
- a = (c) => s(i, c)
220
- e.addEventListener(n, a),
221
- (r[n] = { domEvent: n, busEvent: i, listener: a })
219
+ o = (c) => s(i, c)
220
+ e.addEventListener(n, o),
221
+ (r[n] = { domEvent: n, busEvent: i, listener: o })
222
222
  }
223
223
  e.eventMaps = r
224
224
  },
225
- _t = (e, t, s, r) => {
226
- const n = wt(e, r.document)
227
- return Nt(n, t), St(n, s, r.publish), n
225
+ xt = (e, t, s, r) => {
226
+ const n = Nt(e, r.document)
227
+ return St(n, t), _t(n, s, r.publish), n
228
228
  },
229
229
  N = 'http://www.w3.org/2000/svg',
230
- xt = {
230
+ Tt = {
231
231
  animate: !0,
232
232
  animateMotion: !0,
233
233
  animateTransform: !0,
@@ -291,8 +291,8 @@
291
291
  use: !0,
292
292
  view: !0,
293
293
  },
294
- Tt = (e, t) => !!(xt[e] || (e === 'a' && t === N)),
295
- jt = (e, t, s) => {
294
+ jt = (e, t) => !!(Tt[e] || (e === 'a' && t === N)),
295
+ Ot = (e, t, s) => {
296
296
  const r = s.createElementNS(N, e)
297
297
  for (const n in t)
298
298
  n === '__self' ||
@@ -300,54 +300,54 @@
300
300
  r.setAttributeNS(null, n, t[n].toString())
301
301
  return r
302
302
  },
303
- Ot = (e) => e.namespaceURI === N,
304
- Mt = (e, t) => t.createTextNode(e)
305
- class kt {
303
+ Mt = (e) => e.namespaceURI === N,
304
+ kt = (e, t) => t.createTextNode(e)
305
+ class $t {
306
306
  constructor(t) {
307
307
  this.value = t.toString()
308
308
  }
309
309
  render(t) {
310
- const s = Mt(this.value, t.document)
310
+ const s = kt(this.value, t.document)
311
311
  return (s.__jsx = 'TextNode'), [s]
312
312
  }
313
313
  }
314
- const $t = (e) => typeof e == 'string' || typeof e == 'number',
315
- Bt = (e) => new kt(e),
316
- Dt = (e) => ($t(e) ? Bt(e) : e),
317
- $ = (e) => Pt(e).map(Dt).flat(),
318
- Pt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
319
- B = (e, t = {}) => $(e || t.children || []),
320
- Ft = (e, t = '') => {
314
+ const Bt = (e) => typeof e == 'string' || typeof e == 'number',
315
+ Dt = (e) => new $t(e),
316
+ Pt = (e) => (Bt(e) ? Dt(e) : e),
317
+ B = (e) => Ft(e).map(Pt).flat(),
318
+ Ft = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
319
+ D = (e, t = {}) => B(e || t.children || []),
320
+ Vt = (e, t = '') => {
321
321
  const s = {},
322
322
  r = {}
323
323
  for (const n in e) {
324
324
  const i = e[n]
325
325
  if (n.match(/^on.+/i)) {
326
- const a = n.slice(2).toLowerCase()
327
- r[a] = i ? i.toString() : ''
326
+ const o = n.slice(2).toLowerCase()
327
+ r[o] = i ? i.toString() : ''
328
328
  } else {
329
329
  if (i === !1) continue
330
- n === '__source' ? (s.__source = e.__source) : (s[n] = Vt(n, i, t))
330
+ n === '__source' ? (s.__source = e.__source) : (s[n] = Lt(n, i, t))
331
331
  }
332
332
  }
333
333
  return { attributes: s, events: r }
334
334
  },
335
- Vt = (e, t, s = '') => (t == null ? s : t.toString()),
336
- Lt = (e, t) => {
335
+ Lt = (e, t, s = '') => (t == null ? s : t.toString()),
336
+ zt = (e, t) => {
337
337
  const s = e || {},
338
- r = B(t, s)
338
+ r = D(t, s)
339
339
  return (s.children = s.children || r), s
340
340
  },
341
- D = (e, t, s, r = []) => e.reduce(zt(t, s), r).flat(),
342
- zt = (e, t) => (s, r) =>
341
+ P = (e, t, s, r = []) => e.reduce(Kt(t, s), r).flat(),
342
+ Kt = (e, t) => (s, r) =>
343
343
  r
344
344
  ? Array.isArray(r)
345
- ? D(r, e, t, s)
345
+ ? P(r, e, t, s)
346
346
  : (r.render(e, t).forEach((n) => s.push(n)), s)
347
347
  : s
348
- class P {
348
+ class F {
349
349
  constructor(t) {
350
- this.collection = $(t)
350
+ this.collection = B(t)
351
351
  }
352
352
  render(t, s) {
353
353
  this.parentElement = s
@@ -355,7 +355,7 @@
355
355
  return this.attachToParent(r), r
356
356
  }
357
357
  generateDom(t) {
358
- return D(this.collection, t, this.parentElement)
358
+ return P(this.collection, t, this.parentElement)
359
359
  }
360
360
  attachToParent(t) {
361
361
  if (this.parentElement === void 0) return
@@ -363,7 +363,7 @@
363
363
  t.forEach((r) => s.appendChild(r))
364
364
  }
365
365
  }
366
- class Kt {
366
+ class Rt {
367
367
  constructor(t, s) {
368
368
  ;(this.type = t), (this.attributes = s)
369
369
  }
@@ -391,14 +391,14 @@
391
391
  return `${this.type}${t}${s}${r}`
392
392
  }
393
393
  }
394
- class Rt {
394
+ class Ut {
395
395
  constructor(t, s, r = []) {
396
396
  this.type = t
397
- const { events: n, attributes: i } = Ft(s)
397
+ const { events: n, attributes: i } = Vt(s)
398
398
  ;(this.events = n),
399
399
  (this.attributes = i),
400
- (this.isSvg = Tt(this.type, this.attributes.xmlns)),
401
- (this.children = new P(r))
400
+ (this.isSvg = jt(this.type, this.attributes.xmlns)),
401
+ (this.children = new F(r))
402
402
  }
403
403
  render(t) {
404
404
  const s = this.generateDom(t)
@@ -408,24 +408,24 @@
408
408
  return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t)
409
409
  }
410
410
  generateHtmlDom(t) {
411
- const s = _t(this.type, this.attributes, this.events, t)
411
+ const s = xt(this.type, this.attributes, this.events, t)
412
412
  return (s.__jsx = this.jsxKey()), s
413
413
  }
414
414
  generateSvgDom(t) {
415
- const s = jt(this.type, this.attributes, t.document)
415
+ const s = Ot(this.type, this.attributes, t.document)
416
416
  return (s.__jsx = this.jsxKey()), s
417
417
  }
418
418
  jsxKey() {
419
- return new Kt(this.type, this.attributes).generate()
419
+ return new Rt(this.type, this.attributes).generate()
420
420
  }
421
421
  }
422
- const F = (e, t, ...s) =>
423
- typeof e == 'string' ? new Rt(e, t, s) : e(Lt(t, s))
424
- F.fragment = (e, t) => {
425
- const s = B(t, e)
426
- return new P(s)
422
+ const V = (e, t, ...s) =>
423
+ typeof e == 'string' ? new Ut(e, t, s) : e(zt(t, s))
424
+ V.fragment = (e, t) => {
425
+ const s = D(t, e)
426
+ return new F(s)
427
427
  }
428
- class Ut {
428
+ class qt {
429
429
  constructor(t, s, r) {
430
430
  ;(this.template = t),
431
431
  (this.selector = s),
@@ -450,45 +450,45 @@
450
450
  return this.renderKit.document.querySelector(this.selector)
451
451
  }
452
452
  }
453
- const qt = (e, t, s) => {
454
- const r = new Ut(e, t, s)
453
+ const It = (e, t, s) => {
454
+ const r = new qt(e, t, s)
455
455
  return r.renderAndAttach(s), r
456
456
  },
457
- V = 'go-to-href',
458
- L = 'go-to',
457
+ L = 'go-to-href',
458
+ z = 'go-to',
459
459
  E = 'navigation:location-change',
460
- z = 'navigation:route-change',
461
- It = Object.freeze(
460
+ K = 'navigation:route-change',
461
+ Jt = Object.freeze(
462
462
  Object.defineProperty(
463
463
  {
464
464
  __proto__: null,
465
- linkNavigationEvent: V,
465
+ linkNavigationEvent: L,
466
466
  locationChangeEvent: E,
467
- navigationEvent: L,
468
- routeChangeEvent: z,
467
+ navigationEvent: z,
468
+ routeChangeEvent: K,
469
469
  },
470
470
  Symbol.toStringTag,
471
471
  { value: 'Module' },
472
472
  ),
473
473
  ),
474
- K = (e) => {
474
+ R = (e) => {
475
475
  e.create('route', { host: '', path: '', query: {} })
476
476
  },
477
- R = (e) => {
477
+ U = (e) => {
478
478
  const t = e.closest('[href]')
479
479
  return (t && t.getAttribute('href')) || ''
480
480
  },
481
481
  S = ({ payload: e, publish: t, window: s }) => {
482
482
  s.history.pushState(null, '', e), t(E, null)
483
483
  },
484
- U = (e) => {
484
+ q = (e) => {
485
485
  const t = e.payload
486
486
  if (!t || !t.target) return
487
487
  t.preventDefault()
488
- const s = R(t.target)
488
+ const s = U(t.target)
489
489
  S({ ...e, payload: s })
490
490
  },
491
- q = (e) =>
491
+ I = (e) =>
492
492
  e
493
493
  .replace(/^\?/, '')
494
494
  .split('&')
@@ -497,39 +497,39 @@
497
497
  const r = s.split('=')
498
498
  return (t[r[0]] = r[1]), t
499
499
  }, {}),
500
- I = (e) => {
500
+ J = (e) => {
501
501
  const { state: t, publish: s, window: r } = e,
502
- { host: n, pathname: i, search: a } = r.location,
502
+ { host: n, pathname: i, search: o } = r.location,
503
503
  c = i,
504
- u = q(a),
504
+ u = I(o),
505
505
  d = { host: n, path: c, query: u }
506
- t.store('route').update(d), s(z, d)
506
+ t.store('route').update(d), s(K, d)
507
507
  },
508
- J = (e) => {
508
+ H = (e) => {
509
509
  const { subscribe: t } = e
510
- t(V, U),
511
- t(L, (s) => {
510
+ t(L, q),
511
+ t(z, (s) => {
512
512
  S(s)
513
513
  })
514
514
  },
515
515
  G = (e) => {
516
516
  const { publish: t, subscribe: s, state: r, window: n } = e
517
- K(r), n.addEventListener('popstate', () => t(E, null)), s(E, I)
517
+ R(r), n.addEventListener('popstate', () => t(E, null)), s(E, J)
518
518
  },
519
- H = (e) => {
519
+ W = (e) => {
520
520
  setTimeout(() => e.publish(E, null), 0)
521
521
  },
522
522
  C = (e) => {
523
- G(e), J(e), H(e)
523
+ G(e), H(e), W(e)
524
524
  },
525
- Jt = Object.freeze(
525
+ Ht = Object.freeze(
526
526
  Object.defineProperty(
527
527
  {
528
528
  __proto__: null,
529
- publishLocation: H,
529
+ publishLocation: W,
530
530
  startNavigation: C,
531
531
  subscribeToHistoryChange: G,
532
- subscribeToNavigation: J,
532
+ subscribeToNavigation: H,
533
533
  },
534
534
  Symbol.toStringTag,
535
535
  { value: 'Module' },
@@ -542,7 +542,7 @@
542
542
  publish: r,
543
543
  subscribe: n,
544
544
  bus: i,
545
- state: a,
545
+ state: o,
546
546
  renderKit: c,
547
547
  }) {
548
548
  ;(this.window = t),
@@ -550,12 +550,12 @@
550
550
  (this.publish = r),
551
551
  (this.subscribe = n),
552
552
  (this.bus = i),
553
- (this.state = a),
553
+ (this.state = o),
554
554
  (this.renderKit = c),
555
555
  (this.roots = [])
556
556
  }
557
557
  render(t, s) {
558
- const r = qt(t, s, this.renderKit)
558
+ const r = It(t, s, this.renderKit)
559
559
  return this.roots.push(r), r
560
560
  }
561
561
  startNavigation() {
@@ -567,7 +567,7 @@
567
567
  value: 'Module',
568
568
  }),
569
569
  )
570
- class W {
570
+ class X {
571
571
  constructor() {
572
572
  this.lookup = {}
573
573
  }
@@ -590,7 +590,7 @@
590
590
  this.lookup[t] || (this.lookup[t] = [])
591
591
  }
592
592
  }
593
- class X {
593
+ class Y {
594
594
  constructor() {
595
595
  this.lookup = []
596
596
  }
@@ -605,7 +605,7 @@
605
605
  return this.lookup.filter((s) => s.matcher.test(t))
606
606
  }
607
607
  }
608
- class Ht {
608
+ class _ {
609
609
  constructor({ publish: t, event: s, payload: r, timer: n }) {
610
610
  ;(this.setNewTimeout = () => {
611
611
  this.stopped ||
@@ -642,26 +642,28 @@
642
642
  ((this.callCount += 1), this.publish(this.event, this.payload))
643
643
  }
644
644
  }
645
- const Ct = (e) => {
646
- const { offset: t, period: s } = e,
647
- r = ({ callCount: n }) => (t && n == 0 ? t : s)
648
- return {
649
- event: e.event,
650
- publish: e.publish,
651
- payload: e.payload,
652
- timer: r,
653
- }
645
+ const Wt = (e) => (t, s) => {
646
+ const { offset: r, period: n, payload: i } = s,
647
+ o = ({ callCount: u }) => (r && u == 0 ? r : n),
648
+ c = new _({ payload: i, event: t, publish: e, timer: o })
649
+ return c.start(), c.stop
654
650
  },
655
- Qt = (e) => {
656
- let t
657
- 'timer' in e ? (t = e) : (t = Ct(e))
658
- const s = new Ht(t)
659
- return s.start(), s.stop
651
+ Ct =
652
+ (e) =>
653
+ (t, { timeout: s, payload: r }) => {
654
+ const n = ({ callCount: o, stop: c }) => (o > 1 && c(), s),
655
+ i = new _({ publish: e, event: t, payload: r, timer: n })
656
+ return i.start(), i.stop
657
+ },
658
+ Qt = (e) => (t, s) => {
659
+ const r = { ...s, event: t, publish: e },
660
+ n = new _(r)
661
+ return n.start(), n.stop
660
662
  }
661
- class Y {
663
+ class Z {
662
664
  constructor() {
663
- ;(this.exactSubscriptions = new W()),
664
- (this.fuzzySubscriptions = new X()),
665
+ ;(this.exactSubscriptions = new X()),
666
+ (this.fuzzySubscriptions = new Y()),
665
667
  (this.currentIndex = 0)
666
668
  }
667
669
  subscribe(t, s) {
@@ -696,48 +698,49 @@
696
698
  }
697
699
  }
698
700
  }
699
- const Z = () => {
700
- const e = new Y()
701
- return {
702
- bus: e,
703
- publish: (r, n) => e.publish(r, n),
704
- subscribe: (r, n) => e.subscribe(r, n),
705
- }
701
+ const tt = () => {
702
+ const e = new Z(),
703
+ t = (r, n) => e.publish(r, n)
704
+ return (
705
+ (t.withTimeout = Ct(t)),
706
+ (t.periodically = Wt(t)),
707
+ (t.periodicallyWithCustomTimer = Qt(t)),
708
+ { bus: e, publish: t, subscribe: (r, n) => e.subscribe(r, n) }
709
+ )
706
710
  },
707
- Wt = Object.freeze(
711
+ Xt = Object.freeze(
708
712
  Object.defineProperty(
709
713
  {
710
714
  __proto__: null,
711
- ExactSubscriptions: W,
712
- FuzzySubscriptions: X,
713
- JaxsBus: Y,
714
- createBus: Z,
715
- publishPeriodically: Qt,
715
+ ExactSubscriptions: X,
716
+ FuzzySubscriptions: Y,
717
+ JaxsBus: Z,
718
+ createBus: tt,
716
719
  },
717
720
  Symbol.toStringTag,
718
721
  { value: 'Module' },
719
722
  ),
720
723
  ),
721
- Xt = (e, t) => e === t,
722
- Yt = (e, t) => Object.keys(e).length === Object.keys(t).length,
723
- tt = (e, t) =>
724
- !(A(e) && A(t)) || !Yt(e, t)
724
+ Yt = (e, t) => e === t,
725
+ Zt = (e, t) => Object.keys(e).length === Object.keys(t).length,
726
+ et = (e, t) =>
727
+ !(A(e) && A(t)) || !Zt(e, t)
725
728
  ? !1
726
729
  : Object.keys(e).every((s) => {
727
730
  const r = e[s],
728
731
  n = t[s]
729
732
  return w(r, n)
730
733
  }),
731
- et = (e, t) =>
734
+ st = (e, t) =>
732
735
  !(g(e) && g(t)) || e.length !== t.length
733
736
  ? !1
734
737
  : e.every((s, r) => {
735
738
  const n = t[r]
736
739
  return w(s, n)
737
740
  }),
738
- w = (e, t) => (A(e) ? tt(e, t) : g(e) ? et(e, t) : Xt(e, t)),
739
- Zt = { objects: tt, arrays: et, equal: w }
740
- class _ {
741
+ w = (e, t) => (A(e) ? et(e, t) : g(e) ? st(e, t) : Yt(e, t)),
742
+ te = { objects: et, arrays: st, equal: w }
743
+ class x {
741
744
  constructor(t) {
742
745
  ;(this.name = t.name),
743
746
  (this.parent = t.parent),
@@ -766,21 +769,21 @@
766
769
  return t(this.value)
767
770
  }
768
771
  }
769
- const x = 'state'
770
- class st {
772
+ const T = 'state'
773
+ class rt {
771
774
  constructor(t) {
772
775
  ;(this.publisher = t),
773
776
  (this.stores = {}),
774
- (this.eventNamePrefix = x),
777
+ (this.eventNamePrefix = T),
775
778
  (this.notifications = new Set()),
776
779
  (this.inTransaction = !1)
777
780
  }
778
781
  create(t, s) {
779
- const r = new _({ name: t, parent: this, value: s })
782
+ const r = new x({ name: t, parent: this, value: s })
780
783
  return (this.stores[t] = r), r
781
784
  }
782
785
  store(t) {
783
- return this.stores[t] || new _({ name: t, parent: this, value: void 0 })
786
+ return this.stores[t] || new x({ name: t, parent: this, value: void 0 })
784
787
  }
785
788
  get(t) {
786
789
  return this.store(t).value
@@ -813,15 +816,15 @@
813
816
  return `${this.eventNamePrefix}:${t}`
814
817
  }
815
818
  }
816
- const rt = (e) => new st(e),
817
- te = Object.freeze(
819
+ const nt = (e) => new rt(e),
820
+ ee = Object.freeze(
818
821
  Object.defineProperty(
819
- { __proto__: null, State: st, Store: _, createState: rt, eventName: x },
822
+ { __proto__: null, State: rt, Store: x, createState: nt, eventName: T },
820
823
  Symbol.toStringTag,
821
824
  { value: 'Module' },
822
825
  ),
823
826
  )
824
- class ee {
827
+ class se {
825
828
  constructor(t) {
826
829
  this.setupDomEnvironment(t)
827
830
  }
@@ -851,11 +854,11 @@
851
854
  : ((this.window = window), (this.document = document))
852
855
  }
853
856
  setupBus() {
854
- const { publish: t, subscribe: s, bus: r } = Z()
857
+ const { publish: t, subscribe: s, bus: r } = tt()
855
858
  ;(this.publish = t), (this.subscribe = s), (this.bus = r)
856
859
  }
857
860
  setupState() {
858
- this.state = rt(this.publish)
861
+ this.state = nt(this.publish)
859
862
  }
860
863
  addBusOptions() {
861
864
  this.bus.addListenerOptions({
@@ -874,11 +877,11 @@
874
877
  }
875
878
  }
876
879
  }
877
- const se = (e = {}) => {
878
- const s = new ee(e).setup()
880
+ const re = (e = {}) => {
881
+ const s = new se(e).setup()
879
882
  return s.startNavigation(), s
880
883
  }
881
- var o = ((e) => (
884
+ var a = ((e) => (
882
885
  (e[(e.removeNode = 0)] = 'removeNode'),
883
886
  (e[(e.insertNode = 1)] = 'insertNode'),
884
887
  (e[(e.replaceNode = 2)] = 'replaceNode'),
@@ -891,38 +894,38 @@
891
894
  (e[(e.changeValue = 9)] = 'changeValue'),
892
895
  (e[(e.changeText = 10)] = 'changeText'),
893
896
  e
894
- ))(o || {})
895
- const re = Object.freeze(
897
+ ))(a || {})
898
+ const ne = Object.freeze(
896
899
  Object.defineProperty(
897
- { __proto__: null, ChangeInstructionTypes: o },
900
+ { __proto__: null, ChangeInstructionTypes: a },
898
901
  Symbol.toStringTag,
899
902
  { value: 'Module' },
900
903
  ),
901
904
  ),
902
- ne = (e, t) => ({ source: e, target: t, type: o.changeText, data: {} }),
903
- ie = (e, t) => ({ source: e, target: t, type: o.replaceNode, data: {} }),
904
- oe = (e, t, s) => ({
905
+ ie = (e, t) => ({ source: e, target: t, type: a.changeText, data: {} }),
906
+ oe = (e, t) => ({ source: e, target: t, type: a.replaceNode, data: {} }),
907
+ ue = (e, t, s) => ({
905
908
  source: e,
906
909
  target: t,
907
910
  data: s,
908
- type: o.removeAttribute,
911
+ type: a.removeAttribute,
909
912
  }),
910
- ue = (e, t, s) => ({ source: e, target: t, data: s, type: o.addAttribute }),
911
- ae = (e, t, s) => ({
913
+ ae = (e, t, s) => ({ source: e, target: t, data: s, type: a.addAttribute }),
914
+ ce = (e, t, s) => ({
912
915
  source: e,
913
916
  target: t,
914
917
  data: s,
915
- type: o.updateAttribute,
918
+ type: a.updateAttribute,
916
919
  }),
917
- ce = (e, t, s) => ({ source: e, target: t, data: s, type: o.removeEvent }),
918
- le = (e, t, s) => ({ source: e, target: t, data: s, type: o.addEvent }),
919
- he = (e, t, s) => ({ source: e, target: t, data: s, type: o.updateEvent }),
920
- nt = (e) => ({ source: e, target: e, type: o.removeNode, data: {} }),
921
- T = (e, t) => ({ target: e, source: e, type: o.insertNode, data: t }),
922
- de = (e, t, s) => ({ source: e, target: t, type: o.changeValue, data: s }),
923
- pe = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
924
- it = { index: -1 }
925
- class fe {
920
+ le = (e, t, s) => ({ source: e, target: t, data: s, type: a.removeEvent }),
921
+ he = (e, t, s) => ({ source: e, target: t, data: s, type: a.addEvent }),
922
+ de = (e, t, s) => ({ source: e, target: t, data: s, type: a.updateEvent }),
923
+ it = (e) => ({ source: e, target: e, type: a.removeNode, data: {} }),
924
+ j = (e, t) => ({ target: e, source: e, type: a.insertNode, data: t }),
925
+ pe = (e, t, s) => ({ source: e, target: t, type: a.changeValue, data: s }),
926
+ fe = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
927
+ ot = { index: -1 }
928
+ class me {
926
929
  constructor() {
927
930
  this.map = {}
928
931
  }
@@ -937,7 +940,7 @@
937
940
  pullMatch(t) {
938
941
  const s = t && t.__jsx
939
942
  return !s || !(this.map[s] && this.map[s].length)
940
- ? it
943
+ ? ot
941
944
  : this.map[s].shift()
942
945
  }
943
946
  clear(t) {
@@ -954,23 +957,23 @@
954
957
  return Object.values(this.map).flat()
955
958
  }
956
959
  }
957
- const ot = (e) => {
958
- const t = new fe()
960
+ const ut = (e) => {
961
+ const t = new me()
959
962
  return t.populate(e), t
960
963
  },
961
- ut = (e, t, s = !1) => {
964
+ at = (e, t, s = !1) => {
962
965
  const r = [],
963
966
  n = e.attributes,
964
967
  i = n.length,
965
- a = t.attributes,
966
- c = a.length
968
+ o = t.attributes,
969
+ c = o.length
967
970
  let u, d, p
968
971
  for (u = 0; u < i; u++) {
969
972
  p = null
970
973
  const h = n.item(u)
971
974
  if (h) {
972
975
  for (d = 0; d < c; d++) {
973
- const f = a.item(d)
976
+ const f = o.item(d)
974
977
  if (f && h.name == f.name) {
975
978
  p = f
976
979
  break
@@ -978,13 +981,13 @@
978
981
  }
979
982
  p
980
983
  ? h.value !== p.value &&
981
- r.push(ae(e, t, { name: h.name, value: p.value, isSvg: s }))
982
- : r.push(oe(e, t, { name: h.name, isSvg: s }))
984
+ r.push(ce(e, t, { name: h.name, value: p.value, isSvg: s }))
985
+ : r.push(ue(e, t, { name: h.name, isSvg: s }))
983
986
  }
984
987
  }
985
988
  for (u = 0; u < c; u++) {
986
989
  p = null
987
- const h = a.item(u)
990
+ const h = o.item(u)
988
991
  if (h) {
989
992
  for (d = 0; d < i; d++) {
990
993
  const f = n.item(d)
@@ -993,17 +996,17 @@
993
996
  break
994
997
  }
995
998
  }
996
- p || r.push(ue(e, t, { name: h.name, value: h.value, isSvg: s }))
999
+ p || r.push(ae(e, t, { name: h.name, value: h.value, isSvg: s }))
997
1000
  }
998
1001
  }
999
1002
  return r
1000
1003
  },
1001
- me = (e, t) => {
1004
+ be = (e, t) => {
1002
1005
  const s = [],
1003
1006
  r = e.eventMaps,
1004
1007
  n = t.eventMaps,
1005
1008
  i = Object.keys(r),
1006
- a = Object.keys(n)
1009
+ o = Object.keys(n)
1007
1010
  return (
1008
1011
  i.forEach((c) => {
1009
1012
  const u = r[c],
@@ -1011,204 +1014,204 @@
1011
1014
  d
1012
1015
  ? d.busEvent !== u.busEvent &&
1013
1016
  s.push(
1014
- he(e, t, {
1017
+ de(e, t, {
1015
1018
  name: c,
1016
1019
  targetValue: d.listener,
1017
1020
  sourceValue: u.listener,
1018
1021
  }),
1019
1022
  )
1020
- : s.push(ce(e, t, { name: u.domEvent, value: u.listener }))
1023
+ : s.push(le(e, t, { name: u.domEvent, value: u.listener }))
1021
1024
  }),
1022
- a.forEach((c) => {
1025
+ o.forEach((c) => {
1023
1026
  const u = r[c],
1024
1027
  d = n[c]
1025
- u || s.push(le(e, t, { name: d.domEvent, value: d.listener }))
1028
+ u || s.push(he(e, t, { name: d.domEvent, value: d.listener }))
1026
1029
  }),
1027
1030
  s
1028
1031
  )
1029
1032
  },
1030
- be = (e) => e.tagName !== 'INPUT',
1031
- ve = (e, t) => e.value === t.value,
1032
- ye = (e, t) => {
1033
- if (be(e) || ve(e, t)) return []
1033
+ ve = (e) => e.tagName !== 'INPUT',
1034
+ ye = (e, t) => e.value === t.value,
1035
+ ge = (e, t) => {
1036
+ if (ve(e) || ye(e, t)) return []
1034
1037
  const s = e,
1035
1038
  r = t
1036
- return [de(s, r, { name: 'value', value: r.value })]
1039
+ return [pe(s, r, { name: 'value', value: r.value })]
1037
1040
  },
1038
- ge = (e, t) => {
1039
- const s = ut(e, t),
1040
- r = me(e, t),
1041
- n = ye(e, t)
1041
+ Ee = (e, t) => {
1042
+ const s = at(e, t),
1043
+ r = be(e, t),
1044
+ n = ge(e, t)
1042
1045
  return s.concat(r).concat(n)
1043
1046
  },
1044
- Ee = (e, t) => ut(e, t, !0),
1045
- Ae = (e, t) => (e.textContent !== t.textContent ? [ne(e, t)] : []),
1046
- we = (e, t, s) => {
1047
+ Ae = (e, t) => at(e, t, !0),
1048
+ we = (e, t) => (e.textContent !== t.textContent ? [ie(e, t)] : []),
1049
+ Ne = (e, t, s) => {
1047
1050
  let r = []
1048
- if (e.nodeType === 1 && Ot(e)) {
1051
+ if (e.nodeType === 1 && Mt(e)) {
1049
1052
  const n = e,
1050
1053
  i = t,
1051
- a = Ee(n, i),
1054
+ o = Ae(n, i),
1052
1055
  c = s(n.childNodes, i.childNodes, n)
1053
- r = a.concat(c)
1056
+ r = o.concat(c)
1054
1057
  } else if (e.nodeType === 1) {
1055
1058
  const n = e,
1056
1059
  i = t,
1057
- a = ge(n, i),
1060
+ o = Ee(n, i),
1058
1061
  c = s(n.childNodes, i.childNodes, n)
1059
- r = a.concat(c)
1060
- } else e.nodeType === 3 && (r = Ae(e, t))
1062
+ r = o.concat(c)
1063
+ } else e.nodeType === 3 && (r = we(e, t))
1061
1064
  return r
1062
1065
  },
1063
- at = (e, t, s) => {
1066
+ ct = (e, t, s) => {
1064
1067
  const r = [],
1065
- n = Ne(e, t),
1066
- i = ot(e),
1067
- a = ot(t),
1068
+ n = Se(e, t),
1069
+ i = ut(e),
1070
+ o = ut(t),
1068
1071
  c = []
1069
1072
  let u = 0
1070
1073
  for (; u < n; u++) {
1071
1074
  const p = e[u],
1072
1075
  h = t[u]
1073
- if (h && a.check(h)) {
1076
+ if (h && o.check(h)) {
1074
1077
  const f = i.pullMatch(h)
1075
- a.clear(h),
1078
+ o.clear(h),
1076
1079
  f.element
1077
- ? (f.index !== u && r.push(T(f.element, { parent: s, index: u })),
1080
+ ? (f.index !== u && r.push(j(f.element, { parent: s, index: u })),
1078
1081
  c.push({ source: f.element, target: h }))
1079
1082
  : p
1080
- ? a.check(p)
1081
- ? r.push(T(h, { parent: s, index: u }))
1082
- : (i.clear(p), r.push(ie(p, h)))
1083
- : r.push(T(h, { parent: s, index: u }))
1084
- } else p && i.pullMatch(p).element && r.push(nt(p))
1083
+ ? o.check(p)
1084
+ ? r.push(j(h, { parent: s, index: u }))
1085
+ : (i.clear(p), r.push(oe(p, h)))
1086
+ : r.push(j(h, { parent: s, index: u }))
1087
+ } else p && i.pullMatch(p).element && r.push(it(p))
1085
1088
  }
1086
1089
  i.remaining().forEach(({ element: p }) => {
1087
- r.push(nt(p))
1090
+ r.push(it(p))
1088
1091
  })
1089
1092
  const d = c.reduce(
1090
- (p, { source: h, target: f }) => p.concat(we(h, f, at)),
1093
+ (p, { source: h, target: f }) => p.concat(Ne(h, f, ct)),
1091
1094
  [],
1092
1095
  )
1093
- return r.concat(d).sort(pe)
1096
+ return r.concat(d).sort(fe)
1094
1097
  },
1095
- Ne = (e, t) => {
1098
+ Se = (e, t) => {
1096
1099
  const s = e.length,
1097
1100
  r = t.length
1098
1101
  return s > r ? s : r
1099
1102
  },
1100
- Se = (e, t, s) => {
1101
- const r = at(e, t, s)
1103
+ _e = (e, t, s) => {
1104
+ const r = ct(e, t, s)
1102
1105
  return (
1103
1106
  r.forEach((n) => {
1104
- _e(n)
1107
+ xe(n)
1105
1108
  }),
1106
1109
  r
1107
1110
  )
1108
1111
  },
1109
- _e = (e) => {
1110
- ;(Ve[e.type] || xe)(e)
1112
+ xe = (e) => {
1113
+ ;(Le[e.type] || Te)(e)
1111
1114
  },
1112
- xe = (e) => {},
1113
- Te = (e) => {
1115
+ Te = (e) => {},
1116
+ je = (e) => {
1114
1117
  const { source: t, target: s } = e
1115
1118
  t.nodeValue = s.textContent
1116
1119
  },
1117
- je = (e) => {
1120
+ Oe = (e) => {
1118
1121
  const { source: t } = e
1119
1122
  t.remove()
1120
1123
  },
1121
- Oe = (e) => {
1124
+ Me = (e) => {
1122
1125
  const { target: t, data: s } = e,
1123
1126
  { parent: r, index: n } = s,
1124
1127
  i = r.childNodes[n]
1125
1128
  i ? i && i !== t && r.insertBefore(t, i) : r.appendChild(t)
1126
1129
  },
1127
- Me = (e) => {
1130
+ ke = (e) => {
1128
1131
  const { source: t, target: s } = e
1129
1132
  t.replaceWith(s)
1130
1133
  },
1131
- ke = (e) => {
1134
+ $e = (e) => {
1132
1135
  const { source: t, data: s } = e,
1133
1136
  { name: r, isSvg: n } = s
1134
1137
  n ? t.removeAttributeNS(null, r) : t.removeAttribute(r)
1135
1138
  },
1136
- ct = (e) => {
1139
+ lt = (e) => {
1137
1140
  const { source: t, data: s } = e,
1138
1141
  { name: r, value: n, isSvg: i } = s
1139
1142
  i ? t.setAttributeNS(null, r, n) : t.setAttribute(r, n)
1140
1143
  },
1141
- $e = (e) => {
1142
- ct(e)
1143
- },
1144
1144
  Be = (e) => {
1145
+ lt(e)
1146
+ },
1147
+ De = (e) => {
1145
1148
  const t = e.data,
1146
1149
  s = e.source,
1147
1150
  { name: r, value: n } = t
1148
1151
  s.removeEventListener(r, n)
1149
1152
  },
1150
- De = (e) => {
1153
+ Pe = (e) => {
1151
1154
  const t = e.data,
1152
1155
  s = e.source,
1153
1156
  { name: r, value: n } = t
1154
1157
  s.addEventListener(r, n)
1155
1158
  },
1156
- Pe = (e) => {
1159
+ Fe = (e) => {
1157
1160
  const t = e.data,
1158
1161
  s = e.source,
1159
1162
  { name: r, sourceValue: n, targetValue: i } = t
1160
1163
  s.removeEventListener(r, n), s.addEventListener(r, i)
1161
1164
  },
1162
- Fe = (e) => {
1165
+ Ve = (e) => {
1163
1166
  const t = e.data,
1164
1167
  s = e.source,
1165
1168
  { value: r } = t
1166
1169
  s.value = r
1167
1170
  },
1168
- Ve = {
1169
- [o.changeText]: Te,
1170
- [o.removeNode]: je,
1171
- [o.insertNode]: Oe,
1172
- [o.replaceNode]: Me,
1173
- [o.removeAttribute]: ke,
1174
- [o.addAttribute]: ct,
1175
- [o.updateAttribute]: $e,
1176
- [o.removeEvent]: Be,
1177
- [o.addEvent]: De,
1178
- [o.updateEvent]: Pe,
1179
- [o.changeValue]: Fe,
1171
+ Le = {
1172
+ [a.changeText]: je,
1173
+ [a.removeNode]: Oe,
1174
+ [a.insertNode]: Me,
1175
+ [a.replaceNode]: ke,
1176
+ [a.removeAttribute]: $e,
1177
+ [a.addAttribute]: lt,
1178
+ [a.updateAttribute]: Be,
1179
+ [a.removeEvent]: De,
1180
+ [a.addEvent]: Pe,
1181
+ [a.updateEvent]: Fe,
1182
+ [a.changeValue]: Ve,
1180
1183
  },
1181
- Le = (e, t, s) => {
1184
+ ze = (e, t, s) => {
1182
1185
  const r = [...t]
1183
1186
  return (
1184
1187
  e.forEach((n) => {
1185
- ze(n, r, s)
1188
+ Ke(n, r, s)
1186
1189
  }),
1187
1190
  r
1188
1191
  )
1189
1192
  },
1190
- ze = (e, t, s) => {
1191
- const r = qe[e.type]
1193
+ Ke = (e, t, s) => {
1194
+ const r = Ie[e.type]
1192
1195
  r && r(e, t, s)
1193
1196
  },
1194
- Ke = (e, t) => {
1197
+ Re = (e, t) => {
1195
1198
  const { source: s } = e,
1196
1199
  r = t.indexOf(s)
1197
1200
  r >= 0 && t.splice(r, 1)
1198
1201
  },
1199
- Re = (e, t, s) => {
1202
+ Ue = (e, t, s) => {
1200
1203
  const { target: r } = e,
1201
1204
  n = e.data,
1202
- { index: i, parent: a } = n
1203
- s === a && t.splice(i, 0, r)
1205
+ { index: i, parent: o } = n
1206
+ s === o && t.splice(i, 0, r)
1204
1207
  },
1205
- Ue = (e, t) => {
1208
+ qe = (e, t) => {
1206
1209
  const { target: s, source: r } = e,
1207
1210
  n = t.indexOf(r)
1208
1211
  n >= 0 && (t[n] = s)
1209
1212
  },
1210
- qe = { [o.removeNode]: Ke, [o.insertNode]: Re, [o.replaceNode]: Ue }
1211
- class Ie {
1213
+ Ie = { [a.removeNode]: Re, [a.insertNode]: Ue, [a.replaceNode]: qe }
1214
+ class Je {
1212
1215
  constructor({
1213
1216
  Template: t,
1214
1217
  subscriptions: s,
@@ -1245,8 +1248,8 @@
1245
1248
  this.parentElement = r
1246
1249
  }
1247
1250
  const t = this.generateDom(this.renderKit),
1248
- s = Se(this.dom, t, this.parentElement)
1249
- this.dom = Le(s, this.dom, this.parentElement)
1251
+ s = _e(this.dom, t, this.parentElement)
1252
+ this.dom = ze(s, this.dom, this.parentElement)
1250
1253
  }
1251
1254
  subscribeForRerender() {
1252
1255
  const { subscribe: t } = this.renderKit
@@ -1255,22 +1258,22 @@
1255
1258
  })
1256
1259
  }
1257
1260
  eventName(t) {
1258
- return `${x}:${t}`
1261
+ return `${T}:${t}`
1259
1262
  }
1260
1263
  }
1261
- const Je = (e) => e,
1262
- lt = ({ Template: e, viewModel: t, subscriptions: s }) => (
1264
+ const He = (e) => e,
1265
+ ht = ({ Template: e, viewModel: t, subscriptions: s }) => (
1263
1266
  (s = s || []),
1264
- (t = t || Je),
1267
+ (t = t || He),
1265
1268
  (r) =>
1266
- new Ie({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1269
+ new Je({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1267
1270
  ),
1268
1271
  Ge =
1269
1272
  (e) =>
1270
1273
  ({ path: t }) =>
1271
1274
  t === e,
1272
- He = () => !0,
1273
- ht =
1275
+ We = () => !0,
1276
+ dt =
1274
1277
  (e) =>
1275
1278
  ({ route: t }) => {
1276
1279
  const s = e.find((r) => r.match(t))
@@ -1278,51 +1281,51 @@
1278
1281
  },
1279
1282
  Ce = Object.freeze(
1280
1283
  Object.defineProperty(
1281
- { __proto__: null, buildRouter: ht, catchAll: He, exactPathMatch: Ge },
1284
+ { __proto__: null, buildRouter: dt, catchAll: We, exactPathMatch: Ge },
1282
1285
  Symbol.toStringTag,
1283
1286
  { value: 'Module' },
1284
1287
  ),
1285
1288
  ),
1286
1289
  Qe = () => ({ render: (e, t) => [] }),
1287
- We = (e) => {
1288
- const t = ht(e)
1289
- return lt({
1290
+ Xe = (e) => {
1291
+ const t = dt(e)
1292
+ return ht({
1290
1293
  Template: ({ route: r }) => (t({ route: r }) || Qe)(),
1291
1294
  subscriptions: ['route'],
1292
1295
  })
1293
1296
  },
1294
- Xe = Object.freeze(
1297
+ Ye = Object.freeze(
1295
1298
  Object.defineProperty(
1296
1299
  {
1297
1300
  __proto__: null,
1298
- createRouteState: K,
1299
- events: It,
1300
- extractQueryParams: q,
1301
- findHref: R,
1301
+ createRouteState: R,
1302
+ events: Jt,
1303
+ extractQueryParams: I,
1304
+ findHref: U,
1302
1305
  navigate: S,
1303
- onLinkClick: U,
1304
- onLocationChange: I,
1305
- start: Jt,
1306
+ onLinkClick: q,
1307
+ onLocationChange: J,
1308
+ start: Ht,
1306
1309
  },
1307
1310
  Symbol.toStringTag,
1308
1311
  { value: 'Module' },
1309
1312
  ),
1310
1313
  )
1311
- ;(l.ArrayModifiers = dt),
1312
- (l.BooleanStore = ft),
1313
- (l.Equality = Zt),
1314
- (l.Is = At),
1315
- (l.JaxsTypes = re),
1316
- (l.ListStore = bt),
1317
- (l.RecordStore = yt),
1314
+ ;(l.ArrayModifiers = pt),
1315
+ (l.BooleanStore = mt),
1316
+ (l.Equality = te),
1317
+ (l.Is = wt),
1318
+ (l.JaxsTypes = ne),
1319
+ (l.ListStore = vt),
1320
+ (l.RecordStore = gt),
1318
1321
  (l.appBuilding = Gt),
1319
- (l.bind = lt),
1320
- (l.createApp = se),
1321
- (l.jsx = F),
1322
- (l.messageBus = Wt),
1323
- (l.navigation = Xe),
1324
- (l.routedView = We),
1322
+ (l.bind = ht),
1323
+ (l.createApp = re),
1324
+ (l.jsx = V),
1325
+ (l.messageBus = Xt),
1326
+ (l.navigation = Ye),
1327
+ (l.routedView = Xe),
1325
1328
  (l.routing = Ce),
1326
- (l.state = te),
1329
+ (l.state = ee),
1327
1330
  Object.defineProperty(l, Symbol.toStringTag, { value: 'Module' })
1328
1331
  })