@golemui/core 1.5.1 → 1.6.0-rc.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/CHANGELOG.md +20 -0
- package/index.js +824 -769
- package/index.umd.cjs +6 -6
- package/lib/store/model.d.ts +23 -0
- package/lib/utils/repeater.d.ts +25 -17
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { BehaviorSubject as
|
|
2
|
-
import { Decoder as
|
|
1
|
+
import { BehaviorSubject as lr, distinctUntilChanged as Ne, Subject as ot, pipe as ar, map as Et } from "rxjs";
|
|
2
|
+
import { Decoder as me, err as x, ok as Ve, object as Z, array as Le, string as w, oneOf as b, boolean as fr, optional as y, succeed as _, number as ge, literal as z, lazy as wt, discriminatedUnion as pr, record as hr, formatIssuePath as mr } from "ts.data.json";
|
|
3
3
|
import "@standard-schema/spec";
|
|
4
|
-
function
|
|
4
|
+
function gr(e, t) {
|
|
5
5
|
const r = e["~standard"].validate(t);
|
|
6
6
|
if (r instanceof Promise)
|
|
7
7
|
throw new TypeError("Schema validation must be synchronous");
|
|
8
8
|
return r;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function yr(e) {
|
|
11
11
|
return e.issues === void 0;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return new
|
|
13
|
+
function Y(e) {
|
|
14
|
+
return new me((t) => {
|
|
15
15
|
if (typeof t != "object" || t === null)
|
|
16
|
-
return
|
|
16
|
+
return x([{ message: `Expected object literal, got "${typeof t}"`, path: [] }]);
|
|
17
17
|
const r = {};
|
|
18
18
|
for (const [n, o] of Object.entries(e)) {
|
|
19
19
|
const i = o.decoder.decode(t[n]);
|
|
20
20
|
if (!i.isOk())
|
|
21
|
-
return
|
|
21
|
+
return x(
|
|
22
22
|
i.issues.map((s) => ({
|
|
23
23
|
message: s.message,
|
|
24
24
|
path: [n, ...s.path]
|
|
@@ -27,60 +27,60 @@ function J(e) {
|
|
|
27
27
|
if (r[n] = i.value, o.suffixed) {
|
|
28
28
|
for (const [s, c] of Object.entries(t))
|
|
29
29
|
if (s.startsWith(n + ".")) {
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
32
|
-
return
|
|
33
|
-
|
|
30
|
+
const d = o.decoder.decode(c);
|
|
31
|
+
if (!d.isOk())
|
|
32
|
+
return x(
|
|
33
|
+
d.issues.map((l) => ({
|
|
34
34
|
message: l.message,
|
|
35
35
|
path: [s, ...l.path]
|
|
36
36
|
}))
|
|
37
37
|
);
|
|
38
|
-
r[s] =
|
|
38
|
+
r[s] = d.value;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
return Ve(r);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const vr = (e) => typeof e != "function" && e.kind === "display", ie = (e) => typeof e != "function" && e.kind === "action", I = (e) => typeof e != "function" && e.kind === "input", M = (e) => typeof e != "function" && e.kind === "layout", W = (e) => typeof e == "function", $r = Z({ in: Le(w()) }), _e = Z({ when: w() }), ye = b([$r, _e]), Sr = Z({ from: Le(w()) }), ve = b([Sr, _e]), Pe = b([fr(), _e]), Ar = new me((e) => {
|
|
46
46
|
const t = typeof e;
|
|
47
|
-
return t === "function" ? Ve(e) :
|
|
48
|
-
}), D = (e) =>
|
|
49
|
-
load: { suffixed: !0, decoder: D(y(
|
|
50
|
-
click: { suffixed: !0, decoder: D(y(
|
|
51
|
-
change: { suffixed: !0, decoder: D(y(
|
|
52
|
-
filter: { suffixed: !0, decoder: D(y(
|
|
53
|
-
blur: { suffixed: !0, decoder: D(y(
|
|
54
|
-
}),
|
|
55
|
-
key:
|
|
56
|
-
default: y(
|
|
57
|
-
params: y(
|
|
58
|
-
}), Ct =
|
|
59
|
-
kind: { decoder:
|
|
60
|
-
uid: { decoder:
|
|
61
|
-
type: { decoder:
|
|
62
|
-
size: { suffixed: !0, decoder: y(
|
|
63
|
-
include: { decoder: y(
|
|
64
|
-
exclude: { decoder: y(
|
|
65
|
-
props: { decoder: y(
|
|
66
|
-
}),
|
|
67
|
-
kind: { decoder:
|
|
68
|
-
uid: { decoder:
|
|
69
|
-
type: { decoder:
|
|
47
|
+
return t === "function" ? Ve(e) : x([{ message: `Expected a function, got '${t}'`, path: [] }]);
|
|
48
|
+
}), D = (e) => b([e, Ar]), Me = Y({
|
|
49
|
+
load: { suffixed: !0, decoder: D(y(w())) },
|
|
50
|
+
click: { suffixed: !0, decoder: D(y(w())) },
|
|
51
|
+
change: { suffixed: !0, decoder: D(y(w())) },
|
|
52
|
+
filter: { suffixed: !0, decoder: D(y(w())) },
|
|
53
|
+
blur: { suffixed: !0, decoder: D(y(w())) }
|
|
54
|
+
}), Er = Z({
|
|
55
|
+
key: w(),
|
|
56
|
+
default: y(w()),
|
|
57
|
+
params: y(_())
|
|
58
|
+
}), Ct = b([w(), Er]), Ue = y(w()), wr = Y({
|
|
59
|
+
kind: { decoder: z("display") },
|
|
60
|
+
uid: { decoder: Ue },
|
|
61
|
+
type: { decoder: w() },
|
|
62
|
+
size: { suffixed: !0, decoder: y(ge()) },
|
|
63
|
+
include: { decoder: y(ye) },
|
|
64
|
+
exclude: { decoder: y(ve) },
|
|
65
|
+
props: { decoder: y(_()) }
|
|
66
|
+
}), Cr = Y({
|
|
67
|
+
kind: { decoder: z("action") },
|
|
68
|
+
uid: { decoder: Ue },
|
|
69
|
+
type: { decoder: w() },
|
|
70
70
|
actionType: {
|
|
71
|
-
decoder: y(
|
|
71
|
+
decoder: y(b([z("button"), z("submit")]))
|
|
72
72
|
},
|
|
73
|
-
size: { suffixed: !0, decoder: y(
|
|
74
|
-
include: { decoder: y(
|
|
75
|
-
exclude: { decoder: y(
|
|
73
|
+
size: { suffixed: !0, decoder: y(ge()) },
|
|
74
|
+
include: { decoder: y(ye) },
|
|
75
|
+
exclude: { decoder: y(ve) },
|
|
76
76
|
label: {
|
|
77
77
|
suffixed: !0,
|
|
78
78
|
decoder: D(y(Ct))
|
|
79
79
|
},
|
|
80
|
-
disabled: { suffixed: !0, decoder: y(
|
|
81
|
-
on: { decoder: y(
|
|
82
|
-
props: { decoder: y(
|
|
83
|
-
}),
|
|
80
|
+
disabled: { suffixed: !0, decoder: y(Pe) },
|
|
81
|
+
on: { decoder: y(Me) },
|
|
82
|
+
props: { decoder: y(_()) }
|
|
83
|
+
}), Ir = new me((e) => {
|
|
84
84
|
const t = typeof e;
|
|
85
85
|
if (t === "function") {
|
|
86
86
|
const r = e, n = r({
|
|
@@ -91,56 +91,56 @@ const gr = (e) => typeof e != "function" && e.kind === "display", oe = (e) => ty
|
|
|
91
91
|
});
|
|
92
92
|
return r.uid = r.uid || n.uid, r.type = n.type, r.path = n.path, Ve(r);
|
|
93
93
|
} else
|
|
94
|
-
return
|
|
95
|
-
}),
|
|
96
|
-
kind: { decoder:
|
|
97
|
-
uid: { decoder: y(
|
|
98
|
-
type: { decoder:
|
|
99
|
-
size: { suffixed: !0, decoder: y(
|
|
100
|
-
include: { decoder: y(
|
|
101
|
-
exclude: { decoder: y(
|
|
102
|
-
disabled: { suffixed: !0, decoder: y(
|
|
103
|
-
readonly: { suffixed: !0, decoder: y(
|
|
104
|
-
on: { decoder: y(
|
|
105
|
-
props: { decoder: y(
|
|
94
|
+
return x([{ message: `Expected a function, got '${t}'`, path: [] }]);
|
|
95
|
+
}), Or = Y({
|
|
96
|
+
kind: { decoder: z("input") },
|
|
97
|
+
uid: { decoder: y(w()) },
|
|
98
|
+
type: { decoder: w() },
|
|
99
|
+
size: { suffixed: !0, decoder: y(ge()) },
|
|
100
|
+
include: { decoder: y(ye) },
|
|
101
|
+
exclude: { decoder: y(ve) },
|
|
102
|
+
disabled: { suffixed: !0, decoder: y(Pe) },
|
|
103
|
+
readonly: { suffixed: !0, decoder: y(Pe) },
|
|
104
|
+
on: { decoder: y(Me) },
|
|
105
|
+
props: { decoder: y(_()) },
|
|
106
106
|
label: {
|
|
107
107
|
suffixed: !0,
|
|
108
108
|
decoder: D(y(Ct))
|
|
109
109
|
},
|
|
110
|
-
path: { decoder:
|
|
111
|
-
defaultValue: { decoder: y(
|
|
110
|
+
path: { decoder: w() },
|
|
111
|
+
defaultValue: { decoder: y(_()) },
|
|
112
112
|
validator: {
|
|
113
113
|
suffixed: !0,
|
|
114
|
-
decoder: D(y(
|
|
114
|
+
decoder: D(y(_()))
|
|
115
115
|
}
|
|
116
116
|
}).map((e) => {
|
|
117
117
|
const t = { ...e };
|
|
118
118
|
if (e.uid || (t.uid = `${e.path}-${e.type}`), e.type === "repeater") {
|
|
119
119
|
const r = e.props;
|
|
120
|
-
t.props = { ...r, template:
|
|
120
|
+
t.props = { ...r, template: He.parse(r.template) };
|
|
121
121
|
}
|
|
122
122
|
return t;
|
|
123
|
-
}),
|
|
124
|
-
const e =
|
|
125
|
-
input:
|
|
126
|
-
layout:
|
|
127
|
-
display:
|
|
128
|
-
action:
|
|
123
|
+
}), Pr = wt(() => {
|
|
124
|
+
const e = pr("kind", {
|
|
125
|
+
input: Or,
|
|
126
|
+
layout: He,
|
|
127
|
+
display: wr,
|
|
128
|
+
action: Cr
|
|
129
129
|
});
|
|
130
|
-
return new
|
|
131
|
-
(t) => typeof t == "function" ?
|
|
130
|
+
return new me(
|
|
131
|
+
(t) => typeof t == "function" ? Ir.decode(t) : e.decode(t)
|
|
132
132
|
);
|
|
133
|
-
}),
|
|
134
|
-
kind: { decoder:
|
|
135
|
-
uid: { decoder:
|
|
136
|
-
type: { decoder:
|
|
137
|
-
size: { suffixed: !0, decoder: y(
|
|
138
|
-
include: { decoder: y(
|
|
139
|
-
exclude: { decoder: y(
|
|
140
|
-
props: { decoder: y(
|
|
141
|
-
on: { decoder: y(
|
|
142
|
-
children: { decoder:
|
|
143
|
-
}),
|
|
133
|
+
}), He = Y({
|
|
134
|
+
kind: { decoder: z("layout") },
|
|
135
|
+
uid: { decoder: Ue },
|
|
136
|
+
type: { decoder: w() },
|
|
137
|
+
size: { suffixed: !0, decoder: y(ge()) },
|
|
138
|
+
include: { decoder: y(ye) },
|
|
139
|
+
exclude: { decoder: y(ve) },
|
|
140
|
+
props: { decoder: y(_()) },
|
|
141
|
+
on: { decoder: y(Me) },
|
|
142
|
+
children: { decoder: Le(Pr) }
|
|
143
|
+
}), k = class k {
|
|
144
144
|
constructor() {
|
|
145
145
|
this.widgetLoaders = {}, this._ready = !1;
|
|
146
146
|
}
|
|
@@ -155,11 +155,11 @@ const gr = (e) => typeof e != "function" && e.kind === "display", oe = (e) => ty
|
|
|
155
155
|
}
|
|
156
156
|
async loadWidget(t) {
|
|
157
157
|
const r = this.widgetLoaders[t];
|
|
158
|
-
if (!
|
|
159
|
-
const n = r().catch((o) => (
|
|
160
|
-
|
|
158
|
+
if (!k.sharedCache.has(r)) {
|
|
159
|
+
const n = r().catch((o) => (k.sharedCache.delete(r), Promise.reject(o)));
|
|
160
|
+
k.sharedCache.set(r, n);
|
|
161
161
|
}
|
|
162
|
-
return
|
|
162
|
+
return k.sharedCache.get(r);
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Loads the given widget types (default: every configured type) and stores each
|
|
@@ -171,7 +171,7 @@ const gr = (e) => typeof e != "function" && e.kind === "display", oe = (e) => ty
|
|
|
171
171
|
await Promise.all(
|
|
172
172
|
r.map(async (n) => {
|
|
173
173
|
const o = await this.loadWidget(n);
|
|
174
|
-
|
|
174
|
+
k.resolvedCache.set(this.widgetLoaders[n], o);
|
|
175
175
|
})
|
|
176
176
|
);
|
|
177
177
|
}
|
|
@@ -182,31 +182,31 @@ const gr = (e) => typeof e != "function" && e.kind === "display", oe = (e) => ty
|
|
|
182
182
|
getIfLoaded(t) {
|
|
183
183
|
const r = this.widgetLoaders[t];
|
|
184
184
|
if (r)
|
|
185
|
-
return
|
|
185
|
+
return k.resolvedCache.get(r);
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
|
-
|
|
189
|
-
let
|
|
190
|
-
async function
|
|
191
|
-
const t = new
|
|
188
|
+
k.sharedCache = /* @__PURE__ */ new Map(), k.resolvedCache = /* @__PURE__ */ new Map();
|
|
189
|
+
let se = k;
|
|
190
|
+
async function si(e) {
|
|
191
|
+
const t = new se();
|
|
192
192
|
t.setWidgetLoaders(e.widgetLoaders), await t.preloadWidgets();
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function jr(e) {
|
|
195
195
|
je(e, "#0");
|
|
196
196
|
}
|
|
197
197
|
function je(e, t) {
|
|
198
|
-
if (
|
|
198
|
+
if (W(e)) {
|
|
199
199
|
e.uid || (e.uid = `${t}.f`);
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
if (e.uid || (e.uid = t),
|
|
202
|
+
if (e.uid || (e.uid = t), M(e) && e.children.forEach((r, n) => {
|
|
203
203
|
je(r, `${t}.${n}`);
|
|
204
204
|
}), I(e) && e.type === "repeater") {
|
|
205
205
|
const r = e.props?.template;
|
|
206
206
|
r && je(r, `${t}.t`);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function ci(e) {
|
|
210
210
|
return {
|
|
211
211
|
...e,
|
|
212
212
|
form: {
|
|
@@ -217,12 +217,12 @@ function ei(e) {
|
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
-
const
|
|
221
|
-
states: y(
|
|
222
|
-
form:
|
|
223
|
-
}).map((e) => (
|
|
220
|
+
const It = Z({
|
|
221
|
+
states: y(hr(w())),
|
|
222
|
+
form: wt(() => He)
|
|
223
|
+
}).map((e) => (jr(e.form), e)), Ot = (e) => ({
|
|
224
224
|
formName: "",
|
|
225
|
-
formDef:
|
|
225
|
+
formDef: It.parse({
|
|
226
226
|
form: {
|
|
227
227
|
kind: "layout",
|
|
228
228
|
type: "flex",
|
|
@@ -239,6 +239,7 @@ const wt = q({
|
|
|
239
239
|
isFormValid: !0,
|
|
240
240
|
widgetFlags: {},
|
|
241
241
|
repeaterItemScopes: {},
|
|
242
|
+
repeaterRows: {},
|
|
242
243
|
widgetPropOverrides: {},
|
|
243
244
|
data: {},
|
|
244
245
|
meta: {},
|
|
@@ -246,16 +247,16 @@ const wt = q({
|
|
|
246
247
|
touched: !1,
|
|
247
248
|
allControlsValidated: !1,
|
|
248
249
|
lang: e
|
|
249
|
-
}),
|
|
250
|
+
}), di = {
|
|
250
251
|
submit: "formSubmit",
|
|
251
252
|
health: "formHealth",
|
|
252
253
|
event: "formEvent"
|
|
253
254
|
}, kr = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
|
|
254
|
-
function
|
|
255
|
+
function ui(e) {
|
|
255
256
|
const t = new Intl.Locale(e).maximize().script;
|
|
256
257
|
return ["Arab", "Hebr", "Thaa", "Syrc", "Tfng", "Adlm", "Rohg"].includes(t || "") ? "rtl" : "ltr";
|
|
257
258
|
}
|
|
258
|
-
const
|
|
259
|
+
const Wr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
|
|
259
260
|
const t = /* @__PURE__ */ new Set();
|
|
260
261
|
return {
|
|
261
262
|
get lang() {
|
|
@@ -273,7 +274,7 @@ const jr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
|
|
|
273
274
|
e = n, t.forEach((o) => o(e));
|
|
274
275
|
}
|
|
275
276
|
};
|
|
276
|
-
},
|
|
277
|
+
}, P = {
|
|
277
278
|
calculateCurrentStateError: 10,
|
|
278
279
|
calculateWidgetFlagsError: 11,
|
|
279
280
|
calculateWidgetPropsError: 12,
|
|
@@ -283,13 +284,13 @@ const jr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
|
|
|
283
284
|
initializeMalformedFormShapeError: 23,
|
|
284
285
|
widgetCouldNotBeLoaded: 30,
|
|
285
286
|
resolveStringInterpolationError: 40
|
|
286
|
-
},
|
|
287
|
+
}, Dr = (e) => {
|
|
287
288
|
throw new Error(`Unhandled case: ${JSON.stringify(e)}`);
|
|
288
|
-
},
|
|
289
|
+
}, N = (e, t) => {
|
|
289
290
|
if (e === void 0)
|
|
290
291
|
throw new Error("obj is undefined");
|
|
291
292
|
return t.split(".").reduce((r, n) => r === void 0 || n === "" ? r : Array.isArray(r) ? r[parseInt(n, 10)] : r[n], e);
|
|
292
|
-
},
|
|
293
|
+
}, Fr = (e, t) => {
|
|
293
294
|
if (t === "")
|
|
294
295
|
return !1;
|
|
295
296
|
let r = e;
|
|
@@ -308,7 +309,7 @@ const jr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
|
|
|
308
309
|
}
|
|
309
310
|
}
|
|
310
311
|
return !0;
|
|
311
|
-
},
|
|
312
|
+
}, ke = (e, t, r) => {
|
|
312
313
|
if (e === null)
|
|
313
314
|
throw new Error("object is null");
|
|
314
315
|
if (e === void 0)
|
|
@@ -318,26 +319,26 @@ const jr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
|
|
|
318
319
|
const n = t.split(".");
|
|
319
320
|
let o = e;
|
|
320
321
|
for (let s = 0; s < n.length - 1; s++) {
|
|
321
|
-
const c = n[s],
|
|
322
|
-
(o[c] == null || typeof o[c] != "object") && (o[c] =
|
|
322
|
+
const c = n[s], d = n[s + 1];
|
|
323
|
+
(o[c] == null || typeof o[c] != "object") && (o[c] = jt(d) ? [] : {}), o = o[c];
|
|
323
324
|
}
|
|
324
325
|
const i = n[n.length - 1];
|
|
325
326
|
return o[i] = r, e;
|
|
326
|
-
},
|
|
327
|
+
}, Pt = (e, t, r) => {
|
|
327
328
|
if (e === null)
|
|
328
329
|
throw new Error("object is null");
|
|
329
330
|
if (e === void 0)
|
|
330
331
|
throw new Error("object is undefined");
|
|
331
332
|
if (t === "")
|
|
332
333
|
throw new Error("path cannot be empty");
|
|
333
|
-
const n = t.split("."), o =
|
|
334
|
+
const n = t.split("."), o = it(e);
|
|
334
335
|
let i = o;
|
|
335
336
|
for (let s = 0; s < n.length - 1; s++) {
|
|
336
|
-
const c = n[s],
|
|
337
|
-
i[c] == null || typeof i[c] != "object" ? i[c] =
|
|
337
|
+
const c = n[s], d = n[s + 1];
|
|
338
|
+
i[c] == null || typeof i[c] != "object" ? i[c] = jt(d) ? [] : {} : i[c] = it(i[c]), i = i[c];
|
|
338
339
|
}
|
|
339
340
|
return i[n[n.length - 1]] = r, o;
|
|
340
|
-
},
|
|
341
|
+
}, it = (e) => Array.isArray(e) ? e.slice() : { ...e }, Rr = (e, t) => {
|
|
341
342
|
if (t === "")
|
|
342
343
|
return e;
|
|
343
344
|
const r = t.split("."), n = [e];
|
|
@@ -345,7 +346,7 @@ const jr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
|
|
|
345
346
|
const c = n[s];
|
|
346
347
|
if (c == null || typeof c != "object")
|
|
347
348
|
return e;
|
|
348
|
-
const
|
|
349
|
+
const d = r[s], l = Array.isArray(c) ? c[parseInt(d, 10)] : c[d];
|
|
349
350
|
if (l == null || typeof l != "object")
|
|
350
351
|
return e;
|
|
351
352
|
n.push(l);
|
|
@@ -354,88 +355,92 @@ const jr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
|
|
|
354
355
|
Array.isArray(o) ? o.splice(parseInt(i, 10), 1) : delete o[i];
|
|
355
356
|
for (let s = n.length - 1; s >= 1; s--) {
|
|
356
357
|
const c = n[s];
|
|
357
|
-
if (Array.isArray(c) || !
|
|
358
|
+
if (Array.isArray(c) || !Tr(c))
|
|
358
359
|
break;
|
|
359
|
-
const
|
|
360
|
-
if (Array.isArray(
|
|
360
|
+
const d = n[s - 1], l = r[s - 1];
|
|
361
|
+
if (Array.isArray(d))
|
|
361
362
|
break;
|
|
362
|
-
delete
|
|
363
|
+
delete d[l];
|
|
363
364
|
}
|
|
364
365
|
return e;
|
|
365
366
|
};
|
|
366
|
-
function
|
|
367
|
+
function jt(e) {
|
|
367
368
|
const t = Number(e);
|
|
368
369
|
return Number.isInteger(t) && t >= 0 && t.toString() === e;
|
|
369
370
|
}
|
|
370
|
-
function
|
|
371
|
+
function Tr(e) {
|
|
371
372
|
return e != null && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0;
|
|
372
373
|
}
|
|
373
|
-
function
|
|
374
|
+
function ce(e) {
|
|
374
375
|
if (e === null || typeof e != "object")
|
|
375
376
|
return e;
|
|
376
377
|
if (Array.isArray(e))
|
|
377
|
-
return e.map((r) =>
|
|
378
|
+
return e.map((r) => ce(r));
|
|
378
379
|
const t = {};
|
|
379
380
|
for (const r of Object.keys(e))
|
|
380
|
-
t[r] =
|
|
381
|
+
t[r] = ce(e[r]);
|
|
381
382
|
return t;
|
|
382
383
|
}
|
|
383
|
-
function
|
|
384
|
+
function ze(e) {
|
|
384
385
|
return e.flatMap((t) => [
|
|
385
386
|
t,
|
|
386
|
-
...
|
|
387
|
+
...M(t) ? ze(t.children) : []
|
|
387
388
|
]);
|
|
388
389
|
}
|
|
389
|
-
function
|
|
390
|
+
function $e(e) {
|
|
390
391
|
return Object.entries(e.validations).sort(
|
|
391
392
|
([n], [o]) => n.split(".").length - o.split(".").length
|
|
392
393
|
).reduce(
|
|
393
|
-
(n, [o, i]) => (i !== null && (n.$formIsInvalid = !0,
|
|
394
|
+
(n, [o, i]) => (i !== null && (n.$formIsInvalid = !0, ke(n.$errors, o, [...i])), n),
|
|
394
395
|
{ $formIsInvalid: !1, $errors: {} }
|
|
395
396
|
);
|
|
396
397
|
}
|
|
397
|
-
function
|
|
398
|
+
function R(e) {
|
|
398
399
|
if (e !== void 0)
|
|
399
|
-
return I(e) ||
|
|
400
|
+
return I(e) || W(e) ? e.path : void 0;
|
|
400
401
|
}
|
|
401
|
-
function
|
|
402
|
-
const t =
|
|
402
|
+
function Ce(e) {
|
|
403
|
+
const t = ce(e.data);
|
|
403
404
|
for (const [r, n] of Object.entries(e.widgetFlags))
|
|
404
405
|
if (n.hidden === !0) {
|
|
405
|
-
const o =
|
|
406
|
-
o !== void 0 &&
|
|
406
|
+
const o = R(e.resolvedSources[r]);
|
|
407
|
+
o !== void 0 && Rr(t, o);
|
|
407
408
|
}
|
|
408
409
|
return t;
|
|
409
410
|
}
|
|
410
|
-
const
|
|
411
|
-
function
|
|
412
|
-
const r = {
|
|
411
|
+
const X = (e) => !W(e) && e.type === "repeater", Se = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((t) => parseInt(t[1], 10)), We = "items";
|
|
412
|
+
function De(e, t) {
|
|
413
|
+
const r = {
|
|
414
|
+
resolvedSources: {},
|
|
415
|
+
repeaterItemScopes: {},
|
|
416
|
+
repeaterRows: {}
|
|
417
|
+
};
|
|
413
418
|
for (const n of Object.values(e))
|
|
414
|
-
r.resolvedSources[n.uid] = n,
|
|
419
|
+
r.resolvedSources[n.uid] = n, X(n) && kt(n, n.path, [], t, r);
|
|
415
420
|
return r;
|
|
416
421
|
}
|
|
417
|
-
function
|
|
418
|
-
const
|
|
419
|
-
if (!Array.isArray(
|
|
422
|
+
function kt(e, t, r, n, o) {
|
|
423
|
+
const i = N(n, e.path);
|
|
424
|
+
if (!Array.isArray(i))
|
|
420
425
|
return;
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
index:
|
|
426
|
-
};
|
|
427
|
-
for (const
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
|
|
426
|
+
const s = ze([e.props.template]);
|
|
427
|
+
i.forEach((c, d) => {
|
|
428
|
+
const l = `${e.path}.${d}`, a = [
|
|
429
|
+
...r,
|
|
430
|
+
{ declaredItemPath: `${t}.${We}`, itemPath: l, index: d }
|
|
431
|
+
], p = { itemPath: l, index: d };
|
|
432
|
+
for (const g of s) {
|
|
433
|
+
const A = Wt(g, a);
|
|
434
|
+
o.resolvedSources[A.uid] = A, o.repeaterItemScopes[A.uid] = p, o.repeaterRows[A.uid] = a;
|
|
435
|
+
const L = Nr(g, A, a, n, c, d);
|
|
436
|
+
L && kt(L.repeater, L.declaredPath, a, n, o);
|
|
432
437
|
}
|
|
433
438
|
});
|
|
434
439
|
}
|
|
435
|
-
function
|
|
436
|
-
if (
|
|
437
|
-
return t;
|
|
438
|
-
if (!
|
|
440
|
+
function Nr(e, t, r, n, o, i) {
|
|
441
|
+
if (X(e) && X(t))
|
|
442
|
+
return { repeater: t, declaredPath: e.path };
|
|
443
|
+
if (!W(e))
|
|
439
444
|
return;
|
|
440
445
|
const s = e({
|
|
441
446
|
$form: n,
|
|
@@ -448,156 +453,206 @@ function Tr(e, t, r, n, o, i) {
|
|
|
448
453
|
if (s.type !== "repeater")
|
|
449
454
|
return;
|
|
450
455
|
const c = { ...s, uid: e.uid };
|
|
451
|
-
return
|
|
456
|
+
return {
|
|
457
|
+
repeater: Wt(c, r),
|
|
458
|
+
declaredPath: s.path
|
|
459
|
+
};
|
|
452
460
|
}
|
|
453
461
|
function Wt(e, t) {
|
|
454
|
-
const r =
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
462
|
+
const r = t[t.length - 1];
|
|
463
|
+
return Dt(
|
|
464
|
+
e,
|
|
465
|
+
t.map((n) => n.index),
|
|
466
|
+
(n) => Lr(n, r)
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
function li(e, t) {
|
|
470
|
+
return Dt(
|
|
471
|
+
e,
|
|
472
|
+
t,
|
|
473
|
+
(r) => Vr(r, t)
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
function Dt(e, t, r) {
|
|
477
|
+
const n = be(e.uid, t);
|
|
478
|
+
if (W(e)) {
|
|
479
|
+
const o = (i) => e(i);
|
|
480
|
+
return o.uid = n, o.type = e.type, e.path !== void 0 && (o.path = r(e.path)), o;
|
|
458
481
|
}
|
|
459
482
|
return I(e) ? {
|
|
460
483
|
...e,
|
|
461
|
-
uid:
|
|
462
|
-
path:
|
|
484
|
+
uid: n,
|
|
485
|
+
path: r(e.path)
|
|
463
486
|
} : {
|
|
464
487
|
...e,
|
|
465
|
-
uid:
|
|
488
|
+
uid: n
|
|
466
489
|
};
|
|
467
490
|
}
|
|
468
|
-
function
|
|
491
|
+
function be(e, t) {
|
|
469
492
|
if (t.length === 0)
|
|
470
493
|
throw new Error("Repeater indexes cannot be an empty array");
|
|
471
494
|
const r = t.reduce((n, o) => `${n}[${o}]`, "");
|
|
472
495
|
return `${e}${r}`;
|
|
473
496
|
}
|
|
474
|
-
function
|
|
497
|
+
function Vr(e, t) {
|
|
475
498
|
if (t.length === 0)
|
|
476
499
|
throw new Error("Repeater indexes cannot be an empty array");
|
|
477
|
-
const r = "
|
|
478
|
-
if (
|
|
500
|
+
const r = e.split("."), n = r.map((o, i) => i > 0 && o === We ? i : -1).filter((o) => o !== -1);
|
|
501
|
+
if (n.length !== t.length)
|
|
479
502
|
throw new Error(
|
|
480
|
-
`Path contains ${
|
|
503
|
+
`Path contains ${n.length} '${We}' occurrences, but ${t.length} indexes were provided.`
|
|
481
504
|
);
|
|
482
|
-
return n.
|
|
505
|
+
return n.forEach((o, i) => {
|
|
506
|
+
r[o] = String(t[i]);
|
|
507
|
+
}), r.join(".");
|
|
483
508
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
});
|
|
509
|
+
function Lr(e, t) {
|
|
510
|
+
const r = t.declaredItemPath;
|
|
511
|
+
if (e !== r && !e.startsWith(`${r}.`))
|
|
512
|
+
throw new Error(`Path "${e}" is not inside the repeater row "${r}".`);
|
|
513
|
+
return `${t.itemPath}${e.slice(r.length)}`;
|
|
490
514
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
515
|
+
function _r(e, t) {
|
|
516
|
+
let r = e;
|
|
517
|
+
for (let n = t.length - 1; n >= 0; n--)
|
|
518
|
+
r = Mr(r, t[n]);
|
|
519
|
+
return r;
|
|
520
|
+
}
|
|
521
|
+
function Mr(e, t) {
|
|
522
|
+
const r = t.declaredItemPath.split("."), n = t.itemPath.split(".");
|
|
523
|
+
return e.replace(
|
|
524
|
+
Ur(t.declaredItemPath),
|
|
525
|
+
(o, i, s, ...c) => {
|
|
526
|
+
const d = c.slice(0, r.length - 1), l = n.map((a, p) => p === 0 ? a : d[p - 1] + a).join("");
|
|
527
|
+
return `${i}${s ?? ""}${l}`;
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
const st = /* @__PURE__ */ new Map();
|
|
532
|
+
function Ur(e) {
|
|
533
|
+
let t = st.get(e);
|
|
534
|
+
if (t === void 0) {
|
|
535
|
+
const r = e.split(".").map(Hr);
|
|
536
|
+
t = new RegExp(
|
|
537
|
+
`(^|[^\\w$.])(\\$form\\??\\.)?${r.join("(\\??\\.)")}(?![\\w$])`,
|
|
538
|
+
"g"
|
|
539
|
+
), st.set(e, t);
|
|
540
|
+
}
|
|
541
|
+
return t;
|
|
542
|
+
}
|
|
543
|
+
function Hr(e) {
|
|
544
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
545
|
+
}
|
|
546
|
+
const ct = ["include", "exclude", "disabled", "readonly"];
|
|
547
|
+
function zr(e, t) {
|
|
548
|
+
if (!ct.some(
|
|
549
|
+
(o) => dt(e[o])
|
|
495
550
|
))
|
|
496
551
|
return e;
|
|
497
552
|
const n = { ...e };
|
|
498
|
-
for (const o of
|
|
553
|
+
for (const o of ct) {
|
|
499
554
|
const i = n[o];
|
|
500
|
-
|
|
555
|
+
dt(i) && (n[o] = {
|
|
501
556
|
...i,
|
|
502
|
-
when:
|
|
557
|
+
when: _r(i.when, t)
|
|
503
558
|
});
|
|
504
559
|
}
|
|
505
560
|
return n;
|
|
506
561
|
}
|
|
507
|
-
function
|
|
562
|
+
function dt(e) {
|
|
508
563
|
return e !== null && typeof e == "object" && "when" in e && typeof e.when == "string";
|
|
509
564
|
}
|
|
510
|
-
const
|
|
511
|
-
let t = e.data, r =
|
|
512
|
-
for (let n = 0; n <
|
|
565
|
+
const br = 50, Br = (e) => {
|
|
566
|
+
let t = e.data, r = De(e.flatForm, t);
|
|
567
|
+
for (let n = 0; n < br; n++) {
|
|
513
568
|
let o = !1;
|
|
514
569
|
for (const i of Object.values(r.resolvedSources))
|
|
515
|
-
!I(i) ||
|
|
570
|
+
!I(i) || Fr(t, i.path) || (t = Pt(t, i.path, ce(i.defaultValue)), i.defaultValue !== void 0 && (o = !0));
|
|
516
571
|
if (!o)
|
|
517
572
|
break;
|
|
518
|
-
r =
|
|
573
|
+
r = De(e.flatForm, t);
|
|
519
574
|
}
|
|
520
575
|
return { ...e, data: t, ...r };
|
|
521
|
-
},
|
|
522
|
-
let
|
|
576
|
+
}, Be = 32;
|
|
577
|
+
let Fe, h, m, v = (e) => (h = 0, m = e, v.newline = !1, e = S(), m[h] ? U() : e || ""), U = (e = "Unexpected token", t = h, r = m.slice(0, t).split(`
|
|
523
578
|
`), n = r.pop(), o = m.slice(Math.max(0, t - 40), t), i = "̭", s = (m[t] || " ") + i, c = m.slice(t + 1, t + 20)) => {
|
|
524
579
|
throw SyntaxError(`${e} at ${r.length + 1}:${n.length + 1}
|
|
525
580
|
${m[t - 41] !== `
|
|
526
581
|
`, "" + o}${s}${c}`);
|
|
527
|
-
},
|
|
582
|
+
}, Ft = (e, t = h) => (Array.isArray(e) && (e.loc = t), e), B = (e, t = h, r) => {
|
|
528
583
|
for (; r = e(m.charCodeAt(h)); ) h += r;
|
|
529
584
|
return m.slice(t, h);
|
|
530
|
-
}, C = (e = 1) => m[h += e],
|
|
585
|
+
}, C = (e = 1) => m[h += e], Re = (e) => h = e, S = (e = 0, t) => {
|
|
531
586
|
let r, n, o, i, s;
|
|
532
587
|
for (t && v.asi && (v.newline = !1); (r = v.space()) && (s = v.newline, 1) && r !== t && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
|
|
533
|
-
(n && r === 91 &&
|
|
534
|
-
return t && (r == t ? (h++, t === 125 && v.asi && (v.newline = !0)) :
|
|
535
|
-
},
|
|
536
|
-
for (
|
|
537
|
-
v.asi && e === 10 && (v.newline =
|
|
588
|
+
(n && r === 91 && Fe && v.asi?.(n, e, S) || null) ?? ((i = j[r]) && i(n, e)) ?? (n && s && v.asi?.(n, e, S)) ?? (!n && B(v.id))); ) n = o;
|
|
589
|
+
return t && (r == t ? (h++, t === 125 && v.asi && (v.newline = !0)) : U("Unclosed " + String.fromCharCode(t - (t > 42 ? 2 : 1)))), n;
|
|
590
|
+
}, T = (e, t = h) => {
|
|
591
|
+
for (Fe = !1; (e = m.charCodeAt(h)) <= Be; )
|
|
592
|
+
v.asi && e === 10 && (v.newline = Fe = !0), h++;
|
|
538
593
|
return e;
|
|
539
|
-
},
|
|
540
|
-
for (; m.charCodeAt(e) <=
|
|
594
|
+
}, Gr = (e = h) => {
|
|
595
|
+
for (; m.charCodeAt(e) <= Be; ) e++;
|
|
541
596
|
return m.charCodeAt(e);
|
|
542
597
|
};
|
|
543
598
|
v.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
|
|
544
|
-
let
|
|
599
|
+
let Kr = (e, t = e.length) => m.substr(h, t) === e && !v.id(m.charCodeAt(h + t)), j = [], ut = {}, O = (e, t = Be, r, n = e.charCodeAt(0), o = e.length, i = j[n], s = e.toUpperCase() !== e, c, d) => (t = ut[e] = !i && ut[e] || t, j[n] = (l, a, p, g = h) => (c = p, (p ? e == p : (o < 2 || e.charCodeAt(1) === m.charCodeAt(h + 1) && (o < 3 || m.substr(h, o) == e)) && (!s || !v.id(m.charCodeAt(h + o))) && (c = p = e)) && a < t && (h += o, (d = r(l)) ? Ft(d, g) : (h = g, c = 0, !s && !i && !l && U()), d) || i?.(l, a, c))), $ = (e, t, r = !1) => O(e, t, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(t - (r ? 0.5 : 0)))), V = (e, t, r) => O(e, t, (n) => !n && (n = S(t - 0.5)) && [e, n]), ee = (e, t) => O(e, 200, (r) => !r && [, t]), Rt = (e, t, r) => O(
|
|
545
600
|
e,
|
|
546
601
|
t,
|
|
547
602
|
(n, o) => (o = S(t - (r ? 0.5 : 0)), n?.[0] !== e && (n = [e, n || null]), o?.[0] === e ? n.push(...o.slice(1)) : n.push(o || null), n)
|
|
548
|
-
),
|
|
603
|
+
), Ge = (e, t) => O(e[0], t, (r) => !r && [e, S(0, e.charCodeAt(1)) || null]), Tt = (e, t) => O(e[0], t, (r) => r && [e, r, S(0, e.charCodeAt(1)) || null]), te = (e, t, r, n = e.charCodeAt(0), o = e.length, i = j[n], s) => j[n] = (c, d, l, a = h) => !c && (l ? e == l : (o < 2 || m.substr(h, o) == e) && (l = e)) && d < t && !v.id(m.charCodeAt(h + o)) && (!v.prop || v.prop(h + o)) && (Re(h + o), (s = r()) ? Ft(s, a) : Re(a), s) || i?.(c, d, l);
|
|
549
604
|
Object.defineProperty(v, "space", {
|
|
550
605
|
configurable: !0,
|
|
551
606
|
enumerable: !0,
|
|
552
|
-
get: () =>
|
|
553
|
-
set: (e) =>
|
|
607
|
+
get: () => T,
|
|
608
|
+
set: (e) => T = e
|
|
554
609
|
});
|
|
555
|
-
const Te = {}, f = (e, t, r = Te[e]) => Te[e] = (...n) => t(...n) || r?.(...n),
|
|
610
|
+
const Te = {}, f = (e, t, r = Te[e]) => Te[e] = (...n) => t(...n) || r?.(...n), u = (e) => Array.isArray(e) ? e[0] == null ? /* @__PURE__ */ ((t) => () => t)(e[1]) : (
|
|
556
611
|
// == catches both undefined and null
|
|
557
|
-
Te[e[0]]?.(...e.slice(1)) ??
|
|
612
|
+
Te[e[0]]?.(...e.slice(1)) ?? U(`Unknown operator: ${e[0]}`, e?.loc)
|
|
558
613
|
) : e === void 0 ? () => {
|
|
559
|
-
} : (t) => t?.[e],
|
|
560
|
-
let t =
|
|
614
|
+
} : (t) => t?.[e], de = 46, Q = 48, ue = 57, xr = 69, Xr = 101, Qr = 43, qr = 45, oe = 95, Nt = 110, Jr = 97, Zr = 102, Yr = 65, en = 70, Vt = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Ke = (e) => {
|
|
615
|
+
let t = Vt(B(
|
|
561
616
|
(r) => (
|
|
562
617
|
// . is decimal only if NOT followed by another . (range operator)
|
|
563
|
-
r ===
|
|
618
|
+
r === de && m.charCodeAt(h + 1) !== de || r >= Q && r <= ue || r === oe || ((r === xr || r === Xr) && ((r = m.charCodeAt(h + 1)) >= Q && r <= ue || r === Qr || r === qr) ? 2 : 0)
|
|
564
619
|
)
|
|
565
620
|
));
|
|
566
|
-
return m.charCodeAt(h) ===
|
|
567
|
-
},
|
|
568
|
-
2: (e) => e === 48 || e === 49 || e ===
|
|
569
|
-
8: (e) => e >= 48 && e <= 55 || e ===
|
|
570
|
-
16: (e) => e >=
|
|
621
|
+
return m.charCodeAt(h) === Nt ? (C(), [, BigInt(t)]) : (e = +t) != e ? U() : [, e];
|
|
622
|
+
}, tn = {
|
|
623
|
+
2: (e) => e === 48 || e === 49 || e === oe,
|
|
624
|
+
8: (e) => e >= 48 && e <= 55 || e === oe,
|
|
625
|
+
16: (e) => e >= Q && e <= ue || e >= Jr && e <= Zr || e >= Yr && e <= en || e === oe
|
|
571
626
|
};
|
|
572
627
|
v.number = null;
|
|
573
|
-
j[
|
|
574
|
-
for (let e =
|
|
575
|
-
j[
|
|
628
|
+
j[de] = (e) => !e && m.charCodeAt(h + 1) !== de && Ke();
|
|
629
|
+
for (let e = Q; e <= ue; e++) j[e] = (t) => t ? void 0 : Ke();
|
|
630
|
+
j[Q] = (e) => {
|
|
576
631
|
if (e) return;
|
|
577
632
|
const t = v.number;
|
|
578
633
|
if (t) {
|
|
579
634
|
for (const [r, n] of Object.entries(t))
|
|
580
635
|
if (r[0] === "0" && m[h + 1]?.toLowerCase() === r[1]) {
|
|
581
636
|
C(2);
|
|
582
|
-
const o =
|
|
583
|
-
return m.charCodeAt(h) ===
|
|
637
|
+
const o = Vt(B(tn[n]));
|
|
638
|
+
return m.charCodeAt(h) === Nt ? (C(), [, BigInt("0" + r[1] + o)]) : [, parseInt(o, n)];
|
|
584
639
|
}
|
|
585
640
|
}
|
|
586
|
-
return
|
|
641
|
+
return Ke();
|
|
587
642
|
};
|
|
588
|
-
const
|
|
589
|
-
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" },
|
|
643
|
+
const rn = 92, lt = 34, at = 39, nn = { n: `
|
|
644
|
+
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Lt = (e) => (t, r, n = "") => {
|
|
590
645
|
if (!(t || !v.string?.[String.fromCharCode(e)]))
|
|
591
|
-
return C(),
|
|
646
|
+
return C(), B((o) => o - e && (o === rn ? (n += nn[m[h + 1]] || m[h + 1], 2) : (n += m[h], 1))), m[h] === String.fromCharCode(e) ? C() : U("Bad string"), [, n];
|
|
592
647
|
};
|
|
593
|
-
j[
|
|
594
|
-
j[
|
|
648
|
+
j[lt] = Lt(lt);
|
|
649
|
+
j[at] = Lt(at);
|
|
595
650
|
v.string = { '"': !0 };
|
|
596
|
-
const
|
|
597
|
-
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => $(e,
|
|
598
|
-
const
|
|
651
|
+
const on = 20;
|
|
652
|
+
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => $(e, on, !0));
|
|
653
|
+
const _t = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = u(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "[]" && e.length === 3 ? (r = u(e[1]), n = u(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "()" && e.length === 2 ? _t(e[1], t) : (() => {
|
|
599
654
|
throw Error("Invalid assignment target");
|
|
600
|
-
})(),
|
|
655
|
+
})(), ft = {
|
|
601
656
|
"=": (e, t, r) => e[t] = r,
|
|
602
657
|
"+=": (e, t, r) => e[t] += r,
|
|
603
658
|
"-=": (e, t, r) => e[t] -= r,
|
|
@@ -610,58 +665,58 @@ const Rt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "
|
|
|
610
665
|
">>=": (e, t, r) => e[t] >>= r,
|
|
611
666
|
"<<=": (e, t, r) => e[t] <<= r
|
|
612
667
|
};
|
|
613
|
-
for (const e in
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
$("||",
|
|
617
|
-
$("&&",
|
|
618
|
-
f("!", (e) => (e =
|
|
619
|
-
f("||", (e, t) => (e =
|
|
620
|
-
f("&&", (e, t) => (e =
|
|
621
|
-
const
|
|
622
|
-
$("|",
|
|
623
|
-
$("&",
|
|
624
|
-
$("^",
|
|
625
|
-
$(">>",
|
|
626
|
-
$("<<",
|
|
627
|
-
|
|
628
|
-
f("~", (e) => (e =
|
|
629
|
-
f("|", (e, t) => (e =
|
|
630
|
-
f("&", (e, t) => (e =
|
|
631
|
-
f("^", (e, t) => (e =
|
|
632
|
-
f(">>", (e, t) => (e =
|
|
633
|
-
f("<<", (e, t) => (e =
|
|
634
|
-
const
|
|
635
|
-
$("<",
|
|
636
|
-
$(">",
|
|
637
|
-
$("<=",
|
|
638
|
-
$(">=",
|
|
639
|
-
f(">", (e, t) => (e =
|
|
640
|
-
f("<", (e, t) => (e =
|
|
641
|
-
f(">=", (e, t) => (e =
|
|
642
|
-
f("<=", (e, t) => (e =
|
|
643
|
-
const
|
|
644
|
-
$("==",
|
|
645
|
-
$("!=",
|
|
646
|
-
f("==", (e, t) => (e =
|
|
647
|
-
f("!=", (e, t) => (e =
|
|
648
|
-
const
|
|
649
|
-
$("+",
|
|
650
|
-
$("-",
|
|
651
|
-
$("*",
|
|
652
|
-
$("/",
|
|
653
|
-
$("%",
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
f("+", (e, t) => t !== void 0 ? (e =
|
|
657
|
-
f("-", (e, t) => t !== void 0 ? (e =
|
|
658
|
-
f("*", (e, t) => (e =
|
|
659
|
-
f("/", (e, t) => (e =
|
|
660
|
-
f("%", (e, t) => (e =
|
|
661
|
-
const
|
|
662
|
-
O("++",
|
|
663
|
-
O("--",
|
|
664
|
-
const Xe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "." ? (r =
|
|
668
|
+
for (const e in ft) f(e, (t, r) => (r = u(r), _t(t, (n, o, i) => ft[e](n, o, r(i)))));
|
|
669
|
+
const sn = 30, cn = 40, dn = 140;
|
|
670
|
+
V("!", dn);
|
|
671
|
+
$("||", sn);
|
|
672
|
+
$("&&", cn);
|
|
673
|
+
f("!", (e) => (e = u(e), (t) => !e(t)));
|
|
674
|
+
f("||", (e, t) => (e = u(e), t = u(t), (r) => e(r) || t(r)));
|
|
675
|
+
f("&&", (e, t) => (e = u(e), t = u(t), (r) => e(r) && t(r)));
|
|
676
|
+
const un = 50, ln = 60, an = 70, Mt = 100, fn = 140;
|
|
677
|
+
$("|", un);
|
|
678
|
+
$("&", an);
|
|
679
|
+
$("^", ln);
|
|
680
|
+
$(">>", Mt);
|
|
681
|
+
$("<<", Mt);
|
|
682
|
+
V("~", fn);
|
|
683
|
+
f("~", (e) => (e = u(e), (t) => ~e(t)));
|
|
684
|
+
f("|", (e, t) => (e = u(e), t = u(t), (r) => e(r) | t(r)));
|
|
685
|
+
f("&", (e, t) => (e = u(e), t = u(t), (r) => e(r) & t(r)));
|
|
686
|
+
f("^", (e, t) => (e = u(e), t = u(t), (r) => e(r) ^ t(r)));
|
|
687
|
+
f(">>", (e, t) => (e = u(e), t = u(t), (r) => e(r) >> t(r)));
|
|
688
|
+
f("<<", (e, t) => (e = u(e), t = u(t), (r) => e(r) << t(r)));
|
|
689
|
+
const Ae = 90;
|
|
690
|
+
$("<", Ae);
|
|
691
|
+
$(">", Ae);
|
|
692
|
+
$("<=", Ae);
|
|
693
|
+
$(">=", Ae);
|
|
694
|
+
f(">", (e, t) => (e = u(e), t = u(t), (r) => e(r) > t(r)));
|
|
695
|
+
f("<", (e, t) => (e = u(e), t = u(t), (r) => e(r) < t(r)));
|
|
696
|
+
f(">=", (e, t) => (e = u(e), t = u(t), (r) => e(r) >= t(r)));
|
|
697
|
+
f("<=", (e, t) => (e = u(e), t = u(t), (r) => e(r) <= t(r)));
|
|
698
|
+
const Ut = 80;
|
|
699
|
+
$("==", Ut);
|
|
700
|
+
$("!=", Ut);
|
|
701
|
+
f("==", (e, t) => (e = u(e), t = u(t), (r) => e(r) == t(r)));
|
|
702
|
+
f("!=", (e, t) => (e = u(e), t = u(t), (r) => e(r) != t(r)));
|
|
703
|
+
const Ht = 110, xe = 120, zt = 140;
|
|
704
|
+
$("+", Ht);
|
|
705
|
+
$("-", Ht);
|
|
706
|
+
$("*", xe);
|
|
707
|
+
$("/", xe);
|
|
708
|
+
$("%", xe);
|
|
709
|
+
V("+", zt);
|
|
710
|
+
V("-", zt);
|
|
711
|
+
f("+", (e, t) => t !== void 0 ? (e = u(e), t = u(t), (r) => e(r) + t(r)) : (e = u(e), (r) => +e(r)));
|
|
712
|
+
f("-", (e, t) => t !== void 0 ? (e = u(e), t = u(t), (r) => e(r) - t(r)) : (e = u(e), (r) => -e(r)));
|
|
713
|
+
f("*", (e, t) => (e = u(e), t = u(t), (r) => e(r) * t(r)));
|
|
714
|
+
f("/", (e, t) => (e = u(e), t = u(t), (r) => e(r) / t(r)));
|
|
715
|
+
f("%", (e, t) => (e = u(e), t = u(t), (r) => e(r) % t(r)));
|
|
716
|
+
const le = 150;
|
|
717
|
+
O("++", le, (e) => e ? ["++", e, null] : ["++", S(le - 1)]);
|
|
718
|
+
O("--", le, (e) => e ? ["--", e, null] : ["--", S(le - 1)]);
|
|
719
|
+
const Xe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "." ? (r = u(e[1]), n = e[2], (o) => t(r(o), n)) : e[0] === "[]" && e.length === 3 ? (r = u(e[1]), n = u(e[2]), (o) => t(r(o), n(o))) : e[0] === "()" && e.length === 2 ? Xe(e[1], t) : (
|
|
665
720
|
// unwrap parens: (x)++
|
|
666
721
|
(() => {
|
|
667
722
|
throw Error("Invalid increment target");
|
|
@@ -669,114 +724,114 @@ const Xe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "."
|
|
|
669
724
|
);
|
|
670
725
|
f("++", (e, t) => Xe(e, t === null ? (r, n) => r[n]++ : (r, n) => ++r[n]));
|
|
671
726
|
f("--", (e, t) => Xe(e, t === null ? (r, n) => r[n]-- : (r, n) => --r[n]));
|
|
672
|
-
const
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
const
|
|
727
|
+
const pn = 5, hn = 10;
|
|
728
|
+
Rt(",", hn);
|
|
729
|
+
Rt(";", pn, !0);
|
|
730
|
+
const bt = (...e) => (e = e.map(u), (t) => {
|
|
676
731
|
let r;
|
|
677
732
|
for (const n of e) r = n(t);
|
|
678
733
|
return r;
|
|
679
734
|
});
|
|
680
|
-
f(",",
|
|
681
|
-
f(";",
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
const F = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype",
|
|
685
|
-
|
|
686
|
-
$(".",
|
|
687
|
-
|
|
688
|
-
const
|
|
735
|
+
f(",", bt);
|
|
736
|
+
f(";", bt);
|
|
737
|
+
const mn = 170;
|
|
738
|
+
Ge("()", mn);
|
|
739
|
+
const F = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", Qe = 170;
|
|
740
|
+
Tt("[]", Qe);
|
|
741
|
+
$(".", Qe);
|
|
742
|
+
Tt("()", Qe);
|
|
743
|
+
const ae = (e) => {
|
|
689
744
|
throw Error(e);
|
|
690
745
|
};
|
|
691
746
|
f("[]", (e, t) => t === void 0 ? (e = e ? e[0] === "," ? e.slice(1) : [e] : [], e = e.map((r) => r == null ? (() => {
|
|
692
|
-
}) : r[0] === "..." ? (r =
|
|
747
|
+
}) : r[0] === "..." ? (r = u(r[1]), (n) => r(n)) : (r = u(r), (n) => [r(n)])), (r) => e.flatMap((n) => n(r))) : (t == null && ae("Missing index"), e = u(e), t = u(t), (r) => {
|
|
693
748
|
const n = t(r);
|
|
694
749
|
return F(n) ? void 0 : e(r)[n];
|
|
695
750
|
}));
|
|
696
|
-
f(".", (e, t) => (e =
|
|
751
|
+
f(".", (e, t) => (e = u(e), t = t[0] ? t : t[1], F(t) ? () => {
|
|
697
752
|
} : (r) => e(r)[t]));
|
|
698
753
|
f("()", (e, t) => {
|
|
699
|
-
if (t === void 0) return e == null ?
|
|
754
|
+
if (t === void 0) return e == null ? ae("Empty ()") : u(e);
|
|
700
755
|
const r = (o) => o?.[0] === "," && o.slice(1).some((i) => i == null || r(i));
|
|
701
|
-
r(t) &&
|
|
702
|
-
const n = t ? t[0] === "," ? (t = t.slice(1).map(
|
|
703
|
-
return
|
|
756
|
+
r(t) && ae("Empty argument");
|
|
757
|
+
const n = t ? t[0] === "," ? (t = t.slice(1).map(u), (o) => t.map((i) => i(o))) : (t = u(t), (o) => [t(o)]) : () => [];
|
|
758
|
+
return qe(e, (o, i, s) => o[i](...n(s)));
|
|
704
759
|
});
|
|
705
|
-
const
|
|
760
|
+
const H = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[0] === "?." || e[0] === "[]" && e.length === 3 || e[0] === "?.[]" || e[0] === "()" && e.length === 2 && H(e[1]) || e[0] === "{}"), qe = (e, t, r, n) => e == null ? ae("Empty ()") : e[0] === "()" && e.length == 2 ? qe(e[1], t) : typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = u(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "?." ? (r = u(e[1]), n = e[2], (o) => {
|
|
706
761
|
const i = r(o);
|
|
707
762
|
return i == null ? void 0 : t(i, n, o);
|
|
708
|
-
}) : e[0] === "[]" && e.length === 3 ? (r =
|
|
763
|
+
}) : e[0] === "[]" && e.length === 3 ? (r = u(e[1]), n = u(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "?.[]" ? (r = u(e[1]), n = u(e[2]), (o) => {
|
|
709
764
|
const i = r(o);
|
|
710
765
|
return i == null ? void 0 : t(i, n(o), o);
|
|
711
|
-
}) : (e =
|
|
766
|
+
}) : (e = u(e), (o) => t([e(o)], 0, o)), G = qe, gn = 32, yn = v.space;
|
|
712
767
|
v.comment ??= { "//": `
|
|
713
768
|
`, "/*": "*/" };
|
|
714
769
|
let Ie;
|
|
715
770
|
v.space = () => {
|
|
716
771
|
Ie || (Ie = Object.entries(v.comment).map(([o, i]) => [o, i, o.charCodeAt(0)]));
|
|
717
|
-
for (var e; e =
|
|
772
|
+
for (var e; e = yn(); ) {
|
|
718
773
|
for (var t = 0, r; r = Ie[t++]; )
|
|
719
774
|
if (e === r[2] && m.substr(h, r[0].length) === r[0]) {
|
|
720
775
|
var n = h + r[0].length;
|
|
721
776
|
if (r[1] === `
|
|
722
|
-
`) for (; m.charCodeAt(n) >=
|
|
777
|
+
`) for (; m.charCodeAt(n) >= gn; ) n++;
|
|
723
778
|
else {
|
|
724
779
|
for (; m[n] && m.substr(n, r[1].length) !== r[1]; ) n++;
|
|
725
780
|
m[n] && (n += r[1].length);
|
|
726
781
|
}
|
|
727
|
-
|
|
782
|
+
Re(n), e = 0;
|
|
728
783
|
break;
|
|
729
784
|
}
|
|
730
785
|
if (e) return e;
|
|
731
786
|
}
|
|
732
787
|
return e;
|
|
733
788
|
};
|
|
734
|
-
const
|
|
735
|
-
$("===",
|
|
736
|
-
$("!==",
|
|
737
|
-
f("===", (e, t) => (e =
|
|
738
|
-
f("!==", (e, t) => (e =
|
|
739
|
-
const
|
|
740
|
-
$("??",
|
|
741
|
-
f("??", (e, t) => (e =
|
|
742
|
-
const
|
|
743
|
-
$("**",
|
|
744
|
-
$("**=",
|
|
745
|
-
f("**", (e, t) => (e =
|
|
746
|
-
const
|
|
789
|
+
const Bt = 80;
|
|
790
|
+
$("===", Bt);
|
|
791
|
+
$("!==", Bt);
|
|
792
|
+
f("===", (e, t) => (e = u(e), t = u(t), (r) => e(r) === t(r)));
|
|
793
|
+
f("!==", (e, t) => (e = u(e), t = u(t), (r) => e(r) !== t(r)));
|
|
794
|
+
const vn = 30;
|
|
795
|
+
$("??", vn);
|
|
796
|
+
f("??", (e, t) => (e = u(e), t = u(t), (r) => e(r) ?? t(r)));
|
|
797
|
+
const $n = 130, Sn = 20;
|
|
798
|
+
$("**", $n, !0);
|
|
799
|
+
$("**=", Sn, !0);
|
|
800
|
+
f("**", (e, t) => (e = u(e), t = u(t), (r) => e(r) ** t(r)));
|
|
801
|
+
const An = (e) => {
|
|
747
802
|
throw Error(e);
|
|
748
803
|
};
|
|
749
|
-
f("**=", (e, t) => (
|
|
750
|
-
const
|
|
751
|
-
$("in",
|
|
752
|
-
$("of",
|
|
753
|
-
f("in", (e, t) => (e =
|
|
754
|
-
const
|
|
804
|
+
f("**=", (e, t) => (H(e) || An("Invalid assignment target"), t = u(t), G(e, (r, n, o) => r[n] **= t(o))));
|
|
805
|
+
const Gt = 90;
|
|
806
|
+
$("in", Gt);
|
|
807
|
+
$("of", Gt);
|
|
808
|
+
f("in", (e, t) => (e = u(e), t = u(t), (r) => e(r) in t(r)));
|
|
809
|
+
const En = 20, wn = 100, Cn = (e) => {
|
|
755
810
|
throw Error(e);
|
|
756
811
|
};
|
|
757
|
-
$(">>>",
|
|
758
|
-
$(">>>=",
|
|
759
|
-
f(">>>", (e, t) => (e =
|
|
760
|
-
f(">>>=", (e, t) => (
|
|
761
|
-
const
|
|
812
|
+
$(">>>", wn);
|
|
813
|
+
$(">>>=", En, !0);
|
|
814
|
+
f(">>>", (e, t) => (e = u(e), t = u(t), (r) => e(r) >>> t(r)));
|
|
815
|
+
f(">>>=", (e, t) => (H(e) || Cn("Invalid assignment target"), t = u(t), G(e, (r, n, o) => r[n] >>>= t(o))));
|
|
816
|
+
const Je = 5, In = 10, On = 20, Pn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, fe = (e, t, r) => {
|
|
762
817
|
if (typeof e == "string") {
|
|
763
818
|
r[e] = t;
|
|
764
819
|
return;
|
|
765
820
|
}
|
|
766
|
-
const [n, ...o] = e, i =
|
|
821
|
+
const [n, ...o] = e, i = Pn(o);
|
|
767
822
|
if (n === "{}") {
|
|
768
823
|
const s = [];
|
|
769
824
|
for (const c of i) {
|
|
770
825
|
if (Array.isArray(c) && c[0] === "...") {
|
|
771
826
|
const g = {};
|
|
772
|
-
for (const
|
|
827
|
+
for (const A in t) s.includes(A) || (g[A] = t[A]);
|
|
773
828
|
r[c[1]] = g;
|
|
774
829
|
break;
|
|
775
830
|
}
|
|
776
|
-
let
|
|
777
|
-
typeof c == "string" ?
|
|
778
|
-
let p = t[
|
|
779
|
-
p === void 0 && a && (p =
|
|
831
|
+
let d, l, a;
|
|
832
|
+
typeof c == "string" ? d = l = c : c[0] === "=" ? (typeof c[1] == "string" ? d = l = c[1] : [, d, l] = c[1], a = c[2]) : [, d, l] = c, s.push(d);
|
|
833
|
+
let p = t[d];
|
|
834
|
+
p === void 0 && a && (p = u(a)(r)), fe(l, p, r);
|
|
780
835
|
}
|
|
781
836
|
} else if (n === "[]") {
|
|
782
837
|
let s = 0;
|
|
@@ -789,68 +844,68 @@ const qe = 5, vn = 10, $n = 20, Sn = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
|
|
|
789
844
|
r[c[1]] = t.slice(s);
|
|
790
845
|
break;
|
|
791
846
|
}
|
|
792
|
-
let
|
|
793
|
-
Array.isArray(c) && c[0] === "=" && ([,
|
|
847
|
+
let d = c, l;
|
|
848
|
+
Array.isArray(c) && c[0] === "=" && ([, d, l] = c);
|
|
794
849
|
let a = t[s++];
|
|
795
|
-
a === void 0 && l && (a =
|
|
850
|
+
a === void 0 && l && (a = u(l)(r)), fe(d, a, r);
|
|
796
851
|
}
|
|
797
852
|
}
|
|
798
|
-
},
|
|
799
|
-
let t = S(
|
|
853
|
+
}, Kt = (e) => {
|
|
854
|
+
let t = S(In - 1);
|
|
800
855
|
return t?.[0] === "in" || t?.[0] === "of" ? [t[0], [e, t[1]], t[2]] : t?.[0] === "," ? [e, ...t.slice(1)] : [e, t];
|
|
801
856
|
};
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
const
|
|
857
|
+
te("let", Je + 1, () => Kt("let"));
|
|
858
|
+
te("const", Je + 1, () => Kt("const"));
|
|
859
|
+
te("var", Je, () => (T(), ["var", S(On)]));
|
|
860
|
+
const xt = (...e) => (e = e.map((t) => {
|
|
806
861
|
if (typeof t == "string") return (r) => {
|
|
807
862
|
r[t] = void 0;
|
|
808
863
|
};
|
|
809
864
|
if (t[0] === "=") {
|
|
810
|
-
const [, r, n] = t, o =
|
|
865
|
+
const [, r, n] = t, o = u(n);
|
|
811
866
|
return typeof r == "string" ? (i) => {
|
|
812
867
|
i[r] = o(i);
|
|
813
|
-
} : (i) =>
|
|
868
|
+
} : (i) => fe(r, o(i), i);
|
|
814
869
|
}
|
|
815
|
-
return
|
|
870
|
+
return u(t);
|
|
816
871
|
}), (t) => {
|
|
817
872
|
for (const r of e) r(t);
|
|
818
873
|
});
|
|
819
|
-
f("let",
|
|
820
|
-
f("const",
|
|
874
|
+
f("let", xt);
|
|
875
|
+
f("const", xt);
|
|
821
876
|
f("var", (e) => typeof e == "string" ? (t) => {
|
|
822
877
|
t[e] = void 0;
|
|
823
878
|
} : () => {
|
|
824
879
|
});
|
|
825
|
-
const
|
|
880
|
+
const Ze = 20, Ee = (e) => {
|
|
826
881
|
throw Error(e);
|
|
827
882
|
};
|
|
828
|
-
$("||=",
|
|
829
|
-
$("&&=",
|
|
830
|
-
$("??=",
|
|
883
|
+
$("||=", Ze, !0);
|
|
884
|
+
$("&&=", Ze, !0);
|
|
885
|
+
$("??=", Ze, !0);
|
|
831
886
|
f("=", (e, t) => {
|
|
832
887
|
if (Array.isArray(e) && (e[0] === "let" || e[0] === "const" || e[0] === "var")) {
|
|
833
888
|
const r = e[1];
|
|
834
|
-
return t =
|
|
889
|
+
return t = u(t), typeof r == "string" ? (n) => {
|
|
835
890
|
n[r] = t(n);
|
|
836
|
-
} : (n) =>
|
|
891
|
+
} : (n) => fe(r, t(n), n);
|
|
837
892
|
}
|
|
838
|
-
return
|
|
893
|
+
return H(e) || Ee("Invalid assignment target"), t = u(t), G(e, (r, n, o) => r[n] = t(o));
|
|
839
894
|
});
|
|
840
|
-
f("||=", (e, t) => (
|
|
841
|
-
f("&&=", (e, t) => (
|
|
842
|
-
f("??=", (e, t) => (
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
895
|
+
f("||=", (e, t) => (H(e) || Ee("Invalid assignment target"), t = u(t), G(e, (r, n, o) => r[n] ||= t(o))));
|
|
896
|
+
f("&&=", (e, t) => (H(e) || Ee("Invalid assignment target"), t = u(t), G(e, (r, n, o) => r[n] &&= t(o))));
|
|
897
|
+
f("??=", (e, t) => (H(e) || Ee("Invalid assignment target"), t = u(t), G(e, (r, n, o) => r[n] ??= t(o))));
|
|
898
|
+
ee("true", !0);
|
|
899
|
+
ee("false", !1);
|
|
900
|
+
ee("null", null);
|
|
901
|
+
te("undefined", 200, () => []);
|
|
902
|
+
ee("NaN", NaN);
|
|
903
|
+
ee("Infinity", 1 / 0);
|
|
849
904
|
const Oe = 20;
|
|
850
|
-
O("?", Oe, (e, t, r) => e && (t = S(Oe - 1)) &&
|
|
851
|
-
f("?", (e, t, r) => (e =
|
|
852
|
-
const
|
|
853
|
-
$("=>",
|
|
905
|
+
O("?", Oe, (e, t, r) => e && (t = S(Oe - 1)) && B((n) => n === 58) && (r = S(Oe - 1), ["?", e, t, r]));
|
|
906
|
+
f("?", (e, t, r) => (e = u(e), t = u(t), r = u(r), (n) => e(n) ? t(n) : r(n)));
|
|
907
|
+
const jn = [], kn = 20;
|
|
908
|
+
$("=>", kn, !0);
|
|
854
909
|
f("=>", (e, t) => {
|
|
855
910
|
e = e?.[0] === "()" ? e[1] : e;
|
|
856
911
|
const r = e ? e[0] === "," ? e.slice(1) : [e] : [];
|
|
@@ -858,202 +913,202 @@ f("=>", (e, t) => {
|
|
|
858
913
|
const i = r[r.length - 1];
|
|
859
914
|
Array.isArray(i) && i[0] === "..." && (n = r.length - 1, o = i[1], r.length--);
|
|
860
915
|
const s = t?.[0] === "{}";
|
|
861
|
-
return t =
|
|
916
|
+
return t = u(s ? ["{", t[1]] : t), (c) => (...d) => {
|
|
862
917
|
const l = {};
|
|
863
|
-
r.forEach((p, g) => l[p] =
|
|
918
|
+
r.forEach((p, g) => l[p] = d[g]), o && (l[o] = d.slice(n));
|
|
864
919
|
const a = new Proxy(l, {
|
|
865
920
|
get: (p, g) => g in p ? p[g] : c?.[g],
|
|
866
|
-
set: (p, g,
|
|
921
|
+
set: (p, g, A) => ((g in p ? p : c)[g] = A, !0),
|
|
867
922
|
has: (p, g) => g in p || (c ? g in c : !1)
|
|
868
923
|
});
|
|
869
924
|
try {
|
|
870
925
|
const p = t(a);
|
|
871
926
|
return s ? void 0 : p;
|
|
872
927
|
} catch (p) {
|
|
873
|
-
if (p ===
|
|
928
|
+
if (p === jn) return p[0];
|
|
874
929
|
throw p;
|
|
875
930
|
}
|
|
876
931
|
};
|
|
877
932
|
});
|
|
878
|
-
const
|
|
879
|
-
|
|
880
|
-
f("...", (e) => (e =
|
|
881
|
-
const
|
|
882
|
-
O("?.",
|
|
933
|
+
const Wn = 140;
|
|
934
|
+
V("...", Wn);
|
|
935
|
+
f("...", (e) => (e = u(e), (t) => Object.entries(e(t))));
|
|
936
|
+
const pt = 170;
|
|
937
|
+
O("?.", pt, (e, t) => {
|
|
883
938
|
if (!e) return;
|
|
884
|
-
const r =
|
|
885
|
-
return r === 40 ? (C(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (C(), ["?.[]", e, S(0, 93)]) : (t = S(
|
|
939
|
+
const r = T();
|
|
940
|
+
return r === 40 ? (C(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (C(), ["?.[]", e, S(0, 93)]) : (t = S(pt), t ? ["?.", e, t] : void 0);
|
|
886
941
|
});
|
|
887
|
-
f("?.", (e, t) => (e =
|
|
942
|
+
f("?.", (e, t) => (e = u(e), F(t) ? () => {
|
|
888
943
|
} : (r) => e(r)?.[t]));
|
|
889
|
-
f("?.[]", (e, t) => (e =
|
|
944
|
+
f("?.[]", (e, t) => (e = u(e), t = u(t), (r) => {
|
|
890
945
|
const n = t(r);
|
|
891
946
|
return F(n) ? void 0 : e(r)?.[n];
|
|
892
947
|
}));
|
|
893
948
|
f("?.()", (e, t) => {
|
|
894
|
-
const r = t ? t[0] === "," ? (t = t.slice(1).map(
|
|
949
|
+
const r = t ? t[0] === "," ? (t = t.slice(1).map(u), (o) => t.map((i) => i(o))) : (t = u(t), (o) => [t(o)]) : () => [];
|
|
895
950
|
if (e[0] === "?.") {
|
|
896
|
-
const o =
|
|
951
|
+
const o = u(e[1]), i = e[2];
|
|
897
952
|
return F(i) ? () => {
|
|
898
953
|
} : (s) => o(s)?.[i]?.(...r(s));
|
|
899
954
|
}
|
|
900
955
|
if (e[0] === "?.[]") {
|
|
901
|
-
const o =
|
|
956
|
+
const o = u(e[1]), i = u(e[2]);
|
|
902
957
|
return (s) => {
|
|
903
|
-
const c = o(s),
|
|
904
|
-
return F(
|
|
958
|
+
const c = o(s), d = i(s);
|
|
959
|
+
return F(d) ? void 0 : c?.[d]?.(...r(s));
|
|
905
960
|
};
|
|
906
961
|
}
|
|
907
962
|
if (e[0] === ".") {
|
|
908
|
-
const o =
|
|
963
|
+
const o = u(e[1]), i = e[2];
|
|
909
964
|
return F(i) ? () => {
|
|
910
965
|
} : (s) => o(s)?.[i]?.(...r(s));
|
|
911
966
|
}
|
|
912
967
|
if (e[0] === "[]" && e.length === 3) {
|
|
913
|
-
const o =
|
|
968
|
+
const o = u(e[1]), i = u(e[2]);
|
|
914
969
|
return (s) => {
|
|
915
|
-
const c = o(s),
|
|
916
|
-
return F(
|
|
970
|
+
const c = o(s), d = i(s);
|
|
971
|
+
return F(d) ? void 0 : c?.[d]?.(...r(s));
|
|
917
972
|
};
|
|
918
973
|
}
|
|
919
|
-
const n =
|
|
974
|
+
const n = u(e);
|
|
920
975
|
return (o) => n(o)?.(...r(o));
|
|
921
976
|
});
|
|
922
|
-
const
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
977
|
+
const q = 140;
|
|
978
|
+
V("typeof", q);
|
|
979
|
+
V("void", q);
|
|
980
|
+
V("delete", q);
|
|
981
|
+
te(
|
|
927
982
|
"new",
|
|
928
|
-
|
|
929
|
-
() =>
|
|
983
|
+
q,
|
|
984
|
+
() => Kr(".target") ? (C(7), ["new.target"]) : ["new", S(q)]
|
|
930
985
|
);
|
|
931
|
-
f("typeof", (e) => (e =
|
|
932
|
-
f("void", (e) => (e =
|
|
986
|
+
f("typeof", (e) => (e = u(e), (t) => typeof e(t)));
|
|
987
|
+
f("void", (e) => (e = u(e), (t) => (e(t), void 0)));
|
|
933
988
|
f("delete", (e) => {
|
|
934
989
|
if (e[0] === ".") {
|
|
935
|
-
const t =
|
|
990
|
+
const t = u(e[1]), r = e[2];
|
|
936
991
|
return (n) => delete t(n)[r];
|
|
937
992
|
}
|
|
938
993
|
if (e[0] === "[]") {
|
|
939
|
-
const t =
|
|
994
|
+
const t = u(e[1]), r = u(e[2]);
|
|
940
995
|
return (n) => delete t(n)[r(n)];
|
|
941
996
|
}
|
|
942
997
|
return () => !0;
|
|
943
998
|
});
|
|
944
999
|
f("new", (e) => {
|
|
945
|
-
const t =
|
|
1000
|
+
const t = u(e?.[0] === "()" ? e[1] : e), r = e?.[0] === "()" ? e[2] : null, n = r ? r[0] === "," ? /* @__PURE__ */ ((o) => (i) => o.map((s) => s(i)))(r.slice(1).map(u)) : /* @__PURE__ */ ((o) => (i) => [o(i)])(u(r)) : () => [];
|
|
946
1001
|
return (o) => new (t(o))(...n(o));
|
|
947
1002
|
});
|
|
948
|
-
const
|
|
1003
|
+
const Ye = /* @__PURE__ */ Symbol("accessor"), et = 20, Dn = 40, Xt = 41, Qt = 123, qt = 125, Jt = (e) => (t) => {
|
|
949
1004
|
if (t) return;
|
|
950
|
-
|
|
951
|
-
const r =
|
|
952
|
-
if (!r || (
|
|
1005
|
+
T();
|
|
1006
|
+
const r = B(v.id);
|
|
1007
|
+
if (!r || (T(), m.charCodeAt(h) !== Dn)) return !1;
|
|
953
1008
|
C();
|
|
954
|
-
const n = S(0,
|
|
955
|
-
return
|
|
1009
|
+
const n = S(0, Xt);
|
|
1010
|
+
return T(), m.charCodeAt(h) !== Qt ? !1 : (C(), [e, r, n, S(0, qt)]);
|
|
956
1011
|
};
|
|
957
|
-
O("get",
|
|
958
|
-
O("set",
|
|
959
|
-
O("(",
|
|
1012
|
+
O("get", et - 1, Jt("get"));
|
|
1013
|
+
O("set", et - 1, Jt("set"));
|
|
1014
|
+
O("(", et - 1, (e) => {
|
|
960
1015
|
if (!e || typeof e != "string") return;
|
|
961
|
-
const t = S(0,
|
|
962
|
-
if (
|
|
963
|
-
return C(), [":", e, ["=>", ["()", t], S(0,
|
|
1016
|
+
const t = S(0, Xt) || null;
|
|
1017
|
+
if (T(), m.charCodeAt(h) === Qt)
|
|
1018
|
+
return C(), [":", e, ["=>", ["()", t], S(0, qt) || null]];
|
|
964
1019
|
});
|
|
965
|
-
f("get", (e, t) => (t = t ?
|
|
966
|
-
}, (r) => [[
|
|
1020
|
+
f("get", (e, t) => (t = t ? u(t) : () => {
|
|
1021
|
+
}, (r) => [[Ye, e, {
|
|
967
1022
|
get: function() {
|
|
968
1023
|
const n = Object.create(r || {});
|
|
969
1024
|
return n.this = this, t(n);
|
|
970
1025
|
}
|
|
971
1026
|
}]]));
|
|
972
|
-
f("set", (e, t, r) => (r = r ?
|
|
973
|
-
}, (n) => [[
|
|
1027
|
+
f("set", (e, t, r) => (r = r ? u(r) : () => {
|
|
1028
|
+
}, (n) => [[Ye, e, {
|
|
974
1029
|
set: function(o) {
|
|
975
1030
|
const i = Object.create(n || {});
|
|
976
1031
|
i.this = this, i[t] = o, r(i);
|
|
977
1032
|
}
|
|
978
1033
|
}]]));
|
|
979
|
-
const
|
|
980
|
-
v.prop = (e) =>
|
|
981
|
-
const
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
$(":",
|
|
1034
|
+
const Fn = 20, Zt = 200;
|
|
1035
|
+
v.prop = (e) => Gr(e) !== 58;
|
|
1036
|
+
const Rn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
|
|
1037
|
+
Ge("[]", Zt);
|
|
1038
|
+
Ge("{}", Zt);
|
|
1039
|
+
$(":", Fn - 1, !0);
|
|
985
1040
|
f("{}", (e, t) => {
|
|
986
1041
|
if (t !== void 0) return;
|
|
987
|
-
if (!
|
|
1042
|
+
if (!Rn(e)) return u(["{", e]);
|
|
988
1043
|
e = e ? e[0] !== "," ? [e] : e.slice(1) : [];
|
|
989
|
-
const r = e.map((n) =>
|
|
1044
|
+
const r = e.map((n) => u(typeof n == "string" ? [":", n, n] : n));
|
|
990
1045
|
return (n) => {
|
|
991
1046
|
const o = {}, i = {};
|
|
992
1047
|
for (const s of r.flatMap((c) => c(n)))
|
|
993
|
-
if (s[0] ===
|
|
994
|
-
const [, c,
|
|
995
|
-
i[c] = { ...i[c], ...
|
|
1048
|
+
if (s[0] === Ye) {
|
|
1049
|
+
const [, c, d] = s;
|
|
1050
|
+
i[c] = { ...i[c], ...d, configurable: !0, enumerable: !0 };
|
|
996
1051
|
} else o[s[0]] = s[1];
|
|
997
1052
|
for (const s in i) Object.defineProperty(o, s, i[s]);
|
|
998
1053
|
return o;
|
|
999
1054
|
};
|
|
1000
1055
|
});
|
|
1001
|
-
f("{", (e) => (e = e ?
|
|
1056
|
+
f("{", (e) => (e = e ? u(e) : () => {
|
|
1002
1057
|
}, (t) => e(Object.create(t))));
|
|
1003
|
-
f(":", (e, t) => (t =
|
|
1004
|
-
const
|
|
1005
|
-
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" },
|
|
1058
|
+
f(":", (e, t) => (t = u(t), Array.isArray(e) ? (e = u(e), (r) => [[e(r), t(r)]]) : (r) => [[e, t(r)]]));
|
|
1059
|
+
const Tn = 170, pe = 96, Nn = 36, Vn = 123, Ln = 92, _n = { n: `
|
|
1060
|
+
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, ht = () => {
|
|
1006
1061
|
const e = [];
|
|
1007
|
-
for (let t = "", r; (r = m.charCodeAt(h)) !==
|
|
1008
|
-
r ? r ===
|
|
1062
|
+
for (let t = "", r; (r = m.charCodeAt(h)) !== pe; )
|
|
1063
|
+
r ? r === Ln ? (C(), t += _n[m[h]] || m[h], C()) : r === Nn && m.charCodeAt(h + 1) === Vn ? (t && e.push([, t]), t = "", C(2), e.push(S(0, 125))) : (t += m[h], C(), r = m.charCodeAt(h), r === pe && t && e.push([, t])) : U("Unterminated template");
|
|
1009
1064
|
return C(), e;
|
|
1010
|
-
},
|
|
1011
|
-
j[
|
|
1065
|
+
}, Mn = j[pe];
|
|
1066
|
+
j[pe] = (e, t) => e && t < Tn ? v.asi && v.newline ? void 0 : (C(), ["``", e, ...ht()]) : (
|
|
1012
1067
|
// tagged
|
|
1013
1068
|
e ? (
|
|
1014
1069
|
// plain
|
|
1015
|
-
|
|
1016
|
-
) : (C(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(
|
|
1070
|
+
Mn?.(e, t)
|
|
1071
|
+
) : (C(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(ht()))
|
|
1017
1072
|
);
|
|
1018
|
-
f("`", (...e) => (e = e.map(
|
|
1073
|
+
f("`", (...e) => (e = e.map(u), (t) => e.map((r) => r(t)).join("")));
|
|
1019
1074
|
f("``", (e, ...t) => {
|
|
1020
|
-
e =
|
|
1075
|
+
e = u(e);
|
|
1021
1076
|
const r = [], n = [];
|
|
1022
1077
|
for (const i of t)
|
|
1023
|
-
Array.isArray(i) && i[0] === void 0 ? r.push(i[1]) : n.push(
|
|
1078
|
+
Array.isArray(i) && i[0] === void 0 ? r.push(i[1]) : n.push(u(i));
|
|
1024
1079
|
const o = Object.assign([...r], { raw: r });
|
|
1025
1080
|
return (i) => e(i)(o, ...n.map((s) => s(i)));
|
|
1026
1081
|
});
|
|
1027
1082
|
v.string["'"] = !0;
|
|
1028
1083
|
v.number = { "0x": 16, "0b": 2, "0o": 8 };
|
|
1029
|
-
const
|
|
1084
|
+
const Un = {
|
|
1030
1085
|
log: (e, t) => (t ? console.log(t, e) : console.log(e), e)
|
|
1031
|
-
},
|
|
1032
|
-
function
|
|
1033
|
-
const t =
|
|
1086
|
+
}, Hn = 2e3, re = /* @__PURE__ */ new Map();
|
|
1087
|
+
function tt(e) {
|
|
1088
|
+
const t = re.get(e);
|
|
1034
1089
|
if (t !== void 0)
|
|
1035
1090
|
return t;
|
|
1036
|
-
const r =
|
|
1037
|
-
return
|
|
1091
|
+
const r = u(v(zn(e)));
|
|
1092
|
+
return re.size >= Hn && re.clear(), re.set(e, r), r;
|
|
1038
1093
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return
|
|
1094
|
+
function K(e, t, r, n, o, i) {
|
|
1095
|
+
return tt(e)({
|
|
1041
1096
|
$form: t,
|
|
1042
1097
|
$meta: r,
|
|
1043
1098
|
$errors: n,
|
|
1044
1099
|
$formIsInvalid: o,
|
|
1045
|
-
$log:
|
|
1100
|
+
$log: Un.log,
|
|
1046
1101
|
$fn: {},
|
|
1047
1102
|
...i
|
|
1048
1103
|
}) === !0;
|
|
1049
1104
|
}
|
|
1050
|
-
function
|
|
1105
|
+
function zn(e) {
|
|
1051
1106
|
return e.replace(
|
|
1052
1107
|
/(\?\.|\.)(\d+)/g,
|
|
1053
|
-
(t, r, n, o) => r === "." &&
|
|
1108
|
+
(t, r, n, o) => r === "." && bn(e, o) ? t : r === "?." ? `?.[${n}]` : `[${n}]`
|
|
1054
1109
|
);
|
|
1055
1110
|
}
|
|
1056
|
-
function
|
|
1111
|
+
function bn(e, t) {
|
|
1057
1112
|
let r = t - 1, n = !1;
|
|
1058
1113
|
for (; r >= 0 && e[r] >= "0" && e[r] <= "9"; )
|
|
1059
1114
|
n = !0, r--;
|
|
@@ -1062,28 +1117,28 @@ function Rn(e, t) {
|
|
|
1062
1117
|
const o = e[r];
|
|
1063
1118
|
return n ? !/[\w$.\]]/.test(o) : !/[\w$)\]]/.test(o);
|
|
1064
1119
|
}
|
|
1065
|
-
const
|
|
1120
|
+
const Bn = (e) => (t, r) => {
|
|
1066
1121
|
let n = t.formDef.states;
|
|
1067
1122
|
if (!n || Object.keys(n).length === 0 || t.formHealth.status === "errored")
|
|
1068
1123
|
return t;
|
|
1069
|
-
const { $formIsInvalid: o, $errors: i } = r ??
|
|
1070
|
-
n =
|
|
1124
|
+
const { $formIsInvalid: o, $errors: i } = r ?? $e(t);
|
|
1125
|
+
n = Gn(n);
|
|
1071
1126
|
let s = [], c = { status: "ok" };
|
|
1072
1127
|
try {
|
|
1073
|
-
s = Object.keys(n).map((
|
|
1074
|
-
const l = n[
|
|
1128
|
+
s = Object.keys(n).map((d) => {
|
|
1129
|
+
const l = n[d];
|
|
1075
1130
|
let a;
|
|
1076
1131
|
try {
|
|
1077
|
-
a =
|
|
1132
|
+
a = K(l, t.data, t.meta, i, o, {
|
|
1078
1133
|
$fn: e
|
|
1079
1134
|
});
|
|
1080
1135
|
} catch {
|
|
1081
1136
|
a = !1;
|
|
1082
1137
|
}
|
|
1083
|
-
return a === !0 ?
|
|
1084
|
-
}).filter((
|
|
1085
|
-
} catch (
|
|
1086
|
-
const l =
|
|
1138
|
+
return a === !0 ? d : void 0;
|
|
1139
|
+
}).filter((d) => d !== void 0);
|
|
1140
|
+
} catch (d) {
|
|
1141
|
+
const l = d, a = P.calculateCurrentStateError;
|
|
1087
1142
|
c = {
|
|
1088
1143
|
status: "errored",
|
|
1089
1144
|
message: `[${a}] ${l.message}`,
|
|
@@ -1092,7 +1147,7 @@ const Ln = (e) => (t, r) => {
|
|
|
1092
1147
|
}
|
|
1093
1148
|
return { ...t, currentStates: s, formHealth: c };
|
|
1094
1149
|
};
|
|
1095
|
-
function
|
|
1150
|
+
function Gn(e) {
|
|
1096
1151
|
const t = {};
|
|
1097
1152
|
function r(n) {
|
|
1098
1153
|
const o = n.split(":"), i = [];
|
|
@@ -1108,45 +1163,45 @@ function _n(e) {
|
|
|
1108
1163
|
}
|
|
1109
1164
|
return t;
|
|
1110
1165
|
}
|
|
1111
|
-
const
|
|
1112
|
-
function
|
|
1166
|
+
const J = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e;
|
|
1167
|
+
function mt(e) {
|
|
1113
1168
|
if (typeof e != "object" || e === null)
|
|
1114
1169
|
return !1;
|
|
1115
1170
|
const t = Object.getPrototypeOf(e);
|
|
1116
1171
|
return t === Object.prototype || t === null;
|
|
1117
1172
|
}
|
|
1118
|
-
function
|
|
1173
|
+
function he(e, t) {
|
|
1119
1174
|
if (e === t)
|
|
1120
1175
|
return !0;
|
|
1121
1176
|
if (Array.isArray(e) && Array.isArray(t))
|
|
1122
|
-
return e.length === t.length && e.every((r, n) =>
|
|
1123
|
-
if (
|
|
1177
|
+
return e.length === t.length && e.every((r, n) => he(r, t[n]));
|
|
1178
|
+
if (mt(e) && mt(t)) {
|
|
1124
1179
|
const r = Object.keys(e);
|
|
1125
|
-
return r.length !== Object.keys(t).length ? !1 : r.every((n) => n in t &&
|
|
1180
|
+
return r.length !== Object.keys(t).length ? !1 : r.every((n) => n in t && he(e[n], t[n]));
|
|
1126
1181
|
}
|
|
1127
1182
|
return !1;
|
|
1128
1183
|
}
|
|
1129
|
-
const
|
|
1130
|
-
const { $formIsInvalid: n, $errors: o } = r ??
|
|
1184
|
+
const Kn = (e) => (t, r) => {
|
|
1185
|
+
const { $formIsInvalid: n, $errors: o } = r ?? $e(t);
|
|
1131
1186
|
return {
|
|
1132
1187
|
...t,
|
|
1133
|
-
widgetFlags:
|
|
1188
|
+
widgetFlags: xn(t, o, n, e)
|
|
1134
1189
|
};
|
|
1135
1190
|
};
|
|
1136
|
-
function
|
|
1191
|
+
function xn(e, t, r, n) {
|
|
1137
1192
|
const o = [];
|
|
1138
1193
|
for (const [s, c] of Object.entries(e.resolvedSources))
|
|
1139
|
-
if (
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1142
|
-
} else
|
|
1194
|
+
if (W(c)) {
|
|
1195
|
+
const d = vt(s, c, e);
|
|
1196
|
+
gt(d) && o.push(d);
|
|
1197
|
+
} else gt(c) && o.push(vt(s, c, e));
|
|
1143
1198
|
const i = o.reduce(
|
|
1144
1199
|
(s, c) => {
|
|
1145
1200
|
s[c.uid] = s[c.uid] || {};
|
|
1146
|
-
const
|
|
1201
|
+
const d = e.repeaterItemScopes[c.uid], l = d ? { $item: N(e.data, d.itemPath), $index: d.index, $fn: n } : { $fn: n };
|
|
1147
1202
|
return c.include && "in" in c.include ? s[c.uid].hidden = !c.include.in.some(
|
|
1148
1203
|
(a) => e.currentStates.includes(a)
|
|
1149
|
-
) : c.include && "when" in c.include && (s[c.uid].hidden = !
|
|
1204
|
+
) : c.include && "when" in c.include && (s[c.uid].hidden = !K(
|
|
1150
1205
|
c.include.when,
|
|
1151
1206
|
e.data,
|
|
1152
1207
|
e.meta,
|
|
@@ -1155,21 +1210,21 @@ function Un(e, t, r, n) {
|
|
|
1155
1210
|
l
|
|
1156
1211
|
)), c.exclude && "from" in c.exclude ? s[c.uid].hidden = c.exclude.from.some(
|
|
1157
1212
|
(a) => e.currentStates.includes(a)
|
|
1158
|
-
) : c.exclude && "when" in c.exclude && (s[c.uid].hidden =
|
|
1213
|
+
) : c.exclude && "when" in c.exclude && (s[c.uid].hidden = K(
|
|
1159
1214
|
c.exclude.when,
|
|
1160
1215
|
e.data,
|
|
1161
1216
|
e.meta,
|
|
1162
1217
|
t,
|
|
1163
1218
|
r,
|
|
1164
1219
|
l
|
|
1165
|
-
)), (I(c) ||
|
|
1220
|
+
)), (I(c) || ie(c)) && J(c.disabled) && (s[c.uid].disabled = K(
|
|
1166
1221
|
c.disabled.when,
|
|
1167
1222
|
e.data,
|
|
1168
1223
|
e.meta,
|
|
1169
1224
|
t,
|
|
1170
1225
|
r,
|
|
1171
1226
|
l
|
|
1172
|
-
)), I(c) &&
|
|
1227
|
+
)), I(c) && J(c.readonly) && (s[c.uid].readonly = K(
|
|
1173
1228
|
c.readonly.when,
|
|
1174
1229
|
e.data,
|
|
1175
1230
|
e.meta,
|
|
@@ -1180,64 +1235,64 @@ function Un(e, t, r, n) {
|
|
|
1180
1235
|
},
|
|
1181
1236
|
{}
|
|
1182
1237
|
);
|
|
1183
|
-
return
|
|
1238
|
+
return Xn(e, i), i;
|
|
1184
1239
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return !!(e.include && ("in" in e.include || "when" in e.include) || e.exclude && ("from" in e.exclude || "when" in e.exclude) || (I(e) ||
|
|
1240
|
+
function gt(e) {
|
|
1241
|
+
return !!(e.include && ("in" in e.include || "when" in e.include) || e.exclude && ("from" in e.exclude || "when" in e.exclude) || (I(e) || ie(e)) && J(e.disabled) || I(e) && J(e.readonly));
|
|
1187
1242
|
}
|
|
1188
|
-
function
|
|
1243
|
+
function Xn(e, t) {
|
|
1189
1244
|
const r = Object.keys(t).filter((n) => t[n].hidden === !0);
|
|
1190
1245
|
for (const n of r)
|
|
1191
|
-
|
|
1246
|
+
Yt(n, e, t);
|
|
1192
1247
|
}
|
|
1193
|
-
function
|
|
1248
|
+
function Yt(e, t, r) {
|
|
1194
1249
|
const n = t.resolvedSources[e];
|
|
1195
1250
|
if (n !== void 0) {
|
|
1196
|
-
if (
|
|
1251
|
+
if (X(n) || W(n) && n.path !== void 0) {
|
|
1197
1252
|
const o = `${n.path}.`;
|
|
1198
1253
|
for (const [i, s] of Object.entries(t.repeaterItemScopes))
|
|
1199
|
-
s.itemPath.startsWith(o) &&
|
|
1254
|
+
s.itemPath.startsWith(o) && yt(i, r);
|
|
1200
1255
|
}
|
|
1201
|
-
if (
|
|
1202
|
-
const o =
|
|
1256
|
+
if (M(n)) {
|
|
1257
|
+
const o = Se(e);
|
|
1203
1258
|
for (const i of n.children) {
|
|
1204
|
-
const s = o.length > 0 ?
|
|
1259
|
+
const s = o.length > 0 ? be(i.uid, o) : i.uid;
|
|
1205
1260
|
if (t.resolvedSources[s] === void 0)
|
|
1206
1261
|
continue;
|
|
1207
1262
|
const c = r[s]?.hidden === !0;
|
|
1208
|
-
|
|
1263
|
+
yt(s, r), c || Yt(s, t, r);
|
|
1209
1264
|
}
|
|
1210
1265
|
}
|
|
1211
1266
|
}
|
|
1212
1267
|
}
|
|
1213
|
-
function
|
|
1268
|
+
function yt(e, t) {
|
|
1214
1269
|
t[e] = t[e] || {}, t[e].hidden = !0;
|
|
1215
1270
|
}
|
|
1216
|
-
function
|
|
1271
|
+
function vt(e, t, r) {
|
|
1217
1272
|
const n = r.repeaterItemScopes[e];
|
|
1218
1273
|
let o;
|
|
1219
|
-
|
|
1274
|
+
W(t) ? (o = {
|
|
1220
1275
|
...t({
|
|
1221
1276
|
$form: r.data,
|
|
1222
|
-
$item: n ?
|
|
1277
|
+
$item: n ? N(r.data, n.itemPath) : void 0,
|
|
1223
1278
|
$index: n?.index,
|
|
1224
1279
|
errors: void 0,
|
|
1225
1280
|
touched: void 0,
|
|
1226
1281
|
translate: void 0
|
|
1227
1282
|
})
|
|
1228
1283
|
}, o.uid = e) : o = t;
|
|
1229
|
-
const i =
|
|
1230
|
-
return i
|
|
1284
|
+
const i = r.repeaterRows[e];
|
|
1285
|
+
return i !== void 0 && (o = zr(o, i)), o;
|
|
1231
1286
|
}
|
|
1232
|
-
const
|
|
1287
|
+
const er = (e, t) => (r, n) => {
|
|
1233
1288
|
try {
|
|
1234
|
-
const o = n ??
|
|
1289
|
+
const o = n ?? $e(r);
|
|
1235
1290
|
return {
|
|
1236
1291
|
...r,
|
|
1237
|
-
calculatedWidgets:
|
|
1292
|
+
calculatedWidgets: Qn(r, e, t, o)
|
|
1238
1293
|
};
|
|
1239
1294
|
} catch (o) {
|
|
1240
|
-
const i = o, s = i.code ??
|
|
1295
|
+
const i = o, s = i.code ?? P.calculateWidgetPropsError;
|
|
1241
1296
|
return {
|
|
1242
1297
|
...r,
|
|
1243
1298
|
formHealth: {
|
|
@@ -1248,19 +1303,19 @@ const Zt = (e, t) => (r, n) => {
|
|
|
1248
1303
|
};
|
|
1249
1304
|
}
|
|
1250
1305
|
};
|
|
1251
|
-
function
|
|
1252
|
-
const i =
|
|
1306
|
+
function Qn(e, t, r, { $formIsInvalid: n, $errors: o }) {
|
|
1307
|
+
const i = mo(e, t, n, o, r), s = {};
|
|
1253
1308
|
for (const c of Object.keys(e.calculatedWidgets)) {
|
|
1254
1309
|
if (e.widgetFlags[c]?.hidden)
|
|
1255
1310
|
continue;
|
|
1256
|
-
const
|
|
1257
|
-
if (
|
|
1258
|
-
s[c] =
|
|
1311
|
+
const d = e.calculatedWidgets[c], l = d.source, a = e.repeaterItemScopes[c];
|
|
1312
|
+
if (W(l)) {
|
|
1313
|
+
s[c] = qn(d, c, l, e, t, a);
|
|
1259
1314
|
continue;
|
|
1260
1315
|
}
|
|
1261
|
-
const p = a ? { ...i, $item:
|
|
1262
|
-
s[c] =
|
|
1263
|
-
|
|
1316
|
+
const p = a ? { ...i, $item: N(i.$form, a.itemPath), $index: a.index } : i;
|
|
1317
|
+
s[c] = Jn(
|
|
1318
|
+
d,
|
|
1264
1319
|
l,
|
|
1265
1320
|
e,
|
|
1266
1321
|
p
|
|
@@ -1268,83 +1323,83 @@ function zn(e, t, r, { $formIsInvalid: n, $errors: o }) {
|
|
|
1268
1323
|
}
|
|
1269
1324
|
return s;
|
|
1270
1325
|
}
|
|
1271
|
-
function
|
|
1326
|
+
function qn(e, t, r, n, o, i) {
|
|
1272
1327
|
const s = {
|
|
1273
1328
|
...r({
|
|
1274
1329
|
$form: n.data,
|
|
1275
1330
|
errors: r.path ? n.validations[r.path] : void 0,
|
|
1276
1331
|
touched: r.path ? n.touchedControls[r.path] : void 0,
|
|
1277
1332
|
translate: o.translate,
|
|
1278
|
-
$item: i ?
|
|
1333
|
+
$item: i ? N(n.data, i.itemPath) : void 0,
|
|
1279
1334
|
$index: i?.index
|
|
1280
1335
|
})
|
|
1281
1336
|
};
|
|
1282
1337
|
s.uid = t, r.path !== void 0 && (s.path = r.path);
|
|
1283
1338
|
const c = n.widgetPropOverrides[t];
|
|
1284
|
-
return c !== void 0 && (s.props = { ...s.props, ...c }), e.current &&
|
|
1339
|
+
return c !== void 0 && (s.props = { ...s.props, ...c }), e.current && he(e.current, s) ? e : { source: r, current: s };
|
|
1285
1340
|
}
|
|
1286
|
-
function
|
|
1287
|
-
const o = new
|
|
1288
|
-
return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind),
|
|
1341
|
+
function Jn(e, t, r, n) {
|
|
1342
|
+
const o = new ho(t, e.current);
|
|
1343
|
+
return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), vr(t) ? Zn(o, n) : ie(t) ? Yn(o, n) : I(t) ? eo(o, n) : M(t) && to(o, n), ro(t, o, n, r), (ie(t) || I(t)) && no(t, o, n), M(t) && oo(t, o, r), o.changed ? { source: e.source, current: o.current } : e;
|
|
1289
1344
|
}
|
|
1290
|
-
function
|
|
1291
|
-
|
|
1345
|
+
function Zn(e, t) {
|
|
1346
|
+
E(e, t, "size"), E(e, t, "include"), E(e, t, "exclude");
|
|
1292
1347
|
}
|
|
1293
|
-
function
|
|
1294
|
-
|
|
1348
|
+
function Yn(e, t) {
|
|
1349
|
+
E(e, t, "size"), E(e, t, "include"), E(e, t, "exclude"), E(e, t, "label"), E(e, t, "disabled"), E(e, t, "actionType");
|
|
1295
1350
|
}
|
|
1296
|
-
function
|
|
1297
|
-
|
|
1351
|
+
function eo(e, t) {
|
|
1352
|
+
E(e, t, "size"), E(e, t, "include"), E(e, t, "exclude"), E(e, t, "label"), E(e, t, "disabled"), E(e, t, "readonly"), E(e, t, "validator"), E(e, t, "path"), E(e, t, "defaultValue");
|
|
1298
1353
|
}
|
|
1299
|
-
function
|
|
1300
|
-
|
|
1354
|
+
function to(e, t) {
|
|
1355
|
+
E(e, t, "size"), E(e, t, "include"), E(e, t, "exclude");
|
|
1301
1356
|
}
|
|
1302
|
-
function
|
|
1357
|
+
function ro(e, t, r, n) {
|
|
1303
1358
|
const o = n.widgetPropOverrides[e.uid] ?? {}, i = { ...e.props ?? {}, ...o };
|
|
1304
|
-
for (const s of
|
|
1305
|
-
|
|
1359
|
+
for (const s of nr(Object.keys(i)))
|
|
1360
|
+
io(t, r, s);
|
|
1306
1361
|
}
|
|
1307
|
-
function
|
|
1362
|
+
function no(e, t, r) {
|
|
1308
1363
|
const n = e.on ?? {};
|
|
1309
|
-
for (const o of
|
|
1310
|
-
|
|
1364
|
+
for (const o of nr(Object.keys(n)))
|
|
1365
|
+
so(t, r, o);
|
|
1311
1366
|
}
|
|
1312
|
-
function
|
|
1313
|
-
const n =
|
|
1367
|
+
function oo(e, t, r) {
|
|
1368
|
+
const n = Se(e.uid), o = yo(e.children, n, r.widgetFlags);
|
|
1314
1369
|
t.current.children = o;
|
|
1315
1370
|
const i = t.previous.children ?? [];
|
|
1316
|
-
i.length === o.length && o.every((c,
|
|
1371
|
+
i.length === o.length && o.every((c, d) => i[d] && i[d].uid === o[d].uid) || t.markChanged();
|
|
1317
1372
|
}
|
|
1318
|
-
function
|
|
1373
|
+
function E(e, t, r) {
|
|
1319
1374
|
const n = e.source;
|
|
1320
|
-
if (!
|
|
1375
|
+
if (!go(n, r))
|
|
1321
1376
|
return;
|
|
1322
|
-
const o =
|
|
1377
|
+
const o = nt(n, r, t.sortedStates);
|
|
1323
1378
|
let i;
|
|
1324
1379
|
switch (r) {
|
|
1325
1380
|
case "disabled":
|
|
1326
1381
|
case "readonly":
|
|
1327
|
-
i =
|
|
1382
|
+
i = lo(o, t, e.source.uid, r);
|
|
1328
1383
|
break;
|
|
1329
1384
|
case "defaultValue":
|
|
1330
1385
|
i = o;
|
|
1331
1386
|
break;
|
|
1332
1387
|
default:
|
|
1333
|
-
i =
|
|
1388
|
+
i = rr(o, t);
|
|
1334
1389
|
}
|
|
1335
1390
|
e.write(r, i);
|
|
1336
1391
|
}
|
|
1337
|
-
function
|
|
1338
|
-
const n = e.source.props, o =
|
|
1339
|
-
let i =
|
|
1392
|
+
function io(e, t, r) {
|
|
1393
|
+
const n = e.source.props, o = nt(n, r, t.sortedStates);
|
|
1394
|
+
let i = rr(o, t);
|
|
1340
1395
|
const s = t.widgetPropOverrides[e.source.uid]?.[r];
|
|
1341
1396
|
s !== void 0 && (i = s), e.write(`props.${r}`, i);
|
|
1342
1397
|
}
|
|
1343
|
-
function
|
|
1344
|
-
const n = e.source.on, o =
|
|
1345
|
-
e.write(`on.${r}`,
|
|
1398
|
+
function so(e, t, r) {
|
|
1399
|
+
const n = e.source.on, o = nt(n, r, t.sortedStates);
|
|
1400
|
+
e.write(`on.${r}`, ao(o, t));
|
|
1346
1401
|
}
|
|
1347
|
-
function
|
|
1402
|
+
function rt(e, t) {
|
|
1348
1403
|
return e({
|
|
1349
1404
|
$form: t.$form,
|
|
1350
1405
|
translate: t.localization.translate,
|
|
@@ -1352,14 +1407,14 @@ function tt(e, t) {
|
|
|
1352
1407
|
$index: t.$index
|
|
1353
1408
|
});
|
|
1354
1409
|
}
|
|
1355
|
-
function
|
|
1356
|
-
return t.localization.translate(e.key,
|
|
1410
|
+
function co(e, t) {
|
|
1411
|
+
return t.localization.translate(e.key, po(e.params, t), e.default);
|
|
1357
1412
|
}
|
|
1358
|
-
const
|
|
1359
|
-
function
|
|
1360
|
-
return e.includes("{{") ? e.replace(
|
|
1413
|
+
const uo = /\{\{([^}]+)\}\}/g;
|
|
1414
|
+
function tr(e, t) {
|
|
1415
|
+
return e.includes("{{") ? e.replace(uo, (r, n) => {
|
|
1361
1416
|
try {
|
|
1362
|
-
const o =
|
|
1417
|
+
const o = tt(n.trim())({
|
|
1363
1418
|
$form: t.$form,
|
|
1364
1419
|
$meta: t.$meta,
|
|
1365
1420
|
$errors: t.$errors,
|
|
@@ -1371,20 +1426,20 @@ function Yt(e, t) {
|
|
|
1371
1426
|
return o == null ? "" : String(o);
|
|
1372
1427
|
} catch (o) {
|
|
1373
1428
|
const i = o instanceof Error ? o.message : String(o);
|
|
1374
|
-
throw new
|
|
1429
|
+
throw new or(`Failed to evaluate '{{${n.trim()}}}': ${i}`);
|
|
1375
1430
|
}
|
|
1376
1431
|
}) : e;
|
|
1377
1432
|
}
|
|
1378
|
-
function
|
|
1379
|
-
return typeof e == "function" ?
|
|
1433
|
+
function rr(e, t) {
|
|
1434
|
+
return typeof e == "function" ? rt(e, t) : kr(e) ? co(e, t) : typeof e == "string" ? tr(e, t) : e;
|
|
1380
1435
|
}
|
|
1381
|
-
function
|
|
1382
|
-
return typeof e == "function" ?
|
|
1436
|
+
function lo(e, t, r, n) {
|
|
1437
|
+
return typeof e == "function" ? rt(e, t) : J(e) ? t.widgetFlags[r]?.[n] : typeof e == "string" ? tr(e, t) : e;
|
|
1383
1438
|
}
|
|
1384
|
-
function
|
|
1385
|
-
return typeof e == "function" ?
|
|
1439
|
+
function ao(e, t) {
|
|
1440
|
+
return typeof e == "function" ? rt(e, t) : e;
|
|
1386
1441
|
}
|
|
1387
|
-
function
|
|
1442
|
+
function nt(e, t, r) {
|
|
1388
1443
|
if (e) {
|
|
1389
1444
|
for (const n of r) {
|
|
1390
1445
|
const o = e[`${t}.${n}`];
|
|
@@ -1394,15 +1449,15 @@ function rt(e, t, r) {
|
|
|
1394
1449
|
return e[t];
|
|
1395
1450
|
}
|
|
1396
1451
|
}
|
|
1397
|
-
function
|
|
1452
|
+
function fo(e) {
|
|
1398
1453
|
return e.startsWith("$form") || e.startsWith("$meta") || e.startsWith("$errors") || e.startsWith("$item") || e.startsWith("$index") || e.startsWith("$fn") || e === "$formIsInvalid";
|
|
1399
1454
|
}
|
|
1400
|
-
function
|
|
1455
|
+
function po(e, t) {
|
|
1401
1456
|
return e && Object.keys(e).reduce((r, n) => {
|
|
1402
1457
|
const o = String(e[n]);
|
|
1403
|
-
if (
|
|
1458
|
+
if (fo(o))
|
|
1404
1459
|
try {
|
|
1405
|
-
const i =
|
|
1460
|
+
const i = tt(o)({
|
|
1406
1461
|
$form: t.$form,
|
|
1407
1462
|
$meta: t.$meta,
|
|
1408
1463
|
$errors: t.$errors,
|
|
@@ -1414,14 +1469,14 @@ function io(e, t) {
|
|
|
1414
1469
|
r[n] = i ?? o;
|
|
1415
1470
|
} catch (i) {
|
|
1416
1471
|
const s = i instanceof Error ? i.message : String(i);
|
|
1417
|
-
throw new
|
|
1472
|
+
throw new or(`Failed to evaluate i18n param '${o}': ${s}`);
|
|
1418
1473
|
}
|
|
1419
1474
|
else
|
|
1420
1475
|
r[n] = o;
|
|
1421
1476
|
return r;
|
|
1422
1477
|
}, {});
|
|
1423
1478
|
}
|
|
1424
|
-
class
|
|
1479
|
+
class ho {
|
|
1425
1480
|
constructor(t, r) {
|
|
1426
1481
|
this._changed = !1, this.source = t, this.previous = r, this.current = {};
|
|
1427
1482
|
}
|
|
@@ -1432,15 +1487,15 @@ class so {
|
|
|
1432
1487
|
this._changed = !0;
|
|
1433
1488
|
}
|
|
1434
1489
|
write(t, r) {
|
|
1435
|
-
const n =
|
|
1436
|
-
if (
|
|
1437
|
-
|
|
1490
|
+
const n = N(this.previous, t);
|
|
1491
|
+
if (he(n, r)) {
|
|
1492
|
+
ke(this.current, t, n);
|
|
1438
1493
|
return;
|
|
1439
1494
|
}
|
|
1440
|
-
|
|
1495
|
+
ke(this.current, t, r), this._changed = !0;
|
|
1441
1496
|
}
|
|
1442
1497
|
}
|
|
1443
|
-
function
|
|
1498
|
+
function mo(e, t, r, n, o) {
|
|
1444
1499
|
return {
|
|
1445
1500
|
sortedStates: [...e.currentStates].sort((i, s) => s.length - i.length),
|
|
1446
1501
|
widgetPropOverrides: e.widgetPropOverrides,
|
|
@@ -1453,46 +1508,46 @@ function co(e, t, r, n, o) {
|
|
|
1453
1508
|
$fn: o
|
|
1454
1509
|
};
|
|
1455
1510
|
}
|
|
1456
|
-
function
|
|
1511
|
+
function go(e, t) {
|
|
1457
1512
|
if (t in e)
|
|
1458
1513
|
return !0;
|
|
1459
1514
|
const r = `${t}.`;
|
|
1460
1515
|
return Object.keys(e).some((n) => n.startsWith(r));
|
|
1461
1516
|
}
|
|
1462
|
-
function
|
|
1517
|
+
function nr(e) {
|
|
1463
1518
|
return Array.from(new Set(e.map((t) => t.split(".")[0])));
|
|
1464
1519
|
}
|
|
1465
|
-
function
|
|
1520
|
+
function yo(e, t, r) {
|
|
1466
1521
|
const n = t.map((o) => `[${o}]`).join("");
|
|
1467
1522
|
return e.filter((o) => {
|
|
1468
1523
|
const i = o.uid + n, s = r[i];
|
|
1469
1524
|
return !s || s.hidden !== !0;
|
|
1470
1525
|
});
|
|
1471
1526
|
}
|
|
1472
|
-
class
|
|
1527
|
+
class or extends Error {
|
|
1473
1528
|
constructor() {
|
|
1474
|
-
super(...arguments), this.code =
|
|
1529
|
+
super(...arguments), this.code = P.resolveStringInterpolationError, this.name = "StringInterpolationError";
|
|
1475
1530
|
}
|
|
1476
1531
|
}
|
|
1477
|
-
const
|
|
1478
|
-
const t =
|
|
1532
|
+
const vo = (e) => {
|
|
1533
|
+
const t = $o(e.resolvedSources), r = ne(
|
|
1479
1534
|
e.widgetPropOverrides,
|
|
1480
1535
|
(s) => s in e.resolvedSources
|
|
1481
|
-
), n =
|
|
1536
|
+
), n = ne(e.touchedControls, (s) => t.has(s)), o = ne(e.validations, (s) => t.has(s)), i = ne(
|
|
1482
1537
|
e.injectedValidations,
|
|
1483
1538
|
(s) => t.has(s)
|
|
1484
1539
|
);
|
|
1485
1540
|
return r === e.widgetPropOverrides && n === e.touchedControls && o === e.validations && i === e.injectedValidations ? e : { ...e, widgetPropOverrides: r, touchedControls: n, validations: o, injectedValidations: i };
|
|
1486
1541
|
};
|
|
1487
|
-
function
|
|
1542
|
+
function $o(e) {
|
|
1488
1543
|
const t = /* @__PURE__ */ new Set();
|
|
1489
1544
|
for (const r of Object.values(e)) {
|
|
1490
|
-
const n =
|
|
1545
|
+
const n = R(r);
|
|
1491
1546
|
n !== void 0 && t.add(n);
|
|
1492
1547
|
}
|
|
1493
1548
|
return t;
|
|
1494
1549
|
}
|
|
1495
|
-
function
|
|
1550
|
+
function ne(e, t) {
|
|
1496
1551
|
const r = Object.keys(e).filter(t);
|
|
1497
1552
|
if (r.length === Object.keys(e).length)
|
|
1498
1553
|
return e;
|
|
@@ -1501,7 +1556,7 @@ function re(e, t) {
|
|
|
1501
1556
|
n[o] = e[o];
|
|
1502
1557
|
return n;
|
|
1503
1558
|
}
|
|
1504
|
-
const
|
|
1559
|
+
const So = (e) => {
|
|
1505
1560
|
const t = Object.keys(e.resolvedSources), r = {};
|
|
1506
1561
|
let n = t.length !== Object.keys(e.calculatedWidgets).length;
|
|
1507
1562
|
for (const o of t) {
|
|
@@ -1512,9 +1567,9 @@ const po = (e) => {
|
|
|
1512
1567
|
}, n = !0);
|
|
1513
1568
|
}
|
|
1514
1569
|
return n ? { ...e, calculatedWidgets: r } : e;
|
|
1515
|
-
},
|
|
1570
|
+
}, Ao = ({ lang: e }, t) => {
|
|
1516
1571
|
const r = {
|
|
1517
|
-
...
|
|
1572
|
+
...Ot(e),
|
|
1518
1573
|
formName: t.payload.formName
|
|
1519
1574
|
};
|
|
1520
1575
|
let n = t.payload.formDef, o = { status: "ok" };
|
|
@@ -1522,7 +1577,7 @@ const po = (e) => {
|
|
|
1522
1577
|
try {
|
|
1523
1578
|
n = JSON.parse(n);
|
|
1524
1579
|
} catch (a) {
|
|
1525
|
-
const p = a, g =
|
|
1580
|
+
const p = a, g = P.initializeParseError;
|
|
1526
1581
|
o = {
|
|
1527
1582
|
status: "errored",
|
|
1528
1583
|
message: `[${g}] ${p.message}`,
|
|
@@ -1545,67 +1600,67 @@ const po = (e) => {
|
|
|
1545
1600
|
}
|
|
1546
1601
|
};
|
|
1547
1602
|
}
|
|
1548
|
-
const s =
|
|
1603
|
+
const s = It.decode(i);
|
|
1549
1604
|
if (s.isOk()) {
|
|
1550
1605
|
o = { status: "ok" };
|
|
1551
1606
|
let a = {};
|
|
1552
1607
|
try {
|
|
1553
|
-
a =
|
|
1608
|
+
a = ze([s.value.form]).reduce(
|
|
1554
1609
|
(p, g) => {
|
|
1555
|
-
const
|
|
1556
|
-
if (p[
|
|
1557
|
-
throw { existingWidget: p[
|
|
1558
|
-
return p[
|
|
1610
|
+
const A = g.uid;
|
|
1611
|
+
if (p[A])
|
|
1612
|
+
throw { existingWidget: p[A], newWidget: g };
|
|
1613
|
+
return p[A] = g, p;
|
|
1559
1614
|
},
|
|
1560
1615
|
{}
|
|
1561
1616
|
);
|
|
1562
1617
|
} catch (p) {
|
|
1563
|
-
o =
|
|
1618
|
+
o = Co(p.existingWidget, p.newWidget), a = {};
|
|
1564
1619
|
}
|
|
1565
|
-
return
|
|
1620
|
+
return Io(a, s.value.states), {
|
|
1566
1621
|
...r,
|
|
1567
1622
|
formDef: s.value,
|
|
1568
1623
|
flatForm: a,
|
|
1569
|
-
...
|
|
1624
|
+
...De(a, {}),
|
|
1570
1625
|
formHealth: o
|
|
1571
1626
|
};
|
|
1572
1627
|
}
|
|
1573
|
-
const c =
|
|
1628
|
+
const c = wo(n);
|
|
1574
1629
|
if (c)
|
|
1575
1630
|
return { ...r, formHealth: c };
|
|
1576
|
-
const
|
|
1631
|
+
const d = P.initializeUnknownError, l = s.issues.map((a) => `${a.path.length > 0 ? mr(a.path) : "root"}: ${a.message}`).join("; ");
|
|
1577
1632
|
return {
|
|
1578
1633
|
...r,
|
|
1579
1634
|
formHealth: {
|
|
1580
1635
|
status: "errored",
|
|
1581
|
-
message: `[${
|
|
1582
|
-
code:
|
|
1636
|
+
message: `[${d}] ${l}`,
|
|
1637
|
+
code: d
|
|
1583
1638
|
}
|
|
1584
1639
|
};
|
|
1585
1640
|
};
|
|
1586
|
-
function
|
|
1641
|
+
function ir(e, t) {
|
|
1587
1642
|
return { status: "errored", code: e, message: `[${e}] ${t}` };
|
|
1588
1643
|
}
|
|
1589
|
-
function
|
|
1644
|
+
function Eo() {
|
|
1590
1645
|
return "Malformed form definition. Pass it directly as formDef - `config={{ formDef: { states, form: [...] } }}`. Do NOT wrap it in an extra `{ form: ... }`.";
|
|
1591
1646
|
}
|
|
1592
|
-
function
|
|
1647
|
+
function wo(e) {
|
|
1593
1648
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1594
1649
|
return null;
|
|
1595
1650
|
const t = e.form;
|
|
1596
|
-
return t && typeof t == "object" && !Array.isArray(t) && !
|
|
1651
|
+
return t && typeof t == "object" && !Array.isArray(t) && !M(t) ? ir(P.initializeMalformedFormShapeError, Eo()) : null;
|
|
1597
1652
|
}
|
|
1598
|
-
function
|
|
1653
|
+
function Co(e, t) {
|
|
1599
1654
|
const r = (o) => I(o) ? ` at "${o.path}"` : "", n = `Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`;
|
|
1600
|
-
return
|
|
1655
|
+
return ir(P.initializeUidCollisionError, n);
|
|
1601
1656
|
}
|
|
1602
|
-
function
|
|
1657
|
+
function Io(e, t) {
|
|
1603
1658
|
const r = new Set(Object.keys(t ?? {})), n = /* @__PURE__ */ new Map();
|
|
1604
1659
|
for (const i of Object.values(e)) {
|
|
1605
1660
|
const s = [], c = i.include;
|
|
1606
1661
|
c && Array.isArray(c.in) && s.push(...c.in);
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1662
|
+
const d = i.exclude;
|
|
1663
|
+
d && Array.isArray(d.from) && s.push(...d.from);
|
|
1609
1664
|
for (const l of s) {
|
|
1610
1665
|
if (r.has(l))
|
|
1611
1666
|
continue;
|
|
@@ -1621,7 +1676,7 @@ function vo(e, t) {
|
|
|
1621
1676
|
`[GolemUI] include/exclude references undefined state "${i}" (on ${s.join(", ")}); these widgets will stay hidden. Declared states: ${o}. Fix: declare "${i}" in formConfig.states, or correct the name.`
|
|
1622
1677
|
);
|
|
1623
1678
|
}
|
|
1624
|
-
function
|
|
1679
|
+
function Oo(e, t) {
|
|
1625
1680
|
const { path: r, issues: n } = t.payload, o = n?.length ? {
|
|
1626
1681
|
touched: !0,
|
|
1627
1682
|
touchedControls: { ...e.touchedControls, [r]: !0 }
|
|
@@ -1635,8 +1690,8 @@ function $o(e, t) {
|
|
|
1635
1690
|
}
|
|
1636
1691
|
};
|
|
1637
1692
|
}
|
|
1638
|
-
const
|
|
1639
|
-
const r = "path" in t ?
|
|
1693
|
+
const Po = (e, { payload: t }) => {
|
|
1694
|
+
const r = "path" in t ? ko(e, t.path) : jo(e, t.uid);
|
|
1640
1695
|
if (r === void 0)
|
|
1641
1696
|
return e;
|
|
1642
1697
|
const n = e.widgetPropOverrides[r] || {};
|
|
@@ -1648,53 +1703,53 @@ const So = (e, { payload: t }) => {
|
|
|
1648
1703
|
}
|
|
1649
1704
|
};
|
|
1650
1705
|
};
|
|
1651
|
-
function
|
|
1706
|
+
function jo(e, t) {
|
|
1652
1707
|
if (t in e.resolvedSources)
|
|
1653
1708
|
return t;
|
|
1654
1709
|
console.warn(`Widget with uid "${t}" not found`);
|
|
1655
1710
|
}
|
|
1656
|
-
function
|
|
1711
|
+
function ko(e, t) {
|
|
1657
1712
|
const r = Object.values(e.calculatedWidgets).find(
|
|
1658
|
-
({ source: o, current: i }) => (
|
|
1713
|
+
({ source: o, current: i }) => (R(i) ?? R(o)) === t
|
|
1659
1714
|
);
|
|
1660
1715
|
if (r)
|
|
1661
1716
|
return r.source.uid;
|
|
1662
1717
|
const n = Object.keys(e.resolvedSources).find(
|
|
1663
|
-
(o) =>
|
|
1718
|
+
(o) => R(e.resolvedSources[o]) === t
|
|
1664
1719
|
);
|
|
1665
1720
|
if (n !== void 0)
|
|
1666
1721
|
return n;
|
|
1667
1722
|
console.warn(`Input with path "${t}" not found`);
|
|
1668
1723
|
}
|
|
1669
|
-
const
|
|
1724
|
+
const Wo = (e, t) => ({
|
|
1670
1725
|
...e,
|
|
1671
1726
|
data: { ...t.payload.data }
|
|
1672
|
-
}),
|
|
1727
|
+
}), Do = (e, t) => ({
|
|
1673
1728
|
...e,
|
|
1674
1729
|
formHealth: t.payload.formHealth
|
|
1675
|
-
}),
|
|
1730
|
+
}), Fo = (e, t) => ({
|
|
1676
1731
|
...e,
|
|
1677
1732
|
lang: t.payload.lang
|
|
1678
|
-
}),
|
|
1733
|
+
}), Ro = (e, t) => ({
|
|
1679
1734
|
...e,
|
|
1680
1735
|
meta: { ...t.payload.meta }
|
|
1681
|
-
}),
|
|
1736
|
+
}), To = (e, t) => ({
|
|
1682
1737
|
...e,
|
|
1683
|
-
data:
|
|
1684
|
-
}),
|
|
1685
|
-
function
|
|
1738
|
+
data: Pt(e.data, t.payload.path, t.payload.data)
|
|
1739
|
+
}), sr = /* @__PURE__ */ Symbol("filterMap.skip");
|
|
1740
|
+
function No(e, t) {
|
|
1686
1741
|
const r = [];
|
|
1687
1742
|
for (let n = 0; n < e.length; n++) {
|
|
1688
1743
|
const o = t(e[n], n, e);
|
|
1689
|
-
o !==
|
|
1744
|
+
o !== sr && r.push(o);
|
|
1690
1745
|
}
|
|
1691
1746
|
return r;
|
|
1692
1747
|
}
|
|
1693
|
-
function
|
|
1748
|
+
function ai(e, t, r) {
|
|
1694
1749
|
for (let n = 0; n < e.length; n++)
|
|
1695
1750
|
t(e[n], n, e) && r(e[n], n, e);
|
|
1696
1751
|
}
|
|
1697
|
-
function
|
|
1752
|
+
function Vo(e, t, r) {
|
|
1698
1753
|
if (e.length !== t.length)
|
|
1699
1754
|
return !1;
|
|
1700
1755
|
for (let n = 0; n < e.length; n++)
|
|
@@ -1702,140 +1757,140 @@ function Wo(e, t, r) {
|
|
|
1702
1757
|
return !1;
|
|
1703
1758
|
return !0;
|
|
1704
1759
|
}
|
|
1705
|
-
const
|
|
1706
|
-
const n =
|
|
1760
|
+
const Lo = (e, t) => (r) => {
|
|
1761
|
+
const n = No(
|
|
1707
1762
|
Object.values(r.calculatedWidgets),
|
|
1708
|
-
({ current: i }) => I(i) ? i :
|
|
1763
|
+
({ current: i }) => I(i) ? i : sr
|
|
1709
1764
|
), o = r.validations;
|
|
1710
1765
|
return {
|
|
1711
1766
|
...r,
|
|
1712
1767
|
validations: n.reduce(
|
|
1713
1768
|
(i, s) => {
|
|
1714
1769
|
if (i[s.path] = null, s.validator) {
|
|
1715
|
-
const c = e(s.validator, t),
|
|
1770
|
+
const c = e(s.validator, t), d = N(r.data, s.path), l = gr(
|
|
1716
1771
|
c,
|
|
1717
|
-
|
|
1772
|
+
d
|
|
1718
1773
|
);
|
|
1719
|
-
i[s.path] =
|
|
1774
|
+
i[s.path] = yr(l) ? null : l.issues.map((a) => a.message);
|
|
1720
1775
|
}
|
|
1721
|
-
return Array.isArray(i[s.path]) && Array.isArray(o[s.path]) &&
|
|
1776
|
+
return Array.isArray(i[s.path]) && Array.isArray(o[s.path]) && Vo(
|
|
1722
1777
|
i[s.path],
|
|
1723
1778
|
o[s.path],
|
|
1724
|
-
(c,
|
|
1779
|
+
(c, d) => c === d
|
|
1725
1780
|
) && (i[s.path] = o[s.path]), i;
|
|
1726
1781
|
},
|
|
1727
1782
|
{}
|
|
1728
1783
|
)
|
|
1729
1784
|
};
|
|
1730
|
-
},
|
|
1785
|
+
}, _o = ({
|
|
1731
1786
|
validators: e,
|
|
1732
1787
|
validateOn: t,
|
|
1733
1788
|
localization: r,
|
|
1734
1789
|
functions: n
|
|
1735
1790
|
}) => {
|
|
1736
|
-
const o =
|
|
1791
|
+
const o = Ho(r, n), i = Lo(e, r), s = er(r, n), c = (l) => $t(l, o, i, !1), d = (l) => $t(l, o, i, !0);
|
|
1737
1792
|
return (l, a) => {
|
|
1738
1793
|
switch (a.type) {
|
|
1739
1794
|
case "INITIALIZE":
|
|
1740
|
-
return
|
|
1795
|
+
return Ao(l, a);
|
|
1741
1796
|
case "SET_DATA":
|
|
1742
|
-
return c(
|
|
1797
|
+
return c(Wo(l, a));
|
|
1743
1798
|
case "SET_META":
|
|
1744
|
-
return c(
|
|
1799
|
+
return c(Ro(l, a));
|
|
1745
1800
|
case "SET_WIDGET_DATA":
|
|
1746
|
-
return c(
|
|
1801
|
+
return c(To(l, a));
|
|
1747
1802
|
case "SET_LANGUAGE":
|
|
1748
|
-
return s(
|
|
1803
|
+
return s(Fo(l, a));
|
|
1749
1804
|
case "OVERRIDE_WIDGET_PROP": {
|
|
1750
|
-
const p =
|
|
1805
|
+
const p = Po(l, a);
|
|
1751
1806
|
if (p === l)
|
|
1752
1807
|
return l;
|
|
1753
1808
|
const g = c(p);
|
|
1754
|
-
return
|
|
1809
|
+
return Go(g, a) ? i(g) : g;
|
|
1755
1810
|
}
|
|
1756
1811
|
case "SET_FORM_HEALTH":
|
|
1757
|
-
return
|
|
1812
|
+
return Do(l, a);
|
|
1758
1813
|
case "VALIDATE_ALL":
|
|
1759
|
-
return
|
|
1814
|
+
return d(i(bo(l)));
|
|
1760
1815
|
case "ATTEMPT_VALIDATION": {
|
|
1761
|
-
if (!
|
|
1816
|
+
if (!Bo(t, a.payload.reason))
|
|
1762
1817
|
return l;
|
|
1763
1818
|
const p = {
|
|
1764
1819
|
...l,
|
|
1765
1820
|
touched: !0,
|
|
1766
1821
|
touchedControls: { ...l.touchedControls, [a.payload.path]: !0 }
|
|
1767
1822
|
};
|
|
1768
|
-
return
|
|
1823
|
+
return d(i(p));
|
|
1769
1824
|
}
|
|
1770
1825
|
case "INJECT_VALIDATION_ISSUES":
|
|
1771
|
-
return
|
|
1826
|
+
return Oo(l, a);
|
|
1772
1827
|
default:
|
|
1773
|
-
return
|
|
1828
|
+
return Dr(a);
|
|
1774
1829
|
}
|
|
1775
1830
|
};
|
|
1776
|
-
},
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
]),
|
|
1782
|
-
function
|
|
1783
|
-
const r =
|
|
1831
|
+
}, Mo = /* @__PURE__ */ new Set([
|
|
1832
|
+
P.calculateCurrentStateError,
|
|
1833
|
+
P.calculateWidgetFlagsError,
|
|
1834
|
+
P.calculateWidgetPropsError,
|
|
1835
|
+
P.resolveStringInterpolationError
|
|
1836
|
+
]), Uo = (e) => e.formHealth.status === "errored" && !Mo.has(e.formHealth.code);
|
|
1837
|
+
function Ho(e, t) {
|
|
1838
|
+
const r = Bn(t), n = Kn(t), o = er(e, t);
|
|
1784
1839
|
return function(s) {
|
|
1785
|
-
if (
|
|
1840
|
+
if (Uo(s))
|
|
1786
1841
|
return s;
|
|
1787
|
-
const c = (
|
|
1842
|
+
const c = (d) => ({ ...s, formHealth: d });
|
|
1788
1843
|
try {
|
|
1789
|
-
let
|
|
1790
|
-
|
|
1791
|
-
const l =
|
|
1792
|
-
return
|
|
1793
|
-
} catch (
|
|
1794
|
-
const l =
|
|
1844
|
+
let d = s.formHealth.status === "ok" ? s : { ...s, formHealth: { status: "ok" } };
|
|
1845
|
+
d = Br(d), d = vo(d);
|
|
1846
|
+
const l = $e(d);
|
|
1847
|
+
return d = r(d, l), d.formHealth.status !== "ok" ? c(d.formHealth) : (d = n(d, l), d = So(d), d = o(d, l), d.formHealth.status === "ok" ? d : c(d.formHealth));
|
|
1848
|
+
} catch (d) {
|
|
1849
|
+
const l = P.calculateWidgetFlagsError;
|
|
1795
1850
|
return c({
|
|
1796
1851
|
status: "errored",
|
|
1797
1852
|
code: l,
|
|
1798
|
-
message: `[${l}] ${
|
|
1853
|
+
message: `[${l}] ${d.message}`
|
|
1799
1854
|
});
|
|
1800
1855
|
}
|
|
1801
1856
|
};
|
|
1802
1857
|
}
|
|
1803
|
-
function
|
|
1804
|
-
const o = (a) => n ?
|
|
1858
|
+
function $t(e, t, r, n) {
|
|
1859
|
+
const o = (a) => n ? St(a) : a, i = e.resolvedSources, s = e.widgetFlags;
|
|
1805
1860
|
let c = t(e);
|
|
1806
1861
|
if (!c.allControlsValidated || c.formHealth.status !== "ok")
|
|
1807
1862
|
return o(c);
|
|
1808
|
-
const
|
|
1809
|
-
if (
|
|
1863
|
+
const d = zo(c, i, s);
|
|
1864
|
+
if (d.length === 0)
|
|
1810
1865
|
return o(c);
|
|
1811
1866
|
const l = { ...c.touchedControls };
|
|
1812
|
-
for (const a of
|
|
1867
|
+
for (const a of d)
|
|
1813
1868
|
l[a] = !0;
|
|
1814
|
-
return c = { ...c, touchedControls: l },
|
|
1869
|
+
return c = { ...c, touchedControls: l }, St(t(r(c)));
|
|
1815
1870
|
}
|
|
1816
|
-
function
|
|
1871
|
+
function zo(e, t, r) {
|
|
1817
1872
|
const n = [];
|
|
1818
1873
|
for (const [o, i] of Object.entries(e.resolvedSources)) {
|
|
1819
|
-
const s =
|
|
1874
|
+
const s = R(i);
|
|
1820
1875
|
if (s === void 0 || e.widgetFlags[o]?.hidden === !0 || e.touchedControls[s] === !0)
|
|
1821
1876
|
continue;
|
|
1822
|
-
const c = t[o] === void 0,
|
|
1823
|
-
(c ||
|
|
1877
|
+
const c = t[o] === void 0, d = r[o]?.hidden === !0;
|
|
1878
|
+
(c || d) && n.push(s);
|
|
1824
1879
|
}
|
|
1825
1880
|
return n;
|
|
1826
1881
|
}
|
|
1827
|
-
function
|
|
1882
|
+
function bo(e) {
|
|
1828
1883
|
const t = {};
|
|
1829
1884
|
for (const { source: r, current: n } of Object.values(e.calculatedWidgets)) {
|
|
1830
|
-
const o =
|
|
1885
|
+
const o = R(n) ?? R(r);
|
|
1831
1886
|
o !== void 0 && (t[o] = !0);
|
|
1832
1887
|
}
|
|
1833
1888
|
return { ...e, touched: !0, allControlsValidated: !0, touchedControls: t };
|
|
1834
1889
|
}
|
|
1835
|
-
function
|
|
1890
|
+
function Bo(e, t) {
|
|
1836
1891
|
return e === "eager" || t === e || Array.isArray(e) && e.includes(t);
|
|
1837
1892
|
}
|
|
1838
|
-
function
|
|
1893
|
+
function Go(e, t) {
|
|
1839
1894
|
if (!e.touched)
|
|
1840
1895
|
return !1;
|
|
1841
1896
|
let r;
|
|
@@ -1847,7 +1902,7 @@ function _o(e, t) {
|
|
|
1847
1902
|
}
|
|
1848
1903
|
return r !== void 0 && e.touchedControls[r] === !0;
|
|
1849
1904
|
}
|
|
1850
|
-
function
|
|
1905
|
+
function St(e) {
|
|
1851
1906
|
const t = Object.keys(e.injectedValidations), r = Object.keys(e.validations);
|
|
1852
1907
|
if (t.length === 0 && r.length === 0)
|
|
1853
1908
|
return { ...e, isFormValid: !0 };
|
|
@@ -1860,30 +1915,30 @@ function $t(e) {
|
|
|
1860
1915
|
return Array.isArray(i) && i.length > 0;
|
|
1861
1916
|
}), n !== void 0 ? { ...e, isFormValid: !1 } : { ...e, isFormValid: !0 });
|
|
1862
1917
|
}
|
|
1863
|
-
function
|
|
1864
|
-
const i = new
|
|
1865
|
-
function
|
|
1866
|
-
const
|
|
1867
|
-
i.next(
|
|
1918
|
+
function Ko(e = [], t, r, n, o = {}) {
|
|
1919
|
+
const i = new lr(Ot(n.lang)), s = i.asObservable().pipe(Ne()), c = _o({ validators: t, validateOn: r, localization: n, functions: o });
|
|
1920
|
+
function d(g) {
|
|
1921
|
+
const A = i.getValue(), L = c(A, g);
|
|
1922
|
+
i.next(L);
|
|
1868
1923
|
}
|
|
1869
|
-
let l =
|
|
1924
|
+
let l = d;
|
|
1870
1925
|
const a = {
|
|
1871
1926
|
getState: () => i.getValue(),
|
|
1872
1927
|
dispatch: (g) => l(g)
|
|
1873
1928
|
// reference is updated later
|
|
1874
1929
|
};
|
|
1875
|
-
return l = e.map((g) => g(a)).reduceRight((g,
|
|
1930
|
+
return l = e.map((g) => g(a)).reduceRight((g, A) => A(g), d), {
|
|
1876
1931
|
state$: s,
|
|
1877
1932
|
dispatch: l,
|
|
1878
1933
|
getState: () => i.getValue()
|
|
1879
1934
|
};
|
|
1880
1935
|
}
|
|
1881
|
-
class
|
|
1936
|
+
class fi {
|
|
1882
1937
|
constructor() {
|
|
1883
|
-
this.widgetRegistry = new
|
|
1938
|
+
this.widgetRegistry = new se(), this.store = {}, this.events$ = new ot(), this.submit$ = new ot(), this.itemRenderers = {}, this.dependencies = {};
|
|
1884
1939
|
}
|
|
1885
|
-
initialize(t, r = [], n, o, i, s =
|
|
1886
|
-
this.localization = s, this.dependencies = c, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = i, this.store =
|
|
1940
|
+
initialize(t, r = [], n, o, i, s = Wr(), c, d = {}) {
|
|
1941
|
+
this.localization = s, this.dependencies = c, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = i, this.store = Ko(r, n, o, s, d);
|
|
1887
1942
|
}
|
|
1888
1943
|
emitEvent(t, r, n) {
|
|
1889
1944
|
const i = this.store.getState().currentStates.filter((s) => r.on?.[`${t}.${s}`] !== void 0);
|
|
@@ -1892,10 +1947,10 @@ class oi {
|
|
|
1892
1947
|
const c = r.on?.[`${t}.${s}`];
|
|
1893
1948
|
c && this.events$.next({
|
|
1894
1949
|
name: c,
|
|
1895
|
-
data:
|
|
1950
|
+
data: Ce(this.store.getState()),
|
|
1896
1951
|
detail: n ?? void 0,
|
|
1897
|
-
callback: (
|
|
1898
|
-
this.store.dispatch(
|
|
1952
|
+
callback: (d) => {
|
|
1953
|
+
this.store.dispatch(d);
|
|
1899
1954
|
}
|
|
1900
1955
|
});
|
|
1901
1956
|
});
|
|
@@ -1903,7 +1958,7 @@ class oi {
|
|
|
1903
1958
|
const s = r.on?.[t];
|
|
1904
1959
|
s && this.events$.next({
|
|
1905
1960
|
name: s,
|
|
1906
|
-
data:
|
|
1961
|
+
data: Ce(this.store.getState()),
|
|
1907
1962
|
detail: n,
|
|
1908
1963
|
callback: (c) => {
|
|
1909
1964
|
this.store.dispatch(c);
|
|
@@ -1915,7 +1970,7 @@ class oi {
|
|
|
1915
1970
|
this.store.dispatch({
|
|
1916
1971
|
type: "VALIDATE_ALL"
|
|
1917
1972
|
}), this.store.getState().isFormValid && this.submit$.next({
|
|
1918
|
-
data:
|
|
1973
|
+
data: Ce(this.store.getState()),
|
|
1919
1974
|
callback: (t) => {
|
|
1920
1975
|
this.store.dispatch(t);
|
|
1921
1976
|
}
|
|
@@ -1934,7 +1989,7 @@ class oi {
|
|
|
1934
1989
|
}));
|
|
1935
1990
|
}
|
|
1936
1991
|
}
|
|
1937
|
-
function
|
|
1992
|
+
function pi(e = "GolemUI Form Store") {
|
|
1938
1993
|
return (t) => {
|
|
1939
1994
|
const n = (typeof window < "u" ? window.__REDUX_DEVTOOLS_EXTENSION__ : void 0)?.connect({ name: e });
|
|
1940
1995
|
return n?.init(t.getState()), (o) => (i) => {
|
|
@@ -1942,37 +1997,37 @@ function ii(e = "GolemUI Form Store") {
|
|
|
1942
1997
|
};
|
|
1943
1998
|
};
|
|
1944
1999
|
}
|
|
1945
|
-
const
|
|
1946
|
-
|
|
2000
|
+
const xo = ar(
|
|
2001
|
+
Et((e) => e.formHealth),
|
|
1947
2002
|
Ne((e, t) => e.status !== t.status ? !1 : e.status === "errored" && t.status === "errored" ? e.message === t.message && e.code === t.code : !0)
|
|
1948
|
-
),
|
|
1949
|
-
function
|
|
1950
|
-
return
|
|
2003
|
+
), hi = (e) => e.pipe(xo);
|
|
2004
|
+
function mi(e, t) {
|
|
2005
|
+
return dr(e, t, cr(e, t), void 0);
|
|
1951
2006
|
}
|
|
1952
|
-
function
|
|
2007
|
+
function Xo() {
|
|
1953
2008
|
const e = /* @__PURE__ */ new Map();
|
|
1954
2009
|
return (t, r) => {
|
|
1955
|
-
const n =
|
|
1956
|
-
if (o &&
|
|
2010
|
+
const n = cr(t, r), o = e.get(r);
|
|
2011
|
+
if (o && Jo(o.slices, n))
|
|
1957
2012
|
return o.viewModel;
|
|
1958
|
-
const i =
|
|
2013
|
+
const i = dr(t, r, n, o);
|
|
1959
2014
|
return e.set(r, { slices: n, viewModel: i }), i;
|
|
1960
2015
|
};
|
|
1961
2016
|
}
|
|
1962
|
-
const
|
|
1963
|
-
const r =
|
|
2017
|
+
const gi = (e) => (t) => {
|
|
2018
|
+
const r = Xo();
|
|
1964
2019
|
return t.pipe(
|
|
1965
|
-
|
|
2020
|
+
Et((n) => r(n, e)),
|
|
1966
2021
|
// The reader returns the same object while nothing changed, so reference equality is enough.
|
|
1967
2022
|
Ne()
|
|
1968
2023
|
);
|
|
1969
|
-
},
|
|
1970
|
-
function
|
|
1971
|
-
const r =
|
|
2024
|
+
}, Qo = [], At = [], qo = [];
|
|
2025
|
+
function cr(e, t) {
|
|
2026
|
+
const r = Zo(e, t);
|
|
1972
2027
|
return [
|
|
1973
2028
|
e.calculatedWidgets[t],
|
|
1974
2029
|
e.lang,
|
|
1975
|
-
r === void 0 ? void 0 :
|
|
2030
|
+
r === void 0 ? void 0 : N(e.data, r),
|
|
1976
2031
|
r !== void 0 && e.touched ? e.validations[r] : null,
|
|
1977
2032
|
r !== void 0 && e.touched ? e.injectedValidations[r] : null,
|
|
1978
2033
|
r !== void 0 && e.touchedControls[r] === !0,
|
|
@@ -1980,60 +2035,60 @@ function ir(e, t) {
|
|
|
1980
2035
|
e.widgetFlags[t]?.hidden === !0
|
|
1981
2036
|
];
|
|
1982
2037
|
}
|
|
1983
|
-
function
|
|
2038
|
+
function Jo(e, t) {
|
|
1984
2039
|
return e.every((r, n) => Object.is(r, t[n]));
|
|
1985
2040
|
}
|
|
1986
|
-
function
|
|
1987
|
-
const [o, i, s, c,
|
|
2041
|
+
function dr(e, t, r, n) {
|
|
2042
|
+
const [o, i, s, c, d, l, a, p] = r, g = n === void 0 || !Object.is(n.slices[0], o), A = n === void 0 || !Object.is(n.slices[2], s), L = n === void 0 || !Object.is(n.slices[3], c) || !Object.is(n.slices[4], d), we = o?.current;
|
|
1988
2043
|
return {
|
|
1989
2044
|
uid: t,
|
|
1990
|
-
widget:
|
|
1991
|
-
children: g ?
|
|
1992
|
-
rows: g ||
|
|
2045
|
+
widget: we,
|
|
2046
|
+
children: g ? Yo(e, t, we) : n.viewModel.children,
|
|
2047
|
+
rows: g || A ? ei(e, t, we, s) : n.viewModel.rows,
|
|
1993
2048
|
lang: i,
|
|
1994
2049
|
value: s,
|
|
1995
|
-
errors:
|
|
2050
|
+
errors: L ? ti(c, d) : n.viewModel.errors,
|
|
1996
2051
|
touched: l,
|
|
1997
2052
|
formInvalid: a,
|
|
1998
2053
|
hidden: p
|
|
1999
2054
|
};
|
|
2000
2055
|
}
|
|
2001
|
-
function
|
|
2056
|
+
function Zo(e, t) {
|
|
2002
2057
|
return e.resolvedSources[t]?.path;
|
|
2003
2058
|
}
|
|
2004
|
-
function
|
|
2005
|
-
if (r === void 0 || !
|
|
2006
|
-
return
|
|
2007
|
-
const n = r.children, o =
|
|
2059
|
+
function Yo(e, t, r) {
|
|
2060
|
+
if (r === void 0 || !M(r))
|
|
2061
|
+
return Qo;
|
|
2062
|
+
const n = r.children, o = Se(t);
|
|
2008
2063
|
if (o.length === 0)
|
|
2009
2064
|
return n;
|
|
2010
2065
|
const i = o.map((s) => `[${s}]`).join("");
|
|
2011
2066
|
return n.map((s) => e.resolvedSources[`${s.uid}${i}`] ?? s);
|
|
2012
2067
|
}
|
|
2013
|
-
function
|
|
2068
|
+
function ei(e, t, r, n) {
|
|
2014
2069
|
if (r === void 0 || !Array.isArray(n))
|
|
2015
|
-
return
|
|
2070
|
+
return At;
|
|
2016
2071
|
const o = e.resolvedSources[t];
|
|
2017
|
-
if (o === void 0 ||
|
|
2018
|
-
return
|
|
2019
|
-
const i = o.props.template.uid, s =
|
|
2020
|
-
return n.map((c,
|
|
2021
|
-
const l =
|
|
2072
|
+
if (o === void 0 || !X(o))
|
|
2073
|
+
return At;
|
|
2074
|
+
const i = o.props.template.uid, s = Se(t);
|
|
2075
|
+
return n.map((c, d) => {
|
|
2076
|
+
const l = be(i, [...s, d]);
|
|
2022
2077
|
return e.resolvedSources[l];
|
|
2023
2078
|
}).filter((c) => c !== void 0);
|
|
2024
2079
|
}
|
|
2025
|
-
function
|
|
2026
|
-
return (e?.length ?? 0) + (t?.length ?? 0) === 0 ?
|
|
2080
|
+
function ti(e, t) {
|
|
2081
|
+
return (e?.length ?? 0) + (t?.length ?? 0) === 0 ? qo : [...e ?? [], ...t ?? []];
|
|
2027
2082
|
}
|
|
2028
|
-
let
|
|
2029
|
-
function
|
|
2030
|
-
|
|
2083
|
+
let ur = !1;
|
|
2084
|
+
function yi() {
|
|
2085
|
+
ur = !0;
|
|
2031
2086
|
}
|
|
2032
|
-
function
|
|
2033
|
-
return
|
|
2087
|
+
function ri() {
|
|
2088
|
+
return ur;
|
|
2034
2089
|
}
|
|
2035
|
-
function
|
|
2036
|
-
if (!
|
|
2090
|
+
function vi(e, t, r) {
|
|
2091
|
+
if (!ri())
|
|
2037
2092
|
return;
|
|
2038
2093
|
const n = Object.keys(t ?? {}).filter((o) => o in r);
|
|
2039
2094
|
if (n.length > 0)
|
|
@@ -2041,26 +2096,26 @@ function li(e, t, r) {
|
|
|
2041
2096
|
`[GolemUI] Widget "${e}": prop keys [${n.join(", ")}] collide with widget fields`
|
|
2042
2097
|
);
|
|
2043
2098
|
}
|
|
2044
|
-
const
|
|
2099
|
+
const $i = () => crypto.randomUUID().slice(0, 8);
|
|
2045
2100
|
export {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2101
|
+
fi as FormContext,
|
|
2102
|
+
vi as assertNoPropCollisions,
|
|
2103
|
+
ce as cloneObject,
|
|
2104
|
+
Xo as createWidgetViewModelReader,
|
|
2105
|
+
ci as defineForm,
|
|
2106
|
+
pi as devToolsMiddleware,
|
|
2107
|
+
yi as enableDevMode,
|
|
2108
|
+
P as errorCodes,
|
|
2109
|
+
ai as filterTap,
|
|
2110
|
+
di as formEventNames,
|
|
2111
|
+
hi as formHealth,
|
|
2112
|
+
ui as getDirectionFromLanguage,
|
|
2113
|
+
Wr as identityTranslator,
|
|
2114
|
+
yr as isStandardValidateSuccess,
|
|
2115
|
+
li as makeRepeaterItemConfig,
|
|
2116
|
+
si as preloadFormWidgets,
|
|
2117
|
+
$i as shortUUID,
|
|
2118
|
+
gr as standardValidate,
|
|
2119
|
+
mi as widgetViewModel,
|
|
2120
|
+
gi as widgetViewModel$
|
|
2066
2121
|
};
|