-
Notifications
You must be signed in to change notification settings - Fork 0
/
servicestack-vue.mjs
6681 lines (6681 loc) · 255 KB
/
servicestack-vue.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
var js = Object.defineProperty;
var Bs = (e, l, t) => l in e ? js(e, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[l] = t;
var ye = (e, l, t) => (Bs(e, typeof l != "symbol" ? l + "" : l, t), t);
import { defineComponent as Y, computed as c, openBlock as o, createElementBlock as u, normalizeClass as w, unref as s, createElementVNode as n, createCommentVNode as C, renderSlot as Z, ref as I, toDisplayString as V, inject as Oe, nextTick as ul, isRef as Tn, h as ft, resolveComponent as U, createBlock as X, withCtx as ve, mergeProps as Ce, useAttrs as Rs, createVNode as fe, createTextVNode as he, watchEffect as Sl, normalizeStyle as El, withModifiers as je, Fragment as be, renderList as $e, withDirectives as gt, vModelCheckbox as Hl, withKeys as Es, createStaticVNode as dl, vModelSelect as Hs, useSlots as Nl, onMounted as lt, createSlots as zl, normalizeProps as _t, guardReactiveProps as al, vModelDynamic as Ns, onUnmounted as Ut, watch as At, vModelText as zs, provide as qt, resolveDynamicComponent as Us, resolveDirective as qs } from "vue";
import { errorResponseExcept as Qs, dateFmt as In, toTime as Ks, omit as nt, enc as Al, setQueryString as Gs, appendQueryString as Rt, nameOf as Ws, ApiResult as Ze, lastRightPart as pt, leftPart as cl, map as De, toDate as bt, toDateTime as Zs, toCamelCase as Js, mapGet as ce, chop as Xs, humanize as Ie, delaySet as Fn, queryString as Tl, combinePaths as Ys, rightPart as ea, toPascalCase as Ye, errorResponse as dt, trimEnd as ta, $1 as ol, lastLeftPart as la, ResponseStatus as Ll, ResponseError as Ln, HttpMethods as Ul, uniqueKeys as Il, humanify as Pn, fromXsdDuration as Dn, isDate as fl, timeFmt12 as na, apiValue as sa, indexOfAny as aa, each as oa } from "@servicestack/client";
const ia = { class: "flex items-center" }, ra = {
key: 0,
class: "flex-shrink-0 mr-3"
}, ua = {
key: 0,
class: "h-5 w-5 text-yellow-400",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 20 20",
fill: "currentColor",
"aria-hidden": "true"
}, da = /* @__PURE__ */ n("path", {
"fill-rule": "evenodd",
d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",
"clip-rule": "evenodd"
}, null, -1), ca = [
da
], fa = {
key: 1,
class: "h-5 w-5 text-red-400",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 20 20",
fill: "currentColor",
"aria-hidden": "true"
}, ma = /* @__PURE__ */ n("path", {
"fill-rule": "evenodd",
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z",
"clip-rule": "evenodd"
}, null, -1), va = [
ma
], ha = {
key: 2,
class: "h-5 w-5 text-blue-400",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 20 20",
fill: "currentColor",
"aria-hidden": "true"
}, ga = /* @__PURE__ */ n("path", {
"fill-rule": "evenodd",
d: "M19 10.5a8.5 8.5 0 11-17 0 8.5 8.5 0 0117 0zM8.25 9.75A.75.75 0 019 9h.253a1.75 1.75 0 011.709 2.13l-.46 2.066a.25.25 0 00.245.304H11a.75.75 0 010 1.5h-.253a1.75 1.75 0 01-1.709-2.13l.46-2.066a.25.25 0 00-.245-.304H9a.75.75 0 01-.75-.75zM10 7a1 1 0 100-2 1 1 0 000 2z",
"clip-rule": "evenodd"
}, null, -1), pa = [
ga
], ya = {
key: 3,
class: "h-5 w-5 text-green-400",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 20 20",
fill: "currentColor",
"aria-hidden": "true"
}, ba = /* @__PURE__ */ n("path", {
"fill-rule": "evenodd",
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
"clip-rule": "evenodd"
}, null, -1), wa = [
ba
], xa = /* @__PURE__ */ Y({
__name: "Alert",
props: {
type: { default: "warn" },
hideIcon: { type: Boolean }
},
setup(e) {
const l = e, t = c(() => l.type == "info" ? "bg-blue-50 dark:bg-blue-200" : l.type == "error" ? "bg-red-50 dark:bg-red-200" : l.type == "success" ? "bg-green-50 dark:bg-green-200" : "bg-yellow-50 dark:bg-yellow-200"), a = c(() => l.type == "info" ? "border-blue-400" : l.type == "error" ? "border-red-400" : l.type == "success" ? "border-green-400" : "border-yellow-400"), i = c(() => l.type == "info" ? "text-blue-700" : l.type == "error" ? "text-red-700" : l.type == "success" ? "text-green-700" : "text-yellow-700");
return (r, d) => (o(), u("div", {
class: w([s(t), s(a), "border-l-4 p-4"])
}, [
n("div", ia, [
e.hideIcon ? C("", !0) : (o(), u("div", ra, [
e.type == "warn" ? (o(), u("svg", ua, ca)) : e.type == "error" ? (o(), u("svg", fa, va)) : e.type == "info" ? (o(), u("svg", ha, pa)) : e.type == "success" ? (o(), u("svg", ya, wa)) : C("", !0)
])),
n("div", null, [
n("p", {
class: w([s(i), "text-sm"])
}, [
Z(r.$slots, "default")
], 2)
])
])
], 2));
}
}), ka = {
key: 0,
class: "rounded-md bg-green-50 dark:bg-green-200 p-4",
role: "alert"
}, $a = { class: "flex" }, Ca = /* @__PURE__ */ n("div", { class: "flex-shrink-0" }, [
/* @__PURE__ */ n("svg", {
class: "h-5 w-5 text-green-400 dark:text-green-500",
fill: "none",
stroke: "currentColor",
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, [
/* @__PURE__ */ n("path", {
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": "2",
d: "M5 13l4 4L19 7"
})
])
], -1), _a = { class: "ml-3" }, La = { class: "text-sm font-medium text-green-800" }, Va = { key: 0 }, Ma = { class: "ml-auto pl-3" }, Sa = { class: "-mx-1.5 -my-1.5" }, Aa = /* @__PURE__ */ n("span", { class: "sr-only" }, "Dismiss", -1), Ta = /* @__PURE__ */ n("svg", {
class: "h-5 w-5",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 20 20",
fill: "currentColor",
"aria-hidden": "true"
}, [
/* @__PURE__ */ n("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
], -1), Ia = [
Aa,
Ta
], Fa = /* @__PURE__ */ Y({
__name: "AlertSuccess",
props: {
message: null
},
setup(e) {
const l = I(!1);
return (t, a) => l.value ? C("", !0) : (o(), u("div", ka, [
n("div", $a, [
Ca,
n("div", _a, [
n("h3", La, [
e.message ? (o(), u("span", Va, V(e.message), 1)) : Z(t.$slots, "default", { key: 1 })
])
]),
n("div", Ma, [
n("div", Sa, [
n("button", {
type: "button",
class: "inline-flex rounded-md bg-green-50 dark:bg-green-200 p-1.5 text-green-500 dark:text-green-600 hover:bg-green-100 dark:hover:bg-green-700 dark:hover:text-white focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50 dark:ring-offset-green-200",
onClick: a[0] || (a[0] = (i) => l.value = !0)
}, Ia)
])
])
])
]));
}
}), Pa = { class: "flex" }, Da = /* @__PURE__ */ n("div", { class: "flex-shrink-0" }, [
/* @__PURE__ */ n("svg", {
class: "h-5 w-5 text-red-400",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, [
/* @__PURE__ */ n("path", {
fill: "currentColor",
d: "M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12S6.47 2 12 2m3.59 5L12 10.59L8.41 7L7 8.41L10.59 12L7 15.59L8.41 17L12 13.41L15.59 17L17 15.59L13.41 12L17 8.41L15.59 7Z"
})
])
], -1), Oa = { class: "ml-3" }, ja = { class: "text-sm text-red-700 dark:text-red-200" }, Ba = /* @__PURE__ */ Y({
__name: "ErrorSummary",
props: {
status: null,
except: null,
class: null
},
setup(e) {
const l = e;
let t = Oe("ApiState", void 0);
const a = c(() => l.status || t != null && t.error.value ? Qs.call({ responseStatus: l.status ?? (t == null ? void 0 : t.error.value) }, l.except ?? []) : null);
return (i, r) => s(a) ? (o(), u("div", {
key: 0,
class: w(`bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4 ${i.$props.class}`)
}, [
n("div", Pa, [
Da,
n("div", Oa, [
n("p", ja, V(s(a)), 1)
])
])
], 2)) : C("", !0);
}
}), Ra = ["id", "aria-describedby"], Ea = /* @__PURE__ */ Y({
__name: "InputDescription",
props: {
id: null,
description: null
},
setup(e) {
return (l, t) => e.description ? (o(), u("div", {
key: "description",
class: "mt-2 text-sm text-gray-500",
id: `${e.id}-description`,
"aria-describedby": `${e.id}-description`
}, [
n("div", null, V(e.description), 1)
], 8, Ra)) : C("", !0);
}
});
function ml(e) {
return In(e).replace(/\//g, "-");
}
function On(e) {
return e == null ? "" : Ks(e);
}
function jn(e, l) {
e.value = null, ul(() => e.value = l);
}
function kt(e) {
return Object.keys(e).forEach((l) => {
const t = e[l];
e[l] = Tn(t) ? s(t) : t;
}), e;
}
function Lt(e, l, t) {
t ? (l.value = e.entering.cls + " " + e.entering.from, setTimeout(() => l.value = e.entering.cls + " " + e.entering.to, 0)) : (l.value = e.leaving.cls + " " + e.leaving.from, setTimeout(() => l.value = e.leaving.cls + " " + e.leaving.to, 0));
}
function tl() {
if (typeof document > "u")
return;
let e = document.activeElement, l = e && e.form;
if (l) {
let t = ':not([disabled]):not([tabindex="-1"])', a = l.querySelectorAll(`a:not([disabled]), button${t}, input[type=text]${t}, [tabindex]${t}`), i = Array.prototype.filter.call(
a,
(d) => d.offsetWidth > 0 || d.offsetHeight > 0 || d === e
), r = i.indexOf(e);
r > -1 && (i[r + 1] || i[0]).focus();
}
}
function Tt(e) {
if (!e)
return null;
if (typeof e == "string")
return e;
const l = typeof e == "function" ? new e() : typeof e == "object" ? e : null;
if (!l)
throw new Error(`Invalid DTO Type '${typeof e}'`);
if (typeof l.getTypeName != "function")
throw new Error(`${JSON.stringify(l)} is not a Request DTO`);
const t = l.getTypeName();
if (!t)
throw new Error("DTO Required");
return t;
}
function et(e, l, t) {
t || (t = {});
let a = t.cls || t.className || t.class;
return a && (t = nt(t, ["cls", "class", "className"]), t.class = a), l == null ? `<${e}` + Fl(t) + "/>" : `<${e}` + Fl(t) + `>${l || ""}</${e}>`;
}
function Fl(e) {
return Object.keys(e).reduce((l, t) => `${l} ${t}="${Al(e[t])}"`, "");
}
function vl(e) {
return Object.assign({ target: "_blank", rel: "noopener", class: "text-blue-600" }, e);
}
function Ct(e) {
return Gl(e);
}
let Ha = ["string", "number", "boolean", "null", "undefined"];
function yt(e) {
return Ha.indexOf(typeof e) >= 0 || e instanceof Date;
}
function Et(e) {
return !yt(e);
}
class Bn {
get length() {
return typeof localStorage > "u" ? 0 : localStorage.length;
}
getItem(l) {
return typeof localStorage > "u" ? null : localStorage.getItem(l);
}
setItem(l, t) {
typeof localStorage > "u" || localStorage.setItem(l, t);
}
removeItem(l) {
typeof localStorage > "u" || localStorage.removeItem(l);
}
clear() {
typeof localStorage > "u" || localStorage.clear();
}
key(l) {
return typeof localStorage > "u" ? null : localStorage.key(l);
}
}
function il(e) {
return typeof e == "string" ? JSON.parse(e) : null;
}
function ql(e) {
if (typeof history < "u") {
const l = Gs(location.href, e);
history.pushState({}, "", l);
}
}
function Ql(e, l) {
if (["function", "Function", "eval", "=>", ";"].some((i) => e.includes(i)))
throw new Error(`Unsafe script: '${e}'`);
const a = Object.assign(
Object.keys(globalThis).reduce((i, r) => (i[r] = void 0, i), {}),
l
);
return new Function("with(this) { return (" + e + ") }").call(a);
}
function Pl(e) {
typeof navigator < "u" && navigator.clipboard.writeText(e);
}
function Rn(e) {
const l = ne.config.storage.getItem(e);
return l ? JSON.parse(l) : null;
}
function Kl(e, l) {
return Rt(`swr.${Ws(e)}`, l ? Object.assign({}, e, l) : e);
}
function Na(e) {
if (e.request) {
const l = Kl(e.request, e.args);
ne.config.storage.removeItem(l);
}
}
async function En(e, l, t, a, i) {
const r = Kl(l, a);
t(new Ze({ response: Rn(r) }));
const d = await e.api(l, a, i);
if (d.succeeded && d.response) {
d.response._date = new Date().valueOf();
const v = JSON.stringify(d.response);
ne.config.storage.setItem(r, v), t(d);
}
return d;
}
function za() {
return {
LocalStore: Bn,
dateInputFormat: ml,
timeInputFormat: On,
setRef: jn,
unRefs: kt,
transition: Lt,
focusNextElement: tl,
getTypeName: Tt,
htmlTag: et,
htmlAttrs: Fl,
linkAttrs: vl,
toAppUrl: Ct,
isPrimitive: yt,
isComplexType: Et,
pushState: ql,
scopedExpr: Ql,
copyText: Pl,
fromCache: Rn,
swrCacheKey: Kl,
swrClear: Na,
swrApi: En
};
}
class ne {
}
ye(ne, "config", {
redirectSignIn: "/signin",
redirectSignOut: "/auth/logout",
navigate: (l) => location.href = l,
assetsPathResolver: (l) => l,
fallbackPathResolver: (l) => l,
storage: new Bn(),
tableIcon: { svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g fill='none' stroke='currentColor' stroke-width='1.5'><path d='M5 12v6s0 3 7 3s7-3 7-3v-6'/><path d='M5 6v6s0 3 7 3s7-3 7-3V6'/><path d='M12 3c7 0 7 3 7 3s0 3-7 3s-7-3-7-3s0-3 7-3Z'/></g></svg>" }
}), ye(ne, "autoQueryGridDefaults", {
deny: [],
hide: [],
toolbarButtonClass: void 0,
tableStyle: "stripedRows",
take: 25,
maxFieldLength: 150
}), ye(ne, "user", I(null)), ye(ne, "metadata", I(null));
function Ua(e) {
ne.config = Object.assign(ne.config, e);
}
function qa(e) {
ne.autoQueryGridDefaults = Object.assign(ne.autoQueryGridDefaults, e);
}
function Gl(e) {
return e && ne.config.assetsPathResolver ? ne.config.assetsPathResolver(e) : e;
}
function Qa(e) {
return e && ne.config.fallbackPathResolver ? ne.config.fallbackPathResolver(e) : e;
}
function wt() {
const e = c(() => ne.config), l = c(() => ne.autoQueryGridDefaults);
return {
config: e,
setConfig: Ua,
autoQueryGridDefaults: l,
setAutoQueryGridDefaults: qa,
assetsPathResolver: Gl,
fallbackPathResolver: Qa
};
}
const Hn = "png,jpg,jpeg,jfif,gif,svg,webp".split(","), Nn = {
img: "png,jpg,jpeg,gif,svg,webp,png,jpg,jpeg,gif,bmp,tif,tiff,webp,ai,psd,ps".split(","),
vid: "avi,m4v,mov,mp4,mpg,mpeg,wmv,webm".split(","),
aud: "mp3,mpa,ogg,wav,wma,mid,webm".split(","),
ppt: "key,odp,pps,ppt,pptx".split(","),
xls: "xls,xlsm,xlsx,ods,csv,tsv".split(","),
doc: "doc,docx,pdf,rtf,tex,txt,md,rst,xls,xlsm,xlsx,ods,key,odp,pps,ppt,pptx".split(","),
zip: "zip,tar,gz,7z,rar,gzip,deflate,br,iso,dmg,z,lz,lz4,lzh,s7z,apl,arg,jar,war".split(","),
exe: "exe,bat,sh,cmd,com,app,msi,run,vb,vbs,js,ws,wsh".split(","),
att: "bin,oct,dat".split(",")
//attachment
}, Vn = Object.keys(Nn), at = (e, l) => `<svg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' role='img' preserveAspectRatio='xMidYMid meet' viewBox='${e}'>${l}</svg>`, ll = {
img: at("4 4 16 16", "<path fill='currentColor' d='M20 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2zm-2 0H6v6.38l2.19-2.19l5.23 5.23l1-1a1.59 1.59 0 0 1 2.11.11L18 16V6zm-5 3.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0z'/>"),
vid: at("0 0 24 24", "<path fill='currentColor' d='m14 2l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8m4 18V9h-5V4H6v16h12m-2-2l-2.5-1.7V18H8v-5h5.5v1.7L16 13v5Z'/>"),
aud: at("0 0 24 24", "<path fill='currentColor' d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm10-9h-4v3.88a2.247 2.247 0 0 0-3.5 1.87c0 1.24 1.01 2.25 2.25 2.25S13 17.99 13 16.75V13h3v-2z'/>"),
ppt: at("0 0 48 48", "<g fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'><path d='M4 8h40'/><path d='M8 8h32v26H8V8Z' clip-rule='evenodd'/><path d='m22 16l5 5l-5 5m-6 16l8-8l8 8'/></g>"),
xls: at("0 0 256 256", "<path fill='currentColor' d='M200 26H72a14 14 0 0 0-14 14v26H40a14 14 0 0 0-14 14v96a14 14 0 0 0 14 14h18v26a14 14 0 0 0 14 14h128a14 14 0 0 0 14-14V40a14 14 0 0 0-14-14Zm-42 76h44v52h-44Zm44-62v50h-44V80a14 14 0 0 0-14-14h-2V38h58a2 2 0 0 1 2 2ZM70 40a2 2 0 0 1 2-2h58v28H70ZM38 176V80a2 2 0 0 1 2-2h104a2 2 0 0 1 2 2v96a2 2 0 0 1-2 2H40a2 2 0 0 1-2-2Zm32 40v-26h60v28H72a2 2 0 0 1-2-2Zm130 2h-58v-28h2a14 14 0 0 0 14-14v-10h44v50a2 2 0 0 1-2 2ZM69.2 148.4L84.5 128l-15.3-20.4a6 6 0 1 1 9.6-7.2L92 118l13.2-17.6a6 6 0 0 1 9.6 7.2L99.5 128l15.3 20.4a6 6 0 0 1-9.6 7.2L92 138l-13.2 17.6a6 6 0 1 1-9.6-7.2Z'/>"),
doc: at("0 0 32 32", "<path fill='currentColor' d='M26 30H11a2.002 2.002 0 0 1-2-2v-6h2v6h15V6h-9V4h9a2.002 2.002 0 0 1 2 2v22a2.002 2.002 0 0 1-2 2Z'/><path fill='currentColor' d='M17 10h7v2h-7zm-1 5h8v2h-8zm-1 5h9v2h-9zm-6-1a5.005 5.005 0 0 1-5-5V3h2v11a3 3 0 0 0 6 0V5a1 1 0 0 0-2 0v10H8V5a3 3 0 0 1 6 0v9a5.005 5.005 0 0 1-5 5z'/>"),
zip: at("0 0 16 16", "<g fill='currentColor'><path d='M6.5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.109 0l-.93-.62a1 1 0 0 1-.415-1.074l.4-1.599V7.5zm2 0h-1v.938a1 1 0 0 1-.03.243l-.4 1.598l.93.62l.93-.62l-.4-1.598a1 1 0 0 1-.03-.243V7.5z'/><path d='M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm5.5-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9v1H8v1h1v1H8v1h1v1H7.5V5h-1V4h1V3h-1V2h1V1z'/></g>"),
exe: at("0 0 16 16", "<path fill='currentColor' fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM2.575 15.202H.785v-1.073H2.47v-.606H.785v-1.025h1.79v-.648H0v3.999h2.575v-.647ZM6.31 11.85h-.893l-.823 1.439h-.036l-.832-1.439h-.931l1.227 1.983l-1.239 2.016h.861l.853-1.415h.035l.85 1.415h.908l-1.254-1.992L6.31 11.85Zm1.025 3.352h1.79v.647H6.548V11.85h2.576v.648h-1.79v1.025h1.684v.606H7.334v1.073Z'/>"),
att: at("0 0 24 24", "<path fill='currentColor' d='M14 0a5 5 0 0 1 5 5v12a7 7 0 1 1-14 0V9h2v8a5 5 0 0 0 10 0V5a3 3 0 1 0-6 0v12a1 1 0 1 0 2 0V6h2v11a3 3 0 1 1-6 0V5a5 5 0 0 1 5-5Z'/>")
}, Ka = /[\r\n%#()<>?[\\\]^`{|}]/g, Mn = 1024, Ga = ["Bytes", "KB", "MB", "GB", "TB"], Wa = (() => {
const e = "application/", l = e + "vnd.openxmlformats-officedocument.", t = "image/", a = "text/", i = "audio/", r = "video/", d = {
jpg: t + "jpeg",
tif: t + "tiff",
svg: t + "svg+xml",
ico: t + "x-icon",
ts: a + "typescript",
py: a + "x-python",
sh: a + "x-sh",
mp3: i + "mpeg3",
mpg: r + "mpeg",
ogv: r + "ogg",
xlsx: l + "spreadsheetml.sheet",
xltx: l + "spreadsheetml.template",
docx: l + "wordprocessingml.document",
dotx: l + "wordprocessingml.template",
pptx: l + "presentationml.presentation",
potx: l + "presentationml.template",
ppsx: l + "presentationml.slideshow",
mdb: e + "vnd.ms-access"
};
function v(m, g) {
m.split(",").forEach((p) => d[p] = g);
}
function f(m, g) {
m.split(",").forEach((p) => d[p] = g(p));
}
return f("jpeg,gif,png,tiff,bmp,webp", (m) => t + m), f("jsx,csv,css", (m) => a + m), f("aac,ac3,aiff,m4a,m4b,m4p,mid,midi,wav", (m) => i + m), f("3gpp,avi,dv,divx,ogg,mp4,webm", (m) => r + m), f("rtf,pdf", (m) => e + m), v("htm,html,shtm", a + "html"), v("js,mjs,cjs", a + "javascript"), v("yml,yaml", e + "yaml"), v("bat,cmd", e + "bat"), v("xml,csproj,fsproj,vbproj", a + "xml"), v("txt,ps1", a + "plain"), v("qt,mov", r + "quicktime"), v("doc,dot", e + "msword"), v("xls,xlt,xla", e + "excel"), v("ppt,oit,pps,ppa", e + "vnd.ms-powerpoint"), v("cer,crt,der", e + "x-x509-ca-cert"), v("gz,tgz,zip,rar,lzh,z", e + "x-compressed"), v("aaf,aca,asd,bin,cab,chm,class,cur,db,dat,deploy,dll,dsp,exe,fla,ics,inf,mix,msi,mso,obj,ocx,prm,prx,psd,psp,qxd,sea,snp,so,sqlite,toc,ttf,u32,xmp,xsn,xtp", e + "octet-stream"), d;
})();
let Dl = [];
function zn(e) {
return e = e.replace(/"/g, "'"), e = e.replace(/>\s+</g, "><"), e = e.replace(/\s{2,}/g, " "), e.replace(Ka, encodeURIComponent);
}
function Wl(e) {
return "data:image/svg+xml;utf8," + zn(e);
}
function Un(e) {
let l = URL.createObjectURL(e);
return Dl.push(l), l;
}
function qn() {
Dl.forEach((e) => {
try {
URL.revokeObjectURL(e);
} catch (l) {
console.error("URL.revokeObjectURL", l);
}
}), Dl = [];
}
function Zl(e) {
if (!e)
return null;
let l = cl(e, "?");
return pt(l, "/");
}
function Qt(e) {
let l = Zl(e);
return l == null || l.indexOf(".") === -1 ? null : pt(l, ".").toLowerCase();
}
function Jl(e) {
let l = Qt(e.name);
return l && Hn.indexOf(l) >= 0 ? Un(e) : mt(e.name);
}
function Xl(e) {
if (!e)
return !1;
if (e.startsWith("blob:") || e.startsWith("data:"))
return !0;
let l = Qt(e);
return l && Hn.indexOf(l) >= 0 || !1;
}
function mt(e) {
if (!e)
return null;
let l = Qt(e);
return l == null || Xl(e) ? e : Bt(l) || Wl(ll.doc);
}
function Bt(e) {
let l = Qn(e);
return l && Wl(l) || null;
}
function Qn(e) {
if (ll[e])
return ll[e];
for (let l = 0; l < Vn.length; l++) {
let t = Vn[l];
if (Nn[t].indexOf(e) >= 0)
return ll[t];
}
return null;
}
function Yl(e, l = 2) {
if (e === 0)
return "0 Bytes";
const t = l < 0 ? 0 : l, a = Math.floor(Math.log(e) / Math.log(Mn));
return parseFloat((e / Math.pow(Mn, a)).toFixed(t)) + " " + Ga[a];
}
function Za(e) {
return e.files && Array.from(e.files).map((l) => ({ fileName: l.name, contentLength: l.size, filePath: Jl(l) }));
}
function hl(e, l) {
e.onerror = null, e.src = en(e.src, l) || "";
}
function en(e, l) {
return Bt(pt(e, ".").toLowerCase()) || (l ? Bt(l) || l : null) || Bt("doc");
}
function Ol(e) {
if (!e)
throw new Error("fileNameOrExt required");
const l = pt(e, ".").toLowerCase();
return Wa[l] || "application/" + l;
}
function Dm() {
return {
extSvg: Qn,
extSrc: Bt,
getExt: Qt,
encodeSvg: zn,
canPreview: Xl,
getFileName: Zl,
getMimeType: Ol,
formatBytes: Yl,
filePathUri: mt,
svgToDataUri: Wl,
fileImageUri: Jl,
objectUrl: Un,
flush: qn,
inputFiles: Za,
iconOnError: hl,
iconFallbackSrc: en
};
}
class Ja {
constructor(l) {
ye(this, "view");
ye(this, "includeTypes");
Object.assign(this, l);
}
getTypeName() {
return "MetadataApp";
}
getMethod() {
return "GET";
}
createResponse() {
return {};
}
}
const Vt = "/metadata/app.json", Xa = {
Boolean: "checkbox",
DateTime: "date",
DateOnly: "date",
DateTimeOffset: "date",
TimeSpan: "time",
TimeOnly: "time",
Byte: "number",
Short: "number",
Int64: "number",
Int32: "number",
UInt16: "number",
UInt32: "number",
UInt64: "number",
Single: "number",
Double: "number",
Decimal: "number",
String: "text",
Guid: "text",
Uri: "text"
}, Ya = {
number: "Int32",
checkbox: "Boolean",
date: "DateTime",
"datetime-local": "DateTime",
time: "TimeSpan"
}, jl = {
Byte: "byte",
Int16: "short",
Int32: "int",
Int64: "long",
UInt16: "ushort",
Unt32: "uint",
UInt64: "ulong",
Single: "float",
Double: "double",
Decimal: "decimal"
};
[...Object.keys(jl), ...Object.values(jl)];
const eo = {
String: "string",
Boolean: "bool",
...jl
};
function Yt(e) {
return eo[e] || e;
}
function Kn(e, l) {
return e ? (l || (l = []), e === "Nullable`1" ? Yt(l[0]) + "?" : e.endsWith("[]") ? `List<${Yt(e.substring(0, e.length - 2))}>` : l.length === 0 ? Yt(e) : cl(Yt(e), "`") + "<" + l.join(",") + ">") : "";
}
function to(e) {
return e && Kn(e.name, e.genericArgs);
}
class Mt {
constructor() {
ye(this, "Query");
ye(this, "QueryInto");
ye(this, "Create");
ye(this, "Update");
ye(this, "Patch");
ye(this, "Delete");
}
get AnyQuery() {
return this.Query || this.QueryInto;
}
get AnyUpdate() {
return this.Patch || this.Update;
}
toArray() {
return [this.Query, this.QueryInto, this.Create, this.Update, this.Patch, this.Delete].filter((t) => !!t).map((t) => t);
}
get empty() {
return !this.Query && !this.QueryInto && !this.Create && !this.Update && !this.Patch && !this.Delete;
}
add(l) {
Te.isQueryInto(l) && !this.QueryInto ? this.QueryInto = l : Te.isQuery(l) && !this.Query ? this.Query = l : Te.isCreate(l) && !this.Create ? this.Create = l : Te.isUpdate(l) && !this.Update ? this.Update = l : Te.isPatch(l) && !this.Patch ? this.Patch = l : Te.isDelete(l) && !this.Delete && (this.Delete = l);
}
static from(l) {
const t = new Mt();
return l.forEach((a) => {
t.add(a);
}), t;
}
static forType(l, t) {
var i;
let a = new Mt();
return l && (t ?? (t = (i = ne.metadata.value) == null ? void 0 : i.api), t == null || t.operations.forEach((r) => {
var d;
((d = r.dataModel) == null ? void 0 : d.name) == l && a.add(r);
})), a;
}
}
const Te = {
Create: "ICreateDb`1",
Update: "IUpdateDb`1",
Patch: "IPatchDb`1",
Delete: "IDeleteDb`1",
AnyRead: ["QueryDb`1", "QueryDb`2"],
AnyWrite: ["ICreateDb`1", "IUpdateDb`1", "IPatchDb`1", "IDeleteDb`1"],
isAnyQuery: (e) => De(e.request.inherits, (l) => Te.AnyRead.indexOf(l.name) >= 0),
isQuery: (e) => De(e.request.inherits, (l) => l.name === "QueryDb`1"),
isQueryInto: (e) => De(e.request.inherits, (l) => l.name === "QueryDb`2"),
isCrud: (e) => {
var l;
return (l = e.request.implements) == null ? void 0 : l.some((t) => Te.AnyWrite.indexOf(t.name) >= 0);
},
isCreate: (e) => el(e, Te.Create),
isUpdate: (e) => el(e, Te.Update),
isPatch: (e) => el(e, Te.Patch),
isDelete: (e) => el(e, Te.Delete),
model: (e) => {
var l, t, a;
return e ? De(e.inherits, (i) => Te.AnyRead.indexOf(i.name) >= 0) ? (l = e.inherits) == null ? void 0 : l.genericArgs[0] : (a = (t = e.implements) == null ? void 0 : t.find((i) => Te.AnyWrite.indexOf(i.name) >= 0)) == null ? void 0 : a.genericArgs[0] : null;
}
};
function lo(e) {
var l;
return ((l = e.input) == null ? void 0 : l.type) || gl(tn(e));
}
function Gn(e) {
return e.endsWith("?") ? Xs(e, 1) : e;
}
function gl(e) {
return Xa[Gn(e)];
}
function no(e) {
return e && Ya[e] || "String";
}
function tn(e) {
return e.type === "Nullable`1" ? e.genericArgs[0] : e.type;
}
function Bl(e) {
return e && gl(e) == "number" || !1;
}
function Wn(e) {
return e && e.toLowerCase() == "string" || !1;
}
function so(e) {
return e == "List`1" || e.startsWith("List<") || e.endsWith("[]");
}
function Zn(e) {
if (!(e != null && e.type))
return !1;
const l = tn(e);
return e.isValueType && l.indexOf("`") == -1 || e.isEnum ? !1 : gl(e.type) == null;
}
function Jn(e) {
var t, a, i;
if (!(e != null && e.type))
return !1;
const l = tn(e);
return e.isValueType && l.indexOf("`") == -1 || e.isEnum || ((t = e.input) == null ? void 0 : t.type) == "file" || ((a = e.input) == null ? void 0 : a.type) == "tag" || ((i = e.input) == null ? void 0 : i.type) == "combobox" ? !0 : gl(e.type) != null;
}
function Ht(e, l) {
let t = typeof e == "string" ? pl(e) : e;
t || (console.warn(`Metadata not found for: ${e}`), t = { request: { name: e } });
let a = function() {
return function(r) {
Object.assign(this, r);
};
}(), i = function() {
function r(d) {
Object.assign(this, d);
}
return r.prototype.createResponse = function() {
return t.returnsVoid ? void 0 : new a();
}, r.prototype.getTypeName = function() {
return t.request.name;
}, r.prototype.getMethod = function() {
return t.method || "POST";
}, r;
}();
return new i(l);
}
function ao(e, l, t = {}) {
let a = function() {
return function(r) {
Object.assign(this, r);
};
}(), i = function() {
function r(d) {
Object.assign(this, d);
}
return r.prototype.createResponse = function() {
return typeof t.createResponse == "function" ? t.createResponse() : new a();
}, r.prototype.getTypeName = function() {
return e;
}, r.prototype.getMethod = function() {
return t.method || "POST";
}, r;
}();
return new i(l);
}
function nl(e, l) {
return e ? (Object.keys(e).forEach((t) => {
let a = e[t];
typeof a == "string" && a.startsWith("/Date") && (e[t] = ml(bt(a)));
}), e) : {};
}
function oo(e, l) {
let t = {};
return Array.from(e.elements).forEach((a) => {
var g;
let i = a;
if (!i.id || i.value == null || i.value === "")
return;
const r = i.id.toLowerCase(), d = l && l.find((p) => p.name.toLowerCase() == r);
let v = d == null ? void 0 : d.type, f = (g = d == null ? void 0 : d.genericArgs) == null ? void 0 : g[0], m = i.type === "checkbox" ? i.checked : i.value;
Bl(v) ? m = Number(m) : v === "List`1" && typeof m == "string" && (m = m.split(",").map((p) => Bl(f) ? Number(p) : p)), t[i.id] = m;
}), t;
}
function ln(e) {
var l;
return ((l = e == null ? void 0 : e.api) == null ? void 0 : l.operations) && e.api.operations.length > 0;
}
function io(e) {
if (e != null && e.assert && !ne.metadata.value)
throw new Error("useMetadata() not configured, see: https://docs.servicestack.net/vue/use-metadata");
return ne.metadata.value;
}
function Nt(e) {
return e && ln(e) ? (e.date = Zs(new Date()), ne.metadata.value = e, typeof localStorage < "u" && localStorage.setItem(Vt, JSON.stringify(e)), !0) : !1;
}
function ro() {
ne.metadata.value = null, typeof localStorage < "u" && localStorage.removeItem(Vt);
}
function Xn() {
if (ne.metadata.value != null)
return !0;
let e = globalThis.Server;
if (ln(e))
Nt(e);
else {
const l = typeof localStorage < "u" ? localStorage.getItem(Vt) : null;
if (l)
try {
Nt(JSON.parse(l));
} catch {
console.error(`Could not JSON.parse ${Vt} from localStorage`);
}
}
return ne.metadata.value != null;
}
async function Sn(e, l) {
let t = l ? await l() : await fetch(e);
if (t.ok) {
let a = await t.text();
Nt(JSON.parse(a));
} else
console.error(`Could not download ${l ? "AppMetadata" : e}: ${t.statusText}`);
ln(ne.metadata.value) || console.warn("AppMetadata is not available");
}
async function uo(e) {
var r;
const { olderThan: l, resolvePath: t, resolve: a } = e || {};
let i = Xn() && l !== 0;
if (i && l) {
let d = bt((r = ne.metadata.value) == null ? void 0 : r.date);
(!d || new Date().getTime() - d.getTime() > l) && (i = !1);
}
if (!i) {
if ((t || a) && await Sn(t || Vt, a), ne.metadata.value != null)
return;
const d = Oe("client");
if (d != null) {
const v = await d.api(new Ja());
v.succeeded && Nt(v.response);
}
if (ne.metadata.value != null)
return;
await Sn(Vt);
}
return ne.metadata.value;
}
function it(e, l) {
var d;
let t = (d = ne.metadata.value) == null ? void 0 : d.api;
if (!t || !e)
return null;
let a = t.types.find((v) => v.name.toLowerCase() === e.toLowerCase() && (!l || v.namespace == l));
if (a)
return a;
let i = pl(e);
if (i)
return i.request;
let r = t.operations.find((v) => v.response && v.response.name.toLowerCase() === e.toLowerCase() && (!l || v.response.namespace == l));
return r ? r.response : null;
}
function pl(e) {
var a;
let l = (a = ne.metadata.value) == null ? void 0 : a.api;
return l ? l.operations.find((i) => i.request.name.toLowerCase() === e.toLowerCase()) : null;
}
function co({ dataModel: e }) {
var a;
const l = (a = ne.metadata.value) == null ? void 0 : a.api;
if (!l)
return [];
let t = l.operations;
if (e) {
const i = typeof e == "string" ? it(e) : e;
t = t.filter((r) => Yn(r.dataModel, i));
}
return t;
}
function nn(e) {
return e ? it(e.name, e.namespace) : null;
}
function Yn(e, l) {
return e && l && e.name === l.name && (!e.namespace || !l.namespace || e.namespace === l.namespace);
}
function fo(e, l) {
let t = it(e);
return t && t.properties && t.properties.find((i) => i.name.toLowerCase() === l.toLowerCase());
}
function es(e) {
return ts(it(e));
}
function ts(e) {
if (e && e.isEnum && e.enumNames != null) {
let l = {};
for (let t = 0; t < e.enumNames.length; t++) {
const a = (e.enumDescriptions ? e.enumDescriptions[t] : null) || e.enumNames[t], i = (e.enumValues != null ? e.enumValues[t] : null) || e.enumNames[t];
l[i] = a;
}
return l;
}
return null;
}
function ls(e) {
if (!e)
return null;
let l = {}, t = e.input && e.input.allowableEntries;
if (t) {
for (let i = 0; i < t.length; i++) {
let r = t[i];
l[r.key] = r.value;
}
return l;
}
let a = e.allowableValues || (e.input ? e.input.allowableValues : null);
if (a) {
for (let i = 0; i < a.length; i++) {
let r = a[i];
l[r] = r;
}
return l;
}
if (e.isEnum) {
const i = e.genericArgs && e.genericArgs.length == 1 ? e.genericArgs[0] : e.type, r = it(i);
if (r)
return ts(r);
}
return null;
}
function sn(e) {
if (!e)
return;
const l = [];
return Object.keys(e).forEach((t) => l.push({ key: t, value: e[t] })), l;
}
function mo(e, l) {
const a = ((i, r) => Object.assign({
id: i,
name: i,
type: r
}, l))(e.name, (l == null ? void 0 : l.type) || lo(e) || "text");
return e.isEnum && (a.type = "select", a.allowableEntries = sn(ls(e))), a;
}
function vo(e) {
let l = [];
if (e) {
const t = Ke(e), a = pl(e.name), i = nn(a == null ? void 0 : a.dataModel);
t.forEach((r) => {
var v, f, m;
if (!Jn(r))
return;
const d = mo(r, r.input);
if (d.id = Js(d.id), d.type == "file" && r.uploadTo && !d.accept) {
const g = (f = (v = ne.metadata.value) == null ? void 0 : v.plugins.filesUpload) == null ? void 0 : f.locations.find((p) => p.name == r.uploadTo);
g && !d.accept && g.allowExtensions && (d.accept = g.allowExtensions.map((p) => p.startsWith(".") ? p : `.${p}`).join(","));
}
if (i) {
const g = (m = i.properties) == null ? void 0 : m.find((p) => p.name == r.name);
r.ref || (r.ref = g == null ? void 0 : g.ref);
}
if (d.options)
try {
const g = {
$typeFields: t.map((h) => h.name),
$dataModelFields: i ? Ke(i).map((h) => h.name) : []
}, p = Ql(d.options, g);
Object.keys(p).forEach((h) => {
d[h] = p[h];
});
} catch {
console.error(`failed to evaluate '${d.options}'`);
}
l.push(d);
});
}
return l;
}
function Ke(e) {
if (!e)
return [];
let l = [], t = {};
function a(i) {
i.forEach((r) => {
t[r.name] || (t[r.name] = 1, l.push(r));
});
}
for (; e; )
e.properties && a(e.properties), e = e.inherits ? nn(e.inherits) : null;
return l.map((i) => i.type.endsWith("[]") ? { ...i, type: "List`1", genericArgs: [i.type.substring(0, i.type.length - 2)] } : i);
}
function el(e, l) {
var t;
return ((t = e.request.implements) == null ? void 0 : t.some((a) => a.name === l)) || !1;
}
function Kt(e) {
return e ? ns(e, Ke(e)) : null;
}
function ns(e, l) {
let t = l.find((r) => r.name.toLowerCase() === "id");
if (t && t.isPrimaryKey)
return t;
let i = l.find((r) => r.isPrimaryKey) || t;
if (!i) {
let r = Te.model(e);
if (r)
return De(it(r), (d) => Kt(d));
console.error(`Primary Key not found in ${e.name}`);
}
return i || null;
}
function ho(e, l) {
return De(Kt(e), (t) => ce(l, t.name));
}
function ss(e, l, t) {
return e && e.valueType === "none" ? "" : t.key === "%In" || t.key === "%Between" ? `(${t.value})` : go(l, t.value);