@golemui/core 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/index.d.ts +1 -1
- package/index.js +535 -541
- package/index.umd.cjs +8 -8
- package/internals.d.ts +2 -0
- package/internals.js +1 -0
- package/internals.umd.cjs +1 -0
- package/lib/context/widget-registry.d.ts +3 -0
- package/lib/context/with-widget.type.d.ts +3 -0
- package/lib/form-widget.d.ts +2 -2
- package/lib/form.d.ts +1 -2
- package/lib/store/model.d.ts +7 -7
- package/lib/store/reducers/initialize.d.ts +2 -2
- package/lib/store/reducers/override-widget-prop.d.ts +2 -2
- package/lib/store/reducers/set-data.d.ts +2 -2
- package/lib/store/reducers/set-form-health.d.ts +2 -2
- package/lib/store/reducers/set-language.d.ts +2 -2
- package/lib/store/reducers/set-meta.d.ts +2 -2
- package/lib/store/reducers/set-widget-data.d.ts +2 -2
- package/lib/utils/decoder.d.ts +3 -3
- package/lib/utils/form.d.ts +2 -2
- package/package.json +9 -1
package/index.js
CHANGED
|
@@ -1,29 +1,6 @@
|
|
|
1
|
-
import { BehaviorSubject as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
this.widgetLoaders = {}, this._ready = !1;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* When the registry has been initialized by calling `setWidgetLoaders`
|
|
8
|
-
*/
|
|
9
|
-
get ready() {
|
|
10
|
-
return this._ready;
|
|
11
|
-
}
|
|
12
|
-
setWidgetLoaders(r) {
|
|
13
|
-
this.widgetLoaders = r, this._ready = !0;
|
|
14
|
-
}
|
|
15
|
-
async loadWidget(r) {
|
|
16
|
-
const t = this.widgetLoaders[r];
|
|
17
|
-
if (!X.sharedCache.has(t)) {
|
|
18
|
-
const n = t().catch((o) => (X.sharedCache.delete(t), Promise.reject(o)));
|
|
19
|
-
X.sharedCache.set(t, n);
|
|
20
|
-
}
|
|
21
|
-
return X.sharedCache.get(t);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
X.sharedCache = /* @__PURE__ */ new Map();
|
|
25
|
-
let Re = X;
|
|
26
|
-
var Yr = class {
|
|
1
|
+
import { BehaviorSubject as Jr, distinctUntilChanged as D, Subject as Qr, pipe as T, map as O, filter as Ee, startWith as qr, combineLatest as Yr } from "rxjs";
|
|
2
|
+
import "@standard-schema/spec";
|
|
3
|
+
var Zr = class {
|
|
27
4
|
constructor(e) {
|
|
28
5
|
this.value = e;
|
|
29
6
|
}
|
|
@@ -33,7 +10,7 @@ var Yr = class {
|
|
|
33
10
|
isOk() {
|
|
34
11
|
return !0;
|
|
35
12
|
}
|
|
36
|
-
},
|
|
13
|
+
}, xr = class {
|
|
37
14
|
constructor(e) {
|
|
38
15
|
this.error = e;
|
|
39
16
|
}
|
|
@@ -45,12 +22,12 @@ var Yr = class {
|
|
|
45
22
|
}
|
|
46
23
|
};
|
|
47
24
|
function R(e) {
|
|
48
|
-
return new
|
|
25
|
+
return new Zr(e);
|
|
49
26
|
}
|
|
50
27
|
function v(e) {
|
|
51
|
-
return new
|
|
28
|
+
return new xr(e);
|
|
52
29
|
}
|
|
53
|
-
var W = class
|
|
30
|
+
var W = class Re {
|
|
54
31
|
constructor(r) {
|
|
55
32
|
this.decodeFn = r, this["~standard"] = { version: 1, vendor: "ts.data.json", validate: (t) => {
|
|
56
33
|
let n = this.decode(t);
|
|
@@ -72,18 +49,18 @@ var W = class ke {
|
|
|
72
49
|
});
|
|
73
50
|
}
|
|
74
51
|
map(r) {
|
|
75
|
-
return new
|
|
52
|
+
return new Re((t) => {
|
|
76
53
|
let n = this.decodeFn(t);
|
|
77
54
|
return n.isOk() ? R(r(n.value)) : v(n.error);
|
|
78
55
|
});
|
|
79
56
|
}
|
|
80
57
|
flatMap(r) {
|
|
81
|
-
return new
|
|
58
|
+
return new Re((t) => {
|
|
82
59
|
let n = this.decodeFn(t);
|
|
83
60
|
return n.isOk() ? r(n.value).decode(t) : v(n.error);
|
|
84
61
|
});
|
|
85
62
|
}
|
|
86
|
-
},
|
|
63
|
+
}, br = (e, r, t) => `<${e}> decoder failed at index "${r}" with error: ${t}`, Y = (e, r) => `${JSON.stringify(e)} is not a valid ${r}`;
|
|
87
64
|
function Ve(e, r) {
|
|
88
65
|
return new W((t) => {
|
|
89
66
|
if (t instanceof Array) {
|
|
@@ -91,16 +68,16 @@ function Ve(e, r) {
|
|
|
91
68
|
for (let o = 0; o < t.length; o++) {
|
|
92
69
|
let i = e.decode(t[o]);
|
|
93
70
|
if (i.isOk()) n.push(i.value);
|
|
94
|
-
else return v(
|
|
71
|
+
else return v(br(r, o, i.error));
|
|
95
72
|
}
|
|
96
73
|
return R(n);
|
|
97
74
|
} else return v(Y(t, "array"));
|
|
98
75
|
});
|
|
99
76
|
}
|
|
100
|
-
function
|
|
77
|
+
function et() {
|
|
101
78
|
return new W((e) => typeof e == "boolean" ? R(e) : v(Y(e, "boolean")));
|
|
102
79
|
}
|
|
103
|
-
function
|
|
80
|
+
function hr(e) {
|
|
104
81
|
return new W((r) => e().decode(r));
|
|
105
82
|
}
|
|
106
83
|
var rt = (e, r) => `${JSON.stringify(e)} is not exactly ${JSON.stringify(r)}`;
|
|
@@ -134,7 +111,7 @@ function Z(e, r) {
|
|
|
134
111
|
return v(nt(r, t));
|
|
135
112
|
});
|
|
136
113
|
}
|
|
137
|
-
function
|
|
114
|
+
function A(e) {
|
|
138
115
|
return new W((r) => r === void 0 ? R(void 0) : e.decode(r));
|
|
139
116
|
}
|
|
140
117
|
var ot = (e, r, t) => `<${e}> record decoder failed at key "${r}" with error: ${t}`;
|
|
@@ -157,6 +134,69 @@ function I() {
|
|
|
157
134
|
function J() {
|
|
158
135
|
return new W((e) => R(e));
|
|
159
136
|
}
|
|
137
|
+
function vo(e) {
|
|
138
|
+
return {
|
|
139
|
+
...e,
|
|
140
|
+
form: {
|
|
141
|
+
uid: "",
|
|
142
|
+
type: "flex",
|
|
143
|
+
kind: "layout",
|
|
144
|
+
children: e.form
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const pr = oe(
|
|
149
|
+
{
|
|
150
|
+
states: A(it(I(), "states")),
|
|
151
|
+
form: hr(() => He)
|
|
152
|
+
},
|
|
153
|
+
"FormDef"
|
|
154
|
+
), gr = (e) => ({
|
|
155
|
+
formName: "",
|
|
156
|
+
formDef: pr.parse({
|
|
157
|
+
form: {
|
|
158
|
+
kind: "layout",
|
|
159
|
+
type: "flex",
|
|
160
|
+
children: []
|
|
161
|
+
}
|
|
162
|
+
}),
|
|
163
|
+
flatForm: {},
|
|
164
|
+
currentStates: [],
|
|
165
|
+
calculatedWidgets: {},
|
|
166
|
+
validations: {},
|
|
167
|
+
touchedControls: {},
|
|
168
|
+
injectedValidations: {},
|
|
169
|
+
widgetFlags: {},
|
|
170
|
+
widgetPropOverrides: {},
|
|
171
|
+
data: {},
|
|
172
|
+
meta: {},
|
|
173
|
+
formHealth: { status: "ok" },
|
|
174
|
+
touched: !1,
|
|
175
|
+
lang: e
|
|
176
|
+
}), st = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
|
|
177
|
+
function Io(e) {
|
|
178
|
+
const r = new Intl.Locale(e).maximize().script;
|
|
179
|
+
return ["Arab", "Hebr", "Thaa", "Syrc", "Tfng", "Adlm", "Rohg"].includes(r || "") ? "rtl" : "ltr";
|
|
180
|
+
}
|
|
181
|
+
const dt = (e = navigator.language || "en-US") => {
|
|
182
|
+
const r = /* @__PURE__ */ new Set();
|
|
183
|
+
return {
|
|
184
|
+
get lang() {
|
|
185
|
+
return e;
|
|
186
|
+
},
|
|
187
|
+
translate(n) {
|
|
188
|
+
return n;
|
|
189
|
+
},
|
|
190
|
+
subscribe(n) {
|
|
191
|
+
return r.add(n), () => {
|
|
192
|
+
r.delete(n);
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
setLang(n) {
|
|
196
|
+
e = n, r.forEach((o) => o(e));
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
};
|
|
160
200
|
function ie(e, r) {
|
|
161
201
|
return new W((t) => {
|
|
162
202
|
if (typeof t != "object" || t === null)
|
|
@@ -179,85 +219,78 @@ function ie(e, r) {
|
|
|
179
219
|
return R(n);
|
|
180
220
|
});
|
|
181
221
|
}
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
), B = (e) => Z([e, ct], ""), Be = ie(
|
|
222
|
+
const mr = () => crypto.randomUUID().slice(0, 8), ut = (e) => typeof e != "function" && e.kind === "display", re = (e) => typeof e != "function" && e.kind === "action", P = (e) => typeof e != "function" && e.kind === "input", ke = (e) => typeof e != "function" && e.kind === "layout", se = (e) => typeof e == "function", ct = oe({ in: Ve(I(), "In[]") }, "In"), Ue = oe({ when: I() }, "When"), Ie = Z([ct, Ue], "In | When"), lt = oe({ from: Ve(I(), "From[]") }, "From"), we = Z([lt, Ue], "Exclude"), _e = Z([et(), Ue], "Bool | When"), at = new W((e) => {
|
|
223
|
+
const r = typeof e;
|
|
224
|
+
return r === "function" ? R(e) : v(`Expected a function, got '${r}'`);
|
|
225
|
+
}), B = (e) => Z([e, at], ""), Be = ie(
|
|
188
226
|
{
|
|
189
|
-
load: { suffixed: !0, decoder: B(
|
|
190
|
-
click: { suffixed: !0, decoder: B(
|
|
191
|
-
change: { suffixed: !0, decoder: B(
|
|
192
|
-
filter: { suffixed: !0, decoder: B(
|
|
193
|
-
blur: { suffixed: !0, decoder: B(
|
|
227
|
+
load: { suffixed: !0, decoder: B(A(I())) },
|
|
228
|
+
click: { suffixed: !0, decoder: B(A(I())) },
|
|
229
|
+
change: { suffixed: !0, decoder: B(A(I())) },
|
|
230
|
+
filter: { suffixed: !0, decoder: B(A(I())) },
|
|
231
|
+
blur: { suffixed: !0, decoder: B(A(I())) }
|
|
194
232
|
},
|
|
195
233
|
"On"
|
|
196
|
-
),
|
|
234
|
+
), ft = oe(
|
|
197
235
|
{
|
|
198
236
|
key: I(),
|
|
199
|
-
default:
|
|
237
|
+
default: A(I()),
|
|
200
238
|
params: J()
|
|
201
239
|
},
|
|
202
240
|
"TranslationConfig"
|
|
203
|
-
),
|
|
204
|
-
[I(), lt],
|
|
205
|
-
"Localizable"
|
|
206
|
-
), we = $(I()).map((e) => e || hr()), ft = ie(
|
|
241
|
+
), yr = Z([I(), ft], "Localizable"), Oe = A(I()).map((e) => e || mr()), ht = ie(
|
|
207
242
|
{
|
|
208
243
|
kind: { decoder: Se("display") },
|
|
209
|
-
uid: { decoder:
|
|
244
|
+
uid: { decoder: Oe },
|
|
210
245
|
type: { decoder: I() },
|
|
211
|
-
size: { suffixed: !0, decoder:
|
|
212
|
-
include: { decoder:
|
|
213
|
-
exclude: { decoder:
|
|
214
|
-
props: { decoder:
|
|
246
|
+
size: { suffixed: !0, decoder: A(ve()) },
|
|
247
|
+
include: { decoder: A(Ie) },
|
|
248
|
+
exclude: { decoder: A(we) },
|
|
249
|
+
props: { decoder: A(J()) }
|
|
215
250
|
},
|
|
216
251
|
"DisplayWidget"
|
|
217
|
-
),
|
|
252
|
+
), pt = ie(
|
|
218
253
|
{
|
|
219
254
|
kind: { decoder: Se("action") },
|
|
220
|
-
uid: { decoder:
|
|
255
|
+
uid: { decoder: Oe },
|
|
221
256
|
type: { decoder: I() },
|
|
222
|
-
size: { suffixed: !0, decoder:
|
|
223
|
-
include: { decoder:
|
|
224
|
-
exclude: { decoder:
|
|
225
|
-
label: { suffixed: !0, decoder: B(
|
|
226
|
-
disabled: { suffixed: !0, decoder:
|
|
227
|
-
on: { decoder:
|
|
228
|
-
props: { decoder:
|
|
257
|
+
size: { suffixed: !0, decoder: A(ve()) },
|
|
258
|
+
include: { decoder: A(Ie) },
|
|
259
|
+
exclude: { decoder: A(we) },
|
|
260
|
+
label: { suffixed: !0, decoder: B(yr) },
|
|
261
|
+
disabled: { suffixed: !0, decoder: A(_e) },
|
|
262
|
+
on: { decoder: A(Be) },
|
|
263
|
+
props: { decoder: A(J()) }
|
|
229
264
|
},
|
|
230
265
|
"ActionWidget"
|
|
231
|
-
),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
), pt = ie(
|
|
266
|
+
), gt = new W((e) => {
|
|
267
|
+
const r = typeof e;
|
|
268
|
+
if (r === "function") {
|
|
269
|
+
const t = e, n = t(void 0);
|
|
270
|
+
return t.uid = n.uid || mr(), t.type = n.type, t.path = n.path, R(t);
|
|
271
|
+
} else
|
|
272
|
+
return v(`Expected a function, got '${r}'`);
|
|
273
|
+
}), mt = ie(
|
|
241
274
|
{
|
|
242
275
|
kind: { decoder: Se("input") },
|
|
243
|
-
uid: { decoder:
|
|
276
|
+
uid: { decoder: Oe },
|
|
244
277
|
type: { decoder: I() },
|
|
245
|
-
size: { suffixed: !0, decoder:
|
|
246
|
-
include: { decoder:
|
|
247
|
-
exclude: { decoder:
|
|
248
|
-
disabled: { suffixed: !0, decoder:
|
|
249
|
-
readonly: { suffixed: !0, decoder:
|
|
250
|
-
on: { decoder:
|
|
251
|
-
props: { decoder:
|
|
278
|
+
size: { suffixed: !0, decoder: A(ve()) },
|
|
279
|
+
include: { decoder: A(Ie) },
|
|
280
|
+
exclude: { decoder: A(we) },
|
|
281
|
+
disabled: { suffixed: !0, decoder: A(_e) },
|
|
282
|
+
readonly: { suffixed: !0, decoder: A(_e) },
|
|
283
|
+
on: { decoder: A(Be) },
|
|
284
|
+
props: { decoder: A(J()) },
|
|
252
285
|
label: {
|
|
253
286
|
suffixed: !0,
|
|
254
|
-
decoder: B(
|
|
287
|
+
decoder: B(A(yr))
|
|
255
288
|
},
|
|
256
289
|
path: { decoder: I() },
|
|
257
|
-
defaultValue: { decoder:
|
|
290
|
+
defaultValue: { decoder: A(J()) },
|
|
258
291
|
validator: {
|
|
259
292
|
suffixed: !0,
|
|
260
|
-
decoder: B(
|
|
293
|
+
decoder: B(A(J()))
|
|
261
294
|
}
|
|
262
295
|
},
|
|
263
296
|
"InputWidget"
|
|
@@ -268,92 +301,88 @@ const hr = () => crypto.randomUUID().slice(0, 8), st = (e) => typeof e != "funct
|
|
|
268
301
|
t.template = He.parse(t.template);
|
|
269
302
|
}
|
|
270
303
|
return r;
|
|
271
|
-
}),
|
|
304
|
+
}), yt = hr(
|
|
272
305
|
() => Z(
|
|
273
306
|
[
|
|
274
|
-
|
|
275
|
-
|
|
307
|
+
gt,
|
|
308
|
+
mt,
|
|
276
309
|
He,
|
|
277
|
-
|
|
278
|
-
|
|
310
|
+
ht,
|
|
311
|
+
pt
|
|
279
312
|
],
|
|
280
313
|
"FormWidget"
|
|
281
314
|
)
|
|
282
315
|
), He = ie(
|
|
283
316
|
{
|
|
284
317
|
kind: { decoder: Se("layout") },
|
|
285
|
-
uid: { decoder:
|
|
318
|
+
uid: { decoder: Oe },
|
|
286
319
|
type: { decoder: I() },
|
|
287
|
-
size: { suffixed: !0, decoder:
|
|
288
|
-
include: { decoder:
|
|
289
|
-
exclude: { decoder:
|
|
290
|
-
props: { decoder:
|
|
291
|
-
on: { decoder:
|
|
292
|
-
children: { decoder: Ve(
|
|
320
|
+
size: { suffixed: !0, decoder: A(ve()) },
|
|
321
|
+
include: { decoder: A(Ie) },
|
|
322
|
+
exclude: { decoder: A(we) },
|
|
323
|
+
props: { decoder: A(J()) },
|
|
324
|
+
on: { decoder: A(Be) },
|
|
325
|
+
children: { decoder: Ve(yt, "FormWidget[]") }
|
|
293
326
|
},
|
|
294
327
|
"LayoutWidget"
|
|
295
|
-
)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
328
|
+
), X = class X {
|
|
329
|
+
constructor() {
|
|
330
|
+
this.widgetLoaders = {}, this._ready = !1;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* When the registry has been initialized by calling `setWidgetLoaders`
|
|
334
|
+
*/
|
|
335
|
+
get ready() {
|
|
336
|
+
return this._ready;
|
|
337
|
+
}
|
|
338
|
+
setWidgetLoaders(r) {
|
|
339
|
+
this.widgetLoaders = r, this._ready = !0;
|
|
340
|
+
}
|
|
341
|
+
async loadWidget(r) {
|
|
342
|
+
const t = this.widgetLoaders[r];
|
|
343
|
+
if (!X.sharedCache.has(t)) {
|
|
344
|
+
const n = t().catch((o) => (X.sharedCache.delete(t), Promise.reject(o)));
|
|
345
|
+
X.sharedCache.set(t, n);
|
|
304
346
|
}
|
|
305
|
-
|
|
347
|
+
return X.sharedCache.get(t);
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
X.sharedCache = /* @__PURE__ */ new Map();
|
|
351
|
+
let Ne = X;
|
|
352
|
+
function $t(e, r) {
|
|
353
|
+
const t = e["~standard"].validate(r);
|
|
354
|
+
if (t instanceof Promise)
|
|
355
|
+
throw new TypeError("Schema validation must be synchronous");
|
|
356
|
+
return t;
|
|
306
357
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
},
|
|
312
|
-
"FormDef"
|
|
313
|
-
), mr = (e) => ({
|
|
314
|
-
formName: "",
|
|
315
|
-
formDef: gr.parse({
|
|
316
|
-
form: {
|
|
317
|
-
kind: "layout",
|
|
318
|
-
type: "flex",
|
|
319
|
-
children: []
|
|
320
|
-
}
|
|
321
|
-
}),
|
|
322
|
-
flatForm: {},
|
|
323
|
-
currentStates: [],
|
|
324
|
-
calculatedWidgets: {},
|
|
325
|
-
validations: {},
|
|
326
|
-
touchedControls: {},
|
|
327
|
-
injectedValidations: {},
|
|
328
|
-
widgetFlags: {},
|
|
329
|
-
widgetPropOverrides: {},
|
|
330
|
-
data: {},
|
|
331
|
-
meta: {},
|
|
332
|
-
formHealth: { status: "ok" },
|
|
333
|
-
touched: !1,
|
|
334
|
-
lang: e
|
|
335
|
-
}), mt = (e) => {
|
|
358
|
+
function At(e) {
|
|
359
|
+
return e.issues === void 0;
|
|
360
|
+
}
|
|
361
|
+
const Et = (e) => {
|
|
336
362
|
throw new Error(`Unhandled case: ${JSON.stringify(e)}`);
|
|
337
363
|
};
|
|
338
364
|
function L(e, ...r) {
|
|
339
365
|
return r.reduce((t, n) => n(t), e);
|
|
340
366
|
}
|
|
341
|
-
function
|
|
367
|
+
function wo(...e) {
|
|
342
368
|
return (r) => e.reduceRight((t, n) => n(t), r);
|
|
343
369
|
}
|
|
344
|
-
function
|
|
370
|
+
function St(e, r) {
|
|
371
|
+
const t = r.payload.widget.uid;
|
|
372
|
+
if (!t)
|
|
373
|
+
throw new Error("addWidget: widget must have a uid");
|
|
345
374
|
return {
|
|
346
375
|
...e,
|
|
347
376
|
calculatedWidgets: {
|
|
348
377
|
...e.calculatedWidgets,
|
|
349
|
-
[
|
|
378
|
+
[t]: {
|
|
350
379
|
source: r.payload.widget,
|
|
351
380
|
current: {}
|
|
352
381
|
}
|
|
353
382
|
}
|
|
354
383
|
};
|
|
355
384
|
}
|
|
356
|
-
const
|
|
385
|
+
const fe = {
|
|
357
386
|
calculateCurrentStateError: 10,
|
|
358
387
|
initializeParseError: 20,
|
|
359
388
|
initializeUidCollisionError: 21,
|
|
@@ -374,12 +403,12 @@ const ae = {
|
|
|
374
403
|
let o = e;
|
|
375
404
|
for (let s = 0; s < n.length - 1; s++) {
|
|
376
405
|
const u = n[s], c = n[s + 1];
|
|
377
|
-
(o[u] == null || typeof o[u] != "object") && (o[u] =
|
|
406
|
+
(o[u] == null || typeof o[u] != "object") && (o[u] = vt(c) ? [] : {}), o = o[u];
|
|
378
407
|
}
|
|
379
408
|
const i = n[n.length - 1];
|
|
380
409
|
return o[i] = t, e;
|
|
381
410
|
};
|
|
382
|
-
function
|
|
411
|
+
function vt(e) {
|
|
383
412
|
const r = Number(e);
|
|
384
413
|
return Number.isInteger(r) && r >= 0 && r.toString() === e;
|
|
385
414
|
}
|
|
@@ -399,10 +428,10 @@ const F = {
|
|
|
399
428
|
META: "$meta",
|
|
400
429
|
ERRORS: "$errors",
|
|
401
430
|
FORM_IS_INVALID: "$formIsInvalid"
|
|
402
|
-
},
|
|
403
|
-
`\\{\\{(?:(?<scope>${
|
|
431
|
+
}, It = (e) => typeof e == "string" && !e.includes(" ") && (e.startsWith(`${F.FORM}.`) || e.startsWith(`${F.META}.`) || e.startsWith(`${F.ERRORS}.`) || e === F.FORM_IS_INVALID), wt = [F.FORM, F.META, F.ERRORS].map((e) => e.replace("$", "\\$")).join("|"), Ot = new RegExp(
|
|
432
|
+
`\\{\\{(?:(?<scope>${wt})\\.(?<path>[^}]+)|(?<isInvalid>\\${F.FORM_IS_INVALID}))\\}\\}`,
|
|
404
433
|
"g"
|
|
405
|
-
),
|
|
434
|
+
), Ct = (e, r) => typeof e != "string" || !e.includes("{{$") ? e : e.replace(Ot, (t, ...n) => {
|
|
406
435
|
const o = n[n.length - 1], { scope: i, path: s, isInvalid: u } = o;
|
|
407
436
|
try {
|
|
408
437
|
if (u === F.FORM_IS_INVALID)
|
|
@@ -422,7 +451,7 @@ const F = {
|
|
|
422
451
|
return console.error(`Error resolving Expression: '${e}'`, c), t;
|
|
423
452
|
}
|
|
424
453
|
return t;
|
|
425
|
-
}),
|
|
454
|
+
}), Ft = (e, r) => {
|
|
426
455
|
const t = `${F.FORM}.`;
|
|
427
456
|
if (e.startsWith(t))
|
|
428
457
|
return r.resolveFormPath(e.replace(t, ""));
|
|
@@ -438,7 +467,7 @@ const F = {
|
|
|
438
467
|
function Ke(e) {
|
|
439
468
|
return e.flatMap((r) => [
|
|
440
469
|
r,
|
|
441
|
-
...
|
|
470
|
+
...ke(r) ? Ke(r.children) : []
|
|
442
471
|
]);
|
|
443
472
|
}
|
|
444
473
|
function Xe(e) {
|
|
@@ -448,33 +477,33 @@ function Xe(e) {
|
|
|
448
477
|
);
|
|
449
478
|
}
|
|
450
479
|
const ze = 32;
|
|
451
|
-
let Le,
|
|
480
|
+
let Le, f, p, m = (e) => (f = 0, p = e, m.newline = !1, e = E(), p[f] ? Q() : e || ""), Q = (e = "Unexpected token", r = f, t = p.slice(0, r).split(`
|
|
452
481
|
`), n = t.pop(), o = p.slice(Math.max(0, r - 40), r), i = "̭", s = (p[r] || " ") + i, u = p.slice(r + 1, r + 20)) => {
|
|
453
482
|
throw SyntaxError(`${e} at ${t.length + 1}:${n.length + 1}
|
|
454
483
|
${p[r - 41] !== `
|
|
455
484
|
`, "" + o}${s}${u}`);
|
|
456
|
-
},
|
|
457
|
-
for (; t = e(p.charCodeAt(
|
|
458
|
-
return p.slice(r,
|
|
459
|
-
},
|
|
485
|
+
}, $r = (e, r = f) => (Array.isArray(e) && (e.loc = r), e), x = (e, r = f, t) => {
|
|
486
|
+
for (; t = e(p.charCodeAt(f)); ) f += t;
|
|
487
|
+
return p.slice(r, f);
|
|
488
|
+
}, w = (e = 1) => p[f += e], Me = (e) => f = e, E = (e = 0, r) => {
|
|
460
489
|
let t, n, o, i, s;
|
|
461
490
|
for (r && m.asi && (m.newline = !1); (t = m.space()) && (s = m.newline, 1) && t !== r && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
|
|
462
491
|
(n && t === 91 && Le && m.asi?.(n, e, E) || null) ?? ((i = _[t]) && i(n, e)) ?? (n && s && m.asi?.(n, e, E)) ?? (!n && x(m.id))); ) n = o;
|
|
463
|
-
return r && (t == r ? (
|
|
464
|
-
}, G = (e, r =
|
|
465
|
-
for (Le = !1; (e = p.charCodeAt(
|
|
466
|
-
m.asi && e === 10 && (m.newline = Le = !0),
|
|
492
|
+
return r && (t == r ? (f++, r === 125 && m.asi && (m.newline = !0)) : Q("Unclosed " + String.fromCharCode(r - (r > 42 ? 2 : 1)))), n;
|
|
493
|
+
}, G = (e, r = f) => {
|
|
494
|
+
for (Le = !1; (e = p.charCodeAt(f)) <= ze; )
|
|
495
|
+
m.asi && e === 10 && (m.newline = Le = !0), f++;
|
|
467
496
|
return e;
|
|
468
|
-
},
|
|
497
|
+
}, Dt = (e = f) => {
|
|
469
498
|
for (; p.charCodeAt(e) <= ze; ) e++;
|
|
470
499
|
return p.charCodeAt(e);
|
|
471
500
|
};
|
|
472
501
|
m.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
|
|
473
|
-
let
|
|
502
|
+
let Pt = (e, r = e.length) => p.substr(f, r) === e && !m.id(p.charCodeAt(f + r)), _ = [], dr = {}, k = (e, r = ze, t, n = e.charCodeAt(0), o = e.length, i = _[n], s = e.toUpperCase() !== e, u, c) => (r = dr[e] = !i && dr[e] || r, _[n] = (h, $, g, a = f) => (u = g, (g ? e == g : (o < 2 || e.charCodeAt(1) === p.charCodeAt(f + 1) && (o < 3 || p.substr(f, o) == e)) && (!s || !m.id(p.charCodeAt(f + o))) && (u = g = e)) && $ < r && (f += o, (c = t(h)) ? $r(c, a) : (f = a, u = 0, !s && !i && !h && Q()), c) || i?.(h, $, u))), y = (e, r, t = !1) => k(e, r, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(E(r - (t ? 0.5 : 0)))), K = (e, r, t) => k(e, r, (n) => !n && (n = E(r - 0.5)) && [e, n]), de = (e, r) => k(e, 200, (t) => !t && [, r]), Ar = (e, r, t) => k(
|
|
474
503
|
e,
|
|
475
504
|
r,
|
|
476
505
|
(n, o) => (o = E(r - (t ? 0.5 : 0)), n?.[0] !== e && (n = [e, n || null]), o?.[0] === e ? n.push(...o.slice(1)) : n.push(o || null), n)
|
|
477
|
-
), Je = (e, r) => k(e[0], r, (t) => !t && [e, E(0, e.charCodeAt(1)) || null]),
|
|
506
|
+
), Je = (e, r) => k(e[0], r, (t) => !t && [e, E(0, e.charCodeAt(1)) || null]), Er = (e, r) => k(e[0], r, (t) => t && [e, t, E(0, e.charCodeAt(1)) || null]), ue = (e, r, t, n = e.charCodeAt(0), o = e.length, i = _[n], s) => _[n] = (u, c, h, $ = f) => !u && (h ? e == h : (o < 2 || p.substr(f, o) == e) && (h = e)) && c < r && !m.id(p.charCodeAt(f + o)) && (!m.prop || m.prop(f + o)) && (Me(f + o), (s = t()) ? $r(s, $) : Me($), s) || i?.(u, c, h);
|
|
478
507
|
Object.defineProperty(m, "space", {
|
|
479
508
|
configurable: !0,
|
|
480
509
|
enumerable: !0,
|
|
@@ -485,46 +514,46 @@ const je = {}, l = (e, r, t = je[e]) => je[e] = (...n) => r(...n) || t?.(...n),
|
|
|
485
514
|
// == catches both undefined and null
|
|
486
515
|
je[e[0]]?.(...e.slice(1)) ?? Q(`Unknown operator: ${e[0]}`, e?.loc)
|
|
487
516
|
) : e === void 0 ? () => {
|
|
488
|
-
} : (r) => r?.[e], pe = 46, te = 48, ge = 57,
|
|
489
|
-
let r =
|
|
517
|
+
} : (r) => r?.[e], pe = 46, te = 48, ge = 57, Wt = 69, Tt = 101, Rt = 43, kt = 45, he = 95, Sr = 110, _t = 97, Nt = 102, Lt = 65, Mt = 70, vr = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Qe = (e) => {
|
|
518
|
+
let r = vr(x(
|
|
490
519
|
(t) => (
|
|
491
520
|
// . is decimal only if NOT followed by another . (range operator)
|
|
492
|
-
t === pe && p.charCodeAt(
|
|
521
|
+
t === pe && p.charCodeAt(f + 1) !== pe || t >= te && t <= ge || t === he || ((t === Wt || t === Tt) && ((t = p.charCodeAt(f + 1)) >= te && t <= ge || t === Rt || t === kt) ? 2 : 0)
|
|
493
522
|
)
|
|
494
523
|
));
|
|
495
|
-
return p.charCodeAt(
|
|
496
|
-
},
|
|
524
|
+
return p.charCodeAt(f) === Sr ? (w(), [, BigInt(r)]) : (e = +r) != e ? Q() : [, e];
|
|
525
|
+
}, jt = {
|
|
497
526
|
2: (e) => e === 48 || e === 49 || e === he,
|
|
498
527
|
8: (e) => e >= 48 && e <= 55 || e === he,
|
|
499
|
-
16: (e) => e >= te && e <= ge || e >=
|
|
528
|
+
16: (e) => e >= te && e <= ge || e >= _t && e <= Nt || e >= Lt && e <= Mt || e === he
|
|
500
529
|
};
|
|
501
530
|
m.number = null;
|
|
502
|
-
_[pe] = (e) => !e && p.charCodeAt(
|
|
531
|
+
_[pe] = (e) => !e && p.charCodeAt(f + 1) !== pe && Qe();
|
|
503
532
|
for (let e = te; e <= ge; e++) _[e] = (r) => r ? void 0 : Qe();
|
|
504
533
|
_[te] = (e) => {
|
|
505
534
|
if (e) return;
|
|
506
535
|
const r = m.number;
|
|
507
536
|
if (r) {
|
|
508
537
|
for (const [t, n] of Object.entries(r))
|
|
509
|
-
if (t[0] === "0" && p[
|
|
510
|
-
|
|
511
|
-
const o =
|
|
512
|
-
return p.charCodeAt(
|
|
538
|
+
if (t[0] === "0" && p[f + 1]?.toLowerCase() === t[1]) {
|
|
539
|
+
w(2);
|
|
540
|
+
const o = vr(x(jt[n]));
|
|
541
|
+
return p.charCodeAt(f) === Sr ? (w(), [, BigInt("0" + t[1] + o)]) : [, parseInt(o, n)];
|
|
513
542
|
}
|
|
514
543
|
}
|
|
515
544
|
return Qe();
|
|
516
545
|
};
|
|
517
|
-
const
|
|
518
|
-
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" },
|
|
546
|
+
const Vt = 92, ur = 34, cr = 39, Ut = { n: `
|
|
547
|
+
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Ir = (e) => (r, t, n = "") => {
|
|
519
548
|
if (!(r || !m.string?.[String.fromCharCode(e)]))
|
|
520
|
-
return
|
|
549
|
+
return w(), x((o) => o - e && (o === Vt ? (n += Ut[p[f + 1]] || p[f + 1], 2) : (n += p[f], 1))), p[f] === String.fromCharCode(e) ? w() : Q("Bad string"), [, n];
|
|
521
550
|
};
|
|
522
|
-
_[ur] =
|
|
523
|
-
_[cr] =
|
|
551
|
+
_[ur] = Ir(ur);
|
|
552
|
+
_[cr] = Ir(cr);
|
|
524
553
|
m.string = { '"': !0 };
|
|
525
|
-
const
|
|
526
|
-
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => y(e,
|
|
527
|
-
const
|
|
554
|
+
const Bt = 20;
|
|
555
|
+
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => y(e, Bt, !0));
|
|
556
|
+
const wr = (e, r, t, n) => typeof e == "string" ? (o) => r(o, e, o) : e[0] === "." ? (t = d(e[1]), n = e[2], (o) => r(t(o), n, o)) : e[0] === "[]" && e.length === 3 ? (t = d(e[1]), n = d(e[2]), (o) => r(t(o), n(o), o)) : e[0] === "()" && e.length === 2 ? wr(e[1], r) : (() => {
|
|
528
557
|
throw Error("Invalid assignment target");
|
|
529
558
|
})(), lr = {
|
|
530
559
|
"=": (e, r, t) => e[r] = t,
|
|
@@ -539,21 +568,21 @@ const Ir = (e, r, t, n) => typeof e == "string" ? (o) => r(o, e, o) : e[0] === "
|
|
|
539
568
|
">>=": (e, r, t) => e[r] >>= t,
|
|
540
569
|
"<<=": (e, r, t) => e[r] <<= t
|
|
541
570
|
};
|
|
542
|
-
for (const e in lr) l(e, (r, t) => (t = d(t),
|
|
543
|
-
const
|
|
544
|
-
K("!",
|
|
545
|
-
y("||",
|
|
546
|
-
y("&&",
|
|
571
|
+
for (const e in lr) l(e, (r, t) => (t = d(t), wr(r, (n, o, i) => lr[e](n, o, t(i)))));
|
|
572
|
+
const Ht = 30, Gt = 40, Kt = 140;
|
|
573
|
+
K("!", Kt);
|
|
574
|
+
y("||", Ht);
|
|
575
|
+
y("&&", Gt);
|
|
547
576
|
l("!", (e) => (e = d(e), (r) => !e(r)));
|
|
548
577
|
l("||", (e, r) => (e = d(e), r = d(r), (t) => e(t) || r(t)));
|
|
549
578
|
l("&&", (e, r) => (e = d(e), r = d(r), (t) => e(t) && r(t)));
|
|
550
|
-
const
|
|
551
|
-
y("|",
|
|
552
|
-
y("&",
|
|
553
|
-
y("^",
|
|
579
|
+
const Xt = 50, zt = 60, Jt = 70, Or = 100, Qt = 140;
|
|
580
|
+
y("|", Xt);
|
|
581
|
+
y("&", Jt);
|
|
582
|
+
y("^", zt);
|
|
554
583
|
y(">>", Or);
|
|
555
584
|
y("<<", Or);
|
|
556
|
-
K("~",
|
|
585
|
+
K("~", Qt);
|
|
557
586
|
l("~", (e) => (e = d(e), (r) => ~e(r)));
|
|
558
587
|
l("|", (e, r) => (e = d(e), r = d(r), (t) => e(t) | r(t)));
|
|
559
588
|
l("&", (e, r) => (e = d(e), r = d(r), (t) => e(t) & r(t)));
|
|
@@ -569,19 +598,19 @@ l(">", (e, r) => (e = d(e), r = d(r), (t) => e(t) > r(t)));
|
|
|
569
598
|
l("<", (e, r) => (e = d(e), r = d(r), (t) => e(t) < r(t)));
|
|
570
599
|
l(">=", (e, r) => (e = d(e), r = d(r), (t) => e(t) >= r(t)));
|
|
571
600
|
l("<=", (e, r) => (e = d(e), r = d(r), (t) => e(t) <= r(t)));
|
|
572
|
-
const
|
|
573
|
-
y("==",
|
|
574
|
-
y("!=",
|
|
601
|
+
const Cr = 80;
|
|
602
|
+
y("==", Cr);
|
|
603
|
+
y("!=", Cr);
|
|
575
604
|
l("==", (e, r) => (e = d(e), r = d(r), (t) => e(t) == r(t)));
|
|
576
605
|
l("!=", (e, r) => (e = d(e), r = d(r), (t) => e(t) != r(t)));
|
|
577
|
-
const
|
|
578
|
-
y("+",
|
|
579
|
-
y("-",
|
|
606
|
+
const Fr = 110, qe = 120, Dr = 140;
|
|
607
|
+
y("+", Fr);
|
|
608
|
+
y("-", Fr);
|
|
580
609
|
y("*", qe);
|
|
581
610
|
y("/", qe);
|
|
582
611
|
y("%", qe);
|
|
583
|
-
K("+",
|
|
584
|
-
K("-",
|
|
612
|
+
K("+", Dr);
|
|
613
|
+
K("-", Dr);
|
|
585
614
|
l("+", (e, r) => r !== void 0 ? (e = d(e), r = d(r), (t) => e(t) + r(t)) : (e = d(e), (t) => +e(t)));
|
|
586
615
|
l("-", (e, r) => r !== void 0 ? (e = d(e), r = d(r), (t) => e(t) - r(t)) : (e = d(e), (t) => -e(t)));
|
|
587
616
|
l("*", (e, r) => (e = d(e), r = d(r), (t) => e(t) * r(t)));
|
|
@@ -598,22 +627,22 @@ const Ye = (e, r, t, n) => typeof e == "string" ? (o) => r(o, e) : e[0] === "."
|
|
|
598
627
|
);
|
|
599
628
|
l("++", (e, r) => Ye(e, r === null ? (t, n) => t[n]++ : (t, n) => ++t[n]));
|
|
600
629
|
l("--", (e, r) => Ye(e, r === null ? (t, n) => t[n]-- : (t, n) => --t[n]));
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
const
|
|
630
|
+
const qt = 5, Yt = 10;
|
|
631
|
+
Ar(",", Yt);
|
|
632
|
+
Ar(";", qt, !0);
|
|
633
|
+
const Pr = (...e) => (e = e.map(d), (r) => {
|
|
605
634
|
let t;
|
|
606
635
|
for (const n of e) t = n(r);
|
|
607
636
|
return t;
|
|
608
637
|
});
|
|
609
|
-
l(",",
|
|
610
|
-
l(";",
|
|
611
|
-
const
|
|
612
|
-
Je("()",
|
|
638
|
+
l(",", Pr);
|
|
639
|
+
l(";", Pr);
|
|
640
|
+
const Zt = 170;
|
|
641
|
+
Je("()", Zt);
|
|
613
642
|
const H = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", Ze = 170;
|
|
614
|
-
|
|
643
|
+
Er("[]", Ze);
|
|
615
644
|
y(".", Ze);
|
|
616
|
-
|
|
645
|
+
Er("()", Ze);
|
|
617
646
|
const ye = (e) => {
|
|
618
647
|
throw Error(e);
|
|
619
648
|
};
|
|
@@ -637,18 +666,18 @@ const q = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[
|
|
|
637
666
|
}) : e[0] === "[]" && e.length === 3 ? (t = d(e[1]), n = d(e[2]), (o) => r(t(o), n(o), o)) : e[0] === "?.[]" ? (t = d(e[1]), n = d(e[2]), (o) => {
|
|
638
667
|
const i = t(o);
|
|
639
668
|
return i == null ? void 0 : r(i, n(o), o);
|
|
640
|
-
}) : (e = d(e), (o) => r([e(o)], 0, o)), b = xe,
|
|
669
|
+
}) : (e = d(e), (o) => r([e(o)], 0, o)), b = xe, xt = 32, bt = m.space;
|
|
641
670
|
m.comment ??= { "//": `
|
|
642
671
|
`, "/*": "*/" };
|
|
643
672
|
let De;
|
|
644
673
|
m.space = () => {
|
|
645
674
|
De || (De = Object.entries(m.comment).map(([o, i]) => [o, i, o.charCodeAt(0)]));
|
|
646
|
-
for (var e; e =
|
|
675
|
+
for (var e; e = bt(); ) {
|
|
647
676
|
for (var r = 0, t; t = De[r++]; )
|
|
648
|
-
if (e === t[2] && p.substr(
|
|
649
|
-
var n =
|
|
677
|
+
if (e === t[2] && p.substr(f, t[0].length) === t[0]) {
|
|
678
|
+
var n = f + t[0].length;
|
|
650
679
|
if (t[1] === `
|
|
651
|
-
`) for (; p.charCodeAt(n) >=
|
|
680
|
+
`) for (; p.charCodeAt(n) >= xt; ) n++;
|
|
652
681
|
else {
|
|
653
682
|
for (; p[n] && p.substr(n, t[1].length) !== t[1]; ) n++;
|
|
654
683
|
p[n] && (n += t[1].length);
|
|
@@ -660,52 +689,52 @@ m.space = () => {
|
|
|
660
689
|
}
|
|
661
690
|
return e;
|
|
662
691
|
};
|
|
663
|
-
const
|
|
664
|
-
y("===",
|
|
665
|
-
y("!==",
|
|
692
|
+
const Wr = 80;
|
|
693
|
+
y("===", Wr);
|
|
694
|
+
y("!==", Wr);
|
|
666
695
|
l("===", (e, r) => (e = d(e), r = d(r), (t) => e(t) === r(t)));
|
|
667
696
|
l("!==", (e, r) => (e = d(e), r = d(r), (t) => e(t) !== r(t)));
|
|
668
|
-
const
|
|
669
|
-
y("??",
|
|
697
|
+
const en = 30;
|
|
698
|
+
y("??", en);
|
|
670
699
|
l("??", (e, r) => (e = d(e), r = d(r), (t) => e(t) ?? r(t)));
|
|
671
|
-
const
|
|
672
|
-
y("**",
|
|
673
|
-
y("**=",
|
|
700
|
+
const rn = 130, tn = 20;
|
|
701
|
+
y("**", rn, !0);
|
|
702
|
+
y("**=", tn, !0);
|
|
674
703
|
l("**", (e, r) => (e = d(e), r = d(r), (t) => e(t) ** r(t)));
|
|
675
|
-
const
|
|
704
|
+
const nn = (e) => {
|
|
676
705
|
throw Error(e);
|
|
677
706
|
};
|
|
678
|
-
l("**=", (e, r) => (q(e) ||
|
|
679
|
-
const
|
|
680
|
-
y("in",
|
|
681
|
-
y("of",
|
|
707
|
+
l("**=", (e, r) => (q(e) || nn("Invalid assignment target"), r = d(r), b(e, (t, n, o) => t[n] **= r(o))));
|
|
708
|
+
const Tr = 90;
|
|
709
|
+
y("in", Tr);
|
|
710
|
+
y("of", Tr);
|
|
682
711
|
l("in", (e, r) => (e = d(e), r = d(r), (t) => e(t) in r(t)));
|
|
683
|
-
const
|
|
712
|
+
const on = 20, sn = 100, dn = (e) => {
|
|
684
713
|
throw Error(e);
|
|
685
714
|
};
|
|
686
|
-
y(">>>",
|
|
687
|
-
y(">>>=",
|
|
715
|
+
y(">>>", sn);
|
|
716
|
+
y(">>>=", on, !0);
|
|
688
717
|
l(">>>", (e, r) => (e = d(e), r = d(r), (t) => e(t) >>> r(t)));
|
|
689
|
-
l(">>>=", (e, r) => (q(e) ||
|
|
690
|
-
const be = 5,
|
|
718
|
+
l(">>>=", (e, r) => (q(e) || dn("Invalid assignment target"), r = d(r), b(e, (t, n, o) => t[n] >>>= r(o))));
|
|
719
|
+
const be = 5, un = 10, cn = 20, ln = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, $e = (e, r, t) => {
|
|
691
720
|
if (typeof e == "string") {
|
|
692
721
|
t[e] = r;
|
|
693
722
|
return;
|
|
694
723
|
}
|
|
695
|
-
const [n, ...o] = e, i =
|
|
724
|
+
const [n, ...o] = e, i = ln(o);
|
|
696
725
|
if (n === "{}") {
|
|
697
726
|
const s = [];
|
|
698
727
|
for (const u of i) {
|
|
699
728
|
if (Array.isArray(u) && u[0] === "...") {
|
|
700
|
-
const
|
|
701
|
-
for (const C in r) s.includes(C) || (
|
|
702
|
-
t[u[1]] =
|
|
729
|
+
const a = {};
|
|
730
|
+
for (const C in r) s.includes(C) || (a[C] = r[C]);
|
|
731
|
+
t[u[1]] = a;
|
|
703
732
|
break;
|
|
704
733
|
}
|
|
705
|
-
let c, h,
|
|
706
|
-
typeof u == "string" ? c = h = u : u[0] === "=" ? (typeof u[1] == "string" ? c = h = u[1] : [, c, h] = u[1],
|
|
734
|
+
let c, h, $;
|
|
735
|
+
typeof u == "string" ? c = h = u : u[0] === "=" ? (typeof u[1] == "string" ? c = h = u[1] : [, c, h] = u[1], $ = u[2]) : [, c, h] = u, s.push(c);
|
|
707
736
|
let g = r[c];
|
|
708
|
-
g === void 0 &&
|
|
737
|
+
g === void 0 && $ && (g = d($)(t)), $e(h, g, t);
|
|
709
738
|
}
|
|
710
739
|
} else if (n === "[]") {
|
|
711
740
|
let s = 0;
|
|
@@ -720,18 +749,18 @@ const be = 5, nn = 10, on = 20, sn = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
|
|
|
720
749
|
}
|
|
721
750
|
let c = u, h;
|
|
722
751
|
Array.isArray(u) && u[0] === "=" && ([, c, h] = u);
|
|
723
|
-
let
|
|
724
|
-
|
|
752
|
+
let $ = r[s++];
|
|
753
|
+
$ === void 0 && h && ($ = d(h)(t)), $e(c, $, t);
|
|
725
754
|
}
|
|
726
755
|
}
|
|
727
|
-
},
|
|
728
|
-
let r = E(
|
|
756
|
+
}, Rr = (e) => {
|
|
757
|
+
let r = E(un - 1);
|
|
729
758
|
return r?.[0] === "in" || r?.[0] === "of" ? [r[0], [e, r[1]], r[2]] : r?.[0] === "," ? [e, ...r.slice(1)] : [e, r];
|
|
730
759
|
};
|
|
731
|
-
ue("let", be + 1, () =>
|
|
732
|
-
ue("const", be + 1, () =>
|
|
733
|
-
ue("var", be, () => (G(), ["var", E(
|
|
734
|
-
const
|
|
760
|
+
ue("let", be + 1, () => Rr("let"));
|
|
761
|
+
ue("const", be + 1, () => Rr("const"));
|
|
762
|
+
ue("var", be, () => (G(), ["var", E(cn)]));
|
|
763
|
+
const kr = (...e) => (e = e.map((r) => {
|
|
735
764
|
if (typeof r == "string") return (t) => {
|
|
736
765
|
t[r] = void 0;
|
|
737
766
|
};
|
|
@@ -745,8 +774,8 @@ const Rr = (...e) => (e = e.map((r) => {
|
|
|
745
774
|
}), (r) => {
|
|
746
775
|
for (const t of e) t(r);
|
|
747
776
|
});
|
|
748
|
-
l("let",
|
|
749
|
-
l("const",
|
|
777
|
+
l("let", kr);
|
|
778
|
+
l("const", kr);
|
|
750
779
|
l("var", (e) => typeof e == "string" ? (r) => {
|
|
751
780
|
r[e] = void 0;
|
|
752
781
|
} : () => {
|
|
@@ -778,8 +807,8 @@ de("Infinity", 1 / 0);
|
|
|
778
807
|
const Pe = 20;
|
|
779
808
|
k("?", Pe, (e, r, t) => e && (r = E(Pe - 1)) && x((n) => n === 58) && (t = E(Pe - 1), ["?", e, r, t]));
|
|
780
809
|
l("?", (e, r, t) => (e = d(e), r = d(r), t = d(t), (n) => e(n) ? r(n) : t(n)));
|
|
781
|
-
const
|
|
782
|
-
y("=>",
|
|
810
|
+
const an = [], fn = 20;
|
|
811
|
+
y("=>", fn, !0);
|
|
783
812
|
l("=>", (e, r) => {
|
|
784
813
|
e = e?.[0] === "()" ? e[1] : e;
|
|
785
814
|
const t = e ? e[0] === "," ? e.slice(1) : [e] : [];
|
|
@@ -789,29 +818,29 @@ l("=>", (e, r) => {
|
|
|
789
818
|
const s = r?.[0] === "{}";
|
|
790
819
|
return r = d(s ? ["{", r[1]] : r), (u) => (...c) => {
|
|
791
820
|
const h = {};
|
|
792
|
-
t.forEach((g,
|
|
793
|
-
const
|
|
794
|
-
get: (g,
|
|
795
|
-
set: (g,
|
|
796
|
-
has: (g,
|
|
821
|
+
t.forEach((g, a) => h[g] = c[a]), o && (h[o] = c.slice(n));
|
|
822
|
+
const $ = new Proxy(h, {
|
|
823
|
+
get: (g, a) => a in g ? g[a] : u?.[a],
|
|
824
|
+
set: (g, a, C) => ((a in g ? g : u)[a] = C, !0),
|
|
825
|
+
has: (g, a) => a in g || (u ? a in u : !1)
|
|
797
826
|
});
|
|
798
827
|
try {
|
|
799
|
-
const g = r(
|
|
828
|
+
const g = r($);
|
|
800
829
|
return s ? void 0 : g;
|
|
801
830
|
} catch (g) {
|
|
802
|
-
if (g ===
|
|
831
|
+
if (g === an) return g[0];
|
|
803
832
|
throw g;
|
|
804
833
|
}
|
|
805
834
|
};
|
|
806
835
|
});
|
|
807
|
-
const
|
|
808
|
-
K("...",
|
|
836
|
+
const hn = 140;
|
|
837
|
+
K("...", hn);
|
|
809
838
|
l("...", (e) => (e = d(e), (r) => Object.entries(e(r))));
|
|
810
|
-
const
|
|
811
|
-
k("?.",
|
|
839
|
+
const ar = 170;
|
|
840
|
+
k("?.", ar, (e, r) => {
|
|
812
841
|
if (!e) return;
|
|
813
842
|
const t = G();
|
|
814
|
-
return t === 40 ? (
|
|
843
|
+
return t === 40 ? (w(), ["?.()", e, E(0, 41) || null]) : t === 91 ? (w(), ["?.[]", e, E(0, 93)]) : (r = E(ar), r ? ["?.", e, r] : void 0);
|
|
815
844
|
});
|
|
816
845
|
l("?.", (e, r) => (e = d(e), H(r) ? () => {
|
|
817
846
|
} : (t) => e(t)?.[r]));
|
|
@@ -855,7 +884,7 @@ K("delete", ne);
|
|
|
855
884
|
ue(
|
|
856
885
|
"new",
|
|
857
886
|
ne,
|
|
858
|
-
() =>
|
|
887
|
+
() => Pt(".target") ? (w(7), ["new.target"]) : ["new", E(ne)]
|
|
859
888
|
);
|
|
860
889
|
l("typeof", (e) => (e = d(e), (r) => typeof e(r)));
|
|
861
890
|
l("void", (e) => (e = d(e), (r) => (e(r), void 0)));
|
|
@@ -874,22 +903,22 @@ l("new", (e) => {
|
|
|
874
903
|
const r = d(e?.[0] === "()" ? e[1] : e), t = e?.[0] === "()" ? e[2] : null, n = t ? t[0] === "," ? /* @__PURE__ */ ((o) => (i) => o.map((s) => s(i)))(t.slice(1).map(d)) : /* @__PURE__ */ ((o) => (i) => [o(i)])(d(t)) : () => [];
|
|
875
904
|
return (o) => new (r(o))(...n(o));
|
|
876
905
|
});
|
|
877
|
-
const rr = Symbol("accessor"), tr = 20,
|
|
906
|
+
const rr = Symbol("accessor"), tr = 20, pn = 40, _r = 41, Nr = 123, Lr = 125, Mr = (e) => (r) => {
|
|
878
907
|
if (r) return;
|
|
879
908
|
G();
|
|
880
909
|
const t = x(m.id);
|
|
881
|
-
if (!t || (G(), p.charCodeAt(
|
|
882
|
-
|
|
883
|
-
const n = E(0,
|
|
884
|
-
return G(), p.charCodeAt(
|
|
910
|
+
if (!t || (G(), p.charCodeAt(f) !== pn)) return !1;
|
|
911
|
+
w();
|
|
912
|
+
const n = E(0, _r);
|
|
913
|
+
return G(), p.charCodeAt(f) !== Nr ? !1 : (w(), [e, t, n, E(0, Lr)]);
|
|
885
914
|
};
|
|
886
|
-
k("get", tr - 1,
|
|
887
|
-
k("set", tr - 1,
|
|
915
|
+
k("get", tr - 1, Mr("get"));
|
|
916
|
+
k("set", tr - 1, Mr("set"));
|
|
888
917
|
k("(", tr - 1, (e) => {
|
|
889
918
|
if (!e || typeof e != "string") return;
|
|
890
|
-
const r = E(0,
|
|
891
|
-
if (G(), p.charCodeAt(
|
|
892
|
-
return
|
|
919
|
+
const r = E(0, _r) || null;
|
|
920
|
+
if (G(), p.charCodeAt(f) === Nr)
|
|
921
|
+
return w(), [":", e, ["=>", ["()", r], E(0, Lr) || null]];
|
|
893
922
|
});
|
|
894
923
|
l("get", (e, r) => (r = r ? d(r) : () => {
|
|
895
924
|
}, (t) => [[rr, e, {
|
|
@@ -905,15 +934,15 @@ l("set", (e, r, t) => (t = t ? d(t) : () => {
|
|
|
905
934
|
i.this = this, i[r] = o, t(i);
|
|
906
935
|
}
|
|
907
936
|
}]]));
|
|
908
|
-
const
|
|
909
|
-
m.prop = (e) =>
|
|
910
|
-
const
|
|
911
|
-
Je("[]",
|
|
912
|
-
Je("{}",
|
|
913
|
-
y(":",
|
|
937
|
+
const gn = 20, jr = 200;
|
|
938
|
+
m.prop = (e) => Dt(e) !== 58;
|
|
939
|
+
const mn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
|
|
940
|
+
Je("[]", jr);
|
|
941
|
+
Je("{}", jr);
|
|
942
|
+
y(":", gn - 1, !0);
|
|
914
943
|
l("{}", (e, r) => {
|
|
915
944
|
if (r !== void 0) return;
|
|
916
|
-
if (!
|
|
945
|
+
if (!mn(e)) return d(["{", e]);
|
|
917
946
|
e = e ? e[0] !== "," ? [e] : e.slice(1) : [];
|
|
918
947
|
const t = e.map((n) => d(typeof n == "string" ? [":", n, n] : n));
|
|
919
948
|
return (n) => {
|
|
@@ -930,19 +959,19 @@ l("{}", (e, r) => {
|
|
|
930
959
|
l("{", (e) => (e = e ? d(e) : () => {
|
|
931
960
|
}, (r) => e(Object.create(r))));
|
|
932
961
|
l(":", (e, r) => (r = d(r), Array.isArray(e) ? (e = d(e), (t) => [[e(t), r(t)]]) : (t) => [[e, r(t)]]));
|
|
933
|
-
const
|
|
934
|
-
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" },
|
|
962
|
+
const yn = 170, Ae = 96, $n = 36, An = 123, En = 92, Sn = { n: `
|
|
963
|
+
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, fr = () => {
|
|
935
964
|
const e = [];
|
|
936
|
-
for (let r = "", t; (t = p.charCodeAt(
|
|
937
|
-
t ? t ===
|
|
938
|
-
return
|
|
939
|
-
},
|
|
940
|
-
_[Ae] = (e, r) => e && r <
|
|
965
|
+
for (let r = "", t; (t = p.charCodeAt(f)) !== Ae; )
|
|
966
|
+
t ? t === En ? (w(), r += Sn[p[f]] || p[f], w()) : t === $n && p.charCodeAt(f + 1) === An ? (r && e.push([, r]), r = "", w(2), e.push(E(0, 125))) : (r += p[f], w(), t = p.charCodeAt(f), t === Ae && r && e.push([, r])) : Q("Unterminated template");
|
|
967
|
+
return w(), e;
|
|
968
|
+
}, vn = _[Ae];
|
|
969
|
+
_[Ae] = (e, r) => e && r < yn ? m.asi && m.newline ? void 0 : (w(), ["``", e, ...fr()]) : (
|
|
941
970
|
// tagged
|
|
942
971
|
e ? (
|
|
943
972
|
// plain
|
|
944
|
-
|
|
945
|
-
) : (
|
|
973
|
+
vn?.(e, r)
|
|
974
|
+
) : (w(), ((t) => t.length < 2 && t[0]?.[0] === void 0 ? t[0] || [, ""] : ["`", ...t])(fr()))
|
|
946
975
|
);
|
|
947
976
|
l("`", (...e) => (e = e.map(d), (r) => e.map((t) => t(r)).join("")));
|
|
948
977
|
l("``", (e, ...r) => {
|
|
@@ -955,20 +984,20 @@ l("``", (e, ...r) => {
|
|
|
955
984
|
});
|
|
956
985
|
m.string["'"] = !0;
|
|
957
986
|
m.number = { "0x": 16, "0b": 2, "0o": 8 };
|
|
958
|
-
const
|
|
987
|
+
const In = {
|
|
959
988
|
log: (e, r) => (r ? console.log(r, e) : console.log(e), e)
|
|
960
989
|
};
|
|
961
990
|
function j(e, r, t, n, o) {
|
|
962
|
-
const i = m(
|
|
991
|
+
const i = m(wn(e));
|
|
963
992
|
return d(i)({
|
|
964
993
|
$form: r,
|
|
965
994
|
$meta: t,
|
|
966
995
|
$errors: n,
|
|
967
996
|
$formIsInvalid: o,
|
|
968
|
-
$log:
|
|
997
|
+
$log: In.log
|
|
969
998
|
}) === !0;
|
|
970
999
|
}
|
|
971
|
-
function
|
|
1000
|
+
function wn(e) {
|
|
972
1001
|
return e.replace(/\?\.(\d+)/g, "?.[$1]").replace(/\.(\d+)/g, "[$1]");
|
|
973
1002
|
}
|
|
974
1003
|
const V = (e) => {
|
|
@@ -976,7 +1005,7 @@ const V = (e) => {
|
|
|
976
1005
|
if (!r || Object.keys(r).length === 0 || e.formHealth.status === "errored")
|
|
977
1006
|
return e;
|
|
978
1007
|
const { $formIsInvalid: t, $errors: n } = Xe(e);
|
|
979
|
-
r =
|
|
1008
|
+
r = On(r);
|
|
980
1009
|
let o = [], i = { status: "ok" };
|
|
981
1010
|
try {
|
|
982
1011
|
o = Object.keys(r).map((s) => {
|
|
@@ -990,7 +1019,7 @@ const V = (e) => {
|
|
|
990
1019
|
return c === !0 ? s : void 0;
|
|
991
1020
|
}).filter((s) => s !== void 0);
|
|
992
1021
|
} catch (s) {
|
|
993
|
-
const u = s, c =
|
|
1022
|
+
const u = s, c = fe.calculateCurrentStateError;
|
|
994
1023
|
i = {
|
|
995
1024
|
status: "errored",
|
|
996
1025
|
message: `[${c}] ${u.message}`,
|
|
@@ -999,7 +1028,7 @@ const V = (e) => {
|
|
|
999
1028
|
}
|
|
1000
1029
|
return { ...e, currentStates: o, formHealth: i };
|
|
1001
1030
|
};
|
|
1002
|
-
function
|
|
1031
|
+
function On(e) {
|
|
1003
1032
|
const r = {};
|
|
1004
1033
|
function t(n) {
|
|
1005
1034
|
const o = n.split(":"), i = [];
|
|
@@ -1016,7 +1045,7 @@ function Sn(e) {
|
|
|
1016
1045
|
return r;
|
|
1017
1046
|
}
|
|
1018
1047
|
const nr = Symbol("filterMap.skip");
|
|
1019
|
-
function
|
|
1048
|
+
function Vr(e, r) {
|
|
1020
1049
|
const t = [];
|
|
1021
1050
|
for (let n = 0; n < e.length; n++) {
|
|
1022
1051
|
const o = r(e[n], n, e);
|
|
@@ -1024,17 +1053,17 @@ function jr(e, r) {
|
|
|
1024
1053
|
}
|
|
1025
1054
|
return t;
|
|
1026
1055
|
}
|
|
1027
|
-
function
|
|
1056
|
+
function Oo(e, r, t) {
|
|
1028
1057
|
for (let n = 0; n < e.length; n++)
|
|
1029
1058
|
r(e[n], n, e) && t(e[n], n, e);
|
|
1030
1059
|
}
|
|
1031
|
-
function
|
|
1060
|
+
function Cn(e, r, t, n) {
|
|
1032
1061
|
let o = n;
|
|
1033
1062
|
for (let i = 0; i < e.length; i++)
|
|
1034
1063
|
r(e[i], i, e) && (o = t(o, e[i], i, e));
|
|
1035
1064
|
return o;
|
|
1036
1065
|
}
|
|
1037
|
-
function
|
|
1066
|
+
function Fn(e, r, t) {
|
|
1038
1067
|
if (e.length !== r.length)
|
|
1039
1068
|
return !1;
|
|
1040
1069
|
for (let n = 0; n < e.length; n++)
|
|
@@ -1042,24 +1071,24 @@ function In(e, r, t) {
|
|
|
1042
1071
|
return !1;
|
|
1043
1072
|
return !0;
|
|
1044
1073
|
}
|
|
1045
|
-
function
|
|
1046
|
-
const t =
|
|
1074
|
+
function Dn(e, r) {
|
|
1075
|
+
const t = Ur(e.uid, r);
|
|
1047
1076
|
return P(e) ? {
|
|
1048
1077
|
...e,
|
|
1049
1078
|
uid: t,
|
|
1050
|
-
path:
|
|
1079
|
+
path: Pn(e.path, r)
|
|
1051
1080
|
} : {
|
|
1052
1081
|
...e,
|
|
1053
1082
|
uid: t
|
|
1054
1083
|
};
|
|
1055
1084
|
}
|
|
1056
|
-
function
|
|
1085
|
+
function Ur(e, r) {
|
|
1057
1086
|
if (r.length === 0)
|
|
1058
1087
|
throw new Error("Repeater indexes cannot be an empty array");
|
|
1059
1088
|
const t = r.reduce((n, o) => `${n}[${o}]`, "");
|
|
1060
1089
|
return `${e}${t}`;
|
|
1061
1090
|
}
|
|
1062
|
-
function
|
|
1091
|
+
function Pn(e, r) {
|
|
1063
1092
|
if (r.length === 0)
|
|
1064
1093
|
throw new Error("Repeater indexes cannot be an empty array");
|
|
1065
1094
|
const t = "items", n = e.split(`.${t}`), o = n.length - 1;
|
|
@@ -1076,18 +1105,18 @@ function le(e, r) {
|
|
|
1076
1105
|
return i === void 0 ? n : `.${i}${o}.`;
|
|
1077
1106
|
});
|
|
1078
1107
|
}
|
|
1079
|
-
const
|
|
1108
|
+
const ae = (e, r) => (t) => e(t) ? r(t) : t, z = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e, U = (e) => {
|
|
1080
1109
|
const { $formIsInvalid: r, $errors: t } = Xe(e);
|
|
1081
1110
|
return {
|
|
1082
1111
|
...e,
|
|
1083
1112
|
widgetFlags: {
|
|
1084
|
-
...
|
|
1085
|
-
...
|
|
1113
|
+
...Wn(e, t, r),
|
|
1114
|
+
...Tn(e, t, r)
|
|
1086
1115
|
}
|
|
1087
1116
|
};
|
|
1088
1117
|
};
|
|
1089
|
-
function
|
|
1090
|
-
return
|
|
1118
|
+
function Wn(e, r, t) {
|
|
1119
|
+
return Vr(Object.values(e.flatForm), (n) => {
|
|
1091
1120
|
if (n.uid?.includes("["))
|
|
1092
1121
|
return nr;
|
|
1093
1122
|
if (se(n)) {
|
|
@@ -1133,74 +1162,74 @@ function Cn(e, r, t) {
|
|
|
1133
1162
|
{}
|
|
1134
1163
|
);
|
|
1135
1164
|
}
|
|
1136
|
-
function
|
|
1137
|
-
return
|
|
1165
|
+
function Tn(e, r, t) {
|
|
1166
|
+
return Cn(
|
|
1138
1167
|
Object.values(e.flatForm),
|
|
1139
1168
|
(n) => !se(n) && n.type === "repeater",
|
|
1140
1169
|
(n, o) => ({
|
|
1141
1170
|
...n,
|
|
1142
|
-
...
|
|
1171
|
+
...Br(e, o, [], r, t)
|
|
1143
1172
|
}),
|
|
1144
1173
|
{}
|
|
1145
1174
|
);
|
|
1146
1175
|
}
|
|
1147
|
-
function
|
|
1176
|
+
function Br(e, r, t, n, o) {
|
|
1148
1177
|
const i = r.props.template, s = N(e.data, r.path);
|
|
1149
1178
|
if (!Array.isArray(s))
|
|
1150
1179
|
return {};
|
|
1151
1180
|
const u = {};
|
|
1152
1181
|
return s.forEach((c, h) => {
|
|
1153
|
-
const
|
|
1182
|
+
const $ = [...t, h];
|
|
1154
1183
|
Ke([i]).forEach((g) => {
|
|
1155
|
-
let
|
|
1156
|
-
if (se(g) ? (
|
|
1184
|
+
let a;
|
|
1185
|
+
if (se(g) ? (a = g({
|
|
1157
1186
|
$form: e.data,
|
|
1158
1187
|
errors: void 0,
|
|
1159
1188
|
touched: void 0,
|
|
1160
1189
|
translate: void 0
|
|
1161
|
-
}),
|
|
1162
|
-
const ee =
|
|
1163
|
-
|
|
1164
|
-
|
|
1190
|
+
}), a.uid = g.uid) : a = g, a.type === "repeater") {
|
|
1191
|
+
const ee = Dn(
|
|
1192
|
+
a,
|
|
1193
|
+
$
|
|
1165
1194
|
);
|
|
1166
1195
|
Object.assign(
|
|
1167
1196
|
u,
|
|
1168
|
-
|
|
1197
|
+
Br(
|
|
1169
1198
|
e,
|
|
1170
1199
|
ee,
|
|
1171
|
-
|
|
1200
|
+
$,
|
|
1172
1201
|
n,
|
|
1173
1202
|
o
|
|
1174
1203
|
)
|
|
1175
1204
|
);
|
|
1176
1205
|
return;
|
|
1177
1206
|
}
|
|
1178
|
-
const C =
|
|
1179
|
-
u[C] = u[C] || {},
|
|
1180
|
-
le(
|
|
1207
|
+
const C = Ur(a.uid, $);
|
|
1208
|
+
u[C] = u[C] || {}, a.include && "in" in a.include ? u[C].hidden = !a.include.in.some((ee) => e.currentStates.includes(ee)) : a.include && "when" in a.include && (u[C].hidden = !j(
|
|
1209
|
+
le(a.include.when, $),
|
|
1181
1210
|
e.data,
|
|
1182
1211
|
e.meta,
|
|
1183
1212
|
n,
|
|
1184
1213
|
o
|
|
1185
|
-
)),
|
|
1186
|
-
le(
|
|
1214
|
+
)), a.exclude && "from" in a.exclude ? u[C].hidden = a.exclude.from.some((ee) => e.currentStates.includes(ee)) : a.exclude && "when" in a.exclude && (u[C].hidden = j(
|
|
1215
|
+
le(a.exclude.when, $),
|
|
1187
1216
|
e.data,
|
|
1188
1217
|
e.meta,
|
|
1189
1218
|
n,
|
|
1190
1219
|
o
|
|
1191
|
-
)), (P(
|
|
1220
|
+
)), (P(a) || re(a)) && z(a.disabled) && (u[C].disabled = j(
|
|
1192
1221
|
le(
|
|
1193
|
-
|
|
1194
|
-
|
|
1222
|
+
a.disabled.when,
|
|
1223
|
+
$
|
|
1195
1224
|
),
|
|
1196
1225
|
e.data,
|
|
1197
1226
|
e.meta,
|
|
1198
1227
|
n,
|
|
1199
1228
|
o
|
|
1200
|
-
)), P(
|
|
1229
|
+
)), P(a) && z(a.readonly) && (u[C].readonly = j(
|
|
1201
1230
|
le(
|
|
1202
|
-
|
|
1203
|
-
|
|
1231
|
+
a.readonly.when,
|
|
1232
|
+
$
|
|
1204
1233
|
),
|
|
1205
1234
|
e.data,
|
|
1206
1235
|
e.meta,
|
|
@@ -1210,44 +1239,21 @@ function Ur(e, r, t, n, o) {
|
|
|
1210
1239
|
});
|
|
1211
1240
|
}), u;
|
|
1212
1241
|
}
|
|
1213
|
-
const
|
|
1214
|
-
function Oo(e) {
|
|
1215
|
-
const r = new Intl.Locale(e).maximize().script;
|
|
1216
|
-
return ["Arab", "Hebr", "Thaa", "Syrc", "Tfng", "Adlm", "Rohg"].includes(r || "") ? "rtl" : "ltr";
|
|
1217
|
-
}
|
|
1218
|
-
const Pn = (e = navigator.language || "en-US") => {
|
|
1219
|
-
const r = /* @__PURE__ */ new Set();
|
|
1220
|
-
return {
|
|
1221
|
-
get lang() {
|
|
1222
|
-
return e;
|
|
1223
|
-
},
|
|
1224
|
-
translate(n) {
|
|
1225
|
-
return n;
|
|
1226
|
-
},
|
|
1227
|
-
subscribe(n) {
|
|
1228
|
-
return r.add(n), () => {
|
|
1229
|
-
r.delete(n);
|
|
1230
|
-
};
|
|
1231
|
-
},
|
|
1232
|
-
setLang(n) {
|
|
1233
|
-
e = n, r.forEach((o) => o(e));
|
|
1234
|
-
}
|
|
1235
|
-
};
|
|
1236
|
-
}, M = (e) => (r) => ({
|
|
1242
|
+
const M = (e) => (r) => ({
|
|
1237
1243
|
...r,
|
|
1238
|
-
calculatedWidgets:
|
|
1244
|
+
calculatedWidgets: Rn(r, e)
|
|
1239
1245
|
});
|
|
1240
|
-
function
|
|
1241
|
-
const { $formIsInvalid: t, $errors: n } = Xe(e), o =
|
|
1246
|
+
function Rn(e, r) {
|
|
1247
|
+
const { $formIsInvalid: t, $errors: n } = Xe(e), o = qn(e, r, t, n), i = {};
|
|
1242
1248
|
for (const s of Object.keys(e.calculatedWidgets)) {
|
|
1243
1249
|
if (e.widgetFlags[s]?.hidden)
|
|
1244
1250
|
continue;
|
|
1245
1251
|
const u = e.calculatedWidgets[s], c = u.source;
|
|
1246
1252
|
if (se(c)) {
|
|
1247
|
-
i[s] =
|
|
1253
|
+
i[s] = kn(s, c, e, r);
|
|
1248
1254
|
continue;
|
|
1249
1255
|
}
|
|
1250
|
-
i[s] =
|
|
1256
|
+
i[s] = _n(
|
|
1251
1257
|
u,
|
|
1252
1258
|
c,
|
|
1253
1259
|
e,
|
|
@@ -1256,7 +1262,7 @@ function Wn(e, r) {
|
|
|
1256
1262
|
}
|
|
1257
1263
|
return i;
|
|
1258
1264
|
}
|
|
1259
|
-
function
|
|
1265
|
+
function kn(e, r, t, n) {
|
|
1260
1266
|
const o = r({
|
|
1261
1267
|
$form: t.data,
|
|
1262
1268
|
errors: r.path ? t.validations[r.path] : void 0,
|
|
@@ -1265,85 +1271,85 @@ function Tn(e, r, t, n) {
|
|
|
1265
1271
|
});
|
|
1266
1272
|
return o.uid = e, { source: r, current: o };
|
|
1267
1273
|
}
|
|
1268
|
-
function
|
|
1269
|
-
const o = new
|
|
1270
|
-
return o.write("uid", r.uid), o.write("type", r.type), o.write("kind", r.kind),
|
|
1274
|
+
function _n(e, r, t, n) {
|
|
1275
|
+
const o = new Qn(r, e.current);
|
|
1276
|
+
return o.write("uid", r.uid), o.write("type", r.type), o.write("kind", r.kind), ut(r) ? Nn(o, n) : re(r) ? Ln(o, n) : P(r) ? Mn(o, n) : ke(r) && jn(o, n), Vn(r, o, n, t), (re(r) || P(r)) && Un(r, o, n), ke(r) && Bn(r, o, t), o.changed ? { source: e.source, current: o.current } : e;
|
|
1271
1277
|
}
|
|
1272
|
-
function
|
|
1278
|
+
function Nn(e, r) {
|
|
1273
1279
|
S(e, r, "size"), S(e, r, "include"), S(e, r, "exclude");
|
|
1274
1280
|
}
|
|
1275
|
-
function
|
|
1281
|
+
function Ln(e, r) {
|
|
1276
1282
|
S(e, r, "size"), S(e, r, "include"), S(e, r, "exclude"), S(e, r, "label"), S(e, r, "disabled");
|
|
1277
1283
|
}
|
|
1278
|
-
function
|
|
1284
|
+
function Mn(e, r) {
|
|
1279
1285
|
S(e, r, "size"), S(e, r, "include"), S(e, r, "exclude"), S(e, r, "label"), S(e, r, "disabled"), S(e, r, "readonly"), S(e, r, "validator"), S(e, r, "path"), S(e, r, "defaultValue");
|
|
1280
1286
|
}
|
|
1281
|
-
function
|
|
1287
|
+
function jn(e, r) {
|
|
1282
1288
|
S(e, r, "size"), S(e, r, "include"), S(e, r, "exclude");
|
|
1283
1289
|
}
|
|
1284
|
-
function
|
|
1290
|
+
function Vn(e, r, t, n) {
|
|
1285
1291
|
const o = n.widgetPropOverrides[e.uid] ?? {}, i = { ...e.props ?? {}, ...o };
|
|
1286
|
-
for (const s of
|
|
1287
|
-
|
|
1292
|
+
for (const s of Kr(Object.keys(i)))
|
|
1293
|
+
Hn(r, t, s);
|
|
1288
1294
|
}
|
|
1289
|
-
function
|
|
1295
|
+
function Un(e, r, t) {
|
|
1290
1296
|
const n = e.on ?? {};
|
|
1291
|
-
for (const o of
|
|
1292
|
-
|
|
1297
|
+
for (const o of Kr(Object.keys(n)))
|
|
1298
|
+
Gn(r, t, o);
|
|
1293
1299
|
}
|
|
1294
|
-
function
|
|
1295
|
-
const n =
|
|
1300
|
+
function Bn(e, r, t) {
|
|
1301
|
+
const n = xn(e.uid), o = Zn(e.children, n, t.widgetFlags);
|
|
1296
1302
|
r.current.children = o;
|
|
1297
1303
|
const i = r.previous.children ?? [];
|
|
1298
1304
|
i.length === o.length && o.every((u, c) => i[c] && i[c].uid === o[c].uid) || r.markChanged();
|
|
1299
1305
|
}
|
|
1300
1306
|
function S(e, r, t) {
|
|
1301
1307
|
const n = e.source;
|
|
1302
|
-
if (!
|
|
1308
|
+
if (!Yn(n, t))
|
|
1303
1309
|
return;
|
|
1304
1310
|
const o = ir(n, t, r.sortedStates);
|
|
1305
1311
|
let i;
|
|
1306
1312
|
switch (t) {
|
|
1307
1313
|
case "disabled":
|
|
1308
1314
|
case "readonly":
|
|
1309
|
-
i =
|
|
1315
|
+
i = Xn(o, r, e.source.uid, t);
|
|
1310
1316
|
break;
|
|
1311
1317
|
default:
|
|
1312
|
-
i =
|
|
1318
|
+
i = Gr(o, r);
|
|
1313
1319
|
}
|
|
1314
1320
|
e.write(t, i);
|
|
1315
1321
|
}
|
|
1316
|
-
function
|
|
1322
|
+
function Hn(e, r, t) {
|
|
1317
1323
|
const n = e.source.props, o = ir(n, t, r.sortedStates);
|
|
1318
|
-
let i =
|
|
1324
|
+
let i = Gr(o, r);
|
|
1319
1325
|
const s = r.widgetPropOverrides[e.source.uid]?.[t];
|
|
1320
1326
|
s !== void 0 && (i = s), e.write(`props.${t}`, i);
|
|
1321
1327
|
}
|
|
1322
|
-
function
|
|
1328
|
+
function Gn(e, r, t) {
|
|
1323
1329
|
const n = e.source.on, o = ir(n, t, r.sortedStates);
|
|
1324
|
-
e.write(`on.${t}`,
|
|
1330
|
+
e.write(`on.${t}`, zn(o, r));
|
|
1325
1331
|
}
|
|
1326
1332
|
function or(e, r) {
|
|
1327
1333
|
return e({ $form: r.$form, translate: r.localization.translate });
|
|
1328
1334
|
}
|
|
1329
|
-
function
|
|
1330
|
-
return r.localization.translate(e.key,
|
|
1335
|
+
function Kn(e, r) {
|
|
1336
|
+
return r.localization.translate(e.key, Jn(e.params, r), e.default);
|
|
1331
1337
|
}
|
|
1332
|
-
function
|
|
1333
|
-
return
|
|
1338
|
+
function Hr(e, r) {
|
|
1339
|
+
return Ct(e, {
|
|
1334
1340
|
resolveFormPath: (t) => N(r.$form, t) ?? e,
|
|
1335
1341
|
resolveMetaPath: (t) => N(r.$meta, t) ?? e,
|
|
1336
1342
|
resolveErrorsPath: (t) => N(r.$errors, t) ?? e,
|
|
1337
1343
|
resolveFormIsInvalid: () => String(r.$formIsInvalid)
|
|
1338
1344
|
});
|
|
1339
1345
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return typeof e == "function" ? or(e, r) :
|
|
1346
|
+
function Gr(e, r) {
|
|
1347
|
+
return typeof e == "function" ? or(e, r) : st(e) ? Kn(e, r) : typeof e == "string" ? Hr(e, r) : e;
|
|
1342
1348
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return typeof e == "function" ? or(e, r) : z(e) ? r.widgetFlags[t]?.[n] : typeof e == "string" ?
|
|
1349
|
+
function Xn(e, r, t, n) {
|
|
1350
|
+
return typeof e == "function" ? or(e, r) : z(e) ? r.widgetFlags[t]?.[n] : typeof e == "string" ? Hr(e, r) : e;
|
|
1345
1351
|
}
|
|
1346
|
-
function
|
|
1352
|
+
function zn(e, r) {
|
|
1347
1353
|
return typeof e == "function" ? or(e, r) : e;
|
|
1348
1354
|
}
|
|
1349
1355
|
function ir(e, r, t) {
|
|
@@ -1356,10 +1362,10 @@ function ir(e, r, t) {
|
|
|
1356
1362
|
return e[r];
|
|
1357
1363
|
}
|
|
1358
1364
|
}
|
|
1359
|
-
function
|
|
1365
|
+
function Jn(e, r) {
|
|
1360
1366
|
return e && Object.keys(e).reduce((t, n) => {
|
|
1361
1367
|
const o = String(e[n]);
|
|
1362
|
-
return
|
|
1368
|
+
return It(o) ? t[n] = Ft(o, {
|
|
1363
1369
|
resolveFormPath: (i) => N(r.$form, i) ?? o,
|
|
1364
1370
|
resolveMetaPath: (i) => N(r.$meta, i) ?? o,
|
|
1365
1371
|
resolveErrorsPath: (i) => N(r.$errors, i) ?? o,
|
|
@@ -1367,7 +1373,7 @@ function Xn(e, r) {
|
|
|
1367
1373
|
}) : t[n] = o, t;
|
|
1368
1374
|
}, {});
|
|
1369
1375
|
}
|
|
1370
|
-
class
|
|
1376
|
+
class Qn {
|
|
1371
1377
|
constructor(r, t) {
|
|
1372
1378
|
this._changed = !1, this.source = r, this.previous = t, this.current = {};
|
|
1373
1379
|
}
|
|
@@ -1381,7 +1387,7 @@ class zn {
|
|
|
1381
1387
|
Ge(this.current, r, t), N(this.previous, r) !== t && (this._changed = !0);
|
|
1382
1388
|
}
|
|
1383
1389
|
}
|
|
1384
|
-
function
|
|
1390
|
+
function qn(e, r, t, n) {
|
|
1385
1391
|
return {
|
|
1386
1392
|
sortedStates: [...e.currentStates].sort((o, i) => i.length - o.length),
|
|
1387
1393
|
widgetPropOverrides: e.widgetPropOverrides,
|
|
@@ -1393,25 +1399,25 @@ function Jn(e, r, t, n) {
|
|
|
1393
1399
|
localization: r
|
|
1394
1400
|
};
|
|
1395
1401
|
}
|
|
1396
|
-
function
|
|
1402
|
+
function Yn(e, r) {
|
|
1397
1403
|
if (r in e)
|
|
1398
1404
|
return !0;
|
|
1399
1405
|
const t = `${r}.`;
|
|
1400
1406
|
return Object.keys(e).some((n) => n.startsWith(t));
|
|
1401
1407
|
}
|
|
1402
|
-
function
|
|
1408
|
+
function Kr(e) {
|
|
1403
1409
|
return Array.from(new Set(e.map((r) => r.split(".")[0])));
|
|
1404
1410
|
}
|
|
1405
|
-
function
|
|
1411
|
+
function Zn(e, r, t) {
|
|
1406
1412
|
const n = r.map((o) => `[${o}]`).join("");
|
|
1407
1413
|
return e.filter((o) => {
|
|
1408
1414
|
const i = o.uid + n, s = t[i];
|
|
1409
1415
|
return !s || s.hidden !== !0;
|
|
1410
1416
|
});
|
|
1411
1417
|
}
|
|
1412
|
-
const
|
|
1418
|
+
const xn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)), bn = ({ lang: e }, r) => {
|
|
1413
1419
|
const t = {
|
|
1414
|
-
...
|
|
1420
|
+
...gr(e),
|
|
1415
1421
|
formName: r.payload.formName
|
|
1416
1422
|
};
|
|
1417
1423
|
let n = r.payload.formDef, o = { status: "ok" };
|
|
@@ -1419,7 +1425,7 @@ const Yn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)),
|
|
|
1419
1425
|
try {
|
|
1420
1426
|
n = JSON.parse(n);
|
|
1421
1427
|
} catch (u) {
|
|
1422
|
-
const c = u, h =
|
|
1428
|
+
const c = u, h = fe.initializeParseError;
|
|
1423
1429
|
o = {
|
|
1424
1430
|
status: "errored",
|
|
1425
1431
|
message: `[${h}] ${c.message}`,
|
|
@@ -1438,24 +1444,25 @@ const Yn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)),
|
|
|
1438
1444
|
children: c
|
|
1439
1445
|
};
|
|
1440
1446
|
}
|
|
1441
|
-
const i =
|
|
1447
|
+
const i = pr.decode(n);
|
|
1442
1448
|
if (i.isOk()) {
|
|
1443
1449
|
o = { status: "ok" };
|
|
1444
1450
|
let u = {};
|
|
1445
1451
|
try {
|
|
1446
1452
|
u = Ke([i.value.form]).reduce(
|
|
1447
1453
|
(c, h) => {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1454
|
+
const $ = h.uid;
|
|
1455
|
+
if (c[$])
|
|
1456
|
+
throw { existingWidget: c[$], newWidget: h };
|
|
1457
|
+
return c[$] = h, c;
|
|
1451
1458
|
},
|
|
1452
1459
|
{}
|
|
1453
1460
|
);
|
|
1454
1461
|
} catch (c) {
|
|
1455
|
-
const h =
|
|
1462
|
+
const h = fe.initializeUidCollisionError;
|
|
1456
1463
|
o = {
|
|
1457
1464
|
status: "errored",
|
|
1458
|
-
message: `[${h}] ${
|
|
1465
|
+
message: `[${h}] ${eo(c.existingWidget, c.newWidget)}`,
|
|
1459
1466
|
code: h
|
|
1460
1467
|
}, u = {};
|
|
1461
1468
|
}
|
|
@@ -1466,7 +1473,7 @@ const Yn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)),
|
|
|
1466
1473
|
formHealth: o
|
|
1467
1474
|
};
|
|
1468
1475
|
}
|
|
1469
|
-
const s =
|
|
1476
|
+
const s = fe.initializeUnknownError;
|
|
1470
1477
|
return {
|
|
1471
1478
|
...t,
|
|
1472
1479
|
formHealth: {
|
|
@@ -1476,11 +1483,11 @@ const Yn = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((r) => parseInt(r[1], 10)),
|
|
|
1476
1483
|
}
|
|
1477
1484
|
};
|
|
1478
1485
|
};
|
|
1479
|
-
function
|
|
1486
|
+
function eo(e, r) {
|
|
1480
1487
|
const t = (n) => P(n) ? ` at "${n.path}"` : "";
|
|
1481
1488
|
return `Duplicate UID "${r.uid}": Assigned to widget "${e.type}"${t(e)} and "${r.type}"${t(r)}.`;
|
|
1482
1489
|
}
|
|
1483
|
-
function
|
|
1490
|
+
function ro(e, r) {
|
|
1484
1491
|
return {
|
|
1485
1492
|
...e,
|
|
1486
1493
|
injectedValidations: {
|
|
@@ -1489,25 +1496,25 @@ function bn(e, r) {
|
|
|
1489
1496
|
}
|
|
1490
1497
|
};
|
|
1491
1498
|
}
|
|
1492
|
-
const
|
|
1499
|
+
const to = (e, { payload: r }) => {
|
|
1493
1500
|
let t;
|
|
1494
1501
|
if ("path" in r) {
|
|
1495
1502
|
if (t = Object.values(e.calculatedWidgets).find(
|
|
1496
|
-
({ source:
|
|
1503
|
+
({ source: i }) => P(i) && i.path === r.path
|
|
1497
1504
|
), !t)
|
|
1498
1505
|
return console.warn(`Input with path "${r.path}" not found`), e;
|
|
1499
1506
|
} else if (t = e.calculatedWidgets[r.uid], !t)
|
|
1500
1507
|
return console.warn(`Widget with uid "${r.uid}" not found`), e;
|
|
1501
|
-
const n =
|
|
1508
|
+
const n = t.source.uid, o = e.widgetPropOverrides[n] || {};
|
|
1502
1509
|
return {
|
|
1503
1510
|
...e,
|
|
1504
1511
|
widgetPropOverrides: {
|
|
1505
1512
|
...e.widgetPropOverrides,
|
|
1506
|
-
[
|
|
1513
|
+
[n]: { ...o, [r.prop]: r.value }
|
|
1507
1514
|
}
|
|
1508
1515
|
};
|
|
1509
1516
|
};
|
|
1510
|
-
function
|
|
1517
|
+
function no(e, r) {
|
|
1511
1518
|
return {
|
|
1512
1519
|
...e,
|
|
1513
1520
|
widgetFlags: {
|
|
@@ -1529,36 +1536,26 @@ function ro(e, r) {
|
|
|
1529
1536
|
// TODO: clear widget from injectedValidations
|
|
1530
1537
|
};
|
|
1531
1538
|
}
|
|
1532
|
-
const
|
|
1539
|
+
const oo = (e, r) => ({
|
|
1533
1540
|
...e,
|
|
1534
1541
|
data: { ...r.payload.data }
|
|
1535
|
-
}),
|
|
1542
|
+
}), io = (e, r) => ({
|
|
1536
1543
|
...e,
|
|
1537
1544
|
formHealth: r.payload.formHealth
|
|
1538
|
-
}),
|
|
1545
|
+
}), so = (e, r) => ({
|
|
1539
1546
|
...e,
|
|
1540
1547
|
lang: r.payload.lang
|
|
1541
|
-
}),
|
|
1548
|
+
}), uo = (e, r) => ({
|
|
1542
1549
|
...e,
|
|
1543
1550
|
meta: { ...r.payload.meta }
|
|
1544
|
-
}),
|
|
1551
|
+
}), co = (e, r) => {
|
|
1545
1552
|
const t = N(e.data, r.payload.path);
|
|
1546
1553
|
return r.type === "SET_WIDGET_DATA" || r.type === "SET_WIDGET_INITIAL_DATA" && t === void 0 ? {
|
|
1547
1554
|
...e,
|
|
1548
1555
|
data: { ...Ge(e.data, r.payload.path, r.payload.data) }
|
|
1549
1556
|
} : e;
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
const t = e["~standard"].validate(r);
|
|
1553
|
-
if (t instanceof Promise)
|
|
1554
|
-
throw new TypeError("Schema validation must be synchronous");
|
|
1555
|
-
return t;
|
|
1556
|
-
}
|
|
1557
|
-
function co(e) {
|
|
1558
|
-
return e.issues === void 0;
|
|
1559
|
-
}
|
|
1560
|
-
const We = (e, r) => (t) => {
|
|
1561
|
-
const n = jr(
|
|
1557
|
+
}, We = (e, r) => (t) => {
|
|
1558
|
+
const n = Vr(
|
|
1562
1559
|
Object.values(t.calculatedWidgets),
|
|
1563
1560
|
({ current: i }) => P(i) ? i : nr
|
|
1564
1561
|
), o = t.validations;
|
|
@@ -1567,13 +1564,13 @@ const We = (e, r) => (t) => {
|
|
|
1567
1564
|
validations: n.reduce(
|
|
1568
1565
|
(i, s) => {
|
|
1569
1566
|
if (i[s.path] = null, s.validator) {
|
|
1570
|
-
const u = e(s.validator, r), c = N(t.data, s.path), h =
|
|
1567
|
+
const u = e(s.validator, r), c = N(t.data, s.path), h = $t(
|
|
1571
1568
|
u,
|
|
1572
1569
|
c
|
|
1573
1570
|
);
|
|
1574
|
-
i[s.path] =
|
|
1571
|
+
i[s.path] = At(h) ? null : h.issues.map(($) => $.message);
|
|
1575
1572
|
}
|
|
1576
|
-
return Array.isArray(i[s.path]) && Array.isArray(o[s.path]) &&
|
|
1573
|
+
return Array.isArray(i[s.path]) && Array.isArray(o[s.path]) && Fn(
|
|
1577
1574
|
i[s.path],
|
|
1578
1575
|
o[s.path],
|
|
1579
1576
|
(u, c) => u === c
|
|
@@ -1589,36 +1586,33 @@ const We = (e, r) => (t) => {
|
|
|
1589
1586
|
}) => (n, o) => {
|
|
1590
1587
|
switch (o.type) {
|
|
1591
1588
|
case "INITIALIZE":
|
|
1592
|
-
return
|
|
1589
|
+
return bn(n, o);
|
|
1593
1590
|
case "SET_DATA":
|
|
1594
1591
|
return L(
|
|
1595
|
-
|
|
1592
|
+
oo(n, o),
|
|
1596
1593
|
V,
|
|
1597
1594
|
U,
|
|
1598
1595
|
M(t)
|
|
1599
1596
|
);
|
|
1600
1597
|
case "SET_META":
|
|
1601
1598
|
return L(
|
|
1602
|
-
|
|
1599
|
+
uo(n, o),
|
|
1603
1600
|
V,
|
|
1604
1601
|
U,
|
|
1605
1602
|
M(t)
|
|
1606
1603
|
);
|
|
1607
1604
|
case "SET_LANGUAGE":
|
|
1608
|
-
return L(
|
|
1609
|
-
oo(n, o),
|
|
1610
|
-
M(t)
|
|
1611
|
-
);
|
|
1605
|
+
return L(so(n, o), M(t));
|
|
1612
1606
|
case "ADD_WIDGET":
|
|
1613
1607
|
return L(
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1608
|
+
St(n, o),
|
|
1609
|
+
ae(Te, V),
|
|
1610
|
+
ae(Te, U),
|
|
1611
|
+
ae(Te, M(t))
|
|
1618
1612
|
);
|
|
1619
1613
|
case "REMOVE_WIDGET":
|
|
1620
1614
|
return L(
|
|
1621
|
-
|
|
1615
|
+
no(n, o),
|
|
1622
1616
|
V,
|
|
1623
1617
|
U,
|
|
1624
1618
|
M(t)
|
|
@@ -1626,20 +1620,20 @@ const We = (e, r) => (t) => {
|
|
|
1626
1620
|
case "SET_WIDGET_INITIAL_DATA":
|
|
1627
1621
|
case "SET_WIDGET_DATA":
|
|
1628
1622
|
return L(
|
|
1629
|
-
|
|
1623
|
+
co(n, o),
|
|
1630
1624
|
V,
|
|
1631
1625
|
U,
|
|
1632
1626
|
M(t)
|
|
1633
1627
|
);
|
|
1634
1628
|
case "OVERRIDE_WIDGET_PROP":
|
|
1635
1629
|
return L(
|
|
1636
|
-
|
|
1630
|
+
to(n, o),
|
|
1637
1631
|
V,
|
|
1638
1632
|
U,
|
|
1639
1633
|
M(t),
|
|
1640
1634
|
// Apply validation here because this action can be dispatched from the form's event handlers callback
|
|
1641
1635
|
// Apply only when the action is related to an input
|
|
1642
|
-
|
|
1636
|
+
ae(
|
|
1643
1637
|
(i) => {
|
|
1644
1638
|
let s = !1, u = "";
|
|
1645
1639
|
"path" in o.payload ? (s = !0, u = o.payload.path) : P(i.calculatedWidgets[o.payload.uid].current) && (s = !0, u = i.calculatedWidgets[o.payload.uid].current.path);
|
|
@@ -1650,7 +1644,7 @@ const We = (e, r) => (t) => {
|
|
|
1650
1644
|
)
|
|
1651
1645
|
);
|
|
1652
1646
|
case "SET_FORM_HEALTH":
|
|
1653
|
-
return
|
|
1647
|
+
return io(n, o);
|
|
1654
1648
|
case "VALIDATE_ALL":
|
|
1655
1649
|
return L(
|
|
1656
1650
|
{
|
|
@@ -1686,9 +1680,9 @@ const We = (e, r) => (t) => {
|
|
|
1686
1680
|
// TODO: extract this into a separate function
|
|
1687
1681
|
// When the widget is a Widget Function, we propagate the validation result immediately
|
|
1688
1682
|
(c) => {
|
|
1689
|
-
const h = o.payload.uid,
|
|
1683
|
+
const h = o.payload.uid, $ = c.calculatedWidgets[h], g = $.source;
|
|
1690
1684
|
if (se(g)) {
|
|
1691
|
-
const
|
|
1685
|
+
const a = g({
|
|
1692
1686
|
$form: c.data,
|
|
1693
1687
|
errors: c.validations[s],
|
|
1694
1688
|
touched: !0,
|
|
@@ -1699,8 +1693,8 @@ const We = (e, r) => (t) => {
|
|
|
1699
1693
|
calculatedWidgets: {
|
|
1700
1694
|
...c.calculatedWidgets,
|
|
1701
1695
|
[h]: {
|
|
1702
|
-
source:
|
|
1703
|
-
current:
|
|
1696
|
+
source: $.source,
|
|
1697
|
+
current: a
|
|
1704
1698
|
}
|
|
1705
1699
|
}
|
|
1706
1700
|
};
|
|
@@ -1710,15 +1704,15 @@ const We = (e, r) => (t) => {
|
|
|
1710
1704
|
) : n;
|
|
1711
1705
|
}
|
|
1712
1706
|
case "INJECT_VALIDATION_ISSUES":
|
|
1713
|
-
return
|
|
1707
|
+
return ro(n, o);
|
|
1714
1708
|
default:
|
|
1715
|
-
return
|
|
1709
|
+
return Et(o);
|
|
1716
1710
|
}
|
|
1717
1711
|
}, Te = (e) => e.formHealth.status === "ok";
|
|
1718
|
-
function
|
|
1719
|
-
const o = new
|
|
1712
|
+
function ao(e = [], r, t, n) {
|
|
1713
|
+
const o = new Jr(gr(n.lang)), i = o.asObservable().pipe(D()), s = lo({ validators: r, validateOn: t, localization: n });
|
|
1720
1714
|
function u(g) {
|
|
1721
|
-
const
|
|
1715
|
+
const a = o.getValue(), C = s(a, g);
|
|
1722
1716
|
o.next(C);
|
|
1723
1717
|
}
|
|
1724
1718
|
let c = u;
|
|
@@ -1727,18 +1721,18 @@ function fo(e = [], r, t, n) {
|
|
|
1727
1721
|
dispatch: (g) => c(g)
|
|
1728
1722
|
// reference is updated later
|
|
1729
1723
|
};
|
|
1730
|
-
return c = e.map((g) => g(h)).reduceRight((g,
|
|
1724
|
+
return c = e.map((g) => g(h)).reduceRight((g, a) => a(g), u), {
|
|
1731
1725
|
state$: i,
|
|
1732
1726
|
dispatch: c,
|
|
1733
1727
|
getState: () => o.getValue()
|
|
1734
1728
|
};
|
|
1735
1729
|
}
|
|
1736
|
-
class
|
|
1730
|
+
class Co {
|
|
1737
1731
|
constructor() {
|
|
1738
|
-
this.widgetRegistry = new
|
|
1732
|
+
this.widgetRegistry = new Ne(), this.store = {}, this.events$ = new Qr(), this.uuid = crypto.randomUUID(), this.itemRenderers = {}, this.dependencies = {};
|
|
1739
1733
|
}
|
|
1740
|
-
initialize(r, t = [], n, o, i, s =
|
|
1741
|
-
this.localization = s, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(r), this.itemRenderers = i, this.store =
|
|
1734
|
+
initialize(r, t = [], n, o, i, s = dt(), u) {
|
|
1735
|
+
this.localization = s, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(r), this.itemRenderers = i, this.store = ao(t, n, o, s);
|
|
1742
1736
|
}
|
|
1743
1737
|
emitEvent(r, t, n) {
|
|
1744
1738
|
const i = this.store.getState().currentStates.filter((s) => t.on?.[`${r}.${s}`] !== void 0);
|
|
@@ -1779,7 +1773,7 @@ class wo {
|
|
|
1779
1773
|
}));
|
|
1780
1774
|
}
|
|
1781
1775
|
}
|
|
1782
|
-
function
|
|
1776
|
+
function Fo(e = "GolemUI Form Store") {
|
|
1783
1777
|
return (r) => {
|
|
1784
1778
|
const n = (typeof window < "u" ? window.__REDUX_DEVTOOLS_EXTENSION__ : void 0)?.connect({ name: e });
|
|
1785
1779
|
return n?.init(r.getState()), (o) => (i) => {
|
|
@@ -1787,76 +1781,76 @@ function Co(e = "GolemUI Form Store") {
|
|
|
1787
1781
|
};
|
|
1788
1782
|
};
|
|
1789
1783
|
}
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1784
|
+
const fo = T(
|
|
1785
|
+
O((e) => e.data),
|
|
1792
1786
|
D()
|
|
1793
|
-
),
|
|
1794
|
-
|
|
1795
|
-
|
|
1787
|
+
), Do = (e) => T(
|
|
1788
|
+
fo,
|
|
1789
|
+
O((r) => N(r, e)),
|
|
1796
1790
|
D()
|
|
1797
1791
|
), ho = T(
|
|
1798
1792
|
Ee((e) => e.touched === !0),
|
|
1799
|
-
|
|
1793
|
+
O((e) => e.validations),
|
|
1800
1794
|
D()
|
|
1801
|
-
),
|
|
1795
|
+
), Po = (e) => T(
|
|
1802
1796
|
ho,
|
|
1803
|
-
|
|
1797
|
+
O((r) => r[e]),
|
|
1804
1798
|
D()
|
|
1805
1799
|
), po = T(
|
|
1806
1800
|
Ee((e) => e.touched === !0),
|
|
1807
|
-
|
|
1801
|
+
O((e) => e.injectedValidations),
|
|
1808
1802
|
D()
|
|
1809
|
-
),
|
|
1803
|
+
), Wo = (e) => T(
|
|
1810
1804
|
po,
|
|
1811
|
-
|
|
1805
|
+
O((r) => r[e]),
|
|
1812
1806
|
D(),
|
|
1813
1807
|
// we want to make sure combineLatest([validation$, injectedValidation$]) triggers
|
|
1814
|
-
|
|
1808
|
+
qr(null)
|
|
1815
1809
|
), go = T(
|
|
1816
|
-
|
|
1810
|
+
O((e) => e.lang),
|
|
1817
1811
|
D()
|
|
1818
|
-
),
|
|
1819
|
-
|
|
1812
|
+
), Xr = T(
|
|
1813
|
+
O((e) => e.calculatedWidgets),
|
|
1820
1814
|
D()
|
|
1821
|
-
),
|
|
1822
|
-
|
|
1815
|
+
), To = (e) => (r) => Yr([r.pipe(go), r.pipe(Xr)]).pipe(
|
|
1816
|
+
O(([t, n]) => ({ lang: t, widget: n[e] })),
|
|
1823
1817
|
Ee((t) => t.widget !== void 0),
|
|
1824
1818
|
D((t, n) => t.lang === n.lang && t.widget === n.widget),
|
|
1825
|
-
|
|
1826
|
-
),
|
|
1827
|
-
|
|
1828
|
-
|
|
1819
|
+
O((t) => t.widget.current)
|
|
1820
|
+
), Ro = (e) => T(
|
|
1821
|
+
Xr,
|
|
1822
|
+
O((r) => r[e]),
|
|
1829
1823
|
Ee((r) => r !== void 0),
|
|
1830
|
-
|
|
1824
|
+
O((r) => r.current.children),
|
|
1831
1825
|
D()
|
|
1832
1826
|
), mo = T(
|
|
1833
|
-
|
|
1827
|
+
O((e) => e.widgetFlags),
|
|
1834
1828
|
D()
|
|
1835
|
-
),
|
|
1829
|
+
), ko = (e) => T(
|
|
1836
1830
|
mo,
|
|
1837
|
-
|
|
1831
|
+
O((r) => r[e]),
|
|
1838
1832
|
D()
|
|
1839
1833
|
), yo = T(
|
|
1840
|
-
|
|
1834
|
+
O((e) => e.touchedControls),
|
|
1841
1835
|
D()
|
|
1842
|
-
),
|
|
1836
|
+
), _o = (e) => T(
|
|
1843
1837
|
yo,
|
|
1844
|
-
|
|
1838
|
+
O((r) => r[e]),
|
|
1845
1839
|
D()
|
|
1846
1840
|
), $o = T(
|
|
1847
|
-
|
|
1841
|
+
O((e) => e.formHealth),
|
|
1848
1842
|
D(
|
|
1849
1843
|
(e, r) => !(e.status !== r.status || e.status === "errored")
|
|
1850
1844
|
)
|
|
1851
|
-
),
|
|
1852
|
-
let
|
|
1853
|
-
function
|
|
1854
|
-
|
|
1845
|
+
), No = (e) => e.pipe($o);
|
|
1846
|
+
let zr = !1;
|
|
1847
|
+
function Lo() {
|
|
1848
|
+
zr = !0;
|
|
1855
1849
|
}
|
|
1856
1850
|
function Ao() {
|
|
1857
|
-
return
|
|
1851
|
+
return zr;
|
|
1858
1852
|
}
|
|
1859
|
-
function
|
|
1853
|
+
function Mo(e, r, t) {
|
|
1860
1854
|
if (!Ao())
|
|
1861
1855
|
return;
|
|
1862
1856
|
const n = Object.keys(r ?? {}).filter((o) => o in t);
|
|
@@ -1866,51 +1860,51 @@ function Lo(e, r, t) {
|
|
|
1866
1860
|
);
|
|
1867
1861
|
}
|
|
1868
1862
|
export {
|
|
1869
|
-
|
|
1870
|
-
|
|
1863
|
+
In as Debug,
|
|
1864
|
+
Co as FormContext,
|
|
1871
1865
|
nr as SKIP,
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1866
|
+
Ne as WidgetRegistry,
|
|
1867
|
+
Mo as assertNoPropCollisions,
|
|
1868
|
+
Ro as calculatedLayoutChildrenByUid$,
|
|
1869
|
+
To as calculatedWidgetsByUid$,
|
|
1876
1870
|
sr as cloneObject,
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1871
|
+
wo as compose,
|
|
1872
|
+
ao as createFormStore,
|
|
1873
|
+
gr as createInitialState,
|
|
1874
|
+
Do as dataByPath$,
|
|
1875
|
+
vo as defineForm,
|
|
1882
1876
|
ce as deleteKey,
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1877
|
+
Fo as devToolsMiddleware,
|
|
1878
|
+
Lo as enableDevMode,
|
|
1879
|
+
fe as errorCodes,
|
|
1880
|
+
Vr as filterMap,
|
|
1881
|
+
Cn as filterReduce,
|
|
1882
|
+
Oo as filterTap,
|
|
1883
|
+
pr as formDefDecoder,
|
|
1884
|
+
No as formHealth,
|
|
1891
1885
|
N as get,
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1886
|
+
Io as getDirectionFromLanguage,
|
|
1887
|
+
dt as identityTranslator,
|
|
1888
|
+
Wo as injectedValidationByPath$,
|
|
1895
1889
|
re as isActionWidget,
|
|
1896
1890
|
Ao as isDevMode,
|
|
1897
|
-
|
|
1891
|
+
ut as isDisplayWidget,
|
|
1898
1892
|
se as isFunctionWidget,
|
|
1899
1893
|
P as isInputWidget,
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1894
|
+
ke as isLayoutWidget,
|
|
1895
|
+
At as isStandardValidateSuccess,
|
|
1896
|
+
st as isTranslationConfig,
|
|
1903
1897
|
He as layoutWidgetDecoder,
|
|
1904
|
-
|
|
1898
|
+
Dn as makeRepeaterItemConfig,
|
|
1905
1899
|
L as pipe,
|
|
1906
1900
|
mo as selectWidgetFlags,
|
|
1907
1901
|
Ge as set,
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1902
|
+
mr as shortUUID,
|
|
1903
|
+
$t as standardValidate,
|
|
1904
|
+
Ur as toRepeaterItemUid,
|
|
1905
|
+
_o as touchedControlsByPath$,
|
|
1912
1906
|
le as transformRepeaterItemWhenExpression,
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1907
|
+
Po as validationByPath$,
|
|
1908
|
+
ko as widgetFlagsByUid$,
|
|
1909
|
+
Fn as zipEvery
|
|
1916
1910
|
};
|