jaxs 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jaxs.js CHANGED
@@ -1,19 +1,23 @@
1
- const Z = (e, t) => t.createElement(e),
2
- tt = (e, t) => {
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) => {
3
6
  for (const s in t) {
4
7
  if (s === '__self') continue
5
8
  const r = t[s].toString()
6
9
  if (s === 'value') {
7
10
  const n = e
8
11
  n.value !== r && (n.value = r)
9
- } else e.setAttribute(s, r)
12
+ } else
13
+ tt(r) && r.trim() === '' ? e.removeAttribute(s) : e.setAttribute(s, r)
10
14
  }
11
15
  },
12
- et = (e, t, s) => {
16
+ rt = (e, t, s) => {
13
17
  const r = {}
14
18
  for (const n in t) {
15
19
  const i = t[n],
16
- a = (l) => s(i, l)
20
+ a = (c) => s(i, c)
17
21
  e.addEventListener(n, a),
18
22
  (r[n] = {
19
23
  domEvent: n,
@@ -23,12 +27,12 @@ const Z = (e, t) => t.createElement(e),
23
27
  }
24
28
  e.eventMaps = r
25
29
  },
26
- st = (e, t, s, r) => {
27
- const n = Z(e, r.document)
28
- return tt(n, t), et(n, s, r.publish), n
30
+ nt = (e, t, s, r) => {
31
+ const n = et(e, r.document)
32
+ return st(n, t), rt(n, s, r.publish), n
29
33
  },
30
34
  y = 'http://www.w3.org/2000/svg',
31
- rt = {
35
+ it = {
32
36
  animate: !0,
33
37
  animateMotion: !0,
34
38
  animateTransform: !0,
@@ -92,8 +96,8 @@ const Z = (e, t) => t.createElement(e),
92
96
  use: !0,
93
97
  view: !0,
94
98
  },
95
- nt = (e, t) => !!(rt[e] || (e === 'a' && t === y)),
96
- it = (e, t, s) => {
99
+ ot = (e, t) => !!(it[e] || (e === 'a' && t === y)),
100
+ ut = (e, t, s) => {
97
101
  const r = s.createElementNS(y, e)
98
102
  for (const n in t)
99
103
  n === '__self' ||
@@ -101,24 +105,24 @@ const Z = (e, t) => t.createElement(e),
101
105
  r.setAttributeNS(null, n, t[n].toString())
102
106
  return r
103
107
  },
104
- ot = (e) => e.namespaceURI === y,
105
- ut = (e, t) => t.createTextNode(e)
106
- class at {
108
+ at = (e) => e.namespaceURI === y,
109
+ ct = (e, t) => t.createTextNode(e)
110
+ class lt {
107
111
  constructor(t) {
108
112
  this.value = t.toString()
109
113
  }
110
114
  render(t) {
111
- const s = ut(this.value, t.document)
115
+ const s = ct(this.value, t.document)
112
116
  return (s.__jsx = 'TextNode'), [s]
113
117
  }
114
118
  }
115
- const ct = (e) => typeof e == 'string' || typeof e == 'number',
116
- lt = (e) => new at(e),
117
- ht = (e) => (ct(e) ? lt(e) : e),
118
- dt = (e) => pt(e).map(ht).flat(),
119
- pt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
120
- T = (e, t = {}) => e || t.children || [],
121
- mt = (e, t = '') => {
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 = '') => {
122
126
  const s = {},
123
127
  r = {}
124
128
  for (const n in e) {
@@ -128,7 +132,7 @@ const ct = (e) => typeof e == 'string' || typeof e == 'number',
128
132
  r[a] = i ? i.toString() : ''
129
133
  } else {
130
134
  if (i === !1) continue
131
- n === '__source' ? (s.__source = e.__source) : (s[n] = ft(n, i, t))
135
+ n === '__source' ? (s.__source = e.__source) : (s[n] = bt(n, i, t))
132
136
  }
133
137
  }
134
138
  return {
@@ -136,22 +140,22 @@ const ct = (e) => typeof e == 'string' || typeof e == 'number',
136
140
  events: r,
137
141
  }
138
142
  },
139
- ft = (e, t, s = '') => (t == null ? s : t.toString()),
140
- bt = (e, t) => {
143
+ bt = (e, t, s = '') => (t == null ? s : t.toString()),
144
+ vt = (e, t) => {
141
145
  const s = e || {},
142
- r = T(t, s)
146
+ r = j(t, s)
143
147
  return (s.children = s.children || r), s
144
148
  },
145
- j = (e, t, s, r = []) => e.reduce(vt(t, s), r).flat(),
146
- vt = (e, t) => (s, r) =>
149
+ O = (e, t, s, r = []) => e.reduce(gt(t, s), r).flat(),
150
+ gt = (e, t) => (s, r) =>
147
151
  r
148
152
  ? Array.isArray(r)
149
- ? j(r, e, t, s)
153
+ ? O(r, e, t, s)
150
154
  : (r.render(e, t).forEach((n) => s.push(n)), s)
151
155
  : s
152
- class O {
156
+ class M {
153
157
  constructor(t) {
154
- this.collection = dt(t)
158
+ this.collection = T(t)
155
159
  }
156
160
  render(t, s) {
157
161
  this.parentElement = s
@@ -159,7 +163,7 @@ class O {
159
163
  return this.attachToParent(r), r
160
164
  }
161
165
  generateDom(t) {
162
- return j(this.collection, t, this.parentElement)
166
+ return O(this.collection, t, this.parentElement)
163
167
  }
164
168
  attachToParent(t) {
165
169
  if (this.parentElement === void 0) return
@@ -167,7 +171,7 @@ class O {
167
171
  t.forEach((r) => s.appendChild(r))
168
172
  }
169
173
  }
170
- class gt {
174
+ class yt {
171
175
  constructor(t, s) {
172
176
  ;(this.type = t), (this.attributes = s)
173
177
  }
@@ -193,14 +197,14 @@ class gt {
193
197
  return `${this.type}${t}${s}${r}`
194
198
  }
195
199
  }
196
- class yt {
200
+ class Et {
197
201
  constructor(t, s, r = []) {
198
202
  this.type = t
199
- const { events: n, attributes: i } = mt(s)
203
+ const { events: n, attributes: i } = ft(s)
200
204
  ;(this.events = n),
201
205
  (this.attributes = i),
202
- (this.isSvg = nt(this.type, this.attributes.xmlns)),
203
- (this.children = new O(r))
206
+ (this.isSvg = ot(this.type, this.attributes.xmlns)),
207
+ (this.children = new M(r))
204
208
  }
205
209
  render(t) {
206
210
  const s = this.generateDom(t)
@@ -210,24 +214,24 @@ class yt {
210
214
  return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t)
211
215
  }
212
216
  generateHtmlDom(t) {
213
- const s = st(this.type, this.attributes, this.events, t)
217
+ const s = nt(this.type, this.attributes, this.events, t)
214
218
  return (s.__jsx = this.jsxKey()), s
215
219
  }
216
220
  generateSvgDom(t) {
217
- const s = it(this.type, this.attributes, t.document)
221
+ const s = ut(this.type, this.attributes, t.document)
218
222
  return (s.__jsx = this.jsxKey()), s
219
223
  }
220
224
  jsxKey() {
221
- return new gt(this.type, this.attributes).generate()
225
+ return new yt(this.type, this.attributes).generate()
222
226
  }
223
227
  }
224
- const Et = (e, t, ...s) =>
225
- typeof e == 'string' ? new yt(e, t, s) : e(bt(t, s))
226
- Et.fragment = (e, t) => {
227
- const s = T(t, e)
228
- return new O(s)
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)
229
233
  }
230
- class xt {
234
+ class At {
231
235
  constructor(t, s, r) {
232
236
  ;(this.template = t),
233
237
  (this.selector = s),
@@ -252,48 +256,49 @@ class xt {
252
256
  return this.renderKit.document.querySelector(this.selector)
253
257
  }
254
258
  }
255
- const At = (e, t, s) => {
256
- const r = new xt(e, t, s)
259
+ const wt = (e, t, s) => {
260
+ const r = new At(e, t, s)
257
261
  return r.renderAndAttach(s), r
258
262
  },
259
- M = 'go-to-href',
260
- k = 'go-to',
263
+ k = 'go-to-href',
264
+ $ = 'go-to',
261
265
  m = 'navigation:location-change',
262
- $ = 'navigation:route-change',
263
- wt = /* @__PURE__ */ Object.freeze(
266
+ D = 'navigation:route-change',
267
+ Nt = /* @__PURE__ */ Object.freeze(
264
268
  /* @__PURE__ */ Object.defineProperty(
265
269
  {
266
270
  __proto__: null,
267
- linkNavigationEvent: M,
271
+ linkNavigationEvent: k,
268
272
  locationChangeEvent: m,
269
- navigationEvent: k,
270
- routeChangeEvent: $,
273
+ navigationEvent: $,
274
+ routeChangeEvent: D,
271
275
  },
272
276
  Symbol.toStringTag,
273
277
  { value: 'Module' },
274
278
  ),
275
279
  ),
276
- D = (e) => {
280
+ P = (e) => {
277
281
  e.create('route', {
278
282
  host: '',
279
283
  path: '',
280
284
  query: {},
281
285
  })
282
286
  },
283
- P = (e) => {
287
+ V = (e) => {
284
288
  const t = e.closest('[href]')
285
289
  return (t && t.getAttribute('href')) || ''
286
290
  },
287
- E = (e, { publish: t, window: s }) => {
291
+ E = ({ payload: e, publish: t, window: s }) => {
288
292
  s.history.pushState(null, '', e), t(m, null)
289
293
  },
290
- V = (e, t) => {
291
- if (!e || !e.target) return
292
- e.preventDefault()
293
- const s = P(e.target)
294
- E(s, t)
294
+ F = (e) => {
295
+ const t = e.payload
296
+ if (!t || !t.target) return
297
+ t.preventDefault()
298
+ const s = V(t.target)
299
+ E({ ...e, payload: s })
295
300
  },
296
- F = (e) =>
301
+ L = (e) =>
297
302
  e
298
303
  .replace(/^\?/, '')
299
304
  .split('&')
@@ -302,49 +307,49 @@ const At = (e, t, s) => {
302
307
  const r = s.split('=')
303
308
  return (t[r[0]] = r[1]), t
304
309
  }, {}),
305
- L = (e, t) => {
306
- const { state: s, publish: r, window: n } = t,
307
- { host: i, pathname: a, search: l } = n.location,
308
- u = a,
309
- d = F(l),
310
- c = {
311
- host: i,
312
- path: u,
313
- query: d,
310
+ z = (e) => {
311
+ const { state: t, publish: s, window: r } = e,
312
+ { host: n, pathname: i, search: a } = r.location,
313
+ c = i,
314
+ u = L(a),
315
+ h = {
316
+ host: n,
317
+ path: c,
318
+ query: u,
314
319
  }
315
- s.store('route').update(c), r($, c)
320
+ t.store('route').update(h), s(D, h)
316
321
  },
317
- z = (e) => {
322
+ B = (e) => {
318
323
  const { subscribe: t } = e
319
- t(M, V),
320
- t(k, (s, r) => {
321
- E(s, r)
324
+ t(k, F),
325
+ t($, (s) => {
326
+ E(s)
322
327
  })
323
328
  },
324
- B = (e) => {
329
+ K = (e) => {
325
330
  const { publish: t, subscribe: s, state: r, window: n } = e
326
- D(r), n.addEventListener('popstate', () => t(m, null)), s(m, L)
331
+ P(r), n.addEventListener('popstate', () => t(m, null)), s(m, z)
327
332
  },
328
- K = (e) => {
333
+ R = (e) => {
329
334
  setTimeout(() => e.publish(m, null), 0)
330
335
  },
331
- R = (e) => {
332
- B(e), z(e), K(e)
336
+ U = (e) => {
337
+ K(e), B(e), R(e)
333
338
  },
334
- Nt = /* @__PURE__ */ Object.freeze(
339
+ _t = /* @__PURE__ */ Object.freeze(
335
340
  /* @__PURE__ */ Object.defineProperty(
336
341
  {
337
342
  __proto__: null,
338
- publishLocation: K,
339
- startNavigation: R,
340
- subscribeToHistoryChange: B,
341
- subscribeToNavigation: z,
343
+ publishLocation: R,
344
+ startNavigation: U,
345
+ subscribeToHistoryChange: K,
346
+ subscribeToNavigation: B,
342
347
  },
343
348
  Symbol.toStringTag,
344
349
  { value: 'Module' },
345
350
  ),
346
351
  )
347
- class U {
352
+ class C {
348
353
  constructor({
349
354
  window: t,
350
355
  document: s,
@@ -352,7 +357,7 @@ class U {
352
357
  subscribe: n,
353
358
  bus: i,
354
359
  state: a,
355
- renderKit: l,
360
+ renderKit: c,
356
361
  }) {
357
362
  ;(this.window = t),
358
363
  (this.document = s),
@@ -360,28 +365,28 @@ class U {
360
365
  (this.subscribe = n),
361
366
  (this.bus = i),
362
367
  (this.state = a),
363
- (this.renderKit = l),
368
+ (this.renderKit = c),
364
369
  (this.roots = [])
365
370
  }
366
371
  render(t, s) {
367
- const r = At(t, s, this.renderKit)
372
+ const r = wt(t, s, this.renderKit)
368
373
  return this.roots.push(r), r
369
374
  }
370
375
  startNavigation() {
371
- R(this)
376
+ U(this)
372
377
  }
373
378
  }
374
- const $e = /* @__PURE__ */ Object.freeze(
379
+ const De = /* @__PURE__ */ Object.freeze(
375
380
  /* @__PURE__ */ Object.defineProperty(
376
381
  {
377
382
  __proto__: null,
378
- App: U,
383
+ App: C,
379
384
  },
380
385
  Symbol.toStringTag,
381
386
  { value: 'Module' },
382
387
  ),
383
388
  )
384
- class C {
389
+ class I {
385
390
  constructor() {
386
391
  this.lookup = {}
387
392
  }
@@ -408,7 +413,7 @@ class C {
408
413
  this.lookup[t] || (this.lookup[t] = [])
409
414
  }
410
415
  }
411
- class I {
416
+ class q {
412
417
  constructor() {
413
418
  this.lookup = []
414
419
  }
@@ -427,7 +432,7 @@ class I {
427
432
  return this.lookup.filter((s) => s.matcher.test(t))
428
433
  }
429
434
  }
430
- class _t {
435
+ class St {
431
436
  constructor({ publish: t, event: s, payload: r, timer: n }) {
432
437
  ;(this.setNewTimeout = () => {
433
438
  this.stopped ||
@@ -464,7 +469,7 @@ class _t {
464
469
  ((this.callCount += 1), this.publish(this.event, this.payload))
465
470
  }
466
471
  }
467
- const St = (e) => {
472
+ const Tt = (e) => {
468
473
  const { offset: t, period: s } = e,
469
474
  r = ({ callCount: n }) => (t && n == 0 ? t : s)
470
475
  return {
@@ -474,16 +479,16 @@ const St = (e) => {
474
479
  timer: r,
475
480
  }
476
481
  },
477
- Tt = (e) => {
482
+ jt = (e) => {
478
483
  let t
479
- 'timer' in e ? (t = e) : (t = St(e))
480
- const s = new _t(t)
484
+ 'timer' in e ? (t = e) : (t = Tt(e))
485
+ const s = new St(t)
481
486
  return s.start(), s.stop
482
487
  }
483
- class q {
488
+ class J {
484
489
  constructor() {
485
- ;(this.exactSubscriptions = new C()),
486
- (this.fuzzySubscriptions = new I()),
490
+ ;(this.exactSubscriptions = new I()),
491
+ (this.fuzzySubscriptions = new q()),
487
492
  (this.currentIndex = 0)
488
493
  }
489
494
  subscribe(t, s) {
@@ -503,62 +508,61 @@ class q {
503
508
  ]
504
509
  .sort((n, i) => n.index - i.index)
505
510
  .forEach((n) => {
506
- n.listener(s, this.listenerOptions(t))
511
+ n.listener(this.listenerOptions(t, s))
507
512
  })
508
513
  }
509
514
  addListenerOptions(t) {
510
515
  this.options = t
511
516
  }
512
- listenerOptions(t) {
517
+ listenerOptions(t, s) {
513
518
  return {
514
519
  eventName: t,
515
520
  ...this.options,
516
521
  publish: this.publish.bind(this),
522
+ payload: s,
517
523
  }
518
524
  }
519
525
  }
520
- const J = () => {
521
- const e = new q()
526
+ const G = () => {
527
+ const e = new J()
522
528
  return {
523
529
  bus: e,
524
530
  publish: (r, n) => e.publish(r, n),
525
531
  subscribe: (r, n) => e.subscribe(r, n),
526
532
  }
527
533
  },
528
- De = /* @__PURE__ */ Object.freeze(
534
+ Pe = /* @__PURE__ */ Object.freeze(
529
535
  /* @__PURE__ */ Object.defineProperty(
530
536
  {
531
537
  __proto__: null,
532
- ExactSubscriptions: C,
533
- FuzzySubscriptions: I,
534
- JaxsBus: q,
535
- createBus: J,
536
- publishPeriodically: Tt,
538
+ ExactSubscriptions: I,
539
+ FuzzySubscriptions: q,
540
+ JaxsBus: J,
541
+ createBus: G,
542
+ publishPeriodically: jt,
537
543
  },
538
544
  Symbol.toStringTag,
539
545
  { value: 'Module' },
540
546
  ),
541
547
  ),
542
- f = (e) => Array.isArray(e),
543
- v = (e) => e !== null && !f(e) && typeof e == 'object',
544
- jt = (e, t) => e === t,
545
- Ot = (e, t) => Object.keys(e).length === Object.keys(t).length,
546
- Mt = (e, t) =>
547
- !(v(e) && v(t)) || !Ot(e, t)
548
+ Ot = (e, t) => e === t,
549
+ Mt = (e, t) => Object.keys(e).length === Object.keys(t).length,
550
+ kt = (e, t) =>
551
+ !(v(e) && v(t)) || !Mt(e, t)
548
552
  ? !1
549
553
  : Object.keys(e).every((s) => {
550
554
  const r = e[s],
551
555
  n = t[s]
552
556
  return x(r, n)
553
557
  }),
554
- kt = (e, t) =>
558
+ $t = (e, t) =>
555
559
  !(f(e) && f(t)) || e.length !== t.length
556
560
  ? !1
557
561
  : e.every((s, r) => {
558
562
  const n = t[r]
559
563
  return x(s, n)
560
564
  }),
561
- x = (e, t) => (v(e) ? Mt(e, t) : f(e) ? kt(e, t) : jt(e, t))
565
+ x = (e, t) => (v(e) ? kt(e, t) : f(e) ? $t(e, t) : Ot(e, t))
562
566
  class g {
563
567
  constructor(t) {
564
568
  ;(this.name = t.name),
@@ -602,7 +606,7 @@ class A {
602
606
  return this.store.value
603
607
  }
604
608
  }
605
- class $t extends A {
609
+ class Dt extends A {
606
610
  updateAttribute(t, s) {
607
611
  const r = { ...this.value }
608
612
  ;(r[t] = s), this.update(r)
@@ -622,8 +626,8 @@ class $t extends A {
622
626
  ;(s[t] = r), this.update(s)
623
627
  }
624
628
  }
625
- const Dt = (e) => new $t(e)
626
- class Pt extends A {
629
+ const Pt = (e) => new Dt(e)
630
+ class Vt extends A {
627
631
  push(t) {
628
632
  const s = [...this.value, t]
629
633
  this.update(s)
@@ -664,8 +668,8 @@ class Pt extends A {
664
668
  this.update(s)
665
669
  }
666
670
  }
667
- const Vt = (e) => new Pt(e)
668
- class Ft extends A {
671
+ const Ft = (e) => new Vt(e)
672
+ class Lt extends A {
669
673
  toggle() {
670
674
  const t = !this.value
671
675
  this.update(t)
@@ -677,14 +681,14 @@ class Ft extends A {
677
681
  this.update(!1)
678
682
  }
679
683
  }
680
- const Lt = (e) => new Ft(e),
681
- zt = {
682
- object: Dt,
683
- list: Vt,
684
- boolean: Lt,
684
+ const zt = (e) => new Lt(e),
685
+ Bt = {
686
+ object: Pt,
687
+ list: Ft,
688
+ boolean: zt,
685
689
  },
686
690
  w = 'state'
687
- class G {
691
+ class H {
688
692
  constructor(t) {
689
693
  ;(this.publisher = t),
690
694
  (this.stores = {}),
@@ -744,22 +748,22 @@ class G {
744
748
  return `${this.eventNamePrefix}:${t}`
745
749
  }
746
750
  }
747
- const H = (e) => new G(e),
748
- Pe = /* @__PURE__ */ Object.freeze(
751
+ const Q = (e) => new H(e),
752
+ Ve = /* @__PURE__ */ Object.freeze(
749
753
  /* @__PURE__ */ Object.defineProperty(
750
754
  {
751
755
  __proto__: null,
752
- State: G,
756
+ State: H,
753
757
  Store: g,
754
- createState: H,
758
+ createState: Q,
755
759
  eventName: w,
756
- updaters: zt,
760
+ updaters: Bt,
757
761
  },
758
762
  Symbol.toStringTag,
759
763
  { value: 'Module' },
760
764
  ),
761
765
  )
762
- class Bt {
766
+ class Kt {
763
767
  constructor(t) {
764
768
  this.setupDomEnvironment(t)
765
769
  }
@@ -769,7 +773,7 @@ class Bt {
769
773
  this.setupState(),
770
774
  this.addBusOptions(),
771
775
  this.setRenderKit(),
772
- new U({
776
+ new C({
773
777
  window: this.window,
774
778
  document: this.document,
775
779
  publish: this.publish,
@@ -788,11 +792,11 @@ class Bt {
788
792
  : ((this.window = window), (this.document = document))
789
793
  }
790
794
  setupBus() {
791
- const { publish: t, subscribe: s, bus: r } = J()
795
+ const { publish: t, subscribe: s, bus: r } = G()
792
796
  ;(this.publish = t), (this.subscribe = s), (this.bus = r)
793
797
  }
794
798
  setupState() {
795
- this.state = H(this.publish)
799
+ this.state = Q(this.publish)
796
800
  }
797
801
  addBusOptions() {
798
802
  this.bus.addListenerOptions({
@@ -811,8 +815,8 @@ class Bt {
811
815
  }
812
816
  }
813
817
  }
814
- const Ve = (e = {}) => {
815
- const s = new Bt(e).setup()
818
+ const Fe = (e = {}) => {
819
+ const s = new Kt(e).setup()
816
820
  return s.startNavigation(), s
817
821
  }
818
822
  var o = /* @__PURE__ */ ((e) => (
@@ -829,7 +833,7 @@ var o = /* @__PURE__ */ ((e) => (
829
833
  (e[(e.changeText = 10)] = 'changeText'),
830
834
  e
831
835
  ))(o || {})
832
- const Fe = /* @__PURE__ */ Object.freeze(
836
+ const Le = /* @__PURE__ */ Object.freeze(
833
837
  /* @__PURE__ */ Object.defineProperty(
834
838
  {
835
839
  __proto__: null,
@@ -839,49 +843,49 @@ const Fe = /* @__PURE__ */ Object.freeze(
839
843
  { value: 'Module' },
840
844
  ),
841
845
  ),
842
- Kt = (e, t) => ({
846
+ Rt = (e, t) => ({
843
847
  source: e,
844
848
  target: t,
845
849
  type: o.changeText,
846
850
  data: {},
847
851
  }),
848
- Rt = (e, t) => ({
852
+ Ut = (e, t) => ({
849
853
  source: e,
850
854
  target: t,
851
855
  type: o.replaceNode,
852
856
  data: {},
853
857
  }),
854
- Ut = (e, t, s) => ({
858
+ Ct = (e, t, s) => ({
855
859
  source: e,
856
860
  target: t,
857
861
  data: s,
858
862
  type: o.removeAttribute,
859
863
  }),
860
- Ct = (e, t, s) => ({
864
+ It = (e, t, s) => ({
861
865
  source: e,
862
866
  target: t,
863
867
  data: s,
864
868
  type: o.addAttribute,
865
869
  }),
866
- It = (e, t, s) => ({
870
+ qt = (e, t, s) => ({
867
871
  source: e,
868
872
  target: t,
869
873
  data: s,
870
874
  type: o.updateAttribute,
871
875
  }),
872
- qt = (e, t, s) => ({
876
+ Jt = (e, t, s) => ({
873
877
  source: e,
874
878
  target: t,
875
879
  data: s,
876
880
  type: o.removeEvent,
877
881
  }),
878
- Jt = (e, t, s) => ({
882
+ Gt = (e, t, s) => ({
879
883
  source: e,
880
884
  target: t,
881
885
  data: s,
882
886
  type: o.addEvent,
883
887
  }),
884
- Gt = (e, t, s) => ({
888
+ Ht = (e, t, s) => ({
885
889
  source: e,
886
890
  target: t,
887
891
  data: s,
@@ -901,15 +905,15 @@ const Fe = /* @__PURE__ */ Object.freeze(
901
905
  type: o.insertNode,
902
906
  data: t,
903
907
  }),
904
- Ht = (e, t, s) => ({
908
+ Qt = (e, t, s) => ({
905
909
  source: e,
906
910
  target: t,
907
911
  type: o.changeValue,
908
912
  data: s,
909
913
  }),
910
- Qt = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
914
+ Wt = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
911
915
  _ = { index: -1 }
912
- class Wt {
916
+ class Xt {
913
917
  constructor() {
914
918
  this.map = {}
915
919
  }
@@ -943,55 +947,55 @@ class Wt {
943
947
  }
944
948
  }
945
949
  const S = (e) => {
946
- const t = new Wt()
950
+ const t = new Xt()
947
951
  return t.populate(e), t
948
952
  },
949
- Q = (e, t, s = !1) => {
953
+ W = (e, t, s = !1) => {
950
954
  const r = [],
951
955
  n = e.attributes,
952
956
  i = n.length,
953
957
  a = t.attributes,
954
- l = a.length
955
- let u, d, c
958
+ c = a.length
959
+ let u, h, d
956
960
  for (u = 0; u < i; u++) {
957
- c = null
958
- const h = n.item(u)
959
- if (h) {
960
- for (d = 0; d < l; d++) {
961
- const p = a.item(d)
962
- if (p && h.name == p.name) {
963
- c = p
961
+ d = null
962
+ const l = n.item(u)
963
+ if (l) {
964
+ for (h = 0; h < c; h++) {
965
+ const p = a.item(h)
966
+ if (p && l.name == p.name) {
967
+ d = p
964
968
  break
965
969
  }
966
970
  }
967
- c
968
- ? h.value !== c.value &&
971
+ d
972
+ ? l.value !== d.value &&
969
973
  r.push(
970
- It(e, t, {
971
- name: h.name,
972
- value: c.value,
974
+ qt(e, t, {
975
+ name: l.name,
976
+ value: d.value,
973
977
  isSvg: s,
974
978
  }),
975
979
  )
976
- : r.push(Ut(e, t, { name: h.name, isSvg: s }))
980
+ : r.push(Ct(e, t, { name: l.name, isSvg: s }))
977
981
  }
978
982
  }
979
- for (u = 0; u < l; u++) {
980
- c = null
981
- const h = a.item(u)
982
- if (h) {
983
- for (d = 0; d < i; d++) {
984
- const p = n.item(d)
985
- if (p && p.name == h.name) {
986
- c = p
983
+ for (u = 0; u < c; u++) {
984
+ d = null
985
+ const l = a.item(u)
986
+ if (l) {
987
+ for (h = 0; h < i; h++) {
988
+ const p = n.item(h)
989
+ if (p && p.name == l.name) {
990
+ d = p
987
991
  break
988
992
  }
989
993
  }
990
- c ||
994
+ d ||
991
995
  r.push(
992
- Ct(e, t, {
993
- name: h.name,
994
- value: h.value,
996
+ It(e, t, {
997
+ name: l.name,
998
+ value: l.value,
995
999
  isSvg: s,
996
1000
  }),
997
1001
  )
@@ -999,92 +1003,92 @@ const S = (e) => {
999
1003
  }
1000
1004
  return r
1001
1005
  },
1002
- Xt = (e, t) => {
1006
+ Yt = (e, t) => {
1003
1007
  const s = [],
1004
1008
  r = e.eventMaps,
1005
1009
  n = t.eventMaps,
1006
1010
  i = Object.keys(r),
1007
1011
  a = Object.keys(n)
1008
1012
  return (
1009
- i.forEach((l) => {
1010
- const u = r[l],
1011
- d = n[l]
1012
- d
1013
- ? d.busEvent !== u.busEvent &&
1013
+ i.forEach((c) => {
1014
+ const u = r[c],
1015
+ h = n[c]
1016
+ h
1017
+ ? h.busEvent !== u.busEvent &&
1014
1018
  s.push(
1015
- Gt(e, t, {
1016
- name: l,
1017
- targetValue: d.listener,
1019
+ Ht(e, t, {
1020
+ name: c,
1021
+ targetValue: h.listener,
1018
1022
  sourceValue: u.listener,
1019
1023
  }),
1020
1024
  )
1021
1025
  : s.push(
1022
- qt(e, t, {
1026
+ Jt(e, t, {
1023
1027
  name: u.domEvent,
1024
1028
  value: u.listener,
1025
1029
  }),
1026
1030
  )
1027
1031
  }),
1028
- a.forEach((l) => {
1029
- const u = r[l],
1030
- d = n[l]
1032
+ a.forEach((c) => {
1033
+ const u = r[c],
1034
+ h = n[c]
1031
1035
  u ||
1032
1036
  s.push(
1033
- Jt(e, t, {
1034
- name: d.domEvent,
1035
- value: d.listener,
1037
+ Gt(e, t, {
1038
+ name: h.domEvent,
1039
+ value: h.listener,
1036
1040
  }),
1037
1041
  )
1038
1042
  }),
1039
1043
  s
1040
1044
  )
1041
1045
  },
1042
- Yt = (e) => e.tagName !== 'INPUT',
1043
- Zt = (e, t) => e.value === t.value,
1044
- te = (e, t) => {
1045
- if (Yt(e) || Zt(e, t)) return []
1046
+ Zt = (e) => e.tagName !== 'INPUT',
1047
+ te = (e, t) => e.value === t.value,
1048
+ ee = (e, t) => {
1049
+ if (Zt(e) || te(e, t)) return []
1046
1050
  const s = e,
1047
1051
  r = t
1048
- return [Ht(s, r, { name: 'value', value: r.value })]
1052
+ return [Qt(s, r, { name: 'value', value: r.value })]
1049
1053
  },
1050
- ee = (e, t) => {
1051
- const s = Q(e, t),
1052
- r = Xt(e, t),
1053
- n = te(e, t)
1054
+ se = (e, t) => {
1055
+ const s = W(e, t),
1056
+ r = Yt(e, t),
1057
+ n = ee(e, t)
1054
1058
  return s.concat(r).concat(n)
1055
1059
  },
1056
- se = (e, t) => Q(e, t, !0),
1057
- re = (e, t) => (e.textContent !== t.textContent ? [Kt(e, t)] : []),
1058
- ne = (e, t, s) => {
1060
+ re = (e, t) => W(e, t, !0),
1061
+ ne = (e, t) => (e.textContent !== t.textContent ? [Rt(e, t)] : []),
1062
+ ie = (e, t, s) => {
1059
1063
  let r = []
1060
- if (e.nodeType === 1 && ot(e)) {
1064
+ if (e.nodeType === 1 && at(e)) {
1061
1065
  const n = e,
1062
1066
  i = t,
1063
- a = se(n, i),
1064
- l = s(n.childNodes, i.childNodes, n)
1065
- r = a.concat(l)
1067
+ a = re(n, i),
1068
+ c = s(n.childNodes, i.childNodes, n)
1069
+ r = a.concat(c)
1066
1070
  } else if (e.nodeType === 1) {
1067
1071
  const n = e,
1068
1072
  i = t,
1069
- a = ee(n, i),
1070
- l = s(n.childNodes, i.childNodes, n)
1071
- r = a.concat(l)
1072
- } else e.nodeType === 3 && (r = re(e, t))
1073
+ a = se(n, i),
1074
+ c = s(n.childNodes, i.childNodes, n)
1075
+ r = a.concat(c)
1076
+ } else e.nodeType === 3 && (r = ne(e, t))
1073
1077
  return r
1074
1078
  },
1075
- W = (e, t, s) => {
1079
+ X = (e, t, s) => {
1076
1080
  const r = [],
1077
- n = ie(e, t),
1081
+ n = oe(e, t),
1078
1082
  i = S(e),
1079
1083
  a = S(t),
1080
- l = []
1084
+ c = []
1081
1085
  let u = 0
1082
1086
  for (; u < n; u++) {
1083
- const c = e[u],
1084
- h = t[u]
1085
- if (h && a.check(h)) {
1086
- const p = i.pullMatch(h)
1087
- a.clear(h),
1087
+ const d = e[u],
1088
+ l = t[u]
1089
+ if (l && a.check(l)) {
1090
+ const p = i.pullMatch(l)
1091
+ a.clear(l),
1088
1092
  p.element
1089
1093
  ? (p.index !== u &&
1090
1094
  r.push(
@@ -1093,147 +1097,147 @@ const S = (e) => {
1093
1097
  index: u,
1094
1098
  }),
1095
1099
  ),
1096
- l.push({
1100
+ c.push({
1097
1101
  source: p.element,
1098
- target: h,
1102
+ target: l,
1099
1103
  }))
1100
- : c
1101
- ? a.check(c)
1102
- ? r.push(b(h, { parent: s, index: u }))
1103
- : (i.clear(c), r.push(Rt(c, h)))
1104
- : r.push(b(h, { parent: s, index: u }))
1105
- } else c && i.pullMatch(c).element && r.push(N(c))
1104
+ : d
1105
+ ? a.check(d)
1106
+ ? r.push(b(l, { parent: s, index: u }))
1107
+ : (i.clear(d), r.push(Ut(d, l)))
1108
+ : r.push(b(l, { parent: s, index: u }))
1109
+ } else d && i.pullMatch(d).element && r.push(N(d))
1106
1110
  }
1107
- i.remaining().forEach(({ element: c }) => {
1108
- r.push(N(c))
1111
+ i.remaining().forEach(({ element: d }) => {
1112
+ r.push(N(d))
1109
1113
  })
1110
- const d = l.reduce(
1111
- (c, { source: h, target: p }) => c.concat(ne(h, p, W)),
1114
+ const h = c.reduce(
1115
+ (d, { source: l, target: p }) => d.concat(ie(l, p, X)),
1112
1116
  [],
1113
1117
  )
1114
- return r.concat(d).sort(Qt)
1118
+ return r.concat(h).sort(Wt)
1115
1119
  },
1116
- ie = (e, t) => {
1120
+ oe = (e, t) => {
1117
1121
  const s = e.length,
1118
1122
  r = t.length
1119
1123
  return s > r ? s : r
1120
1124
  },
1121
- oe = (e, t, s) => {
1122
- const r = W(e, t, s)
1125
+ ue = (e, t, s) => {
1126
+ const r = X(e, t, s)
1123
1127
  return (
1124
1128
  r.forEach((n) => {
1125
- ue(n)
1129
+ ae(n)
1126
1130
  }),
1127
1131
  r
1128
1132
  )
1129
1133
  },
1130
- ue = (e) => {
1131
- ;(ye[e.type] || ae)(e)
1134
+ ae = (e) => {
1135
+ ;(Ee[e.type] || ce)(e)
1132
1136
  },
1133
- ae = (e) => {},
1134
- ce = (e) => {
1137
+ ce = (e) => {},
1138
+ le = (e) => {
1135
1139
  const { source: t, target: s } = e
1136
1140
  t.nodeValue = s.textContent
1137
1141
  },
1138
- le = (e) => {
1142
+ he = (e) => {
1139
1143
  const { source: t } = e
1140
1144
  t.remove()
1141
1145
  },
1142
- he = (e) => {
1146
+ de = (e) => {
1143
1147
  const { target: t, data: s } = e,
1144
1148
  { parent: r, index: n } = s,
1145
1149
  i = r.childNodes[n]
1146
1150
  i ? i && i !== t && r.insertBefore(t, i) : r.appendChild(t)
1147
1151
  },
1148
- de = (e) => {
1152
+ pe = (e) => {
1149
1153
  const { source: t, target: s } = e
1150
1154
  t.replaceWith(s)
1151
1155
  },
1152
- pe = (e) => {
1156
+ me = (e) => {
1153
1157
  const { source: t, data: s } = e,
1154
1158
  { name: r, isSvg: n } = s
1155
1159
  n ? t.removeAttributeNS(null, r) : t.removeAttribute(r)
1156
1160
  },
1157
- X = (e) => {
1161
+ Y = (e) => {
1158
1162
  const { source: t, data: s } = e,
1159
1163
  { name: r, value: n, isSvg: i } = s
1160
1164
  i ? t.setAttributeNS(null, r, n) : t.setAttribute(r, n)
1161
1165
  },
1162
- me = (e) => {
1163
- X(e)
1164
- },
1165
1166
  fe = (e) => {
1167
+ Y(e)
1168
+ },
1169
+ be = (e) => {
1166
1170
  const t = e.data,
1167
1171
  s = e.source,
1168
1172
  { name: r, value: n } = t
1169
1173
  s.removeEventListener(r, n)
1170
1174
  },
1171
- be = (e) => {
1175
+ ve = (e) => {
1172
1176
  const t = e.data,
1173
1177
  s = e.source,
1174
1178
  { name: r, value: n } = t
1175
1179
  s.addEventListener(r, n)
1176
1180
  },
1177
- ve = (e) => {
1181
+ ge = (e) => {
1178
1182
  const t = e.data,
1179
1183
  s = e.source,
1180
1184
  { name: r, sourceValue: n, targetValue: i } = t
1181
1185
  s.removeEventListener(r, n), s.addEventListener(r, i)
1182
1186
  },
1183
- ge = (e) => {
1187
+ ye = (e) => {
1184
1188
  const t = e.data,
1185
1189
  s = e.source,
1186
1190
  { value: r } = t
1187
1191
  s.value = r
1188
1192
  },
1189
- ye = {
1190
- [o.changeText]: ce,
1191
- [o.removeNode]: le,
1192
- [o.insertNode]: he,
1193
- [o.replaceNode]: de,
1194
- [o.removeAttribute]: pe,
1195
- [o.addAttribute]: X,
1196
- [o.updateAttribute]: me,
1197
- [o.removeEvent]: fe,
1198
- [o.addEvent]: be,
1199
- [o.updateEvent]: ve,
1200
- [o.changeValue]: ge,
1193
+ Ee = {
1194
+ [o.changeText]: le,
1195
+ [o.removeNode]: he,
1196
+ [o.insertNode]: de,
1197
+ [o.replaceNode]: pe,
1198
+ [o.removeAttribute]: me,
1199
+ [o.addAttribute]: Y,
1200
+ [o.updateAttribute]: fe,
1201
+ [o.removeEvent]: be,
1202
+ [o.addEvent]: ve,
1203
+ [o.updateEvent]: ge,
1204
+ [o.changeValue]: ye,
1201
1205
  },
1202
- Ee = (e, t, s) => {
1206
+ xe = (e, t, s) => {
1203
1207
  const r = [...t]
1204
1208
  return (
1205
1209
  e.forEach((n) => {
1206
- xe(n, r, s)
1210
+ Ae(n, r, s)
1207
1211
  }),
1208
1212
  r
1209
1213
  )
1210
1214
  },
1211
- xe = (e, t, s) => {
1212
- const r = _e[e.type]
1215
+ Ae = (e, t, s) => {
1216
+ const r = Se[e.type]
1213
1217
  r && r(e, t, s)
1214
1218
  },
1215
- Ae = (e, t) => {
1219
+ we = (e, t) => {
1216
1220
  const { source: s } = e,
1217
1221
  r = t.indexOf(s)
1218
1222
  r >= 0 && t.splice(r, 1)
1219
1223
  },
1220
- we = (e, t, s) => {
1224
+ Ne = (e, t, s) => {
1221
1225
  const { target: r } = e,
1222
1226
  n = e.data,
1223
1227
  { index: i, parent: a } = n
1224
1228
  s === a && t.splice(i, 0, r)
1225
1229
  },
1226
- Ne = (e, t) => {
1230
+ _e = (e, t) => {
1227
1231
  const { target: s, source: r } = e,
1228
1232
  n = t.indexOf(r)
1229
1233
  n >= 0 && (t[n] = s)
1230
1234
  },
1231
- _e = {
1232
- [o.removeNode]: Ae,
1233
- [o.insertNode]: we,
1234
- [o.replaceNode]: Ne,
1235
+ Se = {
1236
+ [o.removeNode]: we,
1237
+ [o.insertNode]: Ne,
1238
+ [o.replaceNode]: _e,
1235
1239
  }
1236
- class Se {
1240
+ class Te {
1237
1241
  constructor({ Template: t, subscriptions: s, attributes: r, viewModel: n }) {
1238
1242
  ;(this.Template = t),
1239
1243
  (this.viewModel = n),
@@ -1265,8 +1269,8 @@ class Se {
1265
1269
  this.parentElement = r
1266
1270
  }
1267
1271
  const t = this.generateDom(this.renderKit),
1268
- s = oe(this.dom, t, this.parentElement)
1269
- this.dom = Ee(s, this.dom, this.parentElement)
1272
+ s = ue(this.dom, t, this.parentElement)
1273
+ this.dom = xe(s, this.dom, this.parentElement)
1270
1274
  }
1271
1275
  subscribeForRerender() {
1272
1276
  const { subscribe: t } = this.renderKit
@@ -1278,36 +1282,19 @@ class Se {
1278
1282
  return `${w}:${t}`
1279
1283
  }
1280
1284
  }
1281
- const Te = (e) => e,
1282
- je = ({ Template: e, viewModel: t, subscriptions: s }) => (
1285
+ const je = (e) => e,
1286
+ Oe = ({ Template: e, viewModel: t, subscriptions: s }) => (
1283
1287
  (s = s || []),
1284
- (t = t || Te),
1288
+ (t = t || je),
1285
1289
  (r) =>
1286
- new Se({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1287
- ),
1288
- Le = /* @__PURE__ */ Object.freeze(
1289
- /* @__PURE__ */ Object.defineProperty(
1290
- {
1291
- __proto__: null,
1292
- createRouteState: D,
1293
- events: wt,
1294
- extractQueryParams: F,
1295
- findHref: P,
1296
- navigate: E,
1297
- onLinkClick: V,
1298
- onLocationChange: L,
1299
- start: Nt,
1300
- },
1301
- Symbol.toStringTag,
1302
- { value: 'Module' },
1303
- ),
1290
+ new Te({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1304
1291
  ),
1305
- Oe =
1292
+ Me =
1306
1293
  (e) =>
1307
1294
  ({ path: t }) =>
1308
1295
  t === e,
1309
- Me = () => !0,
1310
- Y =
1296
+ ke = () => !0,
1297
+ Z =
1311
1298
  (e) =>
1312
1299
  ({ route: t }) => {
1313
1300
  const s = e.find((r) => r.match(t))
@@ -1317,33 +1304,50 @@ const Te = (e) => e,
1317
1304
  /* @__PURE__ */ Object.defineProperty(
1318
1305
  {
1319
1306
  __proto__: null,
1320
- buildRouter: Y,
1321
- catchAll: Me,
1322
- exactPathMatch: Oe,
1307
+ buildRouter: Z,
1308
+ catchAll: ke,
1309
+ exactPathMatch: Me,
1323
1310
  },
1324
1311
  Symbol.toStringTag,
1325
1312
  { value: 'Module' },
1326
1313
  ),
1327
1314
  ),
1328
- ke = () => ({
1315
+ $e = () => ({
1329
1316
  render: (e, t) => [],
1330
1317
  }),
1331
1318
  Be = (e) => {
1332
- const t = Y(e)
1333
- return je({
1334
- Template: ({ route: r }) => (t({ route: r }) || ke)(),
1319
+ const t = Z(e)
1320
+ return Oe({
1321
+ Template: ({ route: r }) => (t({ route: r }) || $e)(),
1335
1322
  subscriptions: ['route'],
1336
1323
  })
1337
- }
1324
+ },
1325
+ Ke = /* @__PURE__ */ Object.freeze(
1326
+ /* @__PURE__ */ Object.defineProperty(
1327
+ {
1328
+ __proto__: null,
1329
+ createRouteState: P,
1330
+ events: Nt,
1331
+ extractQueryParams: L,
1332
+ findHref: V,
1333
+ navigate: E,
1334
+ onLinkClick: F,
1335
+ onLocationChange: z,
1336
+ start: _t,
1337
+ },
1338
+ Symbol.toStringTag,
1339
+ { value: 'Module' },
1340
+ ),
1341
+ )
1338
1342
  export {
1339
- Fe as JaxsTypes,
1340
- $e as appBuilding,
1341
- je as bind,
1342
- Ve as createApp,
1343
- Et as jsx,
1344
- De as messageBus,
1345
- Le as navigation,
1343
+ Le as JaxsTypes,
1344
+ De as appBuilding,
1345
+ Oe as bind,
1346
+ Fe as createApp,
1347
+ xt as jsx,
1348
+ Pe as messageBus,
1349
+ Ke as navigation,
1346
1350
  Be as routedView,
1347
1351
  ze as routing,
1348
- Pe as state,
1352
+ Ve as state,
1349
1353
  }