json-renderers 1.13.7 → 1.16.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/docs/dist/min.js CHANGED
@@ -1,702 +1,1510 @@
1
- const x = {
2
- version: "v13.1.0",
3
- description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
- }, j = (t) => {
5
- var e;
6
- typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
7
- meta: x,
8
- renderToDom: t
9
- }));
10
- }, v = {
11
- version: "v3.0.0",
12
- description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
13
- }, N = (t) => {
14
- var e;
15
- typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
16
- meta: v,
17
- renderToDom: t
18
- }));
19
- }, $ = {
20
- version: "v32",
21
- description: "JSON-to-DOM engine with centralized traversal and responsibility-focused construction"
22
- }, k = ({ inFuncDefinition: t } = {}) => {
23
- if (typeof globalThis > "u" || !t) return;
24
- globalThis.ks ?? (globalThis.ks = {});
25
- const e = {
26
- meta: $,
27
- buildSpecElement: t
28
- };
29
- globalThis.ks.jsonToSpec = e;
30
- }, D = (t, e) => g(t, e), m = (t, e) => Array.isArray(t) ? t.map((l) => D(l, e)).flat(1 / 0).filter(Boolean) : [], O = (t, e) => {
31
- if ("source" in t && (t == null ? void 0 : t.source) in e) {
32
- const l = e[t == null ? void 0 : t.source];
33
- if (Array.isArray(l))
34
- return l.map((n) => {
35
- const r = t == null ? void 0 : t.template;
36
- if (r)
37
- return g(r, n);
38
- });
39
- }
40
- }, E = (t, e) => {
41
- let l = [];
42
- for (const [o, n] of Object.entries(e)) {
43
- const r = t == null ? void 0 : t.template;
44
- if (r) {
45
- const a = g(r, {
46
- key: o,
47
- value: n
48
- });
49
- l.push(a);
50
- }
51
- }
52
- return l;
53
- }, S = (t, e) => {
54
- if ("source" in t && (t == null ? void 0 : t.source) in e) {
55
- const l = e[t == null ? void 0 : t.source];
56
- if (Array.isArray(l))
57
- return l.map((n) => {
58
- const r = t == null ? void 0 : t.template;
59
- if (r)
60
- return g(r, n);
61
- });
62
- }
63
- }, L = (t, e) => {
64
- if ("operation" in t) {
65
- if (t.operation === "loopArray")
66
- return O(t, e);
67
- if (t.operation === "loopObject")
68
- return E(t, e);
69
- if (t.operation === "loopCollection")
70
- return S(t, e);
71
- }
72
- }, p = (t, e) => {
73
- if (typeof e == "string") return e;
74
- if (typeof t != "string") return t;
75
- if (t === "${value}")
76
- return e.value;
77
- const l = t.match(/^\$\{(.+?)\}$/);
78
- if (l) {
79
- const o = l[1];
80
- return (e == null ? void 0 : e[o]) ?? "";
81
- }
82
- return t;
83
- }, F = (t, e) => {
84
- let l = {};
85
- for (const [o, n] of Object.entries(t)) {
86
- const r = p(n, e);
87
- l[o] = r;
88
- }
89
- return l;
90
- }, G = (t, e) => {
91
- if ("tagName" in t) {
92
- if ("textContent" in t) {
93
- const l = p(t.textContent, e);
94
- t.textContent = l;
95
- }
96
- if ("attributes" in t) {
97
- const l = F(t.attributes, e);
98
- t.attributes = l;
99
- }
100
- }
101
- }, M = (t, e) => {
102
- if (!t || typeof t != "object" || Array.isArray(t)) return null;
103
- const l = structuredClone(t);
104
- if (!l) return null;
105
- if ("tagName" in l && G(l, e), "jsonToSpec" in l) {
106
- const o = l == null ? void 0 : l.jsonToSpec, n = L(o, e);
107
- Array.isArray(n) ? l.children = n : l.children = [n], delete l.jsonToSpec;
108
- }
109
- if (Array.isArray(l == null ? void 0 : l.children)) {
110
- const o = m(l == null ? void 0 : l.children, e);
111
- l.children = o;
112
- }
113
- return l;
114
- }, g = (t, e) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? m(t, e) : typeof t == "object" ? M(t, e) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t, h = (t, e) => g(t, e);
115
- k({
116
- inFuncDefinition: h
117
- });
118
- const R = {
119
- default: {
120
- tagName: "table",
121
- attributes: {
122
- class: "table table-hover table-striped mb-0"
123
- },
124
- children: [
125
- {
126
- tagName: "thead",
127
- children: [
128
- {
129
- tagName: "tr",
130
- jsonToSpec: {
131
- operation: "loopCollection",
132
- source: "columns",
133
- template: {
134
- tagName: "th",
135
- textContent: "${title}"
136
- }
137
- },
138
- children: []
139
- }
140
- ]
141
- },
142
- {
143
- tagName: "tbody",
144
- jsonToSpec: {
145
- operation: "loopCollection",
146
- source: "data",
147
- template: {
148
- tagName: "tr",
149
- jsonToSpec: {
150
- operation: "loopObject",
151
- source: "data",
152
- template: {
153
- tagName: "td",
154
- textContent: "${value}"
155
- }
156
- },
157
- children: []
158
- }
159
- },
160
- children: []
161
- }
162
- ]
163
- }
164
- }, z = ({
165
- inColumns: t,
166
- inData: e
167
- } = {}) => {
168
- const l = e ?? [], o = t;
169
- return h(R.default, {
170
- columns: o,
171
- data: l
172
- });
173
- }, I = "select", V = {
174
- id: "LedgerName"
175
- }, q = {
176
- operation: "loopArray",
177
- source: "arrayOfStrings",
178
- template: {
179
- tagName: "option",
180
- attributes: {
181
- value: "${}"
182
- },
183
- textContent: "${}"
184
- }
185
- }, B = [], P = {
186
- tagName: I,
187
- attributes: V,
188
- jsonToSpec: q,
189
- children: B
190
- }, H = ({
191
- inData: t
192
- } = {}) => h(P, {
193
- arrayOfStrings: t ?? []
194
- }), _ = {
195
- operation: "loopArray",
196
- source: "arrayOfStrings",
197
- template: {
198
- tagName: "option",
199
- attributes: {
200
- value: "${}"
201
- },
202
- textContent: "${}"
203
- }
204
- }, U = [], K = {
205
- jsonToSpec: _,
206
- children: U
207
- }, X = ({
208
- inData: t
209
- } = {}) => h(K, {
210
- arrayOfStrings: t ?? []
211
- }), w = {
212
- table: z,
213
- select: H,
214
- selectOptionsOnly: X
215
- }, y = ({
216
- type: t = "table",
217
- data: e,
218
- columns: l
219
- } = {}) => {
220
- const o = t, n = w[o];
221
- return n ? n({
222
- inColumns: l,
223
- inData: e
224
- }) : (console.error(
225
- `[Renderer] Unknown renderer type "${o}". Available types: ${Object.keys(w).join(", ")}`
226
- ), null);
227
- };
228
- N(y);
229
- const Q = {
230
- version: "v9",
231
- description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
232
- }, W = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
233
- if (typeof globalThis > "u" || !t) return;
234
- globalThis.ks ?? (globalThis.ks = {});
235
- const l = {
236
- meta: Q,
237
- buildSpecElement: t,
238
- reviewSpec: e
239
- };
240
- globalThis.ks["json-to-tag"] = l, globalThis.ks.jsonToTag = l;
241
- }, Y = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : typeof t == "object" && (t.nodeType === 3 || t.tagName === "#text" || !t.tagName && (t.textContent !== void 0 || t.text !== void 0)) ? document.createTextNode(t.textContent ?? t.text ?? "") : C(t), T = (t) => Array.isArray(t) ? t.map(Y).flat(1 / 0).filter(Boolean) : [], Z = (t) => (t == null, t), J = "http://www.w3.org/2000/svg", tt = /* @__PURE__ */ new Set([
242
- "svg",
243
- "path",
244
- "symbol",
245
- "use",
246
- "g",
247
- "circle",
248
- "ellipse",
249
- "rect",
250
- "line",
251
- "polyline",
252
- "polygon",
253
- "text",
254
- "tspan",
255
- "defs",
256
- "clippath",
257
- "mask",
258
- "pattern",
259
- "marker",
260
- "lineargradient",
261
- "radialgradient",
262
- "stop",
263
- "image",
264
- "filter",
265
- "fegaussianblur",
266
- "femerge",
267
- "femergenode"
268
- ]), et = ({ inTagName: t }) => {
269
- const e = t == null ? void 0 : t.toLowerCase();
270
- if (!e) return null;
271
- if (e === "checkbox") {
272
- const l = document.createElement("input");
273
- return l.type = "checkbox", l;
274
- }
275
- return tt.has(e) ? document.createElementNS(J, e) : document.createElement(e);
276
- }, lt = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), ot = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), rt = "http://www.w3.org/1999/xlink", nt = ({ inElement: t, inAttributes: e }) => {
277
- const l = t, o = e;
278
- if (!l || !o || typeof o != "object")
279
- return l;
280
- const n = typeof SVGElement < "u" ? l instanceof SVGElement : l.namespaceURI === "http://www.w3.org/2000/svg";
281
- return Object.entries(o).forEach(([r, a]) => {
282
- if (r === "class") {
283
- n ? l.setAttribute("class", String(a)) : l.className = a;
284
- return;
285
- }
286
- if (r === "xlink:href" || r === "href") {
287
- if (a != null) {
288
- const i = String(a);
289
- if (n)
290
- try {
291
- l.setAttributeNS(rt, "href", i);
292
- } catch {
293
- }
294
- l.setAttribute("href", i), l.setAttribute("xlink:href", i);
295
- }
296
- return;
297
- }
298
- if (typeof a == "boolean") {
299
- a ? l.setAttribute(r, "") : l.removeAttribute(r);
300
- return;
301
- }
302
- a != null && l.setAttribute(r, String(a));
303
- }), l;
304
- }, at = ({ inElement: t, inClassList: e }) => {
305
- if (!t || !e) return t;
306
- const l = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((o) => typeof o == "string" && o.trim()) : [];
307
- return l.length && t.classList.add(...l), t;
308
- }, st = (t) => {
309
- if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
310
- const e = et({ inTagName: t.tagName });
311
- if (!e) return null;
312
- if (lt({
313
- inElement: e,
314
- inTextContent: Z(t.textContent),
315
- inTagName: t.tagName
316
- }), ot({
317
- inElement: e,
318
- inProperties: t.properties
319
- }), nt({
320
- inElement: e,
321
- inAttributes: t.attributes
322
- }), at({
323
- inElement: e,
324
- inClassList: t.classList
325
- }), Array.isArray(t.children)) {
326
- const l = T(t.children);
327
- l.length && e.append(...l);
328
- }
329
- return e;
330
- }, C = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? T(t) : typeof t == "object" ? st(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, it = "./tags.schema.json", ct = {
331
- allowsTextContent: !1,
332
- allowsChildren: !0,
333
- allowedAttributes: [
334
- "title",
335
- "role"
336
- ],
337
- childTags: []
338
- }, ut = {
339
- allowsTextContent: !1,
340
- allowsChildren: !1,
341
- allowedAttributes: [
342
- "type",
343
- "placeholder",
344
- "value",
345
- "name",
346
- "disabled",
347
- "readonly",
348
- "required",
349
- "list"
350
- ]
351
- }, dt = {
352
- allowsTextContent: !1,
353
- allowsChildren: !1,
354
- allowedAttributes: [
355
- "type",
356
- "checked",
357
- "name",
358
- "value",
359
- "disabled",
360
- "required"
361
- ]
362
- }, ft = {
363
- allowsTextContent: !1,
364
- allowsChildren: !0,
365
- allowedAttributes: [
366
- "span"
367
- ],
368
- childTags: [
369
- "col"
370
- ]
371
- }, gt = {
372
- allowsTextContent: !1,
373
- allowsChildren: !1,
374
- allowedAttributes: [
375
- "span",
376
- "style",
377
- "width"
378
- ]
379
- }, ht = {
380
- allowsTextContent: !0,
381
- allowsChildren: !0,
382
- allowedAttributes: [
383
- "for"
384
- ],
385
- childTags: []
386
- }, bt = {
387
- allowsTextContent: !1,
388
- allowsChildren: !0,
389
- allowedAttributes: [
390
- "action",
391
- "method",
392
- "autocomplete",
393
- "enctype",
394
- "name",
395
- "novalidate",
396
- "target"
397
- ],
398
- childTags: []
399
- }, wt = {
400
- allowsTextContent: !1,
401
- allowsChildren: !0,
402
- allowedAttributes: [
403
- "name",
404
- "disabled",
405
- "required",
406
- "multiple",
407
- "size"
408
- ],
409
- childTags: [
410
- "option"
411
- ]
412
- }, mt = {
413
- allowsTextContent: !0,
414
- allowsChildren: !0,
415
- allowedAttributes: [],
416
- childTags: []
417
- }, pt = {
418
- allowsTextContent: !0,
419
- allowsChildren: !0,
420
- allowedAttributes: [],
421
- childTags: []
422
- }, yt = {
423
- allowsTextContent: !0,
424
- allowsChildren: !0,
425
- allowedAttributes: [],
426
- childTags: []
427
- }, Tt = {
428
- allowsTextContent: !0,
429
- allowsChildren: !0,
430
- allowedAttributes: [],
431
- childTags: []
432
- }, Ct = {
433
- allowsTextContent: !1,
434
- allowsChildren: !1,
435
- allowedAttributes: [
436
- "src",
437
- "alt",
438
- "width",
439
- "height",
440
- "loading"
441
- ]
442
- }, At = {
443
- allowsTextContent: !0,
444
- allowsChildren: !0,
445
- allowedAttributes: [
446
- "type",
447
- "disabled",
448
- "name",
449
- "value"
450
- ],
451
- childTags: []
452
- }, xt = {
453
- allowsTextContent: !1,
454
- allowsChildren: !0,
455
- allowedAttributes: [
456
- "border",
457
- "cellpadding",
458
- "cellspacing"
459
- ],
460
- childTags: [
461
- "caption",
462
- "colgroup",
463
- "thead",
464
- "tbody",
465
- "tfoot",
466
- "tr"
467
- ]
468
- }, jt = {
469
- allowsTextContent: !1,
470
- allowsChildren: !0,
471
- allowedAttributes: [],
472
- childTags: [
473
- "tr"
474
- ]
475
- }, vt = {
476
- allowsTextContent: !1,
477
- allowsChildren: !0,
478
- allowedAttributes: [],
479
- childTags: [
480
- "tr"
481
- ]
482
- }, Nt = {
483
- allowsTextContent: !1,
484
- allowsChildren: !0,
485
- allowedAttributes: [],
486
- childTags: [
487
- "tr"
488
- ]
489
- }, $t = {
490
- allowsTextContent: !1,
491
- allowsChildren: !0,
492
- allowedAttributes: [],
493
- childTags: [
494
- "td",
495
- "th"
496
- ]
497
- }, kt = {
498
- allowsTextContent: !0,
499
- allowsChildren: !0,
500
- allowedAttributes: [
501
- "scope",
502
- "colspan",
503
- "rowspan"
504
- ],
505
- childTags: []
506
- }, Dt = {
507
- allowsTextContent: !0,
508
- allowsChildren: !0,
509
- allowedAttributes: [
510
- "colspan",
511
- "rowspan"
512
- ],
513
- childTags: []
514
- }, Ot = {
515
- allowsTextContent: !1,
516
- allowsChildren: !0,
517
- allowedAttributes: [],
518
- childTags: [
519
- "option"
520
- ]
521
- }, Et = {
522
- allowsTextContent: !0,
523
- allowsChildren: !1,
524
- allowedAttributes: [
525
- "value",
526
- "label",
527
- "selected",
528
- "disabled"
529
- ]
530
- }, St = {
531
- allowsTextContent: !1,
532
- allowsChildren: !0,
533
- allowedAttributes: [
534
- "role"
535
- ],
536
- childTags: []
537
- }, Lt = {
538
- allowsTextContent: !0,
539
- allowsChildren: !0,
540
- allowedAttributes: [
541
- "href",
542
- "target",
543
- "rel",
544
- "title",
545
- "download"
546
- ],
547
- childTags: []
548
- }, Ft = {
549
- allowsTextContent: !0,
550
- allowsChildren: !0,
551
- allowedAttributes: [
552
- "aria-hidden"
553
- ],
554
- childTags: []
555
- }, Gt = {
556
- allowsTextContent: !0,
557
- allowsChildren: !0,
558
- allowedAttributes: [],
559
- childTags: []
560
- }, Mt = {
561
- allowsTextContent: !1,
562
- allowsChildren: !0,
563
- allowedAttributes: [
564
- "type"
565
- ],
566
- childTags: [
567
- "li"
568
- ]
569
- }, Rt = {
570
- allowsTextContent: !0,
571
- allowsChildren: !0,
572
- allowedAttributes: [
573
- "value"
574
- ],
575
- childTags: []
576
- }, zt = {
577
- allowsTextContent: !1,
578
- allowsChildren: !1,
579
- allowedAttributes: []
580
- }, It = {
581
- $schema: it,
582
- div: ct,
583
- input: ut,
584
- checkbox: dt,
585
- colgroup: ft,
586
- col: gt,
587
- label: ht,
588
- form: bt,
589
- select: wt,
590
- p: mt,
591
- h1: pt,
592
- h2: yt,
593
- span: Tt,
594
- img: Ct,
595
- button: At,
596
- table: xt,
597
- thead: jt,
598
- tbody: vt,
599
- tfoot: Nt,
600
- tr: $t,
601
- th: kt,
602
- td: Dt,
603
- datalist: Ot,
604
- option: Et,
605
- header: St,
606
- a: Lt,
607
- i: Ft,
608
- small: Gt,
609
- ul: Mt,
610
- li: Rt,
611
- hr: zt
612
- }, b = ({ inSpec: t }) => {
613
- const e = t;
614
- if (!e) return [];
615
- if (Array.isArray(e))
616
- return e.flatMap((o) => b({ inSpec: o }));
617
- if (typeof e != "object") return [];
618
- const l = [];
619
- return typeof e.tagName == "string" && e.tagName.trim().length > 0 && l.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((o) => {
620
- const n = b({ inSpec: o });
621
- l.push(...n);
622
- }), l;
623
- }, Vt = ({ inTagsFound: t, inAllowedTags: e }) => {
624
- const l = t ?? [], o = e ?? {}, n = new Set(
625
- Object.keys(o).filter((s) => s !== "$schema").map((s) => s.toLowerCase())
626
- ), r = {}, a = [], i = [];
627
- l.forEach((s) => {
628
- r[s] = (r[s] || 0) + 1, n.has(s) ? a.includes(s) || a.push(s) : i.includes(s) || i.push(s);
629
- });
630
- const c = l.length, f = i.length === 0;
631
- return {
632
- totalTags: c,
633
- tagCounts: r,
634
- uniqueTags: Object.keys(r),
635
- recognizedTags: a,
636
- unrecognizedTags: i,
637
- areAllTagsPresent: f
638
- };
639
- }, qt = ({ inSpec: t, inTags: e = It } = {}) => {
640
- const l = t, o = e, n = b({ inSpec: l }), r = Vt({
641
- inTagsFound: n,
642
- inAllowedTags: o
643
- });
644
- return {
645
- areAllTagsPresent: r.areAllTagsPresent,
646
- totalTags: r.totalTags,
647
- tagCounts: r.tagCounts,
648
- uniqueTags: r.uniqueTags,
649
- recognizedTags: r.recognizedTags,
650
- unrecognizedTags: r.unrecognizedTags
651
- };
652
- }, A = (t = {}) => {
653
- const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
654
- return C(e);
655
- };
656
- W({
657
- inFuncDefinition: A,
658
- inReviewSpec: qt
659
- });
660
- const Bt = ({
661
- inTargetHtmlId: t,
662
- inColumns: e,
663
- type: l,
664
- inData: o,
665
- showLog: n
666
- } = {}) => {
667
- const r = t, a = o ?? [], i = e;
668
- console.log("buildSpec 1 :", r, a.localColumns);
669
- let c = y({
670
- type: l,
671
- data: a,
672
- columns: i
673
- }), f = c;
674
- !("tagName" in c) && "children" in c && (f = c.children);
675
- const s = A(f);
676
- return console.log("buildSpec 3 :", s), s;
677
- }, Pt = ({
678
- type: t = "table",
679
- targetHtmlId: e,
680
- data: l,
681
- classToApply: o,
682
- columns: n,
683
- appendPosition: r,
684
- showLog: a = !1
685
- } = {}) => {
686
- const i = t, c = e, f = l, s = n;
687
- console.log("showLog 1 :", i, e, l, o, n, r);
688
- const u = Bt({
689
- inTargetHtmlId: c,
690
- inColumns: s,
691
- showLog: a,
692
- inData: f,
693
- type: i
694
- });
695
- console.log("showLog 2 :", u);
696
- const d = document.getElementById(c);
697
- return console.log("showLog 3 :", d), r === "prepend" ? d.prepend(u) : (d && (d.innerHTML = ""), console.log("showLog 4:1 :", u instanceof Node), console.log("showLog 4:2 :", u instanceof NodeList), console.log("showLog 4:3 :", u instanceof HTMLCollection), u != null && typeof u[Symbol.iterator] == "function" ? d.append(...u) : d.append(u)), console.log("showLog 5 :", d), d;
698
- };
699
- j(Pt);
700
- export {
701
- Pt as default
702
- };
1
+ const k = {
2
+ version: "v15.0.0",
3
+ description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
4
+ }, B = (t) => {
5
+ var e;
6
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderers ?? (e.jsonRenderers = {
7
+ meta: k,
8
+ renderToDom: t
9
+ }));
10
+ }, U = ({ intype: t, indata: e, intargetHtmlId: n, incoumns: o, inshowLog: r }) => {
11
+ if (typeof t != "string" || t.trim() === "")
12
+ throw console.error("type must be a string"), new Error("type must be a string");
13
+ if (!Array.isArray(e))
14
+ throw console.error("data must be an Array"), new Error("data must be an Array");
15
+ if (typeof n != "string" || !n.trim())
16
+ throw console.error("targetHtmlId must be a non-empty string"), new TypeError("targetHtmlId must be a non-empty string");
17
+ if (!Array.isArray(o))
18
+ throw console.error("columns must be an array"), new TypeError("columns must be an array");
19
+ if (typeof r != "boolean")
20
+ throw console.error("showLog must be a boolean"), new TypeError("showLog must be a boolean");
21
+ if (r !== !0)
22
+ throw console.error("showLog must be true"), new TypeError("showLog must be true");
23
+ return !0;
24
+ }, j = {
25
+ version: "v10.0.0",
26
+ description: "build table from store data and render to DOM uses json-to-spec, json-to-dom under the hood"
27
+ }, v = (t) => {
28
+ var e;
29
+ typeof globalThis > "u" || !t || (globalThis.ks ?? (globalThis.ks = {}), (e = globalThis.ks).jsonRenderersBuild ?? (e.jsonRenderersBuild = {
30
+ meta: j,
31
+ renderToDom: t
32
+ }));
33
+ }, O = "table", I = {
34
+ class: "table table-hover table-striped mb-0"
35
+ }, W = [], F = {
36
+ tagName: O,
37
+ attributes: I,
38
+ children: W
39
+ }, J = "thead", D = [], V = {
40
+ tagName: J,
41
+ children: D
42
+ }, R = "tr", H = [], M = {
43
+ tagName: R,
44
+ children: H
45
+ }, L = "th", K = {
46
+ value: ""
47
+ }, q = "", G = {
48
+ tagName: L,
49
+ attributes: K,
50
+ textContent: q
51
+ }, z = ({ inColumn: t } = {}) => {
52
+ const e = structuredClone(G);
53
+ return e.attributes.value = t, e.textContent = t, e;
54
+ }, P = ({ inColumns: t = [] } = {}) => {
55
+ const e = structuredClone(M), n = t.map((o) => z({ inColumn: o }));
56
+ return e.children = n, e;
57
+ }, _ = ({ inColumns: t = [] } = {}) => {
58
+ const e = structuredClone(V), n = [
59
+ P({ inColumns: t })
60
+ ];
61
+ return e.children = n, e;
62
+ }, X = "tbody", Q = [], Y = {
63
+ tagName: X,
64
+ children: Q
65
+ }, Z = "tr", tt = [], et = {
66
+ tagName: Z,
67
+ children: tt
68
+ }, ot = "td", nt = {
69
+ value: ""
70
+ }, rt = "", st = {
71
+ tagName: ot,
72
+ attributes: nt,
73
+ textContent: rt
74
+ }, lt = ({ inValue: t } = {}) => {
75
+ const e = structuredClone(st);
76
+ return e.attributes.value = t, e.textContent = t, e;
77
+ }, at = ({ inRow: t, inColumns: e = [] } = {}) => {
78
+ const n = structuredClone(et), o = e.map((r) => {
79
+ const s = Array.isArray(t) ? t[r] : t == null ? void 0 : t[r];
80
+ return lt({ inValue: s });
81
+ });
82
+ return n.children = o, n;
83
+ }, ct = ({ inData: t = [], inColumns: e = [] } = {}) => {
84
+ const n = structuredClone(Y), o = t.map((r) => at({
85
+ inRow: r,
86
+ inColumns: e
87
+ }));
88
+ return n.children = o, n;
89
+ }, it = "tfoot", ut = {
90
+ class: "table-light"
91
+ }, dt = [], bt = {
92
+ tagName: it,
93
+ attributes: ut,
94
+ children: dt
95
+ }, mt = "tr", ht = {
96
+ class: "align-middle"
97
+ }, pt = [], ft = {
98
+ tagName: mt,
99
+ attributes: ht,
100
+ children: pt
101
+ }, gt = "td", yt = {
102
+ class: "align-middle py-2"
103
+ }, wt = [], Ct = {
104
+ tagName: gt,
105
+ attributes: yt,
106
+ children: wt
107
+ }, $t = "input", Nt = {
108
+ type: "text",
109
+ name: "",
110
+ placeholder: "",
111
+ class: "form-control form-control-sm"
112
+ }, At = {
113
+ tagName: $t,
114
+ attributes: Nt
115
+ }, Tt = ({ inColumn: t } = {}) => {
116
+ const e = structuredClone(Ct), n = structuredClone(At);
117
+ return n.attributes.name = t, n.attributes.placeholder = t, e.children.push(n), e;
118
+ }, St = ({ inColumns: t = [] } = {}) => {
119
+ const e = structuredClone(ft);
120
+ return e.children = t.map((n) => Tt({ inColumn: n })), e;
121
+ }, xt = ({ inColumns: t = [] } = {}) => St({ inColumns: t }), Et = "tr", kt = {
122
+ class: "align-middle"
123
+ }, Bt = [], Ut = {
124
+ tagName: Et,
125
+ attributes: kt,
126
+ children: Bt
127
+ }, jt = "td", vt = {
128
+ class: "align-middle py-2"
129
+ }, Ot = [], It = {
130
+ tagName: jt,
131
+ attributes: vt,
132
+ children: Ot
133
+ }, Wt = "input", Ft = {
134
+ type: "text",
135
+ name: "",
136
+ placeholder: "",
137
+ class: "form-control form-control-sm"
138
+ }, Jt = {
139
+ tagName: Wt,
140
+ attributes: Ft
141
+ }, Dt = "button", Vt = {
142
+ type: "button",
143
+ class: "btn btn-primary btn-sm ms-2"
144
+ }, Rt = "Save", Ht = {
145
+ tagName: Dt,
146
+ attributes: Vt,
147
+ textContent: Rt
148
+ }, Mt = ({ inColumn: t, inSave: e = !1 } = {}) => {
149
+ const n = structuredClone(It), o = structuredClone(Jt);
150
+ return o.attributes.name = t, o.attributes.placeholder = t, n.children.push(o), e && n.children.push(structuredClone(Ht)), n;
151
+ }, Lt = ({ inColumns: t = [] } = {}) => {
152
+ const e = structuredClone(Ut);
153
+ return e.children = t.map((n, o) => Mt({
154
+ inColumn: n,
155
+ inSave: o === t.length - 1
156
+ })), e;
157
+ }, Kt = ({ inColumns: t = [] } = {}) => Lt({ inColumns: t }), qt = "tr", Gt = {
158
+ class: "fw-semibold align-middle"
159
+ }, zt = [], Pt = {
160
+ tagName: qt,
161
+ attributes: Gt,
162
+ children: zt
163
+ }, _t = "td", Xt = {
164
+ class: "align-middle py-2"
165
+ }, Qt = "", Yt = {
166
+ tagName: _t,
167
+ attributes: Xt,
168
+ textContent: Qt
169
+ }, Zt = (t, e) => Array.isArray(t) ? t[e] : t == null ? void 0 : t[e], te = ({ inColumn: t, inIndex: e, inData: n = [] } = {}) => {
170
+ const o = structuredClone(Yt), r = n.map((s) => Zt(s, t)).filter((s) => s != null && String(s).trim() !== "").map(Number).filter(Number.isFinite);
171
+ return o.textContent = r.length ? String(r.reduce((s, l) => s + l, 0)) : e === 0 ? "Total" : "", o;
172
+ }, ee = ({ inColumns: t = [], inData: e = [] } = {}) => {
173
+ const n = structuredClone(Pt);
174
+ return n.children = t.map(
175
+ (o, r) => te({ inColumn: o, inIndex: r, inData: e })
176
+ ), n;
177
+ }, oe = ({ inColumns: t = [], inData: e = [] } = {}) => ee({ inColumns: t, inData: e }), ne = "tr", re = {
178
+ class: "align-middle"
179
+ }, se = [], le = {
180
+ tagName: ne,
181
+ attributes: re,
182
+ children: se
183
+ }, ae = "td", ce = {
184
+ class: "align-middle py-2"
185
+ }, ie = {
186
+ tagName: ae,
187
+ attributes: ce
188
+ }, ue = () => structuredClone(ie), de = ({ inColumns: t = [] } = {}) => {
189
+ const e = structuredClone(le);
190
+ return e.children = t.map(() => ue()), e;
191
+ }, be = ({ inColumns: t = [] } = {}) => de({ inColumns: t }), g = {
192
+ inputs: xt,
193
+ inputsWithSave: Kt,
194
+ totals: oe,
195
+ empty: be
196
+ }, me = ({ inFooter: t = [], inColumns: e = [], inData: n = [] } = {}) => {
197
+ const o = structuredClone(bt);
198
+ return o.children = t.map((r) => {
199
+ if (!Object.hasOwn(g, r))
200
+ throw new Error(`Unknown footer "${r}".`);
201
+ return g[r]({ inColumns: e, inData: n });
202
+ }), o;
203
+ }, he = ({
204
+ inColumns: t = [],
205
+ inData: e = [],
206
+ inFooter: n = []
207
+ } = {}) => {
208
+ const o = structuredClone(F), r = [
209
+ _({ inColumns: t }),
210
+ ct({ inData: e, inColumns: t })
211
+ ];
212
+ if (!Array.isArray(n))
213
+ throw new TypeError("The footer property must be an array of footer names.");
214
+ return n.length > 0 && r.push(me({
215
+ inFooter: n,
216
+ inColumns: t,
217
+ inData: e
218
+ })), o.children = r, o;
219
+ }, pe = (t) => {
220
+ const [e, n] = t.children;
221
+ e.children[0].children.unshift({
222
+ tagName: "th",
223
+ textContent: "#"
224
+ }), n.children.forEach((o, r) => {
225
+ o.children.unshift({
226
+ tagName: "td",
227
+ textContent: String(r + 1)
228
+ });
229
+ });
230
+ }, fe = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], ge = (t, e) => {
231
+ const n = fe(e);
232
+ if (n.length === 0) return;
233
+ const [o, r] = t.children;
234
+ o.children[0].children.push({
235
+ tagName: "th",
236
+ textContent: "Actions"
237
+ }), r.children.forEach((s) => {
238
+ s.children.push({
239
+ tagName: "td",
240
+ children: n.map((l) => ({
241
+ tagName: "button",
242
+ attributes: { type: l.type || "button" },
243
+ textContent: l.label
244
+ }))
245
+ });
246
+ });
247
+ }, ye = (t, e = {}) => (e.showSerial && pe(t), e.showOptions && ge(t, e.showOptions), t), we = {
248
+ type: "table",
249
+ data: [
250
+ {
251
+ itemName: "0.09/30mm",
252
+ baseUnit: "kgs"
253
+ }
254
+ ],
255
+ columns: [
256
+ "itemName",
257
+ "baseUnit"
258
+ ],
259
+ options: {}
260
+ }, Ce = {
261
+ type: "table",
262
+ data: [
263
+ {
264
+ itemName: "0.09/30mm",
265
+ baseUnit: "kgs"
266
+ }
267
+ ],
268
+ columns: [
269
+ "itemName",
270
+ "baseUnit"
271
+ ],
272
+ options: {
273
+ showSerial: !0
274
+ }
275
+ }, $e = {
276
+ type: "table",
277
+ data: [
278
+ {
279
+ itemName: "0.09/30mm",
280
+ baseUnit: "kgs"
281
+ }
282
+ ],
283
+ columns: [
284
+ "itemName",
285
+ "baseUnit"
286
+ ],
287
+ options: {
288
+ showOptions: !0
289
+ }
290
+ }, Ne = {
291
+ type: "table",
292
+ data: [
293
+ {
294
+ itemName: "0.09/30mm",
295
+ baseUnit: "kgs"
296
+ }
297
+ ],
298
+ columns: [
299
+ "itemName",
300
+ "baseUnit"
301
+ ],
302
+ options: {
303
+ showOptions: [
304
+ {
305
+ label: "Show",
306
+ type: "button"
307
+ },
308
+ {
309
+ label: "Edit",
310
+ type: "button"
311
+ }
312
+ ]
313
+ }
314
+ }, Ae = {
315
+ type: "table",
316
+ data: [
317
+ {
318
+ itemName: "0.09/30mm",
319
+ baseUnit: "kgs"
320
+ }
321
+ ],
322
+ columns: [
323
+ "itemName",
324
+ "baseUnit"
325
+ ],
326
+ options: {
327
+ showSerial: !0,
328
+ showOptions: [
329
+ {
330
+ label: "Show",
331
+ type: "button"
332
+ }
333
+ ]
334
+ }
335
+ }, Te = {
336
+ type: "table",
337
+ data: [
338
+ {
339
+ itemName: "0.09/30mm",
340
+ baseUnit: "kgs"
341
+ }
342
+ ],
343
+ columns: [
344
+ "itemName",
345
+ "baseUnit"
346
+ ],
347
+ footer: [
348
+ "inputs"
349
+ ],
350
+ options: {}
351
+ }, Se = {
352
+ type: "table",
353
+ data: [
354
+ {
355
+ itemName: "0.09/30mm",
356
+ baseUnit: "kgs"
357
+ }
358
+ ],
359
+ columns: [
360
+ "itemName",
361
+ "baseUnit"
362
+ ],
363
+ footer: [
364
+ "inputsWithSave"
365
+ ],
366
+ options: {}
367
+ }, xe = {
368
+ type: "table",
369
+ data: [
370
+ {
371
+ itemName: "0.09/30mm",
372
+ baseUnit: "2"
373
+ },
374
+ {
375
+ itemName: "0.11-25",
376
+ baseUnit: "3"
377
+ }
378
+ ],
379
+ columns: [
380
+ "itemName",
381
+ "baseUnit"
382
+ ],
383
+ footer: [
384
+ "totals"
385
+ ],
386
+ options: {}
387
+ }, Ee = {
388
+ type: "table",
389
+ data: [
390
+ {
391
+ itemName: "0.09/30mm",
392
+ baseUnit: "2"
393
+ }
394
+ ],
395
+ columns: [
396
+ "itemName",
397
+ "baseUnit"
398
+ ],
399
+ footer: [
400
+ "inputs",
401
+ "totals",
402
+ "inputsWithSave",
403
+ "empty"
404
+ ],
405
+ options: {}
406
+ }, ke = {
407
+ type: "tableHead",
408
+ data: [],
409
+ columns: [
410
+ "itemName",
411
+ "baseUnit"
412
+ ],
413
+ options: {}
414
+ }, Be = {
415
+ type: "tableBody",
416
+ data: [
417
+ {
418
+ itemName: "0.09/30mm",
419
+ baseUnit: "kgs"
420
+ }
421
+ ],
422
+ columns: [
423
+ "itemName",
424
+ "baseUnit"
425
+ ],
426
+ options: {}
427
+ }, Ue = {
428
+ table: we,
429
+ tableWithSerial: Ce,
430
+ tableWithDefaultAction: $e,
431
+ tableWithCustomActions: Ne,
432
+ tableWithSerialAndActions: Ae,
433
+ tableWithFooter: Te,
434
+ tableWithFooterSave: Se,
435
+ tableWithTotals: xe,
436
+ tableWithMultipleFooters: Ee,
437
+ tableHead: ke,
438
+ tableBody: Be
439
+ }, y = ({
440
+ type: t = "table",
441
+ inData: e,
442
+ inColumns: n,
443
+ footer: o = [],
444
+ options: r = {}
445
+ } = {}) => {
446
+ if (t === "table") {
447
+ const s = he({
448
+ inColumns: n,
449
+ inData: e,
450
+ inFooter: o
451
+ });
452
+ return ye(s, r);
453
+ }
454
+ throw new Error(`Unknown table renderer type "${t}".`);
455
+ };
456
+ y.requests = Ue;
457
+ const w = ({ inItems: t, inRecipe: e, inExecute: n }) => {
458
+ const o = t, r = e, s = n;
459
+ return o.map((l) => f({
460
+ inSource: l,
461
+ inRecipe: r,
462
+ inExecute: s
463
+ })).flat(1 / 0).filter(Boolean);
464
+ }, je = ({ inSource: t, inRecipe: e, inExecute: n }) => {
465
+ const o = t, r = e, s = n;
466
+ let l = o;
467
+ typeof s == "function" && (l = s({
468
+ inSource: o,
469
+ inRecipe: r
470
+ }));
471
+ for (const [a, i] of Object.entries(l))
472
+ Array.isArray(i) && r && a in r && (l[a] = w({
473
+ inItems: i,
474
+ inRecipe: r[a],
475
+ inExecute: s
476
+ }));
477
+ return l;
478
+ }, f = ({ inSource: t, inRecipe: e, inExecute: n }) => {
479
+ const o = t, r = e, s = n;
480
+ return Array.isArray(o) ? w({
481
+ inItems: o,
482
+ inRecipe: r,
483
+ inExecute: s
484
+ }) : typeof o == "object" && o !== null ? je({
485
+ inSource: o,
486
+ inRecipe: r,
487
+ inExecute: s
488
+ }) : o;
489
+ }, ve = ({ inKey: t, inDirective: e }) => {
490
+ const n = t, o = e;
491
+ return (o == null ? void 0 : o.alterKey) || n;
492
+ }, Oe = ({ inValue: t, inDirective: e, inExecute: n }) => {
493
+ const o = t, r = e, s = n;
494
+ return r && "transform" in r ? f({
495
+ inSource: o,
496
+ inRecipe: r,
497
+ inExecute: s
498
+ }) : o;
499
+ }, Ie = ({ inValue: t, inDirective: e }) => {
500
+ const n = t, o = e;
501
+ return (o == null ? void 0 : o.valueType) === "array" && !Array.isArray(n) ? [n] : n;
502
+ }, We = ({ inValue: t, inDirective: e }) => {
503
+ const n = t, o = e;
504
+ return o != null && o.valueKey && n && typeof n == "object" ? n[o.valueKey] : n;
505
+ }, Fe = ({ inSource: t, inTransform: e, inExecute: n }) => {
506
+ const o = t, r = e, s = n, l = {};
507
+ for (const [a, i] of Object.entries(o)) {
508
+ if (!(a in r))
509
+ continue;
510
+ const u = r[a], c = ve({ inKey: a, inDirective: u });
511
+ let m = i;
512
+ m = Oe({
513
+ inValue: m,
514
+ inDirective: u,
515
+ inExecute: s
516
+ }), m = Ie({ inValue: m, inDirective: u }), m = We({ inValue: m, inDirective: u }), l[c] = m;
517
+ }
518
+ return l;
519
+ };
520
+ function C(t, e) {
521
+ for (const n in t)
522
+ typeof t[n] == "object" && t[n] !== null ? C(t[n], e) : typeof t[n] == "string" && t[n] === "${}" && (t[n] = e);
523
+ return t;
524
+ }
525
+ const Je = ({ inSource: t, inOperation: e, inExecute: n }) => {
526
+ const o = t, r = e;
527
+ for (const [s, l] of Object.entries(r))
528
+ if ("operationType" in l && l.operationType === "loopArray" && s in o) {
529
+ const a = o[s].map((i) => {
530
+ const u = structuredClone(l == null ? void 0 : l.template);
531
+ return C(u, i), u;
532
+ });
533
+ o[s] = a;
534
+ }
535
+ return o;
536
+ }, De = ({ inSource: t, inTemplate: e }) => {
537
+ const n = t;
538
+ let o = [];
539
+ for (const [r, s] of Object.entries(n)) {
540
+ const l = structuredClone(e);
541
+ l.textContent = s, o.push(l);
542
+ }
543
+ return o;
544
+ }, Ve = ({ inSource: t, inBuild: e, inExecute: n }) => {
545
+ const o = structuredClone(t), r = structuredClone(e);
546
+ for (const [s, l] of Object.entries(r)) {
547
+ const a = De({
548
+ inSource: o[s],
549
+ inTemplate: l
550
+ });
551
+ o[s] = a;
552
+ }
553
+ return o;
554
+ }, Re = ({ inSource: t, inTemplate: e }) => t.map((o) => {
555
+ const r = structuredClone(e == null ? void 0 : e.row), s = He({
556
+ inSource: o,
557
+ inTemplate: e == null ? void 0 : e.cell
558
+ });
559
+ return r.children = s, r;
560
+ }), He = ({ inSource: t, inTemplate: e }) => {
561
+ const n = t;
562
+ let o = [];
563
+ for (const [r, s] of Object.entries(n)) {
564
+ const l = structuredClone(e);
565
+ l.textContent = s, o.push(l);
566
+ }
567
+ return o;
568
+ }, Me = ({ inSource: t, inBuild: e, inExecute: n }) => {
569
+ const o = structuredClone(t), r = structuredClone(e);
570
+ for (const [s, l] of Object.entries(r)) {
571
+ const a = Re({
572
+ inSource: o[s],
573
+ inTemplate: l
574
+ });
575
+ o[s] = a;
576
+ }
577
+ return o;
578
+ }, Le = ({ inSource: t, inTemplate: e }) => t.map((r) => {
579
+ const s = structuredClone(e);
580
+ return s.textContent = r == null ? void 0 : r.columnName, s;
581
+ }), Ke = ({ inSource: t, inBuild: e, inExecute: n }) => {
582
+ const o = structuredClone(t), r = structuredClone(e);
583
+ for (const [s, l] of Object.entries(r)) {
584
+ const a = Le({
585
+ inSource: o[s],
586
+ inTemplate: l == null ? void 0 : l.cell
587
+ });
588
+ o[s] = l == null ? void 0 : l.row, o[s].children = a;
589
+ }
590
+ return o;
591
+ }, qe = ({ inSource: t, inTemplate: e }) => t.map((o) => {
592
+ const r = structuredClone(e == null ? void 0 : e.row), s = Ge({
593
+ inSource: o,
594
+ inTemplate: e == null ? void 0 : e.cell
595
+ });
596
+ return r.children = s, r;
597
+ }), Ge = ({ inSource: t, inTemplate: e }) => {
598
+ const n = t;
599
+ let o = [];
600
+ for (const [r, s] of Object.entries(n)) {
601
+ const l = structuredClone(e);
602
+ l.textContent = s, o.push(l);
603
+ }
604
+ return o;
605
+ }, ze = ({ inSource: t, inBuild: e, inExecute: n }) => {
606
+ const o = structuredClone(t), r = structuredClone(e);
607
+ for (const [s, l] of Object.entries(r)) {
608
+ const a = qe({
609
+ inSource: o[s],
610
+ inTemplate: l
611
+ });
612
+ o[s] = l == null ? void 0 : l.body, o[s].children = a;
613
+ }
614
+ return o;
615
+ }, Pe = ({ inSource: t, inTemplate: e }) => t.map((o) => {
616
+ const r = structuredClone(e == null ? void 0 : e.row), s = _e({
617
+ inSource: o,
618
+ inTemplate: e == null ? void 0 : e.cell
619
+ });
620
+ return r.children = s, r;
621
+ }), _e = ({ inSource: t, inTemplate: e }) => {
622
+ const n = t;
623
+ let o = [];
624
+ for (const [r, s] of Object.entries(n)) {
625
+ const l = structuredClone(e);
626
+ l.textContent = s, o.push(l);
627
+ }
628
+ return o;
629
+ }, Xe = ({ inSource: t, inBuild: e, inExecute: n }) => {
630
+ const o = structuredClone(t), r = structuredClone(e);
631
+ for (const [s, l] of Object.entries(r)) {
632
+ const a = Pe({
633
+ inSource: o[s],
634
+ inTemplate: l
635
+ });
636
+ o[s] = l == null ? void 0 : l.body, o[s].children = a;
637
+ }
638
+ return o;
639
+ }, Qe = ({ inSource: t, inTransform: e, inExecute: n }) => {
640
+ const o = e, r = {};
641
+ for (let [s, l] of Object.entries(o))
642
+ console.log("aaaaaaaaa : ", s);
643
+ return r;
644
+ }, b = ({ inSource: t, inRecipe: e }) => {
645
+ let n = t;
646
+ const o = e;
647
+ return o && typeof o == "object" && "transform" in o && (n = Fe({
648
+ inSource: n,
649
+ inTransform: o.transform,
650
+ inExecute: b
651
+ })), o && typeof o == "object" && "operation" in o && (n = Je({
652
+ inSource: n,
653
+ inOperation: o.operation,
654
+ inExecute: b
655
+ })), o && typeof o == "object" && "build" in o && (n = Ve({
656
+ inSource: n,
657
+ inBuild: o == null ? void 0 : o.build,
658
+ inExecute: b
659
+ })), o && typeof o == "object" && "buildCollection" in o && (n = Me({
660
+ inSource: n,
661
+ inBuild: o == null ? void 0 : o.buildCollection,
662
+ inExecute: b
663
+ })), o && typeof o == "object" && "buildArray" in o && (n = Ke({
664
+ inSource: n,
665
+ inBuild: o == null ? void 0 : o.buildArray,
666
+ inExecute: b
667
+ })), o && typeof o == "object" && "buildBody" in o && (n = ze({
668
+ inSource: n,
669
+ inBuild: o == null ? void 0 : o.buildBody,
670
+ inExecute: b
671
+ })), o && typeof o == "object" && "objectToArray" in o && (n = Xe({
672
+ inSource: n,
673
+ inBuild: o == null ? void 0 : o.objectToArray,
674
+ inExecute: b
675
+ })), o && typeof o == "object" && "spec" in o && (n = Qe({
676
+ inSource: n,
677
+ inTransform: o == null ? void 0 : o.spec,
678
+ inExecute: b
679
+ })), n;
680
+ }, $ = (t, e) => f({
681
+ inSource: t,
682
+ inRecipe: e,
683
+ inExecute: b
684
+ }), Ye = {
685
+ children: ""
686
+ }, Ze = {
687
+ children: {
688
+ operationType: "loopArray",
689
+ template: {
690
+ tagName: "option",
691
+ attributes: {
692
+ value: "${}"
693
+ },
694
+ textContent: "${}"
695
+ }
696
+ }
697
+ }, to = {
698
+ transform: Ye,
699
+ operation: Ze
700
+ }, N = ({
701
+ inData: t
702
+ }) => {
703
+ let n = $({
704
+ children: t
705
+ }, to);
706
+ return n == null ? void 0 : n.children;
707
+ }, eo = "select", oo = {
708
+ id: "LedgerName"
709
+ }, no = [], ro = {
710
+ tagName: eo,
711
+ attributes: oo,
712
+ children: no
713
+ }, so = ({
714
+ inData: t
715
+ }) => {
716
+ let n = N({
717
+ inData: t
718
+ });
719
+ const o = structuredClone(ro);
720
+ return o.children = n, o;
721
+ }, lo = "table", ao = {
722
+ class: "table table-hover table-striped align-middle border mb-0"
723
+ }, co = [
724
+ {
725
+ tagName: "thead",
726
+ attributes: {
727
+ class: "table-dark"
728
+ },
729
+ children: [
730
+ {
731
+ tagName: "tr",
732
+ children: []
733
+ }
734
+ ]
735
+ },
736
+ {
737
+ tagName: "tbody",
738
+ children: []
739
+ }
740
+ ], io = {
741
+ tagName: lo,
742
+ attributes: ao,
743
+ children: co
744
+ }, uo = {
745
+ columns: {
746
+ row: {
747
+ tagName: "tr"
748
+ },
749
+ cell: {
750
+ tagName: "th",
751
+ textContent: "${}"
752
+ }
753
+ }
754
+ }, bo = {
755
+ rows: {
756
+ body: {
757
+ tagName: "tbody"
758
+ },
759
+ row: {
760
+ tagName: "tr"
761
+ },
762
+ cell: {
763
+ tagName: "td",
764
+ textContent: "${}"
765
+ }
766
+ }
767
+ }, mo = {
768
+ buildArray: uo,
769
+ buildBody: bo
770
+ }, ho = ({
771
+ inColumns: t = [],
772
+ inData: e = [],
773
+ inFooter: n = []
774
+ } = {}) => {
775
+ const o = structuredClone(io), r = t.map((l) => ({
776
+ columnName: l
777
+ })), s = $({ columns: r, rows: e }, mo);
778
+ return o.children[0].children = [s == null ? void 0 : s.columns], o.children[1] = s == null ? void 0 : s.rows, o;
779
+ }, po = (t) => {
780
+ const [e, n] = t.children;
781
+ console.log("aaaaaaa--", e.children[0]), e.children[0].children.unshift({
782
+ tagName: "th",
783
+ textContent: "#"
784
+ }), n.children.forEach((o, r) => {
785
+ o.children.unshift({
786
+ tagName: "td",
787
+ textContent: String(r + 1)
788
+ });
789
+ });
790
+ }, fo = (t) => t === !0 ? [{ label: "Apply", type: "button" }] : Array.isArray(t) ? t : [], go = (t, e) => {
791
+ const n = fo(e);
792
+ if (n.length === 0) return;
793
+ const [o, r] = t.children;
794
+ o.children[0].children.push({
795
+ tagName: "th",
796
+ textContent: "Actions"
797
+ }), r.children.forEach((s) => {
798
+ s.children.push({
799
+ tagName: "td",
800
+ children: n.map((l) => ({
801
+ tagName: "button",
802
+ attributes: { type: l.type || "button" },
803
+ textContent: l.label
804
+ }))
805
+ });
806
+ });
807
+ }, yo = (t, e = {}) => (e.showSerial && po(t), e.showOptions && go(t, e.showOptions), t), wo = {
808
+ type: "table",
809
+ data: [
810
+ {
811
+ itemName: "0.09/30mm",
812
+ baseUnit: "kgs"
813
+ }
814
+ ],
815
+ columns: [
816
+ "itemName",
817
+ "baseUnit"
818
+ ],
819
+ options: {}
820
+ }, Co = {
821
+ type: "table",
822
+ data: [
823
+ {
824
+ itemName: "0.09/30mm",
825
+ baseUnit: "kgs"
826
+ }
827
+ ],
828
+ columns: [
829
+ "itemName",
830
+ "baseUnit"
831
+ ],
832
+ options: {
833
+ showSerial: !0
834
+ }
835
+ }, $o = {
836
+ type: "table",
837
+ data: [
838
+ {
839
+ itemName: "0.09/30mm",
840
+ baseUnit: "kgs"
841
+ }
842
+ ],
843
+ columns: [
844
+ "itemName",
845
+ "baseUnit"
846
+ ],
847
+ options: {
848
+ showOptions: !0
849
+ }
850
+ }, No = {
851
+ type: "table",
852
+ data: [
853
+ {
854
+ itemName: "0.09/30mm",
855
+ baseUnit: "kgs"
856
+ }
857
+ ],
858
+ columns: [
859
+ "itemName",
860
+ "baseUnit"
861
+ ],
862
+ options: {
863
+ showOptions: [
864
+ {
865
+ label: "Show",
866
+ type: "button"
867
+ },
868
+ {
869
+ label: "Edit",
870
+ type: "button"
871
+ }
872
+ ]
873
+ }
874
+ }, Ao = {
875
+ type: "table",
876
+ data: [
877
+ {
878
+ itemName: "0.09/30mm",
879
+ baseUnit: "kgs"
880
+ }
881
+ ],
882
+ columns: [
883
+ "itemName",
884
+ "baseUnit"
885
+ ],
886
+ options: {
887
+ showSerial: !0,
888
+ showOptions: [
889
+ {
890
+ label: "Show",
891
+ type: "button"
892
+ }
893
+ ]
894
+ }
895
+ }, To = {
896
+ type: "table",
897
+ data: [
898
+ {
899
+ itemName: "0.09/30mm",
900
+ baseUnit: "kgs"
901
+ }
902
+ ],
903
+ columns: [
904
+ "itemName",
905
+ "baseUnit"
906
+ ],
907
+ footer: [
908
+ "inputs"
909
+ ],
910
+ options: {}
911
+ }, So = {
912
+ type: "table",
913
+ data: [
914
+ {
915
+ itemName: "0.09/30mm",
916
+ baseUnit: "kgs"
917
+ }
918
+ ],
919
+ columns: [
920
+ "itemName",
921
+ "baseUnit"
922
+ ],
923
+ footer: [
924
+ "inputsWithSave"
925
+ ],
926
+ options: {}
927
+ }, xo = {
928
+ type: "table",
929
+ data: [
930
+ {
931
+ itemName: "0.09/30mm",
932
+ baseUnit: "2"
933
+ },
934
+ {
935
+ itemName: "0.11-25",
936
+ baseUnit: "3"
937
+ }
938
+ ],
939
+ columns: [
940
+ "itemName",
941
+ "baseUnit"
942
+ ],
943
+ footer: [
944
+ "totals"
945
+ ],
946
+ options: {}
947
+ }, Eo = {
948
+ type: "table",
949
+ data: [
950
+ {
951
+ itemName: "0.09/30mm",
952
+ baseUnit: "2"
953
+ }
954
+ ],
955
+ columns: [
956
+ "itemName",
957
+ "baseUnit"
958
+ ],
959
+ footer: [
960
+ "inputs",
961
+ "totals",
962
+ "inputsWithSave",
963
+ "empty"
964
+ ],
965
+ options: {}
966
+ }, ko = {
967
+ type: "tableHead",
968
+ data: [],
969
+ columns: [
970
+ "itemName",
971
+ "baseUnit"
972
+ ],
973
+ options: {}
974
+ }, Bo = {
975
+ type: "tableBody",
976
+ data: [
977
+ {
978
+ itemName: "0.09/30mm",
979
+ baseUnit: "kgs"
980
+ }
981
+ ],
982
+ columns: [
983
+ "itemName",
984
+ "baseUnit"
985
+ ],
986
+ options: {}
987
+ }, Uo = {
988
+ table: wo,
989
+ tableWithSerial: Co,
990
+ tableWithDefaultAction: $o,
991
+ tableWithCustomActions: No,
992
+ tableWithSerialAndActions: Ao,
993
+ tableWithFooter: To,
994
+ tableWithFooterSave: So,
995
+ tableWithTotals: xo,
996
+ tableWithMultipleFooters: Eo,
997
+ tableHead: ko,
998
+ tableBody: Bo
999
+ }, A = ({
1000
+ inData: t,
1001
+ inColumns: e,
1002
+ footer: n = [],
1003
+ options: o
1004
+ } = {}) => {
1005
+ const r = ho({
1006
+ inColumns: e,
1007
+ inData: t,
1008
+ inFooter: n
1009
+ });
1010
+ return o ? yo(r, o) : r;
1011
+ };
1012
+ A.requests = Uo;
1013
+ const jo = {
1014
+ table: y,
1015
+ select: so,
1016
+ selectOptionsOnly: N,
1017
+ tableFromSpec: A
1018
+ }, T = ({
1019
+ type: t = "table",
1020
+ data: e,
1021
+ columns: n,
1022
+ options: o
1023
+ }) => {
1024
+ const s = jo[t];
1025
+ return s({
1026
+ inColumns: n,
1027
+ inData: e,
1028
+ options: o
1029
+ });
1030
+ };
1031
+ v(T);
1032
+ const vo = {
1033
+ version: "v9",
1034
+ description: "JSON-to-DOM engine with SVG namespace support, mixed text content, and centralized traversal"
1035
+ }, Oo = ({ inFuncDefinition: t, inReviewSpec: e } = {}) => {
1036
+ if (typeof globalThis > "u" || !t) return;
1037
+ globalThis.ks ?? (globalThis.ks = {});
1038
+ const n = {
1039
+ meta: vo,
1040
+ buildSpecElement: t,
1041
+ reviewSpec: e
1042
+ };
1043
+ globalThis.ks["json-to-tag"] = n, globalThis.ks.jsonToTag = n;
1044
+ }, Io = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : typeof t == "object" && (t.nodeType === 3 || t.tagName === "#text" || !t.tagName && (t.textContent !== void 0 || t.text !== void 0)) ? document.createTextNode(t.textContent ?? t.text ?? "") : x(t), S = (t) => Array.isArray(t) ? t.map(Io).flat(1 / 0).filter(Boolean) : [], Wo = (t) => (t == null, t), Fo = "http://www.w3.org/2000/svg", Jo = /* @__PURE__ */ new Set([
1045
+ "svg",
1046
+ "path",
1047
+ "symbol",
1048
+ "use",
1049
+ "g",
1050
+ "circle",
1051
+ "ellipse",
1052
+ "rect",
1053
+ "line",
1054
+ "polyline",
1055
+ "polygon",
1056
+ "text",
1057
+ "tspan",
1058
+ "defs",
1059
+ "clippath",
1060
+ "mask",
1061
+ "pattern",
1062
+ "marker",
1063
+ "lineargradient",
1064
+ "radialgradient",
1065
+ "stop",
1066
+ "image",
1067
+ "filter",
1068
+ "fegaussianblur",
1069
+ "femerge",
1070
+ "femergenode"
1071
+ ]), Do = ({ inTagName: t }) => {
1072
+ const e = t == null ? void 0 : t.toLowerCase();
1073
+ if (!e) return null;
1074
+ if (e === "checkbox") {
1075
+ const n = document.createElement("input");
1076
+ return n.type = "checkbox", n;
1077
+ }
1078
+ return Jo.has(e) ? document.createElementNS(Fo, e) : document.createElement(e);
1079
+ }, Vo = ({ inElement: t, inTextContent: e }) => (!t || e === void 0 || e === null || (t.textContent = e), t), Ro = ({ inElement: t, inProperties: e }) => (t && e && typeof e == "object" && Object.assign(t, e), t), Ho = "http://www.w3.org/1999/xlink", Mo = ({ inElement: t, inAttributes: e }) => {
1080
+ const n = t, o = e;
1081
+ if (!n || !o || typeof o != "object")
1082
+ return n;
1083
+ const r = typeof SVGElement < "u" ? n instanceof SVGElement : n.namespaceURI === "http://www.w3.org/2000/svg";
1084
+ return Object.entries(o).forEach(([s, l]) => {
1085
+ if (s === "class") {
1086
+ r ? n.setAttribute("class", String(l)) : n.className = l;
1087
+ return;
1088
+ }
1089
+ if (s === "xlink:href" || s === "href") {
1090
+ if (l != null) {
1091
+ const a = String(l);
1092
+ if (r)
1093
+ try {
1094
+ n.setAttributeNS(Ho, "href", a);
1095
+ } catch {
1096
+ }
1097
+ n.setAttribute("href", a), n.setAttribute("xlink:href", a);
1098
+ }
1099
+ return;
1100
+ }
1101
+ if (typeof l == "boolean") {
1102
+ l ? n.setAttribute(s, "") : n.removeAttribute(s);
1103
+ return;
1104
+ }
1105
+ l != null && n.setAttribute(s, String(l));
1106
+ }), n;
1107
+ }, Lo = ({ inElement: t, inClassList: e }) => {
1108
+ if (!t || !e) return t;
1109
+ const n = typeof e == "string" ? e.split(/\s+/).filter(Boolean) : Array.isArray(e) ? e.filter((o) => typeof o == "string" && o.trim()) : [];
1110
+ return n.length && t.classList.add(...n), t;
1111
+ }, Ko = (t) => {
1112
+ if (!t || typeof t != "object" || Array.isArray(t) || !t.tagName) return null;
1113
+ const e = Do({ inTagName: t.tagName });
1114
+ if (!e) return null;
1115
+ if (Vo({
1116
+ inElement: e,
1117
+ inTextContent: Wo(t.textContent),
1118
+ inTagName: t.tagName
1119
+ }), Ro({
1120
+ inElement: e,
1121
+ inProperties: t.properties
1122
+ }), Mo({
1123
+ inElement: e,
1124
+ inAttributes: t.attributes
1125
+ }), Lo({
1126
+ inElement: e,
1127
+ inClassList: t.classList
1128
+ }), Array.isArray(t.children)) {
1129
+ const n = S(t.children);
1130
+ n.length && e.append(...n);
1131
+ }
1132
+ return e;
1133
+ }, x = (t) => t == null ? null : typeof Node < "u" && t instanceof Node ? t : Array.isArray(t) ? S(t) : typeof t == "object" ? Ko(t) : typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : null, qo = "./tags.schema.json", Go = {
1134
+ allowsTextContent: !1,
1135
+ allowsChildren: !0,
1136
+ allowedAttributes: [
1137
+ "title",
1138
+ "role"
1139
+ ],
1140
+ childTags: []
1141
+ }, zo = {
1142
+ allowsTextContent: !1,
1143
+ allowsChildren: !1,
1144
+ allowedAttributes: [
1145
+ "type",
1146
+ "placeholder",
1147
+ "value",
1148
+ "name",
1149
+ "disabled",
1150
+ "readonly",
1151
+ "required",
1152
+ "list"
1153
+ ]
1154
+ }, Po = {
1155
+ allowsTextContent: !1,
1156
+ allowsChildren: !1,
1157
+ allowedAttributes: [
1158
+ "type",
1159
+ "checked",
1160
+ "name",
1161
+ "value",
1162
+ "disabled",
1163
+ "required"
1164
+ ]
1165
+ }, _o = {
1166
+ allowsTextContent: !1,
1167
+ allowsChildren: !0,
1168
+ allowedAttributes: [
1169
+ "span"
1170
+ ],
1171
+ childTags: [
1172
+ "col"
1173
+ ]
1174
+ }, Xo = {
1175
+ allowsTextContent: !1,
1176
+ allowsChildren: !1,
1177
+ allowedAttributes: [
1178
+ "span",
1179
+ "style",
1180
+ "width"
1181
+ ]
1182
+ }, Qo = {
1183
+ allowsTextContent: !0,
1184
+ allowsChildren: !0,
1185
+ allowedAttributes: [
1186
+ "for"
1187
+ ],
1188
+ childTags: []
1189
+ }, Yo = {
1190
+ allowsTextContent: !1,
1191
+ allowsChildren: !0,
1192
+ allowedAttributes: [
1193
+ "action",
1194
+ "method",
1195
+ "autocomplete",
1196
+ "enctype",
1197
+ "name",
1198
+ "novalidate",
1199
+ "target"
1200
+ ],
1201
+ childTags: []
1202
+ }, Zo = {
1203
+ allowsTextContent: !1,
1204
+ allowsChildren: !0,
1205
+ allowedAttributes: [
1206
+ "name",
1207
+ "disabled",
1208
+ "required",
1209
+ "multiple",
1210
+ "size"
1211
+ ],
1212
+ childTags: [
1213
+ "option"
1214
+ ]
1215
+ }, tn = {
1216
+ allowsTextContent: !0,
1217
+ allowsChildren: !0,
1218
+ allowedAttributes: [],
1219
+ childTags: []
1220
+ }, en = {
1221
+ allowsTextContent: !0,
1222
+ allowsChildren: !0,
1223
+ allowedAttributes: [],
1224
+ childTags: []
1225
+ }, on = {
1226
+ allowsTextContent: !0,
1227
+ allowsChildren: !0,
1228
+ allowedAttributes: [],
1229
+ childTags: []
1230
+ }, nn = {
1231
+ allowsTextContent: !0,
1232
+ allowsChildren: !0,
1233
+ allowedAttributes: [],
1234
+ childTags: []
1235
+ }, rn = {
1236
+ allowsTextContent: !1,
1237
+ allowsChildren: !1,
1238
+ allowedAttributes: [
1239
+ "src",
1240
+ "alt",
1241
+ "width",
1242
+ "height",
1243
+ "loading"
1244
+ ]
1245
+ }, sn = {
1246
+ allowsTextContent: !0,
1247
+ allowsChildren: !0,
1248
+ allowedAttributes: [
1249
+ "type",
1250
+ "disabled",
1251
+ "name",
1252
+ "value"
1253
+ ],
1254
+ childTags: []
1255
+ }, ln = {
1256
+ allowsTextContent: !1,
1257
+ allowsChildren: !0,
1258
+ allowedAttributes: [
1259
+ "border",
1260
+ "cellpadding",
1261
+ "cellspacing"
1262
+ ],
1263
+ childTags: [
1264
+ "caption",
1265
+ "colgroup",
1266
+ "thead",
1267
+ "tbody",
1268
+ "tfoot",
1269
+ "tr"
1270
+ ]
1271
+ }, an = {
1272
+ allowsTextContent: !1,
1273
+ allowsChildren: !0,
1274
+ allowedAttributes: [],
1275
+ childTags: [
1276
+ "tr"
1277
+ ]
1278
+ }, cn = {
1279
+ allowsTextContent: !1,
1280
+ allowsChildren: !0,
1281
+ allowedAttributes: [],
1282
+ childTags: [
1283
+ "tr"
1284
+ ]
1285
+ }, un = {
1286
+ allowsTextContent: !1,
1287
+ allowsChildren: !0,
1288
+ allowedAttributes: [],
1289
+ childTags: [
1290
+ "tr"
1291
+ ]
1292
+ }, dn = {
1293
+ allowsTextContent: !1,
1294
+ allowsChildren: !0,
1295
+ allowedAttributes: [],
1296
+ childTags: [
1297
+ "td",
1298
+ "th"
1299
+ ]
1300
+ }, bn = {
1301
+ allowsTextContent: !0,
1302
+ allowsChildren: !0,
1303
+ allowedAttributes: [
1304
+ "scope",
1305
+ "colspan",
1306
+ "rowspan"
1307
+ ],
1308
+ childTags: []
1309
+ }, mn = {
1310
+ allowsTextContent: !0,
1311
+ allowsChildren: !0,
1312
+ allowedAttributes: [
1313
+ "colspan",
1314
+ "rowspan"
1315
+ ],
1316
+ childTags: []
1317
+ }, hn = {
1318
+ allowsTextContent: !1,
1319
+ allowsChildren: !0,
1320
+ allowedAttributes: [],
1321
+ childTags: [
1322
+ "option"
1323
+ ]
1324
+ }, pn = {
1325
+ allowsTextContent: !0,
1326
+ allowsChildren: !1,
1327
+ allowedAttributes: [
1328
+ "value",
1329
+ "label",
1330
+ "selected",
1331
+ "disabled"
1332
+ ]
1333
+ }, fn = {
1334
+ allowsTextContent: !1,
1335
+ allowsChildren: !0,
1336
+ allowedAttributes: [
1337
+ "role"
1338
+ ],
1339
+ childTags: []
1340
+ }, gn = {
1341
+ allowsTextContent: !0,
1342
+ allowsChildren: !0,
1343
+ allowedAttributes: [
1344
+ "href",
1345
+ "target",
1346
+ "rel",
1347
+ "title",
1348
+ "download"
1349
+ ],
1350
+ childTags: []
1351
+ }, yn = {
1352
+ allowsTextContent: !0,
1353
+ allowsChildren: !0,
1354
+ allowedAttributes: [
1355
+ "aria-hidden"
1356
+ ],
1357
+ childTags: []
1358
+ }, wn = {
1359
+ allowsTextContent: !0,
1360
+ allowsChildren: !0,
1361
+ allowedAttributes: [],
1362
+ childTags: []
1363
+ }, Cn = {
1364
+ allowsTextContent: !1,
1365
+ allowsChildren: !0,
1366
+ allowedAttributes: [
1367
+ "type"
1368
+ ],
1369
+ childTags: [
1370
+ "li"
1371
+ ]
1372
+ }, $n = {
1373
+ allowsTextContent: !0,
1374
+ allowsChildren: !0,
1375
+ allowedAttributes: [
1376
+ "value"
1377
+ ],
1378
+ childTags: []
1379
+ }, Nn = {
1380
+ allowsTextContent: !1,
1381
+ allowsChildren: !1,
1382
+ allowedAttributes: []
1383
+ }, An = {
1384
+ $schema: qo,
1385
+ div: Go,
1386
+ input: zo,
1387
+ checkbox: Po,
1388
+ colgroup: _o,
1389
+ col: Xo,
1390
+ label: Qo,
1391
+ form: Yo,
1392
+ select: Zo,
1393
+ p: tn,
1394
+ h1: en,
1395
+ h2: on,
1396
+ span: nn,
1397
+ img: rn,
1398
+ button: sn,
1399
+ table: ln,
1400
+ thead: an,
1401
+ tbody: cn,
1402
+ tfoot: un,
1403
+ tr: dn,
1404
+ th: bn,
1405
+ td: mn,
1406
+ datalist: hn,
1407
+ option: pn,
1408
+ header: fn,
1409
+ a: gn,
1410
+ i: yn,
1411
+ small: wn,
1412
+ ul: Cn,
1413
+ li: $n,
1414
+ hr: Nn
1415
+ }, p = ({ inSpec: t }) => {
1416
+ const e = t;
1417
+ if (!e) return [];
1418
+ if (Array.isArray(e))
1419
+ return e.flatMap((o) => p({ inSpec: o }));
1420
+ if (typeof e != "object") return [];
1421
+ const n = [];
1422
+ return typeof e.tagName == "string" && e.tagName.trim().length > 0 && n.push(e.tagName.toLowerCase()), Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((o) => {
1423
+ const r = p({ inSpec: o });
1424
+ n.push(...r);
1425
+ }), n;
1426
+ }, Tn = ({ inTagsFound: t, inAllowedTags: e }) => {
1427
+ const n = t ?? [], o = e ?? {}, r = new Set(
1428
+ Object.keys(o).filter((c) => c !== "$schema").map((c) => c.toLowerCase())
1429
+ ), s = {}, l = [], a = [];
1430
+ n.forEach((c) => {
1431
+ s[c] = (s[c] || 0) + 1, r.has(c) ? l.includes(c) || l.push(c) : a.includes(c) || a.push(c);
1432
+ });
1433
+ const i = n.length, u = a.length === 0;
1434
+ return {
1435
+ totalTags: i,
1436
+ tagCounts: s,
1437
+ uniqueTags: Object.keys(s),
1438
+ recognizedTags: l,
1439
+ unrecognizedTags: a,
1440
+ areAllTagsPresent: u
1441
+ };
1442
+ }, Sn = ({ inSpec: t, inTags: e = An } = {}) => {
1443
+ const n = t, o = e, r = p({ inSpec: n }), s = Tn({
1444
+ inTagsFound: r,
1445
+ inAllowedTags: o
1446
+ });
1447
+ return {
1448
+ areAllTagsPresent: s.areAllTagsPresent,
1449
+ totalTags: s.totalTags,
1450
+ tagCounts: s.tagCounts,
1451
+ uniqueTags: s.uniqueTags,
1452
+ recognizedTags: s.recognizedTags,
1453
+ unrecognizedTags: s.unrecognizedTags
1454
+ };
1455
+ }, E = (t = {}) => {
1456
+ const e = (t == null ? void 0 : t.spec) ?? (t == null ? void 0 : t.inSpec) ?? t;
1457
+ return x(e);
1458
+ };
1459
+ Oo({
1460
+ inFuncDefinition: E,
1461
+ inReviewSpec: Sn
1462
+ });
1463
+ const xn = ({
1464
+ inTargetHtmlId: t,
1465
+ inColumns: e,
1466
+ type: n,
1467
+ inData: o,
1468
+ showLog: r
1469
+ } = {}) => {
1470
+ const s = t, l = o ?? [], a = e;
1471
+ r && console.log("buildSpec 1 :", s, l.localColumns);
1472
+ let u = T({
1473
+ type: n,
1474
+ data: l,
1475
+ columns: a
1476
+ });
1477
+ const c = E(u);
1478
+ return console.log("buildSpec 2 :", u, c), r && console.log("buildSpec 3 :", c), c;
1479
+ }, En = ({
1480
+ type: t = "table",
1481
+ targetHtmlId: e,
1482
+ data: n,
1483
+ classToApply: o,
1484
+ columns: r,
1485
+ appendPosition: s,
1486
+ showLog: l = !1
1487
+ } = {}) => {
1488
+ const a = t, i = e, u = n, c = r;
1489
+ U({
1490
+ intype: a,
1491
+ indata: u,
1492
+ intargetHtmlId: i,
1493
+ incoumns: c,
1494
+ inshowLog: l
1495
+ });
1496
+ const h = xn({
1497
+ inTargetHtmlId: i,
1498
+ inColumns: c,
1499
+ showLog: l,
1500
+ inData: u,
1501
+ type: a
1502
+ });
1503
+ l && console.log("showLog 2 :", h);
1504
+ const d = document.getElementById(i);
1505
+ return l && console.log("showLog 3 :", d), Array.isArray(h) || h instanceof NodeList || h instanceof HTMLCollection ? s === "prepend" ? d.prepend(...h) : d.append(...h) : s === "prepend" ? d.prepend(h) : (d && (d.innerHTML = ""), d.append(h)), l && console.log("showLog 5 :", d), d;
1506
+ };
1507
+ B(En);
1508
+ export {
1509
+ En as default
1510
+ };