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