@archduck/gst-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +344 -0
- package/dist/chunks/core-Wpl1tnO4.js +35 -0
- package/dist/chunks/core-Wpl1tnO4.js.map +1 -0
- package/dist/chunks/core-ovxYfJ25.js +2362 -0
- package/dist/chunks/core-ovxYfJ25.js.map +1 -0
- package/dist/chunks/loaders-B7J79C97.js +606 -0
- package/dist/chunks/loaders-B7J79C97.js.map +1 -0
- package/dist/chunks/loaders-BEwXPBCN.js +2 -0
- package/dist/chunks/loaders-BEwXPBCN.js.map +1 -0
- package/dist/chunks/mergeConfigs-CRhPUSCj.js +191 -0
- package/dist/chunks/mergeConfigs-CRhPUSCj.js.map +1 -0
- package/dist/chunks/mergeConfigs-Dgwcseh2.js +2 -0
- package/dist/chunks/mergeConfigs-Dgwcseh2.js.map +1 -0
- package/dist/core.cjs +2 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.js +41 -0
- package/dist/core.js.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +147 -0
- package/dist/index.js.map +1 -0
- package/dist/loaders.cjs +2 -0
- package/dist/loaders.cjs.map +1 -0
- package/dist/loaders.js +19 -0
- package/dist/loaders.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,2362 @@
|
|
|
1
|
+
import { l as O, b as C, t as j, e as Qt, k as Zt, a as Ae } from "./mergeConfigs-CRhPUSCj.js";
|
|
2
|
+
/**
|
|
3
|
+
* @vue/shared v3.5.32
|
|
4
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
+
* @license MIT
|
|
6
|
+
**/
|
|
7
|
+
// @__NO_SIDE_EFFECTS__
|
|
8
|
+
function Oe(t) {
|
|
9
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
10
|
+
for (const e of t.split(",")) n[e] = 1;
|
|
11
|
+
return (e) => e in n;
|
|
12
|
+
}
|
|
13
|
+
process.env.NODE_ENV !== "production" && Object.freeze({});
|
|
14
|
+
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
15
|
+
const ct = Object.assign, Ce = Object.prototype.hasOwnProperty, Rt = (t, n) => Ce.call(t, n), lt = Array.isArray, it = (t) => le(t) === "[object Map]", je = (t) => typeof t == "function", Re = (t) => typeof t == "string", vt = (t) => typeof t == "symbol", ut = (t) => t !== null && typeof t == "object", xe = Object.prototype.toString, le = (t) => xe.call(t), ue = (t) => le(t).slice(8, -1), Mt = (t) => Re(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t, Te = (t) => {
|
|
16
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
17
|
+
return ((e) => n[e] || (n[e] = t(e)));
|
|
18
|
+
}, Ne = Te((t) => t.charAt(0).toUpperCase() + t.slice(1)), W = (t, n) => !Object.is(t, n);
|
|
19
|
+
/**
|
|
20
|
+
* @vue/reactivity v3.5.32
|
|
21
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
22
|
+
* @license MIT
|
|
23
|
+
**/
|
|
24
|
+
function H(t, ...n) {
|
|
25
|
+
console.warn(`[Vue warn] ${t}`, ...n);
|
|
26
|
+
}
|
|
27
|
+
let S;
|
|
28
|
+
const Ot = /* @__PURE__ */ new WeakSet();
|
|
29
|
+
class Xt {
|
|
30
|
+
constructor(n) {
|
|
31
|
+
this.fn = n, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0;
|
|
32
|
+
}
|
|
33
|
+
pause() {
|
|
34
|
+
this.flags |= 64;
|
|
35
|
+
}
|
|
36
|
+
resume() {
|
|
37
|
+
this.flags & 64 && (this.flags &= -65, Ot.has(this) && (Ot.delete(this), this.trigger()));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
notify() {
|
|
43
|
+
this.flags & 2 && !(this.flags & 32) || this.flags & 8 || de(this);
|
|
44
|
+
}
|
|
45
|
+
run() {
|
|
46
|
+
if (!(this.flags & 1))
|
|
47
|
+
return this.fn();
|
|
48
|
+
this.flags |= 2, Dt(this), pe(this);
|
|
49
|
+
const n = S, e = I;
|
|
50
|
+
S = this, I = !0;
|
|
51
|
+
try {
|
|
52
|
+
return this.fn();
|
|
53
|
+
} finally {
|
|
54
|
+
process.env.NODE_ENV !== "production" && S !== this && H(
|
|
55
|
+
"Active effect was not restored correctly - this is likely a Vue internal bug."
|
|
56
|
+
), he(this), S = n, I = e, this.flags &= -3;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
stop() {
|
|
60
|
+
if (this.flags & 1) {
|
|
61
|
+
for (let n = this.deps; n; n = n.nextDep)
|
|
62
|
+
Wt(n);
|
|
63
|
+
this.deps = this.depsTail = void 0, Dt(this), this.onStop && this.onStop(), this.flags &= -2;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
trigger() {
|
|
67
|
+
this.flags & 64 ? Ot.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
runIfDirty() {
|
|
73
|
+
xt(this) && this.run();
|
|
74
|
+
}
|
|
75
|
+
get dirty() {
|
|
76
|
+
return xt(this);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
let fe = 0, st, ot;
|
|
80
|
+
function de(t, n = !1) {
|
|
81
|
+
if (t.flags |= 8, n) {
|
|
82
|
+
t.next = ot, ot = t;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
t.next = st, st = t;
|
|
86
|
+
}
|
|
87
|
+
function Pt() {
|
|
88
|
+
fe++;
|
|
89
|
+
}
|
|
90
|
+
function Kt() {
|
|
91
|
+
if (--fe > 0)
|
|
92
|
+
return;
|
|
93
|
+
if (ot) {
|
|
94
|
+
let n = ot;
|
|
95
|
+
for (ot = void 0; n; ) {
|
|
96
|
+
const e = n.next;
|
|
97
|
+
n.next = void 0, n.flags &= -9, n = e;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
let t;
|
|
101
|
+
for (; st; ) {
|
|
102
|
+
let n = st;
|
|
103
|
+
for (st = void 0; n; ) {
|
|
104
|
+
const e = n.next;
|
|
105
|
+
if (n.next = void 0, n.flags &= -9, n.flags & 1)
|
|
106
|
+
try {
|
|
107
|
+
n.trigger();
|
|
108
|
+
} catch (r) {
|
|
109
|
+
t || (t = r);
|
|
110
|
+
}
|
|
111
|
+
n = e;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (t) throw t;
|
|
115
|
+
}
|
|
116
|
+
function pe(t) {
|
|
117
|
+
for (let n = t.deps; n; n = n.nextDep)
|
|
118
|
+
n.version = -1, n.prevActiveLink = n.dep.activeLink, n.dep.activeLink = n;
|
|
119
|
+
}
|
|
120
|
+
function he(t) {
|
|
121
|
+
let n, e = t.depsTail, r = e;
|
|
122
|
+
for (; r; ) {
|
|
123
|
+
const i = r.prevDep;
|
|
124
|
+
r.version === -1 ? (r === e && (e = i), Wt(r), Ie(r)) : n = r, r.dep.activeLink = r.prevActiveLink, r.prevActiveLink = void 0, r = i;
|
|
125
|
+
}
|
|
126
|
+
t.deps = n, t.depsTail = e;
|
|
127
|
+
}
|
|
128
|
+
function xt(t) {
|
|
129
|
+
for (let n = t.deps; n; n = n.nextDep)
|
|
130
|
+
if (n.dep.version !== n.version || n.dep.computed && (ye(n.dep.computed) || n.dep.version !== n.version))
|
|
131
|
+
return !0;
|
|
132
|
+
return !!t._dirty;
|
|
133
|
+
}
|
|
134
|
+
function ye(t) {
|
|
135
|
+
if (t.flags & 4 && !(t.flags & 16) || (t.flags &= -17, t.globalVersion === ft) || (t.globalVersion = ft, !t.isSSR && t.flags & 128 && (!t.deps && !t._dirty || !xt(t))))
|
|
136
|
+
return;
|
|
137
|
+
t.flags |= 2;
|
|
138
|
+
const n = t.dep, e = S, r = I;
|
|
139
|
+
S = t, I = !0;
|
|
140
|
+
try {
|
|
141
|
+
pe(t);
|
|
142
|
+
const i = t.fn(t._value);
|
|
143
|
+
(n.version === 0 || W(i, t._value)) && (t.flags |= 128, t._value = i, n.version++);
|
|
144
|
+
} catch (i) {
|
|
145
|
+
throw n.version++, i;
|
|
146
|
+
} finally {
|
|
147
|
+
S = e, I = r, he(t), t.flags &= -3;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function Wt(t, n = !1) {
|
|
151
|
+
const { dep: e, prevSub: r, nextSub: i } = t;
|
|
152
|
+
if (r && (r.nextSub = i, t.prevSub = void 0), i && (i.prevSub = r, t.nextSub = void 0), process.env.NODE_ENV !== "production" && e.subsHead === t && (e.subsHead = i), e.subs === t && (e.subs = r, !r && e.computed)) {
|
|
153
|
+
e.computed.flags &= -5;
|
|
154
|
+
for (let s = e.computed.deps; s; s = s.nextDep)
|
|
155
|
+
Wt(s, !0);
|
|
156
|
+
}
|
|
157
|
+
!n && !--e.sc && e.map && e.map.delete(e.key);
|
|
158
|
+
}
|
|
159
|
+
function Ie(t) {
|
|
160
|
+
const { prevDep: n, nextDep: e } = t;
|
|
161
|
+
n && (n.nextDep = e, t.prevDep = void 0), e && (e.prevDep = n, t.nextDep = void 0);
|
|
162
|
+
}
|
|
163
|
+
function J(t, n) {
|
|
164
|
+
t.effect instanceof Xt && (t = t.effect.fn);
|
|
165
|
+
const e = new Xt(t);
|
|
166
|
+
n && ct(e, n);
|
|
167
|
+
try {
|
|
168
|
+
e.run();
|
|
169
|
+
} catch (i) {
|
|
170
|
+
throw e.stop(), i;
|
|
171
|
+
}
|
|
172
|
+
const r = e.run.bind(e);
|
|
173
|
+
return r.effect = e, r;
|
|
174
|
+
}
|
|
175
|
+
function q(t) {
|
|
176
|
+
t.effect.stop();
|
|
177
|
+
}
|
|
178
|
+
let I = !0;
|
|
179
|
+
const Bt = [];
|
|
180
|
+
function Ve() {
|
|
181
|
+
Bt.push(I), I = !1;
|
|
182
|
+
}
|
|
183
|
+
function Cn() {
|
|
184
|
+
Bt.push(I), I = !0;
|
|
185
|
+
}
|
|
186
|
+
function ke() {
|
|
187
|
+
const t = Bt.pop();
|
|
188
|
+
I = t === void 0 ? !0 : t;
|
|
189
|
+
}
|
|
190
|
+
function Dt(t) {
|
|
191
|
+
const { cleanup: n } = t;
|
|
192
|
+
if (t.cleanup = void 0, n) {
|
|
193
|
+
const e = S;
|
|
194
|
+
S = void 0;
|
|
195
|
+
try {
|
|
196
|
+
n();
|
|
197
|
+
} finally {
|
|
198
|
+
S = e;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
let ft = 0;
|
|
203
|
+
class Le {
|
|
204
|
+
constructor(n, e) {
|
|
205
|
+
this.sub = n, this.dep = e, this.version = e.version, this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
class qt {
|
|
209
|
+
// TODO isolatedDeclarations "__v_skip"
|
|
210
|
+
constructor(n) {
|
|
211
|
+
this.computed = n, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, this.__v_skip = !0, process.env.NODE_ENV !== "production" && (this.subsHead = void 0);
|
|
212
|
+
}
|
|
213
|
+
track(n) {
|
|
214
|
+
if (!S || !I || S === this.computed)
|
|
215
|
+
return;
|
|
216
|
+
let e = this.activeLink;
|
|
217
|
+
if (e === void 0 || e.sub !== S)
|
|
218
|
+
e = this.activeLink = new Le(S, this), S.deps ? (e.prevDep = S.depsTail, S.depsTail.nextDep = e, S.depsTail = e) : S.deps = S.depsTail = e, ve(e);
|
|
219
|
+
else if (e.version === -1 && (e.version = this.version, e.nextDep)) {
|
|
220
|
+
const r = e.nextDep;
|
|
221
|
+
r.prevDep = e.prevDep, e.prevDep && (e.prevDep.nextDep = r), e.prevDep = S.depsTail, e.nextDep = void 0, S.depsTail.nextDep = e, S.depsTail = e, S.deps === e && (S.deps = r);
|
|
222
|
+
}
|
|
223
|
+
return process.env.NODE_ENV !== "production" && S.onTrack && S.onTrack(
|
|
224
|
+
ct(
|
|
225
|
+
{
|
|
226
|
+
effect: S
|
|
227
|
+
},
|
|
228
|
+
n
|
|
229
|
+
)
|
|
230
|
+
), e;
|
|
231
|
+
}
|
|
232
|
+
trigger(n) {
|
|
233
|
+
this.version++, ft++, this.notify(n);
|
|
234
|
+
}
|
|
235
|
+
notify(n) {
|
|
236
|
+
Pt();
|
|
237
|
+
try {
|
|
238
|
+
if (process.env.NODE_ENV !== "production")
|
|
239
|
+
for (let e = this.subsHead; e; e = e.nextSub)
|
|
240
|
+
e.sub.onTrigger && !(e.sub.flags & 8) && e.sub.onTrigger(
|
|
241
|
+
ct(
|
|
242
|
+
{
|
|
243
|
+
effect: e.sub
|
|
244
|
+
},
|
|
245
|
+
n
|
|
246
|
+
)
|
|
247
|
+
);
|
|
248
|
+
for (let e = this.subs; e; e = e.prevSub)
|
|
249
|
+
e.sub.notify() && e.sub.dep.notify();
|
|
250
|
+
} finally {
|
|
251
|
+
Kt();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function ve(t) {
|
|
256
|
+
if (t.dep.sc++, t.sub.flags & 4) {
|
|
257
|
+
const n = t.dep.computed;
|
|
258
|
+
if (n && !t.dep.subs) {
|
|
259
|
+
n.flags |= 20;
|
|
260
|
+
for (let r = n.deps; r; r = r.nextDep)
|
|
261
|
+
ve(r);
|
|
262
|
+
}
|
|
263
|
+
const e = t.dep.subs;
|
|
264
|
+
e !== t && (t.prevSub = e, e && (e.nextSub = t)), process.env.NODE_ENV !== "production" && t.dep.subsHead === void 0 && (t.dep.subsHead = t), t.dep.subs = t;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const Tt = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ Symbol(
|
|
268
|
+
process.env.NODE_ENV !== "production" ? "Object iterate" : ""
|
|
269
|
+
), Nt = /* @__PURE__ */ Symbol(
|
|
270
|
+
process.env.NODE_ENV !== "production" ? "Map keys iterate" : ""
|
|
271
|
+
), dt = /* @__PURE__ */ Symbol(
|
|
272
|
+
process.env.NODE_ENV !== "production" ? "Array iterate" : ""
|
|
273
|
+
);
|
|
274
|
+
function N(t, n, e) {
|
|
275
|
+
if (I && S) {
|
|
276
|
+
let r = Tt.get(t);
|
|
277
|
+
r || Tt.set(t, r = /* @__PURE__ */ new Map());
|
|
278
|
+
let i = r.get(e);
|
|
279
|
+
i || (r.set(e, i = new qt()), i.map = r, i.key = e), process.env.NODE_ENV !== "production" ? i.track({
|
|
280
|
+
target: t,
|
|
281
|
+
type: n,
|
|
282
|
+
key: e
|
|
283
|
+
}) : i.track();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function B(t, n, e, r, i, s) {
|
|
287
|
+
const a = Tt.get(t);
|
|
288
|
+
if (!a) {
|
|
289
|
+
ft++;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const o = (c) => {
|
|
293
|
+
c && (process.env.NODE_ENV !== "production" ? c.trigger({
|
|
294
|
+
target: t,
|
|
295
|
+
type: n,
|
|
296
|
+
key: e,
|
|
297
|
+
newValue: r,
|
|
298
|
+
oldValue: i,
|
|
299
|
+
oldTarget: s
|
|
300
|
+
}) : c.trigger());
|
|
301
|
+
};
|
|
302
|
+
if (Pt(), n === "clear")
|
|
303
|
+
a.forEach(o);
|
|
304
|
+
else {
|
|
305
|
+
const c = lt(t), d = c && Mt(e);
|
|
306
|
+
if (c && e === "length") {
|
|
307
|
+
const y = Number(r);
|
|
308
|
+
a.forEach((l, u) => {
|
|
309
|
+
(u === "length" || u === dt || !vt(u) && u >= y) && o(l);
|
|
310
|
+
});
|
|
311
|
+
} else
|
|
312
|
+
switch ((e !== void 0 || a.has(void 0)) && o(a.get(e)), d && o(a.get(dt)), n) {
|
|
313
|
+
case "add":
|
|
314
|
+
c ? d && o(a.get("length")) : (o(a.get(Q)), it(t) && o(a.get(Nt)));
|
|
315
|
+
break;
|
|
316
|
+
case "delete":
|
|
317
|
+
c || (o(a.get(Q)), it(t) && o(a.get(Nt)));
|
|
318
|
+
break;
|
|
319
|
+
case "set":
|
|
320
|
+
it(t) && o(a.get(Q));
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
Kt();
|
|
325
|
+
}
|
|
326
|
+
function X(t) {
|
|
327
|
+
const n = /* @__PURE__ */ A(t);
|
|
328
|
+
return n === t ? n : (N(n, "iterate", dt), /* @__PURE__ */ G(t) ? n : n.map(P));
|
|
329
|
+
}
|
|
330
|
+
function Ht(t) {
|
|
331
|
+
return N(t = /* @__PURE__ */ A(t), "iterate", dt), t;
|
|
332
|
+
}
|
|
333
|
+
function F(t, n) {
|
|
334
|
+
return /* @__PURE__ */ z(t) ? pt(/* @__PURE__ */ we(t) ? P(n) : n) : P(n);
|
|
335
|
+
}
|
|
336
|
+
const Fe = {
|
|
337
|
+
__proto__: null,
|
|
338
|
+
[Symbol.iterator]() {
|
|
339
|
+
return Ct(this, Symbol.iterator, (t) => F(this, t));
|
|
340
|
+
},
|
|
341
|
+
concat(...t) {
|
|
342
|
+
return X(this).concat(
|
|
343
|
+
...t.map((n) => lt(n) ? X(n) : n)
|
|
344
|
+
);
|
|
345
|
+
},
|
|
346
|
+
entries() {
|
|
347
|
+
return Ct(this, "entries", (t) => (t[1] = F(this, t[1]), t));
|
|
348
|
+
},
|
|
349
|
+
every(t, n) {
|
|
350
|
+
return M(this, "every", t, n, void 0, arguments);
|
|
351
|
+
},
|
|
352
|
+
filter(t, n) {
|
|
353
|
+
return M(
|
|
354
|
+
this,
|
|
355
|
+
"filter",
|
|
356
|
+
t,
|
|
357
|
+
n,
|
|
358
|
+
(e) => e.map((r) => F(this, r)),
|
|
359
|
+
arguments
|
|
360
|
+
);
|
|
361
|
+
},
|
|
362
|
+
find(t, n) {
|
|
363
|
+
return M(
|
|
364
|
+
this,
|
|
365
|
+
"find",
|
|
366
|
+
t,
|
|
367
|
+
n,
|
|
368
|
+
(e) => F(this, e),
|
|
369
|
+
arguments
|
|
370
|
+
);
|
|
371
|
+
},
|
|
372
|
+
findIndex(t, n) {
|
|
373
|
+
return M(this, "findIndex", t, n, void 0, arguments);
|
|
374
|
+
},
|
|
375
|
+
findLast(t, n) {
|
|
376
|
+
return M(
|
|
377
|
+
this,
|
|
378
|
+
"findLast",
|
|
379
|
+
t,
|
|
380
|
+
n,
|
|
381
|
+
(e) => F(this, e),
|
|
382
|
+
arguments
|
|
383
|
+
);
|
|
384
|
+
},
|
|
385
|
+
findLastIndex(t, n) {
|
|
386
|
+
return M(this, "findLastIndex", t, n, void 0, arguments);
|
|
387
|
+
},
|
|
388
|
+
// flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
|
|
389
|
+
forEach(t, n) {
|
|
390
|
+
return M(this, "forEach", t, n, void 0, arguments);
|
|
391
|
+
},
|
|
392
|
+
includes(...t) {
|
|
393
|
+
return jt(this, "includes", t);
|
|
394
|
+
},
|
|
395
|
+
indexOf(...t) {
|
|
396
|
+
return jt(this, "indexOf", t);
|
|
397
|
+
},
|
|
398
|
+
join(t) {
|
|
399
|
+
return X(this).join(t);
|
|
400
|
+
},
|
|
401
|
+
// keys() iterator only reads `length`, no optimization required
|
|
402
|
+
lastIndexOf(...t) {
|
|
403
|
+
return jt(this, "lastIndexOf", t);
|
|
404
|
+
},
|
|
405
|
+
map(t, n) {
|
|
406
|
+
return M(this, "map", t, n, void 0, arguments);
|
|
407
|
+
},
|
|
408
|
+
pop() {
|
|
409
|
+
return nt(this, "pop");
|
|
410
|
+
},
|
|
411
|
+
push(...t) {
|
|
412
|
+
return nt(this, "push", t);
|
|
413
|
+
},
|
|
414
|
+
reduce(t, ...n) {
|
|
415
|
+
return te(this, "reduce", t, n);
|
|
416
|
+
},
|
|
417
|
+
reduceRight(t, ...n) {
|
|
418
|
+
return te(this, "reduceRight", t, n);
|
|
419
|
+
},
|
|
420
|
+
shift() {
|
|
421
|
+
return nt(this, "shift");
|
|
422
|
+
},
|
|
423
|
+
// slice could use ARRAY_ITERATE but also seems to beg for range tracking
|
|
424
|
+
some(t, n) {
|
|
425
|
+
return M(this, "some", t, n, void 0, arguments);
|
|
426
|
+
},
|
|
427
|
+
splice(...t) {
|
|
428
|
+
return nt(this, "splice", t);
|
|
429
|
+
},
|
|
430
|
+
toReversed() {
|
|
431
|
+
return X(this).toReversed();
|
|
432
|
+
},
|
|
433
|
+
toSorted(t) {
|
|
434
|
+
return X(this).toSorted(t);
|
|
435
|
+
},
|
|
436
|
+
toSpliced(...t) {
|
|
437
|
+
return X(this).toSpliced(...t);
|
|
438
|
+
},
|
|
439
|
+
unshift(...t) {
|
|
440
|
+
return nt(this, "unshift", t);
|
|
441
|
+
},
|
|
442
|
+
values() {
|
|
443
|
+
return Ct(this, "values", (t) => F(this, t));
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
function Ct(t, n, e) {
|
|
447
|
+
const r = Ht(t), i = r[n]();
|
|
448
|
+
return r !== t && !/* @__PURE__ */ G(t) && (i._next = i.next, i.next = () => {
|
|
449
|
+
const s = i._next();
|
|
450
|
+
return s.done || (s.value = e(s.value)), s;
|
|
451
|
+
}), i;
|
|
452
|
+
}
|
|
453
|
+
const Me = Array.prototype;
|
|
454
|
+
function M(t, n, e, r, i, s) {
|
|
455
|
+
const a = Ht(t), o = a !== t && !/* @__PURE__ */ G(t), c = a[n];
|
|
456
|
+
if (c !== Me[n]) {
|
|
457
|
+
const l = c.apply(t, s);
|
|
458
|
+
return o ? P(l) : l;
|
|
459
|
+
}
|
|
460
|
+
let d = e;
|
|
461
|
+
a !== t && (o ? d = function(l, u) {
|
|
462
|
+
return e.call(this, F(t, l), u, t);
|
|
463
|
+
} : e.length > 2 && (d = function(l, u) {
|
|
464
|
+
return e.call(this, l, u, t);
|
|
465
|
+
}));
|
|
466
|
+
const y = c.call(a, d, r);
|
|
467
|
+
return o && i ? i(y) : y;
|
|
468
|
+
}
|
|
469
|
+
function te(t, n, e, r) {
|
|
470
|
+
const i = Ht(t), s = i !== t && !/* @__PURE__ */ G(t);
|
|
471
|
+
let a = e, o = !1;
|
|
472
|
+
i !== t && (s ? (o = r.length === 0, a = function(d, y, l) {
|
|
473
|
+
return o && (o = !1, d = F(t, d)), e.call(this, d, F(t, y), l, t);
|
|
474
|
+
}) : e.length > 3 && (a = function(d, y, l) {
|
|
475
|
+
return e.call(this, d, y, l, t);
|
|
476
|
+
}));
|
|
477
|
+
const c = i[n](a, ...r);
|
|
478
|
+
return o ? F(t, c) : c;
|
|
479
|
+
}
|
|
480
|
+
function jt(t, n, e) {
|
|
481
|
+
const r = /* @__PURE__ */ A(t);
|
|
482
|
+
N(r, "iterate", dt);
|
|
483
|
+
const i = r[n](...e);
|
|
484
|
+
return (i === -1 || i === !1) && /* @__PURE__ */ De(e[0]) ? (e[0] = /* @__PURE__ */ A(e[0]), r[n](...e)) : i;
|
|
485
|
+
}
|
|
486
|
+
function nt(t, n, e = []) {
|
|
487
|
+
Ve(), Pt();
|
|
488
|
+
const r = (/* @__PURE__ */ A(t))[n].apply(t, e);
|
|
489
|
+
return Kt(), ke(), r;
|
|
490
|
+
}
|
|
491
|
+
const Pe = /* @__PURE__ */ Oe("__proto__,__v_isRef,__isVue"), be = new Set(
|
|
492
|
+
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((t) => t !== "arguments" && t !== "caller").map((t) => Symbol[t]).filter(vt)
|
|
493
|
+
);
|
|
494
|
+
function Ke(t) {
|
|
495
|
+
vt(t) || (t = String(t));
|
|
496
|
+
const n = /* @__PURE__ */ A(this);
|
|
497
|
+
return N(n, "has", t), n.hasOwnProperty(t);
|
|
498
|
+
}
|
|
499
|
+
class ge {
|
|
500
|
+
constructor(n = !1, e = !1) {
|
|
501
|
+
this._isReadonly = n, this._isShallow = e;
|
|
502
|
+
}
|
|
503
|
+
get(n, e, r) {
|
|
504
|
+
if (e === "__v_skip") return n.__v_skip;
|
|
505
|
+
const i = this._isReadonly, s = this._isShallow;
|
|
506
|
+
if (e === "__v_isReactive")
|
|
507
|
+
return !i;
|
|
508
|
+
if (e === "__v_isReadonly")
|
|
509
|
+
return i;
|
|
510
|
+
if (e === "__v_isShallow")
|
|
511
|
+
return s;
|
|
512
|
+
if (e === "__v_raw")
|
|
513
|
+
return r === (i ? s ? Qe : me : s ? Je : Ee).get(n) || // receiver is not the reactive proxy, but has the same prototype
|
|
514
|
+
// this means the receiver is a user proxy of the reactive proxy
|
|
515
|
+
Object.getPrototypeOf(n) === Object.getPrototypeOf(r) ? n : void 0;
|
|
516
|
+
const a = lt(n);
|
|
517
|
+
if (!i) {
|
|
518
|
+
let c;
|
|
519
|
+
if (a && (c = Fe[e]))
|
|
520
|
+
return c;
|
|
521
|
+
if (e === "hasOwnProperty")
|
|
522
|
+
return Ke;
|
|
523
|
+
}
|
|
524
|
+
const o = Reflect.get(
|
|
525
|
+
n,
|
|
526
|
+
e,
|
|
527
|
+
// if this is a proxy wrapping a ref, return methods using the raw ref
|
|
528
|
+
// as receiver so that we don't have to call `toRaw` on the ref in all
|
|
529
|
+
// its class methods
|
|
530
|
+
/* @__PURE__ */ D(n) ? n : r
|
|
531
|
+
);
|
|
532
|
+
if ((vt(e) ? be.has(e) : Pe(e)) || (i || N(n, "get", e), s))
|
|
533
|
+
return o;
|
|
534
|
+
if (/* @__PURE__ */ D(o)) {
|
|
535
|
+
const c = a && Mt(e) ? o : o.value;
|
|
536
|
+
return i && ut(c) ? /* @__PURE__ */ Vt(c) : c;
|
|
537
|
+
}
|
|
538
|
+
return ut(o) ? i ? /* @__PURE__ */ Vt(o) : /* @__PURE__ */ zt(o) : o;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
class We extends ge {
|
|
542
|
+
constructor(n = !1) {
|
|
543
|
+
super(!1, n);
|
|
544
|
+
}
|
|
545
|
+
set(n, e, r, i) {
|
|
546
|
+
let s = n[e];
|
|
547
|
+
const a = lt(n) && Mt(e);
|
|
548
|
+
if (!this._isShallow) {
|
|
549
|
+
const d = /* @__PURE__ */ z(s);
|
|
550
|
+
if (!/* @__PURE__ */ G(r) && !/* @__PURE__ */ z(r) && (s = /* @__PURE__ */ A(s), r = /* @__PURE__ */ A(r)), !a && /* @__PURE__ */ D(s) && !/* @__PURE__ */ D(r))
|
|
551
|
+
return d ? (process.env.NODE_ENV !== "production" && H(
|
|
552
|
+
`Set operation on key "${String(e)}" failed: target is readonly.`,
|
|
553
|
+
n[e]
|
|
554
|
+
), !0) : (s.value = r, !0);
|
|
555
|
+
}
|
|
556
|
+
const o = a ? Number(e) < n.length : Rt(n, e), c = Reflect.set(
|
|
557
|
+
n,
|
|
558
|
+
e,
|
|
559
|
+
r,
|
|
560
|
+
/* @__PURE__ */ D(n) ? n : i
|
|
561
|
+
);
|
|
562
|
+
return n === /* @__PURE__ */ A(i) && (o ? W(r, s) && B(n, "set", e, r, s) : B(n, "add", e, r)), c;
|
|
563
|
+
}
|
|
564
|
+
deleteProperty(n, e) {
|
|
565
|
+
const r = Rt(n, e), i = n[e], s = Reflect.deleteProperty(n, e);
|
|
566
|
+
return s && r && B(n, "delete", e, void 0, i), s;
|
|
567
|
+
}
|
|
568
|
+
has(n, e) {
|
|
569
|
+
const r = Reflect.has(n, e);
|
|
570
|
+
return (!vt(e) || !be.has(e)) && N(n, "has", e), r;
|
|
571
|
+
}
|
|
572
|
+
ownKeys(n) {
|
|
573
|
+
return N(
|
|
574
|
+
n,
|
|
575
|
+
"iterate",
|
|
576
|
+
lt(n) ? "length" : Q
|
|
577
|
+
), Reflect.ownKeys(n);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
class Be extends ge {
|
|
581
|
+
constructor(n = !1) {
|
|
582
|
+
super(!0, n);
|
|
583
|
+
}
|
|
584
|
+
set(n, e) {
|
|
585
|
+
return process.env.NODE_ENV !== "production" && H(
|
|
586
|
+
`Set operation on key "${String(e)}" failed: target is readonly.`,
|
|
587
|
+
n
|
|
588
|
+
), !0;
|
|
589
|
+
}
|
|
590
|
+
deleteProperty(n, e) {
|
|
591
|
+
return process.env.NODE_ENV !== "production" && H(
|
|
592
|
+
`Delete operation on key "${String(e)}" failed: target is readonly.`,
|
|
593
|
+
n
|
|
594
|
+
), !0;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
const qe = /* @__PURE__ */ new We(), He = /* @__PURE__ */ new Be(), It = (t) => t, _t = (t) => Reflect.getPrototypeOf(t);
|
|
598
|
+
function ze(t, n, e) {
|
|
599
|
+
return function(...r) {
|
|
600
|
+
const i = this.__v_raw, s = /* @__PURE__ */ A(i), a = it(s), o = t === "entries" || t === Symbol.iterator && a, c = t === "keys" && a, d = i[t](...r), y = e ? It : n ? pt : P;
|
|
601
|
+
return !n && N(
|
|
602
|
+
s,
|
|
603
|
+
"iterate",
|
|
604
|
+
c ? Nt : Q
|
|
605
|
+
), ct(
|
|
606
|
+
// inheriting all iterator properties
|
|
607
|
+
Object.create(d),
|
|
608
|
+
{
|
|
609
|
+
// iterator protocol
|
|
610
|
+
next() {
|
|
611
|
+
const { value: l, done: u } = d.next();
|
|
612
|
+
return u ? { value: l, done: u } : {
|
|
613
|
+
value: o ? [y(l[0]), y(l[1])] : y(l),
|
|
614
|
+
done: u
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
);
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
function Et(t) {
|
|
622
|
+
return function(...n) {
|
|
623
|
+
if (process.env.NODE_ENV !== "production") {
|
|
624
|
+
const e = n[0] ? `on key "${n[0]}" ` : "";
|
|
625
|
+
H(
|
|
626
|
+
`${Ne(t)} operation ${e}failed: target is readonly.`,
|
|
627
|
+
/* @__PURE__ */ A(this)
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
return t === "delete" ? !1 : t === "clear" ? void 0 : this;
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
function Ge(t, n) {
|
|
634
|
+
const e = {
|
|
635
|
+
get(i) {
|
|
636
|
+
const s = this.__v_raw, a = /* @__PURE__ */ A(s), o = /* @__PURE__ */ A(i);
|
|
637
|
+
t || (W(i, o) && N(a, "get", i), N(a, "get", o));
|
|
638
|
+
const { has: c } = _t(a), d = n ? It : t ? pt : P;
|
|
639
|
+
if (c.call(a, i))
|
|
640
|
+
return d(s.get(i));
|
|
641
|
+
if (c.call(a, o))
|
|
642
|
+
return d(s.get(o));
|
|
643
|
+
s !== a && s.get(i);
|
|
644
|
+
},
|
|
645
|
+
get size() {
|
|
646
|
+
const i = this.__v_raw;
|
|
647
|
+
return !t && N(/* @__PURE__ */ A(i), "iterate", Q), i.size;
|
|
648
|
+
},
|
|
649
|
+
has(i) {
|
|
650
|
+
const s = this.__v_raw, a = /* @__PURE__ */ A(s), o = /* @__PURE__ */ A(i);
|
|
651
|
+
return t || (W(i, o) && N(a, "has", i), N(a, "has", o)), i === o ? s.has(i) : s.has(i) || s.has(o);
|
|
652
|
+
},
|
|
653
|
+
forEach(i, s) {
|
|
654
|
+
const a = this, o = a.__v_raw, c = /* @__PURE__ */ A(o), d = n ? It : t ? pt : P;
|
|
655
|
+
return !t && N(c, "iterate", Q), o.forEach((y, l) => i.call(s, d(y), d(l), a));
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
return ct(
|
|
659
|
+
e,
|
|
660
|
+
t ? {
|
|
661
|
+
add: Et("add"),
|
|
662
|
+
set: Et("set"),
|
|
663
|
+
delete: Et("delete"),
|
|
664
|
+
clear: Et("clear")
|
|
665
|
+
} : {
|
|
666
|
+
add(i) {
|
|
667
|
+
const s = /* @__PURE__ */ A(this), a = _t(s), o = /* @__PURE__ */ A(i), c = !n && !/* @__PURE__ */ G(i) && !/* @__PURE__ */ z(i) ? o : i;
|
|
668
|
+
return a.has.call(s, c) || W(i, c) && a.has.call(s, i) || W(o, c) && a.has.call(s, o) || (s.add(c), B(s, "add", c, c)), this;
|
|
669
|
+
},
|
|
670
|
+
set(i, s) {
|
|
671
|
+
!n && !/* @__PURE__ */ G(s) && !/* @__PURE__ */ z(s) && (s = /* @__PURE__ */ A(s));
|
|
672
|
+
const a = /* @__PURE__ */ A(this), { has: o, get: c } = _t(a);
|
|
673
|
+
let d = o.call(a, i);
|
|
674
|
+
d ? process.env.NODE_ENV !== "production" && ee(a, o, i) : (i = /* @__PURE__ */ A(i), d = o.call(a, i));
|
|
675
|
+
const y = c.call(a, i);
|
|
676
|
+
return a.set(i, s), d ? W(s, y) && B(a, "set", i, s, y) : B(a, "add", i, s), this;
|
|
677
|
+
},
|
|
678
|
+
delete(i) {
|
|
679
|
+
const s = /* @__PURE__ */ A(this), { has: a, get: o } = _t(s);
|
|
680
|
+
let c = a.call(s, i);
|
|
681
|
+
c ? process.env.NODE_ENV !== "production" && ee(s, a, i) : (i = /* @__PURE__ */ A(i), c = a.call(s, i));
|
|
682
|
+
const d = o ? o.call(s, i) : void 0, y = s.delete(i);
|
|
683
|
+
return c && B(s, "delete", i, void 0, d), y;
|
|
684
|
+
},
|
|
685
|
+
clear() {
|
|
686
|
+
const i = /* @__PURE__ */ A(this), s = i.size !== 0, a = process.env.NODE_ENV !== "production" ? it(i) ? new Map(i) : new Set(i) : void 0, o = i.clear();
|
|
687
|
+
return s && B(
|
|
688
|
+
i,
|
|
689
|
+
"clear",
|
|
690
|
+
void 0,
|
|
691
|
+
void 0,
|
|
692
|
+
a
|
|
693
|
+
), o;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
), [
|
|
697
|
+
"keys",
|
|
698
|
+
"values",
|
|
699
|
+
"entries",
|
|
700
|
+
Symbol.iterator
|
|
701
|
+
].forEach((i) => {
|
|
702
|
+
e[i] = ze(i, t, n);
|
|
703
|
+
}), e;
|
|
704
|
+
}
|
|
705
|
+
function _e(t, n) {
|
|
706
|
+
const e = Ge(t, n);
|
|
707
|
+
return (r, i, s) => i === "__v_isReactive" ? !t : i === "__v_isReadonly" ? t : i === "__v_raw" ? r : Reflect.get(
|
|
708
|
+
Rt(e, i) && i in r ? e : r,
|
|
709
|
+
i,
|
|
710
|
+
s
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
const Ue = {
|
|
714
|
+
get: /* @__PURE__ */ _e(!1, !1)
|
|
715
|
+
}, Ye = {
|
|
716
|
+
get: /* @__PURE__ */ _e(!0, !1)
|
|
717
|
+
};
|
|
718
|
+
function ee(t, n, e) {
|
|
719
|
+
const r = /* @__PURE__ */ A(e);
|
|
720
|
+
if (r !== e && n.call(t, r)) {
|
|
721
|
+
const i = ue(t);
|
|
722
|
+
H(
|
|
723
|
+
`Reactive ${i} contains both the raw and reactive versions of the same object${i === "Map" ? " as keys" : ""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
const Ee = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap();
|
|
728
|
+
function Ze(t) {
|
|
729
|
+
switch (t) {
|
|
730
|
+
case "Object":
|
|
731
|
+
case "Array":
|
|
732
|
+
return 1;
|
|
733
|
+
case "Map":
|
|
734
|
+
case "Set":
|
|
735
|
+
case "WeakMap":
|
|
736
|
+
case "WeakSet":
|
|
737
|
+
return 2;
|
|
738
|
+
default:
|
|
739
|
+
return 0;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
function Xe(t) {
|
|
743
|
+
return t.__v_skip || !Object.isExtensible(t) ? 0 : Ze(ue(t));
|
|
744
|
+
}
|
|
745
|
+
// @__NO_SIDE_EFFECTS__
|
|
746
|
+
function zt(t) {
|
|
747
|
+
return /* @__PURE__ */ z(t) ? t : $e(
|
|
748
|
+
t,
|
|
749
|
+
!1,
|
|
750
|
+
qe,
|
|
751
|
+
Ue,
|
|
752
|
+
Ee
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
// @__NO_SIDE_EFFECTS__
|
|
756
|
+
function Vt(t) {
|
|
757
|
+
return $e(
|
|
758
|
+
t,
|
|
759
|
+
!0,
|
|
760
|
+
He,
|
|
761
|
+
Ye,
|
|
762
|
+
me
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
function $e(t, n, e, r, i) {
|
|
766
|
+
if (!ut(t))
|
|
767
|
+
return process.env.NODE_ENV !== "production" && H(
|
|
768
|
+
`value cannot be made ${n ? "readonly" : "reactive"}: ${String(
|
|
769
|
+
t
|
|
770
|
+
)}`
|
|
771
|
+
), t;
|
|
772
|
+
if (t.__v_raw && !(n && t.__v_isReactive))
|
|
773
|
+
return t;
|
|
774
|
+
const s = Xe(t);
|
|
775
|
+
if (s === 0)
|
|
776
|
+
return t;
|
|
777
|
+
const a = i.get(t);
|
|
778
|
+
if (a)
|
|
779
|
+
return a;
|
|
780
|
+
const o = new Proxy(
|
|
781
|
+
t,
|
|
782
|
+
s === 2 ? r : e
|
|
783
|
+
);
|
|
784
|
+
return i.set(t, o), o;
|
|
785
|
+
}
|
|
786
|
+
// @__NO_SIDE_EFFECTS__
|
|
787
|
+
function we(t) {
|
|
788
|
+
return /* @__PURE__ */ z(t) ? /* @__PURE__ */ we(t.__v_raw) : !!(t && t.__v_isReactive);
|
|
789
|
+
}
|
|
790
|
+
// @__NO_SIDE_EFFECTS__
|
|
791
|
+
function z(t) {
|
|
792
|
+
return !!(t && t.__v_isReadonly);
|
|
793
|
+
}
|
|
794
|
+
// @__NO_SIDE_EFFECTS__
|
|
795
|
+
function G(t) {
|
|
796
|
+
return !!(t && t.__v_isShallow);
|
|
797
|
+
}
|
|
798
|
+
// @__NO_SIDE_EFFECTS__
|
|
799
|
+
function De(t) {
|
|
800
|
+
return t ? !!t.__v_raw : !1;
|
|
801
|
+
}
|
|
802
|
+
// @__NO_SIDE_EFFECTS__
|
|
803
|
+
function A(t) {
|
|
804
|
+
const n = t && t.__v_raw;
|
|
805
|
+
return n ? /* @__PURE__ */ A(n) : t;
|
|
806
|
+
}
|
|
807
|
+
const P = (t) => ut(t) ? /* @__PURE__ */ zt(t) : t, pt = (t) => ut(t) ? /* @__PURE__ */ Vt(t) : t;
|
|
808
|
+
// @__NO_SIDE_EFFECTS__
|
|
809
|
+
function D(t) {
|
|
810
|
+
return t ? t.__v_isRef === !0 : !1;
|
|
811
|
+
}
|
|
812
|
+
// @__NO_SIDE_EFFECTS__
|
|
813
|
+
function jn(t) {
|
|
814
|
+
return tn(t, !1);
|
|
815
|
+
}
|
|
816
|
+
function tn(t, n) {
|
|
817
|
+
return /* @__PURE__ */ D(t) ? t : new en(t, n);
|
|
818
|
+
}
|
|
819
|
+
class en {
|
|
820
|
+
constructor(n, e) {
|
|
821
|
+
this.dep = new qt(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = e ? n : /* @__PURE__ */ A(n), this._value = e ? n : P(n), this.__v_isShallow = e;
|
|
822
|
+
}
|
|
823
|
+
get value() {
|
|
824
|
+
return process.env.NODE_ENV !== "production" ? this.dep.track({
|
|
825
|
+
target: this,
|
|
826
|
+
type: "get",
|
|
827
|
+
key: "value"
|
|
828
|
+
}) : this.dep.track(), this._value;
|
|
829
|
+
}
|
|
830
|
+
set value(n) {
|
|
831
|
+
const e = this._rawValue, r = this.__v_isShallow || /* @__PURE__ */ G(n) || /* @__PURE__ */ z(n);
|
|
832
|
+
n = r ? n : /* @__PURE__ */ A(n), W(n, e) && (this._rawValue = n, this._value = r ? n : P(n), process.env.NODE_ENV !== "production" ? this.dep.trigger({
|
|
833
|
+
target: this,
|
|
834
|
+
type: "set",
|
|
835
|
+
key: "value",
|
|
836
|
+
newValue: n,
|
|
837
|
+
oldValue: e
|
|
838
|
+
}) : this.dep.trigger());
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
class nn {
|
|
842
|
+
constructor(n, e, r) {
|
|
843
|
+
this.fn = n, this.setter = e, this._value = void 0, this.dep = new qt(this), this.__v_isRef = !0, this.deps = void 0, this.depsTail = void 0, this.flags = 16, this.globalVersion = ft - 1, this.next = void 0, this.effect = this, this.__v_isReadonly = !e, this.isSSR = r;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* @internal
|
|
847
|
+
*/
|
|
848
|
+
notify() {
|
|
849
|
+
if (this.flags |= 16, !(this.flags & 8) && // avoid infinite self recursion
|
|
850
|
+
S !== this)
|
|
851
|
+
return de(this, !0), !0;
|
|
852
|
+
process.env.NODE_ENV;
|
|
853
|
+
}
|
|
854
|
+
get value() {
|
|
855
|
+
const n = process.env.NODE_ENV !== "production" ? this.dep.track({
|
|
856
|
+
target: this,
|
|
857
|
+
type: "get",
|
|
858
|
+
key: "value"
|
|
859
|
+
}) : this.dep.track();
|
|
860
|
+
return ye(this), n && (n.version = this.dep.version), this._value;
|
|
861
|
+
}
|
|
862
|
+
set value(n) {
|
|
863
|
+
this.setter ? this.setter(n) : process.env.NODE_ENV !== "production" && H("Write operation failed: computed value is readonly");
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
// @__NO_SIDE_EFFECTS__
|
|
867
|
+
function Rn(t, n, e = !1) {
|
|
868
|
+
let r, i;
|
|
869
|
+
je(t) ? r = t : (r = t.get, i = t.set);
|
|
870
|
+
const s = new nn(r, i, e);
|
|
871
|
+
return process.env.NODE_ENV !== "production" && n && !e && (s.onTrack = n.onTrack, s.onTrigger = n.onTrigger), s;
|
|
872
|
+
}
|
|
873
|
+
let at = !1, rt = /* @__PURE__ */ new Set();
|
|
874
|
+
function rn() {
|
|
875
|
+
at = !0;
|
|
876
|
+
}
|
|
877
|
+
function sn() {
|
|
878
|
+
at = !1, rt.clear();
|
|
879
|
+
}
|
|
880
|
+
function kt(t, n, e, r = null, i = {}) {
|
|
881
|
+
var y;
|
|
882
|
+
if (!t)
|
|
883
|
+
return O.warn("createStage called with null/undefined def"), Object.freeze({});
|
|
884
|
+
const s = t.name || e, a = typeof n == "function" ? n : () => n, o = a();
|
|
885
|
+
o || O.warn(`createStage: context is null for element "${s || e}"`);
|
|
886
|
+
const c = s && ((y = o == null ? void 0 : o.form) != null && y.getInitialValue) ? o.form.getInitialValue(s) : void 0, d = {
|
|
887
|
+
get def() {
|
|
888
|
+
return t;
|
|
889
|
+
},
|
|
890
|
+
get path() {
|
|
891
|
+
return e || s;
|
|
892
|
+
},
|
|
893
|
+
get name() {
|
|
894
|
+
return s;
|
|
895
|
+
},
|
|
896
|
+
get element() {
|
|
897
|
+
return r || (s ? document.querySelector(`[name="${s}"]`) : null);
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
return t.component || t.type !== "button" ? Object.freeze({
|
|
901
|
+
...d,
|
|
902
|
+
get value() {
|
|
903
|
+
var l, u;
|
|
904
|
+
return (u = (l = a()) == null ? void 0 : l.form) == null ? void 0 : u.getValue(s);
|
|
905
|
+
},
|
|
906
|
+
get currentValue() {
|
|
907
|
+
var u, h;
|
|
908
|
+
const l = this.element;
|
|
909
|
+
return l ? l.type === "checkbox" ? l.checked : l.value : (h = (u = a()) == null ? void 0 : u.form) == null ? void 0 : h.getValue(s);
|
|
910
|
+
},
|
|
911
|
+
get initialValue() {
|
|
912
|
+
return c;
|
|
913
|
+
},
|
|
914
|
+
get isDirty() {
|
|
915
|
+
return this.currentValue !== c;
|
|
916
|
+
},
|
|
917
|
+
get errors() {
|
|
918
|
+
var l, u;
|
|
919
|
+
return ((u = (l = a()) == null ? void 0 : l.form) == null ? void 0 : u.getFieldErrors(s)) || [];
|
|
920
|
+
},
|
|
921
|
+
get isValid() {
|
|
922
|
+
var l, u;
|
|
923
|
+
return (((u = (l = a()) == null ? void 0 : l.form) == null ? void 0 : u.getFieldErrors(s)) || []).length === 0;
|
|
924
|
+
},
|
|
925
|
+
get isRequired() {
|
|
926
|
+
var l, u;
|
|
927
|
+
return ((u = (l = a()) == null ? void 0 : l.form) == null ? void 0 : u.isRequired(s)) || !1;
|
|
928
|
+
},
|
|
929
|
+
get isReadonly() {
|
|
930
|
+
var l, u;
|
|
931
|
+
return ((u = (l = a()) == null ? void 0 : l.form) == null ? void 0 : u.isReadonly(s)) || !1;
|
|
932
|
+
},
|
|
933
|
+
get isSystemField() {
|
|
934
|
+
var l, u;
|
|
935
|
+
return ((u = (l = a()) == null ? void 0 : l.form) == null ? void 0 : u.isSystemField(s)) || !1;
|
|
936
|
+
},
|
|
937
|
+
setValue(l) {
|
|
938
|
+
var h;
|
|
939
|
+
if (!s) return;
|
|
940
|
+
if (at || i.readOnly) {
|
|
941
|
+
rt.has(s) || (rt.add(s), O.error(
|
|
942
|
+
`[INFINITE LOOP PREVENTED] setValue("${s}") called during render phase. Formatters must RETURN the formatted value, not call setValue(). Check your formatter function for field "${s}".`
|
|
943
|
+
));
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
const u = a();
|
|
947
|
+
if (!((h = u == null ? void 0 : u.form) != null && h.setValue)) {
|
|
948
|
+
O.warn(`setValue: form context not available for "${s}"`);
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
u.form.setValue(s, l);
|
|
952
|
+
},
|
|
953
|
+
setError(l) {
|
|
954
|
+
var p;
|
|
955
|
+
if (!s) return;
|
|
956
|
+
if (at || i.readOnly) {
|
|
957
|
+
rt.has(`${s}:error`) || (rt.add(`${s}:error`), O.error(
|
|
958
|
+
`[INFINITE LOOP PREVENTED] setError("${s}") called during render phase. Validators should be used with onBlur/onChange, not during render. Check your validator function for field "${s}".`
|
|
959
|
+
));
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
const u = a();
|
|
963
|
+
if (!((p = u == null ? void 0 : u.form) != null && p.setFieldErrors)) {
|
|
964
|
+
O.warn(`setError: form context not available for "${s}"`);
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
const h = Array.isArray(l) ? l : [l];
|
|
968
|
+
u.form.setFieldErrors(s, h);
|
|
969
|
+
},
|
|
970
|
+
clearErrors() {
|
|
971
|
+
var u;
|
|
972
|
+
if (!s || at || i.readOnly)
|
|
973
|
+
return;
|
|
974
|
+
const l = a();
|
|
975
|
+
if (!((u = l == null ? void 0 : l.form) != null && u.setFieldErrors)) {
|
|
976
|
+
O.warn(`clearErrors: form context not available for "${s}"`);
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
l.form.setFieldErrors(s, []);
|
|
980
|
+
},
|
|
981
|
+
focus() {
|
|
982
|
+
var l;
|
|
983
|
+
(l = this.element) == null || l.focus();
|
|
984
|
+
},
|
|
985
|
+
blur() {
|
|
986
|
+
var l;
|
|
987
|
+
(l = this.element) == null || l.blur();
|
|
988
|
+
},
|
|
989
|
+
select() {
|
|
990
|
+
var l, u;
|
|
991
|
+
(u = (l = this.element) == null ? void 0 : l.select) == null || u.call(l);
|
|
992
|
+
}
|
|
993
|
+
}) : Object.freeze({
|
|
994
|
+
...d,
|
|
995
|
+
get isLoading() {
|
|
996
|
+
var l, u, h;
|
|
997
|
+
return ((h = (u = (l = a()) == null ? void 0 : l.form) == null ? void 0 : u.isLoading) == null ? void 0 : h.call(u, s)) || !1;
|
|
998
|
+
},
|
|
999
|
+
executeAction(l) {
|
|
1000
|
+
var h;
|
|
1001
|
+
const u = a();
|
|
1002
|
+
return (h = u == null ? void 0 : u.form) != null && h.executeAction ? u.form.executeAction(s, l) : (O.warn(`executeAction: form context not available for button "${s}"`), Promise.reject(new Error("Form context not available")));
|
|
1003
|
+
}
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
function on(t) {
|
|
1007
|
+
if (t.startsWith("_") || t === "...") return t;
|
|
1008
|
+
const n = t.toLowerCase();
|
|
1009
|
+
return n.startsWith("data-") || n.startsWith("aria-") || n === "accept-charset" || n === "http-equiv" ? n : n.replace(/-([a-z])/g, (e, r) => r.toUpperCase());
|
|
1010
|
+
}
|
|
1011
|
+
function an(t) {
|
|
1012
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return t;
|
|
1013
|
+
const n = {};
|
|
1014
|
+
for (const e of Object.keys(t))
|
|
1015
|
+
n[on(e)] = t[e];
|
|
1016
|
+
return n;
|
|
1017
|
+
}
|
|
1018
|
+
const cn = /* @__PURE__ */ new Set([
|
|
1019
|
+
"abort",
|
|
1020
|
+
"auxclick",
|
|
1021
|
+
"beforeinput",
|
|
1022
|
+
"blur",
|
|
1023
|
+
"cancel",
|
|
1024
|
+
"change",
|
|
1025
|
+
"click",
|
|
1026
|
+
"close",
|
|
1027
|
+
"compositionend",
|
|
1028
|
+
"compositionstart",
|
|
1029
|
+
"compositionupdate",
|
|
1030
|
+
"contextmenu",
|
|
1031
|
+
"copy",
|
|
1032
|
+
"cut",
|
|
1033
|
+
"dblclick",
|
|
1034
|
+
"drag",
|
|
1035
|
+
"dragend",
|
|
1036
|
+
"dragenter",
|
|
1037
|
+
"dragleave",
|
|
1038
|
+
"dragover",
|
|
1039
|
+
"dragstart",
|
|
1040
|
+
"drop",
|
|
1041
|
+
"error",
|
|
1042
|
+
"focus",
|
|
1043
|
+
"focusin",
|
|
1044
|
+
"focusout",
|
|
1045
|
+
"input",
|
|
1046
|
+
"invalid",
|
|
1047
|
+
"keydown",
|
|
1048
|
+
"keypress",
|
|
1049
|
+
"keyup",
|
|
1050
|
+
"load",
|
|
1051
|
+
"mousedown",
|
|
1052
|
+
"mouseenter",
|
|
1053
|
+
"mouseleave",
|
|
1054
|
+
"mousemove",
|
|
1055
|
+
"mouseout",
|
|
1056
|
+
"mouseover",
|
|
1057
|
+
"mouseup",
|
|
1058
|
+
"paste",
|
|
1059
|
+
"pointercancel",
|
|
1060
|
+
"pointerdown",
|
|
1061
|
+
"pointerenter",
|
|
1062
|
+
"pointerleave",
|
|
1063
|
+
"pointermove",
|
|
1064
|
+
"pointerout",
|
|
1065
|
+
"pointerover",
|
|
1066
|
+
"pointerup",
|
|
1067
|
+
"reset",
|
|
1068
|
+
"resize",
|
|
1069
|
+
"scroll",
|
|
1070
|
+
"scrollend",
|
|
1071
|
+
"select",
|
|
1072
|
+
"submit",
|
|
1073
|
+
"touchcancel",
|
|
1074
|
+
"touchend",
|
|
1075
|
+
"touchmove",
|
|
1076
|
+
"touchstart",
|
|
1077
|
+
"transitionend",
|
|
1078
|
+
"wheel"
|
|
1079
|
+
]);
|
|
1080
|
+
function ht(t) {
|
|
1081
|
+
return t.length <= 2 || t[0] !== "o" || t[1] !== "n" ? !1 : t[2] >= "A" && t[2] <= "Z" ? !0 : cn.has(t.slice(2));
|
|
1082
|
+
}
|
|
1083
|
+
function $t(t, n, e = {}) {
|
|
1084
|
+
const { path: r, available: i = [] } = e, s = [`⚠️ ${t} "${n}" not found`];
|
|
1085
|
+
return r && s.push(`
|
|
1086
|
+
Path: ${r}`), i.length > 0 && s.push(`
|
|
1087
|
+
Available: ${i.join(", ")}`), s.push(`
|
|
1088
|
+
💡 Check spelling or add "${n}" to your ${t.toLowerCase()} registry`), s.join("");
|
|
1089
|
+
}
|
|
1090
|
+
function ne(t, n) {
|
|
1091
|
+
if (typeof t != "string") return null;
|
|
1092
|
+
const e = t.indexOf(".");
|
|
1093
|
+
if (e <= 0) return null;
|
|
1094
|
+
const r = t.slice(0, e), i = t.slice(e + 1);
|
|
1095
|
+
return n && !n.has(r) || !i ? null : { registry: r, key: i };
|
|
1096
|
+
}
|
|
1097
|
+
const At = (t, n = {}, e = "registry", r = "", i = {}) => {
|
|
1098
|
+
var d;
|
|
1099
|
+
const {
|
|
1100
|
+
allRegistries: s = null,
|
|
1101
|
+
fallbackRegistry: a = null,
|
|
1102
|
+
// Fallback for spread lookups (e.g. defaultButtons)
|
|
1103
|
+
validRegistries: o = null,
|
|
1104
|
+
// Set of valid registry names for dot-notation parsing
|
|
1105
|
+
_visited: c = /* @__PURE__ */ new Set()
|
|
1106
|
+
// Track visited references to prevent circular dependencies
|
|
1107
|
+
} = i;
|
|
1108
|
+
if (typeof t == "string") {
|
|
1109
|
+
t === "^" && (t = r);
|
|
1110
|
+
const y = ne(t, o);
|
|
1111
|
+
let l, u = e, h = t;
|
|
1112
|
+
if (y && s ? (u = y.registry, h = y.key, l = (d = s[y.registry]) == null ? void 0 : d[y.key]) : l = n[t], typeof l == "string" && (l = null), !l) {
|
|
1113
|
+
const p = Object.keys(y && s ? s[y.registry] || {} : n);
|
|
1114
|
+
return O.warn($t(u, h, {
|
|
1115
|
+
path: r ? `${e}.${r}` : e,
|
|
1116
|
+
available: p
|
|
1117
|
+
})), C() && j("registry", `resolve-spread "${r || h}"`, `MISSING string ref "${h}" in ${u}`, {
|
|
1118
|
+
lookupKey: h,
|
|
1119
|
+
lookupRegistry: u,
|
|
1120
|
+
available: p
|
|
1121
|
+
}), null;
|
|
1122
|
+
}
|
|
1123
|
+
return Qt() && r && Zt(e, r, "REFERENCE", `reference to ${t}`), { ...l };
|
|
1124
|
+
}
|
|
1125
|
+
if (t && typeof t == "object" && t["..."]) {
|
|
1126
|
+
const y = t["..."], { "...": l, ...u } = t, h = ne(y, o);
|
|
1127
|
+
let p = n, f = e, b = y;
|
|
1128
|
+
h && s && (p = s[h.registry] || {}, f = h.registry, b = h.key);
|
|
1129
|
+
const _ = `${f}.${b}`;
|
|
1130
|
+
if (c.has(_))
|
|
1131
|
+
return a != null && a[b] ? (C() && j("registry", `resolve-spread "${r}"`, `circular ref "${_}" resolved via fallback`, {
|
|
1132
|
+
refKey: _,
|
|
1133
|
+
itemName: r
|
|
1134
|
+
}), { ...a[b], ...u }) : (O.error(`Circular reference detected: ${_} references itself through spread chain. Breaking circular dependency.`), C() && j("registry", `resolve-spread "${r}"`, `CIRCULAR ref "${_}" (breaking chain)`, {
|
|
1135
|
+
refKey: _,
|
|
1136
|
+
visited: [...c],
|
|
1137
|
+
itemName: r
|
|
1138
|
+
}), u);
|
|
1139
|
+
const R = new Set(c);
|
|
1140
|
+
R.add(_);
|
|
1141
|
+
let v = p[b];
|
|
1142
|
+
if (v && typeof v == "object" && v["..."] === b && (a != null && a[b]) && (v = a[b]), !v)
|
|
1143
|
+
return O.warn($t(`${f} spread`, b, {
|
|
1144
|
+
path: r ? `${e}.${r}` : e,
|
|
1145
|
+
available: Object.keys(p)
|
|
1146
|
+
})), C() && j("registry", `resolve-spread "${r}"`, `MISSING base "${b}" in ${f} (using overrides only)`, {
|
|
1147
|
+
itemName: r,
|
|
1148
|
+
lookupKey: b,
|
|
1149
|
+
targetRegistryName: f,
|
|
1150
|
+
available: Object.keys(p),
|
|
1151
|
+
overrideKeys: Object.keys(u)
|
|
1152
|
+
}), u;
|
|
1153
|
+
if (Qt() && r) {
|
|
1154
|
+
const g = Object.keys(u).length;
|
|
1155
|
+
Zt(e, r, "SPREAD", `spread from ${y}, overrides=${g}`);
|
|
1156
|
+
}
|
|
1157
|
+
const m = At(v, p, f, b, {
|
|
1158
|
+
allRegistries: s,
|
|
1159
|
+
fallbackRegistry: a,
|
|
1160
|
+
validRegistries: o,
|
|
1161
|
+
_visited: R
|
|
1162
|
+
});
|
|
1163
|
+
return !m || typeof m != "object" ? (O.warn(`Base definition "${y}" resolved to non-object type ${typeof m}`), u) : { ...m, ...u };
|
|
1164
|
+
}
|
|
1165
|
+
return t;
|
|
1166
|
+
}, re = (t, n = {}, e = {}, r) => {
|
|
1167
|
+
if (!t || typeof t != "object") return t;
|
|
1168
|
+
if (Array.isArray(t))
|
|
1169
|
+
return t.map((c) => re(c, n, e, r));
|
|
1170
|
+
const i = { ...t }, s = t.name || "unknown";
|
|
1171
|
+
if (typeof i.options == "string" && i.options.startsWith("@")) {
|
|
1172
|
+
const c = i.options.slice(1), d = e[c];
|
|
1173
|
+
d && (i.options = d);
|
|
1174
|
+
}
|
|
1175
|
+
const a = ht, o = /* @__PURE__ */ new Set([
|
|
1176
|
+
"validator",
|
|
1177
|
+
"formatter",
|
|
1178
|
+
"parser",
|
|
1179
|
+
"format",
|
|
1180
|
+
"parse",
|
|
1181
|
+
"validate"
|
|
1182
|
+
]);
|
|
1183
|
+
for (const [c, d] of Object.entries(i))
|
|
1184
|
+
if (!c.startsWith("__") && d != null && typeof d == "string" && d.startsWith("{{") && d.endsWith("}}")) {
|
|
1185
|
+
const y = d.replace(/^{{|}}$/g, ""), l = n[y];
|
|
1186
|
+
if (!l) {
|
|
1187
|
+
a(c) && O.warn($t("Function", y, {
|
|
1188
|
+
path: `${s}.${c}`,
|
|
1189
|
+
available: Object.keys(n)
|
|
1190
|
+
})), C() && j("prop", `bind-function "${s}.${c}"`, `"${y}" not found (preserved for late resolution)`, {
|
|
1191
|
+
field: s,
|
|
1192
|
+
property: c,
|
|
1193
|
+
functionName: y,
|
|
1194
|
+
isEventHandler: a(c),
|
|
1195
|
+
availableFunctions: Object.keys(n)
|
|
1196
|
+
}), i[c] = d;
|
|
1197
|
+
continue;
|
|
1198
|
+
}
|
|
1199
|
+
if (typeof l != "function") {
|
|
1200
|
+
O.error(
|
|
1201
|
+
`Security: Expected function but got ${typeof l} for "${y}" at ${s}.${c}. This could indicate a configuration error or attempted code injection.`
|
|
1202
|
+
);
|
|
1203
|
+
continue;
|
|
1204
|
+
}
|
|
1205
|
+
a(c) ? i[c] = (u) => {
|
|
1206
|
+
try {
|
|
1207
|
+
const h = r();
|
|
1208
|
+
if (!h) return;
|
|
1209
|
+
const p = kt(i, () => h, s);
|
|
1210
|
+
return l.call(p, h, u);
|
|
1211
|
+
} catch (h) {
|
|
1212
|
+
return O.error(`Error in event handler "${c}" for "${s}":`, {
|
|
1213
|
+
error: h,
|
|
1214
|
+
function: y,
|
|
1215
|
+
element: s
|
|
1216
|
+
}), !1;
|
|
1217
|
+
}
|
|
1218
|
+
} : o.has(c) ? i[c] = (u, h) => {
|
|
1219
|
+
rn();
|
|
1220
|
+
try {
|
|
1221
|
+
const p = kt(i, () => u, s);
|
|
1222
|
+
return l.call(p, u, h);
|
|
1223
|
+
} catch (p) {
|
|
1224
|
+
O.error(`Error in transform function "${c}" for "${s}":`, {
|
|
1225
|
+
error: p,
|
|
1226
|
+
function: y,
|
|
1227
|
+
element: s
|
|
1228
|
+
});
|
|
1229
|
+
return;
|
|
1230
|
+
} finally {
|
|
1231
|
+
sn();
|
|
1232
|
+
}
|
|
1233
|
+
} : i[c] = d;
|
|
1234
|
+
}
|
|
1235
|
+
if (typeof t.action == "string" && t.action.startsWith("{{") && (i.action = t.action.replace(/^{{|}}$/g, "")), i.fields && typeof i.fields == "object" && !Array.isArray(i.fields)) {
|
|
1236
|
+
const c = {};
|
|
1237
|
+
for (const [d, y] of Object.entries(i.fields))
|
|
1238
|
+
c[d] = re(y, n, e, r);
|
|
1239
|
+
i.fields = c;
|
|
1240
|
+
}
|
|
1241
|
+
return i;
|
|
1242
|
+
}, ln = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), ie = (t, n = {}, e) => {
|
|
1243
|
+
if (!t || typeof t != "object") return t;
|
|
1244
|
+
if (Array.isArray(t))
|
|
1245
|
+
return t.map((i) => ie(i, n, e));
|
|
1246
|
+
const r = {};
|
|
1247
|
+
for (const [i, s] of Object.entries(t)) {
|
|
1248
|
+
if (i.startsWith("__")) {
|
|
1249
|
+
r[i] = s;
|
|
1250
|
+
continue;
|
|
1251
|
+
}
|
|
1252
|
+
if (ln.has(i)) {
|
|
1253
|
+
O.error(
|
|
1254
|
+
`Security: Blocked potential prototype pollution attempt with key "${i}" in record data. This key is not allowed in record objects.`
|
|
1255
|
+
);
|
|
1256
|
+
continue;
|
|
1257
|
+
}
|
|
1258
|
+
if (s && typeof s == "object") {
|
|
1259
|
+
r[i] = ie(s, n, e);
|
|
1260
|
+
continue;
|
|
1261
|
+
}
|
|
1262
|
+
if (typeof s == "string" && s.startsWith("{{") && s.endsWith("}}")) {
|
|
1263
|
+
const a = s.replace(/^{{|}}$/g, ""), o = n[a];
|
|
1264
|
+
if (!o) {
|
|
1265
|
+
O.warn($t("Function", a, {
|
|
1266
|
+
path: `record.data.${i}`,
|
|
1267
|
+
available: Object.keys(n)
|
|
1268
|
+
})), r[i] = s;
|
|
1269
|
+
continue;
|
|
1270
|
+
}
|
|
1271
|
+
if (typeof o != "function") {
|
|
1272
|
+
O.error(
|
|
1273
|
+
`Expected function but got ${typeof o} for "${a}" in record.data.${i}`
|
|
1274
|
+
), r[i] = s;
|
|
1275
|
+
continue;
|
|
1276
|
+
}
|
|
1277
|
+
try {
|
|
1278
|
+
const c = e();
|
|
1279
|
+
r[i] = o(c, { type: "recordInit", key: i });
|
|
1280
|
+
} catch (c) {
|
|
1281
|
+
O.error(`Error evaluating function "${a}" for record.data.${i}:`, c), r[i] = void 0;
|
|
1282
|
+
}
|
|
1283
|
+
} else
|
|
1284
|
+
r[i] = s;
|
|
1285
|
+
}
|
|
1286
|
+
return r;
|
|
1287
|
+
};
|
|
1288
|
+
function Lt(t, n) {
|
|
1289
|
+
const e = n.split(".");
|
|
1290
|
+
let r = t;
|
|
1291
|
+
for (const i of e) {
|
|
1292
|
+
if (r == null) return;
|
|
1293
|
+
r = r[i];
|
|
1294
|
+
}
|
|
1295
|
+
return r;
|
|
1296
|
+
}
|
|
1297
|
+
function Ft(t, n, e) {
|
|
1298
|
+
const r = n.split(".");
|
|
1299
|
+
let i = t;
|
|
1300
|
+
for (let s = 0; s < r.length - 1; s++)
|
|
1301
|
+
i[r[s]] == null && (i[r[s]] = {}), i = i[r[s]];
|
|
1302
|
+
i[r[r.length - 1]] = e;
|
|
1303
|
+
}
|
|
1304
|
+
function mt(t, n, e) {
|
|
1305
|
+
var r, i, s;
|
|
1306
|
+
if (e != null && e.bind) return Lt(t, e.bind);
|
|
1307
|
+
if (e != null && e.path) return Lt((r = t.record) == null ? void 0 : r.data, e.path);
|
|
1308
|
+
if (n)
|
|
1309
|
+
return (s = (i = t.record) == null ? void 0 : i.data) == null ? void 0 : s[n];
|
|
1310
|
+
}
|
|
1311
|
+
function wt(t, n, e, r) {
|
|
1312
|
+
var i, s;
|
|
1313
|
+
if (e != null && e.bind) {
|
|
1314
|
+
Ft(t, e.bind, r);
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
if (e != null && e.path) {
|
|
1318
|
+
(i = t.record) != null && i.data && Ft(t.record.data, e.path, r);
|
|
1319
|
+
return;
|
|
1320
|
+
}
|
|
1321
|
+
n && (s = t.record) != null && s.data && (t.record.data[n] = r);
|
|
1322
|
+
}
|
|
1323
|
+
function xn(t, n) {
|
|
1324
|
+
return n != null && n.bind ? null : n != null && n.path ? n.path : t || null;
|
|
1325
|
+
}
|
|
1326
|
+
function Tn(t, n, e) {
|
|
1327
|
+
var r, i;
|
|
1328
|
+
if (!(e != null && e.bind)) {
|
|
1329
|
+
if (e != null && e.path) {
|
|
1330
|
+
(r = t.record) != null && r.data && Ft(t.record.data, e.path, void 0);
|
|
1331
|
+
return;
|
|
1332
|
+
}
|
|
1333
|
+
n && (i = t.record) != null && i.data && (t.record.data[n] = void 0);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
function se(t) {
|
|
1337
|
+
var n;
|
|
1338
|
+
return t ? {
|
|
1339
|
+
record: t.record,
|
|
1340
|
+
meta: t.meta,
|
|
1341
|
+
state: t.state || {},
|
|
1342
|
+
registries: t.registries,
|
|
1343
|
+
functions: ((n = t.registries) == null ? void 0 : n.functions) || {},
|
|
1344
|
+
form: un(t),
|
|
1345
|
+
props: t.callbacks || {}
|
|
1346
|
+
} : {};
|
|
1347
|
+
}
|
|
1348
|
+
function un(t) {
|
|
1349
|
+
return {
|
|
1350
|
+
getValue: (n) => {
|
|
1351
|
+
var e, r;
|
|
1352
|
+
return t._getFieldValue ? t._getFieldValue(n) : (r = (e = t.record) == null ? void 0 : e.data) == null ? void 0 : r[n];
|
|
1353
|
+
},
|
|
1354
|
+
setValue: (n, e) => {
|
|
1355
|
+
var r;
|
|
1356
|
+
if (t._setFieldValue) return t._setFieldValue(n, e);
|
|
1357
|
+
(r = t.record) != null && r.data && (t.record.data[n] = e);
|
|
1358
|
+
},
|
|
1359
|
+
getState: (n) => {
|
|
1360
|
+
var e;
|
|
1361
|
+
return (e = t.state) == null ? void 0 : e[n];
|
|
1362
|
+
},
|
|
1363
|
+
setState: (n, e) => {
|
|
1364
|
+
t.state && (t.state[n] = e);
|
|
1365
|
+
},
|
|
1366
|
+
get isDirty() {
|
|
1367
|
+
return t.isDirty;
|
|
1368
|
+
},
|
|
1369
|
+
get isSubmitting() {
|
|
1370
|
+
return t.isSubmitting;
|
|
1371
|
+
},
|
|
1372
|
+
get isDeleted() {
|
|
1373
|
+
return t.isDeleted;
|
|
1374
|
+
},
|
|
1375
|
+
getFieldErrors: (n) => {
|
|
1376
|
+
var e;
|
|
1377
|
+
return ((e = t.fieldErrors) == null ? void 0 : e[n]) || [];
|
|
1378
|
+
},
|
|
1379
|
+
setFieldErrors: (n, e) => {
|
|
1380
|
+
t.fieldErrors && (t.fieldErrors[n] = e);
|
|
1381
|
+
},
|
|
1382
|
+
setFieldError: (n, e) => {
|
|
1383
|
+
t.fieldErrors && (t.fieldErrors[n] = Array.isArray(e) ? e : [e]);
|
|
1384
|
+
},
|
|
1385
|
+
clearFieldError: (n) => {
|
|
1386
|
+
t.fieldErrors && (t.fieldErrors[n] = []);
|
|
1387
|
+
},
|
|
1388
|
+
executeAction: t.executeAction,
|
|
1389
|
+
isRequired: (n) => {
|
|
1390
|
+
var e, r, i;
|
|
1391
|
+
return !!((i = (r = (e = t.registries) == null ? void 0 : e.fields) == null ? void 0 : r[n]) != null && i.required);
|
|
1392
|
+
},
|
|
1393
|
+
isReadonly: (n) => {
|
|
1394
|
+
var e, r;
|
|
1395
|
+
return ((r = (e = t.meta) == null ? void 0 : e.readonly) == null ? void 0 : r.includes(n)) || !1;
|
|
1396
|
+
},
|
|
1397
|
+
isSystemField: (n) => {
|
|
1398
|
+
var e, r;
|
|
1399
|
+
return ((r = (e = t.meta) == null ? void 0 : e.systemFields) == null ? void 0 : r.includes(n)) || !1;
|
|
1400
|
+
},
|
|
1401
|
+
getInitialValue: (n) => {
|
|
1402
|
+
var i, s, a, o, c;
|
|
1403
|
+
const e = (s = (i = t.registries) == null ? void 0 : i.fields) == null ? void 0 : s[n], r = e == null ? void 0 : e.path;
|
|
1404
|
+
return r ? Lt((a = t.initialRecord) == null ? void 0 : a.data, r) : (c = (o = t.initialRecord) == null ? void 0 : o.data) == null ? void 0 : c[n];
|
|
1405
|
+
},
|
|
1406
|
+
addGuard: (n) => {
|
|
1407
|
+
var e;
|
|
1408
|
+
return (e = t.addGuard) == null ? void 0 : e.call(t, n);
|
|
1409
|
+
},
|
|
1410
|
+
removeGuard: (n) => {
|
|
1411
|
+
var e;
|
|
1412
|
+
return (e = t.removeGuard) == null ? void 0 : e.call(t, n);
|
|
1413
|
+
},
|
|
1414
|
+
setMap: (n) => {
|
|
1415
|
+
var r;
|
|
1416
|
+
const e = (r = t.callbacks) == null ? void 0 : r.onMapChange;
|
|
1417
|
+
e && e(n || null);
|
|
1418
|
+
}
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
const fn = /* @__PURE__ */ new Set([
|
|
1422
|
+
"script",
|
|
1423
|
+
"iframe",
|
|
1424
|
+
"object",
|
|
1425
|
+
"embed",
|
|
1426
|
+
"applet",
|
|
1427
|
+
"link",
|
|
1428
|
+
"base",
|
|
1429
|
+
"meta",
|
|
1430
|
+
"form",
|
|
1431
|
+
"frame",
|
|
1432
|
+
"frameset",
|
|
1433
|
+
"param"
|
|
1434
|
+
]), dn = (t) => typeof t != "string" || t[0] === t[0].toUpperCase() ? !1 : fn.has(t) ? (C() && j("render", `blocked-element "${t}"`, "BLOCKED for security", { component: t }), !1) : !0;
|
|
1435
|
+
function pn(t, n, e = null) {
|
|
1436
|
+
if (!t || !n)
|
|
1437
|
+
return C() && j("component", "resolve-component-def", "null (no name or no registry)", {
|
|
1438
|
+
componentName: t,
|
|
1439
|
+
hasRegistry: !!n
|
|
1440
|
+
}), null;
|
|
1441
|
+
const r = n[t];
|
|
1442
|
+
if (!r)
|
|
1443
|
+
return C() && j("component", "resolve-component-def", `null ("${t}" not in components registry)`, {
|
|
1444
|
+
componentName: t,
|
|
1445
|
+
availableComponents: Object.keys(n)
|
|
1446
|
+
}), null;
|
|
1447
|
+
const i = At(
|
|
1448
|
+
r,
|
|
1449
|
+
n,
|
|
1450
|
+
"components",
|
|
1451
|
+
t,
|
|
1452
|
+
{
|
|
1453
|
+
allRegistries: e
|
|
1454
|
+
}
|
|
1455
|
+
);
|
|
1456
|
+
return C() && j("component", "resolve-component-def", `found "${t}"`, {
|
|
1457
|
+
componentName: t,
|
|
1458
|
+
hasAdapter: !!(i != null && i._adapter),
|
|
1459
|
+
resolvedKeys: i ? Object.keys(i) : null
|
|
1460
|
+
}), i;
|
|
1461
|
+
}
|
|
1462
|
+
function hn(t) {
|
|
1463
|
+
return t && t._adapter || null;
|
|
1464
|
+
}
|
|
1465
|
+
function E(t, n, e, r) {
|
|
1466
|
+
var l, u, h;
|
|
1467
|
+
if (n == null || typeof n == "function") return n;
|
|
1468
|
+
if (Array.isArray(n)) {
|
|
1469
|
+
const p = n.map((f) => E(t, f, e, r)).filter(Boolean);
|
|
1470
|
+
return p.length === 0 ? void 0 : p.length === 1 ? p[0] : ht(t) ? (f) => {
|
|
1471
|
+
let b;
|
|
1472
|
+
for (const _ of p)
|
|
1473
|
+
b = typeof _ == "function" ? _(f) : _;
|
|
1474
|
+
return b;
|
|
1475
|
+
} : p[p.length - 1];
|
|
1476
|
+
}
|
|
1477
|
+
if (typeof n != "string" || !n.startsWith("{{"))
|
|
1478
|
+
return n;
|
|
1479
|
+
const i = n.slice(2, -2).trim(), s = i.indexOf(":"), a = s === -1 ? i : i.slice(0, s), o = s === -1 ? void 0 : i.slice(s + 1), c = (u = (l = e.registries) == null ? void 0 : l.functions) == null ? void 0 : u[a];
|
|
1480
|
+
if (!c) {
|
|
1481
|
+
O.warn(`Function "${a}" not found for property "${t}"`), C() && j("prop", `resolve-dynamic-prop "${(r == null ? void 0 : r.name) || "?"}.${t}"`, `MISSING function "${a}"`, {
|
|
1482
|
+
field: r == null ? void 0 : r.name,
|
|
1483
|
+
property: t,
|
|
1484
|
+
functionName: a,
|
|
1485
|
+
availableFunctions: Object.keys(((h = e.registries) == null ? void 0 : h.functions) || {})
|
|
1486
|
+
});
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
const d = se(e), y = kt(r, () => d, r == null ? void 0 : r.name);
|
|
1490
|
+
if (ht(t))
|
|
1491
|
+
return C() && j("prop", `resolve-dynamic-prop "${(r == null ? void 0 : r.name) || "?"}.${t}"`, `wrapped event handler "${a}"`, {
|
|
1492
|
+
field: r == null ? void 0 : r.name,
|
|
1493
|
+
property: t,
|
|
1494
|
+
functionName: a
|
|
1495
|
+
}), (p) => {
|
|
1496
|
+
try {
|
|
1497
|
+
return c.call(y, se(e), p, o);
|
|
1498
|
+
} catch (f) {
|
|
1499
|
+
O.error(
|
|
1500
|
+
`Error in event handler ${t} with function ${a}:`,
|
|
1501
|
+
f
|
|
1502
|
+
);
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
};
|
|
1506
|
+
try {
|
|
1507
|
+
const p = c.call(y, d, null, o);
|
|
1508
|
+
return C() && j("prop", `resolve-dynamic-prop "${(r == null ? void 0 : r.name) || "?"}.${t}"`, `${a}() -> ${JSON.stringify(p)}`, {
|
|
1509
|
+
field: r == null ? void 0 : r.name,
|
|
1510
|
+
property: t,
|
|
1511
|
+
functionName: a,
|
|
1512
|
+
result: p
|
|
1513
|
+
}), p;
|
|
1514
|
+
} catch (p) {
|
|
1515
|
+
O.error(
|
|
1516
|
+
`Error resolving ${t} with function ${a}:`,
|
|
1517
|
+
p
|
|
1518
|
+
), C() && j("prop", `resolve-dynamic-prop "${(r == null ? void 0 : r.name) || "?"}.${t}"`, `ERROR in ${a}(): ${p.message}`, {
|
|
1519
|
+
field: r == null ? void 0 : r.name,
|
|
1520
|
+
property: t,
|
|
1521
|
+
functionName: a,
|
|
1522
|
+
error: p.message
|
|
1523
|
+
});
|
|
1524
|
+
return;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
function oe(t, n) {
|
|
1528
|
+
let e = null;
|
|
1529
|
+
for (const r of Object.keys(t))
|
|
1530
|
+
if (ht(r)) {
|
|
1531
|
+
const i = t[r];
|
|
1532
|
+
if (typeof i == "string" || Array.isArray(i)) {
|
|
1533
|
+
const s = E(r, i, n, t);
|
|
1534
|
+
s !== i && (e || (e = { ...t }), e[r] = s);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
return e || t;
|
|
1538
|
+
}
|
|
1539
|
+
function yn(t, n) {
|
|
1540
|
+
if (!t) return !0;
|
|
1541
|
+
if (t.show !== void 0) {
|
|
1542
|
+
const e = !!E("show", t.show, n, t);
|
|
1543
|
+
return C() && j("visibility", `resolve-visibility "${t.name || "?"}"`, e ? "visible" : "hidden", {
|
|
1544
|
+
field: t.name,
|
|
1545
|
+
showValue: t.show,
|
|
1546
|
+
resolved: e
|
|
1547
|
+
}), e;
|
|
1548
|
+
}
|
|
1549
|
+
return !0;
|
|
1550
|
+
}
|
|
1551
|
+
function vn(t, n, e, r, i) {
|
|
1552
|
+
if (typeof t != "string") return t;
|
|
1553
|
+
let s = n[t];
|
|
1554
|
+
const a = !!s;
|
|
1555
|
+
if (s ? s = At(s, e, "fields", t, {
|
|
1556
|
+
allRegistries: i
|
|
1557
|
+
}) : s = e[t], !s)
|
|
1558
|
+
return O.warn(`Field "${t}" not found in registry`), C() && j("layout", `resolve-item "${t}"`, "NOT FOUND (creating empty stub)", {
|
|
1559
|
+
item: t,
|
|
1560
|
+
searchedLocal: Object.keys(n),
|
|
1561
|
+
searchedRegistry: Object.keys(e),
|
|
1562
|
+
parentName: r
|
|
1563
|
+
}), { name: t };
|
|
1564
|
+
const o = a && r ? `${r}.${t}` : t;
|
|
1565
|
+
return C() && j("layout", `resolve-item "${t}"`, `found (${a ? "local" : "registry"})`, {
|
|
1566
|
+
item: t,
|
|
1567
|
+
resolvedName: o,
|
|
1568
|
+
component: s.component,
|
|
1569
|
+
isLocal: a
|
|
1570
|
+
}), { ...s, name: o };
|
|
1571
|
+
}
|
|
1572
|
+
function bn(t, n, e, r, i, s, a = []) {
|
|
1573
|
+
var u, h, p;
|
|
1574
|
+
const o = document.createElement(n), c = e.name;
|
|
1575
|
+
e._componentName && o.setAttribute("data-gst-component", e._componentName);
|
|
1576
|
+
const d = J(() => {
|
|
1577
|
+
var R, v, m;
|
|
1578
|
+
if (i) {
|
|
1579
|
+
const g = E(
|
|
1580
|
+
"class",
|
|
1581
|
+
e.class,
|
|
1582
|
+
r,
|
|
1583
|
+
e
|
|
1584
|
+
);
|
|
1585
|
+
g ? o.setAttribute("class", g) : o.removeAttribute("class");
|
|
1586
|
+
}
|
|
1587
|
+
const f = E("id", e.id, r, e);
|
|
1588
|
+
f && (o.id = f);
|
|
1589
|
+
const b = E("style", e.style, r, e);
|
|
1590
|
+
b && typeof b == "object" && (o.removeAttribute("style"), Object.assign(o.style, b));
|
|
1591
|
+
const _ = E("title", e.title, r, e);
|
|
1592
|
+
if (_ && (o.title = _), n === "a") {
|
|
1593
|
+
const g = E("href", e.href, r, e);
|
|
1594
|
+
g && (o.href = g);
|
|
1595
|
+
const $ = E("target", e.target, r, e);
|
|
1596
|
+
$ && (o.target = $);
|
|
1597
|
+
}
|
|
1598
|
+
if (n === "img") {
|
|
1599
|
+
const g = E("src", e.src, r, e);
|
|
1600
|
+
g && (o.src = g);
|
|
1601
|
+
const $ = E("alt", e.alt, r, e);
|
|
1602
|
+
$ !== void 0 && (o.alt = $);
|
|
1603
|
+
}
|
|
1604
|
+
if (n === "label") {
|
|
1605
|
+
const g = E(
|
|
1606
|
+
"for",
|
|
1607
|
+
e.for,
|
|
1608
|
+
r,
|
|
1609
|
+
e
|
|
1610
|
+
);
|
|
1611
|
+
g && (o.htmlFor = g);
|
|
1612
|
+
}
|
|
1613
|
+
if (n === "input") {
|
|
1614
|
+
e.type && (o.type = e.type), c && (o.name = c);
|
|
1615
|
+
const g = E(
|
|
1616
|
+
"placeholder",
|
|
1617
|
+
e.placeholder,
|
|
1618
|
+
r,
|
|
1619
|
+
e
|
|
1620
|
+
);
|
|
1621
|
+
g && (o.placeholder = g);
|
|
1622
|
+
const $ = !!E(
|
|
1623
|
+
"required",
|
|
1624
|
+
e.required,
|
|
1625
|
+
r,
|
|
1626
|
+
e
|
|
1627
|
+
);
|
|
1628
|
+
o.disabled = !!E(
|
|
1629
|
+
"disabled",
|
|
1630
|
+
e.disabled,
|
|
1631
|
+
r,
|
|
1632
|
+
e
|
|
1633
|
+
), o.readOnly = !!E(
|
|
1634
|
+
"readonly",
|
|
1635
|
+
e.readonly,
|
|
1636
|
+
r,
|
|
1637
|
+
e
|
|
1638
|
+
), o.required = $, $ && o.setAttribute("aria-required", "true");
|
|
1639
|
+
const T = E("autocomplete", e.autocomplete, r, e);
|
|
1640
|
+
if (T && (o.autocomplete = T), (c ? ((R = r.fieldErrors) == null ? void 0 : R[c]) || [] : []).length ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid"), c || e.bind) {
|
|
1641
|
+
const k = mt(r, c, e);
|
|
1642
|
+
e.type === "checkbox" ? o.checked = !!k : o.value = k ?? "";
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
if (n === "textarea") {
|
|
1646
|
+
c && (o.name = c);
|
|
1647
|
+
const g = E("placeholder", e.placeholder, r, e);
|
|
1648
|
+
g && (o.placeholder = g);
|
|
1649
|
+
const $ = !!E("required", e.required, r, e);
|
|
1650
|
+
o.disabled = !!E("disabled", e.disabled, r, e), o.readOnly = !!E("readonly", e.readonly, r, e), o.required = $, $ && o.setAttribute("aria-required", "true"), typeof e.rows == "number" && (o.rows = e.rows), (c || e.bind) && (o.value = mt(r, c, e) ?? ""), (c ? ((v = r.fieldErrors) == null ? void 0 : v[c]) || [] : []).length ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid");
|
|
1651
|
+
}
|
|
1652
|
+
if (n === "select") {
|
|
1653
|
+
c && (o.name = c);
|
|
1654
|
+
const g = !!E(
|
|
1655
|
+
"required",
|
|
1656
|
+
e.required,
|
|
1657
|
+
r,
|
|
1658
|
+
e
|
|
1659
|
+
);
|
|
1660
|
+
o.disabled = !!E(
|
|
1661
|
+
"disabled",
|
|
1662
|
+
e.disabled,
|
|
1663
|
+
r,
|
|
1664
|
+
e
|
|
1665
|
+
), o.required = g, g && o.setAttribute("aria-required", "true");
|
|
1666
|
+
const $ = E("autocomplete", e.autocomplete, r, e);
|
|
1667
|
+
$ && (o.autocomplete = $), (c || e.bind) && (o.value = mt(r, c, e) ?? ""), (c ? ((m = r.fieldErrors) == null ? void 0 : m[c]) || [] : []).length ? o.setAttribute("aria-invalid", "true") : o.removeAttribute("aria-invalid");
|
|
1668
|
+
}
|
|
1669
|
+
if (n === "button") {
|
|
1670
|
+
o.type = e.type || "button";
|
|
1671
|
+
const g = !!E(
|
|
1672
|
+
"disabled",
|
|
1673
|
+
e.disabled,
|
|
1674
|
+
r,
|
|
1675
|
+
e
|
|
1676
|
+
);
|
|
1677
|
+
o.disabled = g, g && o.setAttribute("aria-disabled", "true"), r.isSubmitting && o.setAttribute("aria-busy", "true"), e.variant && o.setAttribute(
|
|
1678
|
+
"class",
|
|
1679
|
+
["btn", `btn-${e.variant}`].filter(Boolean).join(" ")
|
|
1680
|
+
);
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
if (s.push(() => q(d)), (c || e.bind) && (n === "input" || n === "textarea" || n === "select")) {
|
|
1684
|
+
const f = (b) => {
|
|
1685
|
+
const _ = e.type === "checkbox" ? b.target.checked : b.target.value;
|
|
1686
|
+
wt(r, c, e, _);
|
|
1687
|
+
};
|
|
1688
|
+
o.addEventListener(n === "select" ? "change" : "input", f);
|
|
1689
|
+
}
|
|
1690
|
+
if (n === "button" && e.action) {
|
|
1691
|
+
const f = Array.isArray(e.action) ? e.action : [e.action];
|
|
1692
|
+
o.addEventListener("click", async () => {
|
|
1693
|
+
if (r.executeAction)
|
|
1694
|
+
for (const b of f)
|
|
1695
|
+
await r.executeAction(b, { buttonName: c });
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
for (const f of Object.keys(e))
|
|
1699
|
+
if (ht(f)) {
|
|
1700
|
+
const b = E(f, e[f], r, e);
|
|
1701
|
+
if (typeof b == "function") {
|
|
1702
|
+
const _ = f.slice(2).toLowerCase();
|
|
1703
|
+
o.addEventListener(_, b);
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
if (e.innerhtml && O.warn(
|
|
1707
|
+
`Security: innerHTML not allowed. Use innertext or children. Element: ${c || "unnamed"}`
|
|
1708
|
+
), a.length > 0)
|
|
1709
|
+
for (const f of a)
|
|
1710
|
+
o.appendChild(f);
|
|
1711
|
+
const y = a.length === 0 && e.innertext !== void 0, l = n === "button" && e.label;
|
|
1712
|
+
if (y || l) {
|
|
1713
|
+
const f = J(() => {
|
|
1714
|
+
if (y) {
|
|
1715
|
+
const b = E(
|
|
1716
|
+
"innertext",
|
|
1717
|
+
e.innertext,
|
|
1718
|
+
r,
|
|
1719
|
+
e
|
|
1720
|
+
);
|
|
1721
|
+
b !== void 0 && (o.textContent = b);
|
|
1722
|
+
} else l && !o.textContent && (o.textContent = E("label", e.label, r, e));
|
|
1723
|
+
});
|
|
1724
|
+
s.push(() => q(f));
|
|
1725
|
+
}
|
|
1726
|
+
if (n === "select" && e.options) {
|
|
1727
|
+
let f = e.options;
|
|
1728
|
+
if (typeof f == "string") {
|
|
1729
|
+
const _ = f;
|
|
1730
|
+
f = ((h = (u = r.registries) == null ? void 0 : u.optionSets) == null ? void 0 : h[f]) || [], C() && j("registry", `resolve-option-set "${c || "?"}"`, f.length > 0 ? `found "${_}" (${f.length} items)` : `MISSING "${_}" (empty)`, {
|
|
1731
|
+
field: c,
|
|
1732
|
+
optionSetName: _,
|
|
1733
|
+
availableOptionSets: Object.keys(((p = r.registries) == null ? void 0 : p.optionSets) || {}),
|
|
1734
|
+
itemCount: f.length
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
const b = E(
|
|
1738
|
+
"placeholder",
|
|
1739
|
+
e.placeholder,
|
|
1740
|
+
r,
|
|
1741
|
+
e
|
|
1742
|
+
);
|
|
1743
|
+
if (b) {
|
|
1744
|
+
const _ = document.createElement("option");
|
|
1745
|
+
_.value = "", _.textContent = b, o.appendChild(_);
|
|
1746
|
+
}
|
|
1747
|
+
if (Array.isArray(f))
|
|
1748
|
+
for (const _ of f) {
|
|
1749
|
+
const R = document.createElement("option");
|
|
1750
|
+
R.value = typeof _ == "object" ? _.value : _, R.textContent = typeof _ == "object" ? _.label || _.value : _, o.appendChild(R);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
return t.appendChild(o), o;
|
|
1754
|
+
}
|
|
1755
|
+
function gn(t, n, e, r, i) {
|
|
1756
|
+
var y;
|
|
1757
|
+
const s = document.createElement("div"), a = J(() => {
|
|
1758
|
+
const l = E(
|
|
1759
|
+
"class",
|
|
1760
|
+
n.class,
|
|
1761
|
+
e,
|
|
1762
|
+
n
|
|
1763
|
+
), u = Array.isArray(n.rows) || Array.isArray(n.layout), h = E("title", n.title, e, n), p = E(
|
|
1764
|
+
"description",
|
|
1765
|
+
n.description,
|
|
1766
|
+
e,
|
|
1767
|
+
n
|
|
1768
|
+
), b = u || h || p ? [l, "group"].filter(Boolean).join(" ") : l;
|
|
1769
|
+
b ? s.setAttribute("class", b) : s.removeAttribute("class");
|
|
1770
|
+
const _ = E("id", n.id, e, n);
|
|
1771
|
+
_ && (s.id = _);
|
|
1772
|
+
const R = E("style", n.style, e, n);
|
|
1773
|
+
R && typeof R == "object" && (s.removeAttribute("style"), Object.assign(s.style, R));
|
|
1774
|
+
});
|
|
1775
|
+
i.push(() => q(a));
|
|
1776
|
+
const o = E("title", n.title, e, n), c = E(
|
|
1777
|
+
"description",
|
|
1778
|
+
n.description,
|
|
1779
|
+
e,
|
|
1780
|
+
n
|
|
1781
|
+
);
|
|
1782
|
+
if (o || c) {
|
|
1783
|
+
const l = document.createElement("div");
|
|
1784
|
+
if (l.className = "group-header", o) {
|
|
1785
|
+
const u = n.name ? `gst-group-${n.name}-title` : void 0, h = document.createElement("h3");
|
|
1786
|
+
if (h.className = "group-title", u && (h.id = u), h.textContent = o, E(
|
|
1787
|
+
"required",
|
|
1788
|
+
n.required,
|
|
1789
|
+
e,
|
|
1790
|
+
n
|
|
1791
|
+
)) {
|
|
1792
|
+
const f = document.createElement("span");
|
|
1793
|
+
f.className = "required-indicator", f.setAttribute("aria-hidden", "true"), f.textContent = " *", h.appendChild(f);
|
|
1794
|
+
}
|
|
1795
|
+
l.appendChild(h), s.setAttribute("role", "group"), u && s.setAttribute("aria-labelledby", u);
|
|
1796
|
+
}
|
|
1797
|
+
if (c) {
|
|
1798
|
+
const u = document.createElement("p");
|
|
1799
|
+
u.className = "group-description", u.textContent = c, l.appendChild(u);
|
|
1800
|
+
}
|
|
1801
|
+
s.appendChild(l);
|
|
1802
|
+
}
|
|
1803
|
+
for (const l of r)
|
|
1804
|
+
s.appendChild(l);
|
|
1805
|
+
const d = n.buttonset || n.buttonSet;
|
|
1806
|
+
if (Array.isArray(d) && d.length > 0) {
|
|
1807
|
+
const l = document.createElement("div");
|
|
1808
|
+
l.className = "group-buttons";
|
|
1809
|
+
const u = ((y = e.registries) == null ? void 0 : y.buttons) || {};
|
|
1810
|
+
for (const h of d) {
|
|
1811
|
+
let p = typeof h == "string" ? { ...u[h] || {}, name: h } : h;
|
|
1812
|
+
p["..."] && (p = At(
|
|
1813
|
+
p,
|
|
1814
|
+
u,
|
|
1815
|
+
"buttons",
|
|
1816
|
+
p.name,
|
|
1817
|
+
{
|
|
1818
|
+
allRegistries: e.registries
|
|
1819
|
+
}
|
|
1820
|
+
)), yt(
|
|
1821
|
+
l,
|
|
1822
|
+
{ component: "button", ...p },
|
|
1823
|
+
e,
|
|
1824
|
+
i
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
s.appendChild(l);
|
|
1828
|
+
}
|
|
1829
|
+
return t.appendChild(s), s;
|
|
1830
|
+
}
|
|
1831
|
+
function yt(t, n, e, r = [], i = {}) {
|
|
1832
|
+
var b, _, R, v, m;
|
|
1833
|
+
const { isChild: s = !1 } = i, a = n.name && !n.fields && !n.layout && !Array.isArray(n.rows) && !Array.isArray(n.children);
|
|
1834
|
+
let o = n.component || (a ? (b = e.meta) == null ? void 0 : b.defaultComponent : void 0);
|
|
1835
|
+
if (C() && n.name) {
|
|
1836
|
+
const g = n.component ? "explicit" : a && ((_ = e.meta) != null && _.defaultComponent) ? "meta.defaultComponent" : "none";
|
|
1837
|
+
j("component", `resolve-component "${n.name}"`, o || "(none)", {
|
|
1838
|
+
field: n.name,
|
|
1839
|
+
source: g,
|
|
1840
|
+
isLeafField: a,
|
|
1841
|
+
explicitComponent: n.component,
|
|
1842
|
+
defaultComponent: (R = e.meta) == null ? void 0 : R.defaultComponent
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
const c = ((v = e.registries) == null ? void 0 : v.components) || {}, d = ((m = e.registries) == null ? void 0 : m.fields) || {};
|
|
1846
|
+
let y = null, l = n;
|
|
1847
|
+
o && (y = pn(
|
|
1848
|
+
o,
|
|
1849
|
+
c,
|
|
1850
|
+
e.registries
|
|
1851
|
+
), y && (l = {
|
|
1852
|
+
...y,
|
|
1853
|
+
...n,
|
|
1854
|
+
_component: void 0,
|
|
1855
|
+
_adapter: void 0,
|
|
1856
|
+
_componentName: o
|
|
1857
|
+
})), l = an(l);
|
|
1858
|
+
const u = document.createComment(`gst:${l.name || "element"}`);
|
|
1859
|
+
t.appendChild(u);
|
|
1860
|
+
let h = null, p = [];
|
|
1861
|
+
const f = J(() => {
|
|
1862
|
+
if (!yn(l, e)) {
|
|
1863
|
+
if (h) {
|
|
1864
|
+
l.show !== void 0 && e._onHide && e._onHide(l, e), h.remove(), h = null;
|
|
1865
|
+
for (const k of p) k();
|
|
1866
|
+
p = [];
|
|
1867
|
+
}
|
|
1868
|
+
return;
|
|
1869
|
+
}
|
|
1870
|
+
if (h) return;
|
|
1871
|
+
p = [];
|
|
1872
|
+
const $ = document.createDocumentFragment(), T = _n(
|
|
1873
|
+
$,
|
|
1874
|
+
o,
|
|
1875
|
+
l,
|
|
1876
|
+
y,
|
|
1877
|
+
e,
|
|
1878
|
+
d,
|
|
1879
|
+
s,
|
|
1880
|
+
p
|
|
1881
|
+
);
|
|
1882
|
+
T && (u.parentNode.insertBefore(T, u.nextSibling), h = T);
|
|
1883
|
+
});
|
|
1884
|
+
return r.push(() => {
|
|
1885
|
+
q(f);
|
|
1886
|
+
for (const g of p) g();
|
|
1887
|
+
}), h;
|
|
1888
|
+
}
|
|
1889
|
+
function _n(t, n, e, r, i, s, a, o) {
|
|
1890
|
+
var _, R;
|
|
1891
|
+
const c = e.fields || {}, d = e.name, y = e.rows || e.layout;
|
|
1892
|
+
let l = [];
|
|
1893
|
+
if (Array.isArray(y))
|
|
1894
|
+
for (const v of y) {
|
|
1895
|
+
const m = document.createElement("div");
|
|
1896
|
+
if (m.className = e.rowclassname || "row", Array.isArray(v))
|
|
1897
|
+
for (const g of v) {
|
|
1898
|
+
const $ = vn(
|
|
1899
|
+
g,
|
|
1900
|
+
c,
|
|
1901
|
+
s,
|
|
1902
|
+
d,
|
|
1903
|
+
i.registries
|
|
1904
|
+
);
|
|
1905
|
+
yt(m, $, i, o);
|
|
1906
|
+
}
|
|
1907
|
+
l.push(m);
|
|
1908
|
+
}
|
|
1909
|
+
else if (Array.isArray(e.children))
|
|
1910
|
+
for (const v of e.children)
|
|
1911
|
+
if (typeof v == "string")
|
|
1912
|
+
l.push(document.createTextNode(v));
|
|
1913
|
+
else {
|
|
1914
|
+
const m = document.createDocumentFragment();
|
|
1915
|
+
yt(m, v, i, o, { isChild: !0 }), l.push(m);
|
|
1916
|
+
}
|
|
1917
|
+
const u = l.length > 0, h = e.fields || e.layout || Array.isArray(e.rows), p = n ? hn(r) : null;
|
|
1918
|
+
if (p) {
|
|
1919
|
+
C() && j("render", `render-branch "${e.name || n || "?"}"`, "adapter (registered component)", {
|
|
1920
|
+
component: n,
|
|
1921
|
+
name: e.name,
|
|
1922
|
+
isContainer: h,
|
|
1923
|
+
hasContent: u,
|
|
1924
|
+
adapterType: typeof p.mount
|
|
1925
|
+
});
|
|
1926
|
+
const v = oe(e, i);
|
|
1927
|
+
if (!h && !u) {
|
|
1928
|
+
const $ = document.createElement("div"), T = typeof v.type == "string" ? v.type.toLowerCase() : null, V = n == null ? void 0 : n.toLowerCase(), k = T ? `type-${T}` : null, Z = V ? `component-${V}` : null, U = E(
|
|
1929
|
+
"class",
|
|
1930
|
+
v.class,
|
|
1931
|
+
i,
|
|
1932
|
+
v
|
|
1933
|
+
);
|
|
1934
|
+
$.className = [
|
|
1935
|
+
"field",
|
|
1936
|
+
k,
|
|
1937
|
+
Z,
|
|
1938
|
+
U
|
|
1939
|
+
].filter(Boolean).join(" "), v.name && $.setAttribute("data-field", v.name), T && $.setAttribute("data-type", T);
|
|
1940
|
+
const Y = p.mount($, { def: v, store: i });
|
|
1941
|
+
if (o.push(() => {
|
|
1942
|
+
Y != null && Y.unmount && Y.unmount();
|
|
1943
|
+
}), v.value && (v.name || v.bind)) {
|
|
1944
|
+
const bt = J(() => {
|
|
1945
|
+
const et = E("value", v.value, i, v);
|
|
1946
|
+
et !== void 0 && wt(i, v.name, v, et);
|
|
1947
|
+
});
|
|
1948
|
+
o.push(() => q(bt));
|
|
1949
|
+
}
|
|
1950
|
+
return t.appendChild($), $;
|
|
1951
|
+
}
|
|
1952
|
+
const m = document.createElement("div"), g = p.mount(m, {
|
|
1953
|
+
def: v,
|
|
1954
|
+
store: i,
|
|
1955
|
+
children: l
|
|
1956
|
+
});
|
|
1957
|
+
return o.push(() => {
|
|
1958
|
+
g != null && g.unmount && g.unmount();
|
|
1959
|
+
}), t.appendChild(m), m;
|
|
1960
|
+
}
|
|
1961
|
+
const f = n ? (_ = i.components) == null ? void 0 : _[n] : null;
|
|
1962
|
+
if (f) {
|
|
1963
|
+
C() && j("render", `render-branch "${e.name || n || "?"}"`, "builtin (vanilla component)", {
|
|
1964
|
+
component: n,
|
|
1965
|
+
name: e.name
|
|
1966
|
+
});
|
|
1967
|
+
const v = oe(e, i), m = document.createElement("div"), g = typeof v.type == "string" ? v.type.toLowerCase() : null, $ = n == null ? void 0 : n.toLowerCase(), T = g ? `type-${g}` : null, V = $ ? `component-${$}` : null, k = E(
|
|
1968
|
+
"class",
|
|
1969
|
+
v.class,
|
|
1970
|
+
i,
|
|
1971
|
+
v
|
|
1972
|
+
);
|
|
1973
|
+
if (m.className = ["field", T, V, k].filter(Boolean).join(" "), v.name && m.setAttribute("data-field", v.name), g && m.setAttribute("data-type", g), f(m, v, i, o), v.value && (v.name || v.bind)) {
|
|
1974
|
+
const Z = J(() => {
|
|
1975
|
+
const U = E("value", v.value, i, v);
|
|
1976
|
+
U !== void 0 && wt(i, v.name, v, U);
|
|
1977
|
+
});
|
|
1978
|
+
o.push(() => q(Z));
|
|
1979
|
+
}
|
|
1980
|
+
return t.appendChild(m), m;
|
|
1981
|
+
}
|
|
1982
|
+
if (n === "html") {
|
|
1983
|
+
const v = document.createElement("div");
|
|
1984
|
+
e.name && v.setAttribute("data-field", e.name), e.class && (v.className = e.class), e.style && typeof e.style == "object" && Object.assign(v.style, e.style);
|
|
1985
|
+
const m = J(() => {
|
|
1986
|
+
const g = E("content", e.content, i, e) || E("innerhtml", e.innerhtml, i, e) || "";
|
|
1987
|
+
v.innerHTML = g;
|
|
1988
|
+
});
|
|
1989
|
+
return o.push(() => q(m)), t.appendChild(v), v;
|
|
1990
|
+
}
|
|
1991
|
+
if (n && dn(n))
|
|
1992
|
+
return C() && j("render", `render-branch "${e.name || n || "?"}"`, `html-element <${n}>`, {
|
|
1993
|
+
component: n,
|
|
1994
|
+
name: e.name
|
|
1995
|
+
}), bn(
|
|
1996
|
+
t,
|
|
1997
|
+
n,
|
|
1998
|
+
e,
|
|
1999
|
+
i,
|
|
2000
|
+
a,
|
|
2001
|
+
o,
|
|
2002
|
+
l
|
|
2003
|
+
);
|
|
2004
|
+
if (n && !u)
|
|
2005
|
+
return O.warn(`Unknown component: ${n}. Make sure it's registered.`), C() && j("render", `render-branch "${e.name || n || "?"}"`, `UNKNOWN component "${n}" (returning null)`, {
|
|
2006
|
+
component: n,
|
|
2007
|
+
name: e.name,
|
|
2008
|
+
availableComponents: Object.keys(((R = i.registries) == null ? void 0 : R.components) || {}),
|
|
2009
|
+
availableBuiltins: Object.keys(i.components || {})
|
|
2010
|
+
}), null;
|
|
2011
|
+
if (u) {
|
|
2012
|
+
C() && j("render", `render-branch "${e.name || "?"}"`, "group/fragment (has content, no component)", {
|
|
2013
|
+
name: e.name,
|
|
2014
|
+
hasTitle: !!e.title,
|
|
2015
|
+
hasRows: Array.isArray(e.rows) || Array.isArray(e.layout),
|
|
2016
|
+
childCount: l.length
|
|
2017
|
+
});
|
|
2018
|
+
const v = E("title", e.title, i, e), m = E(
|
|
2019
|
+
"description",
|
|
2020
|
+
e.description,
|
|
2021
|
+
i,
|
|
2022
|
+
e
|
|
2023
|
+
), $ = Array.isArray(e.rows) || Array.isArray(e.layout) || v || m;
|
|
2024
|
+
if (e.class || e.style || e.id || $ || e.name)
|
|
2025
|
+
return gn(t, e, i, l, o);
|
|
2026
|
+
for (const V of l)
|
|
2027
|
+
t.appendChild(V);
|
|
2028
|
+
return t.lastElementChild;
|
|
2029
|
+
}
|
|
2030
|
+
C() && j("render", `render-branch "${e.name || "?"}"`, "EMPTY (no component, no content -> empty div)", {
|
|
2031
|
+
name: e.name,
|
|
2032
|
+
def: e
|
|
2033
|
+
});
|
|
2034
|
+
const b = document.createElement("div");
|
|
2035
|
+
return t.appendChild(b), b;
|
|
2036
|
+
}
|
|
2037
|
+
function Nn(t, n, e, r = []) {
|
|
2038
|
+
if (n == null) return r;
|
|
2039
|
+
const i = Array.isArray(n) ? n : [n];
|
|
2040
|
+
for (const s of i)
|
|
2041
|
+
typeof s == "string" ? t.appendChild(document.createTextNode(s)) : typeof s == "object" && yt(t, s, e, r, { isChild: !0 });
|
|
2042
|
+
return r;
|
|
2043
|
+
}
|
|
2044
|
+
function Gt(t) {
|
|
2045
|
+
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2046
|
+
}
|
|
2047
|
+
function En(t) {
|
|
2048
|
+
return Object.entries(t).filter(([n]) => !n.startsWith("@")).map(([n, e]) => ` ${Gt(n)}: ${e};`).join(`
|
|
2049
|
+
`);
|
|
2050
|
+
}
|
|
2051
|
+
function Se(t, n = ":root") {
|
|
2052
|
+
if (!t || Object.keys(t).length === 0) return "";
|
|
2053
|
+
const e = Object.entries(t).map(([r, i]) => ` ${r.startsWith("--") ? r : `--${Gt(r)}`}: ${i};`).join(`
|
|
2054
|
+
`);
|
|
2055
|
+
return `${n} {
|
|
2056
|
+
${e}
|
|
2057
|
+
}`;
|
|
2058
|
+
}
|
|
2059
|
+
function St(t, n = null) {
|
|
2060
|
+
if (!t || Object.keys(t).length === 0) return "";
|
|
2061
|
+
const e = [], r = {};
|
|
2062
|
+
for (const [i, s] of Object.entries(t))
|
|
2063
|
+
if (i.startsWith("@media")) {
|
|
2064
|
+
const a = St(s, n);
|
|
2065
|
+
a && (r[i] = a);
|
|
2066
|
+
} else if (i.startsWith("@")) {
|
|
2067
|
+
const a = typeof s == "object" ? St(s, null) : s;
|
|
2068
|
+
e.push(`${i} {
|
|
2069
|
+
${a}
|
|
2070
|
+
}`);
|
|
2071
|
+
} else {
|
|
2072
|
+
const a = n ? i.split(",").map((c) => {
|
|
2073
|
+
const d = c.trim();
|
|
2074
|
+
return d.startsWith("&") ? `${n}${d.slice(1)}` : `${n} ${d}`;
|
|
2075
|
+
}).join(", ") : i, o = En(s);
|
|
2076
|
+
o && e.push(`${a} {
|
|
2077
|
+
${o}
|
|
2078
|
+
}`);
|
|
2079
|
+
}
|
|
2080
|
+
for (const [i, s] of Object.entries(r))
|
|
2081
|
+
e.push(`${i} {
|
|
2082
|
+
${s}
|
|
2083
|
+
}`);
|
|
2084
|
+
return e.join(`
|
|
2085
|
+
|
|
2086
|
+
`);
|
|
2087
|
+
}
|
|
2088
|
+
function mn() {
|
|
2089
|
+
return "gst-" + Math.random().toString(36).substring(2, 9);
|
|
2090
|
+
}
|
|
2091
|
+
function $n(t, n) {
|
|
2092
|
+
if (!t) return "";
|
|
2093
|
+
const { scoped: e = !0, vars: r, rules: i } = t, s = [], a = e && n ? `[data-gst-scope="${n}"]` : ".gst";
|
|
2094
|
+
if (r) {
|
|
2095
|
+
const c = Se(r, a || ":root");
|
|
2096
|
+
c && s.push(c);
|
|
2097
|
+
}
|
|
2098
|
+
if (i) {
|
|
2099
|
+
const o = St(i, a);
|
|
2100
|
+
o && s.push(o);
|
|
2101
|
+
}
|
|
2102
|
+
return s.join(`
|
|
2103
|
+
|
|
2104
|
+
`);
|
|
2105
|
+
}
|
|
2106
|
+
function wn(t, n) {
|
|
2107
|
+
if (!t || !n) return "";
|
|
2108
|
+
const e = [];
|
|
2109
|
+
for (const [r, i] of Object.entries(t)) {
|
|
2110
|
+
const s = n[r];
|
|
2111
|
+
if (s == null || s === "") continue;
|
|
2112
|
+
const a = String(s).toLowerCase().replace(/[^a-z0-9-_]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2113
|
+
a && (i === !0 ? e.push(`${Gt(r)}-${a}`) : typeof i == "string" && e.push(`${i}-${a}`));
|
|
2114
|
+
}
|
|
2115
|
+
return e.join(" ");
|
|
2116
|
+
}
|
|
2117
|
+
function In(t, n, e) {
|
|
2118
|
+
if (!t || n === void 0 || n === null || n === "" || !e) return "";
|
|
2119
|
+
let r;
|
|
2120
|
+
if (e === !0)
|
|
2121
|
+
r = { [t]: !0 };
|
|
2122
|
+
else if (typeof e == "string")
|
|
2123
|
+
r = { [t]: e };
|
|
2124
|
+
else if (typeof e == "object")
|
|
2125
|
+
r = e;
|
|
2126
|
+
else
|
|
2127
|
+
return "";
|
|
2128
|
+
return wn(r, { [t]: n });
|
|
2129
|
+
}
|
|
2130
|
+
function Sn(t) {
|
|
2131
|
+
let n = 0;
|
|
2132
|
+
for (let e = 0; e < t.length; e++) {
|
|
2133
|
+
const r = t.charCodeAt(e);
|
|
2134
|
+
n = (n << 5) - n + r, n = n & n;
|
|
2135
|
+
}
|
|
2136
|
+
return Math.abs(n).toString(36);
|
|
2137
|
+
}
|
|
2138
|
+
function ae(t, n) {
|
|
2139
|
+
if (typeof document > "u") return null;
|
|
2140
|
+
const e = document.getElementById(n);
|
|
2141
|
+
e && e.remove();
|
|
2142
|
+
const r = `@layer gst-form {
|
|
2143
|
+
${t}
|
|
2144
|
+
}`, i = document.createElement("style");
|
|
2145
|
+
return i.id = n, i.textContent = r, document.head.appendChild(i), i;
|
|
2146
|
+
}
|
|
2147
|
+
function ce(t) {
|
|
2148
|
+
if (typeof document > "u") return;
|
|
2149
|
+
const n = document.getElementById(t);
|
|
2150
|
+
n && n.remove();
|
|
2151
|
+
}
|
|
2152
|
+
function Vn(t) {
|
|
2153
|
+
if (typeof document > "u") return { id: null, styleEl: null };
|
|
2154
|
+
const e = `gst-styles-${Sn(t)}`, r = document.getElementById(e);
|
|
2155
|
+
if (r) {
|
|
2156
|
+
const a = parseInt(r.dataset.gstRefCount || "1", 10);
|
|
2157
|
+
return r.dataset.gstRefCount = String(a + 1), { id: e, styleEl: r };
|
|
2158
|
+
}
|
|
2159
|
+
const i = `@layer gst-form {
|
|
2160
|
+
${t}
|
|
2161
|
+
}`, s = document.createElement("style");
|
|
2162
|
+
return s.id = e, s.dataset.gstRefCount = "1", s.textContent = i, document.head.appendChild(s), { id: e, styleEl: s };
|
|
2163
|
+
}
|
|
2164
|
+
function kn(t) {
|
|
2165
|
+
if (typeof document > "u" || !t) return;
|
|
2166
|
+
const n = document.getElementById(t);
|
|
2167
|
+
if (!n) return;
|
|
2168
|
+
const e = parseInt(n.dataset.gstRefCount || "1", 10);
|
|
2169
|
+
e <= 1 ? n.remove() : n.dataset.gstRefCount = String(e - 1);
|
|
2170
|
+
}
|
|
2171
|
+
function tt(t, n, e) {
|
|
2172
|
+
if (!t || !n || !e) return "";
|
|
2173
|
+
const r = [];
|
|
2174
|
+
for (const [i, s] of Object.entries(t)) {
|
|
2175
|
+
if (!s || typeof s != "object" || !s.styles) continue;
|
|
2176
|
+
const { styles: a } = s;
|
|
2177
|
+
if (typeof a != "object") continue;
|
|
2178
|
+
const { scoped: o = !0, vars: c, dynamicClasses: d, __source: y, ...l } = a, u = a.rules || l, h = o ? `[data-gst-scope="${n}"] [data-${e}="${i}"]` : `.gst [data-${e}="${i}"]`;
|
|
2179
|
+
if (c && Object.keys(c).length > 0) {
|
|
2180
|
+
const f = Se(c, h || ":root");
|
|
2181
|
+
f && r.push(f);
|
|
2182
|
+
}
|
|
2183
|
+
if (u && Object.keys(u).length > 0) {
|
|
2184
|
+
const p = St(u, h);
|
|
2185
|
+
p && r.push(p);
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
return r.join(`
|
|
2189
|
+
|
|
2190
|
+
`);
|
|
2191
|
+
}
|
|
2192
|
+
function Ln(t, n) {
|
|
2193
|
+
return tt(t, n, "gst-component");
|
|
2194
|
+
}
|
|
2195
|
+
function Fn(t, n) {
|
|
2196
|
+
return tt(t, n, "field");
|
|
2197
|
+
}
|
|
2198
|
+
function Mn(t, n) {
|
|
2199
|
+
return tt(t, n, "button");
|
|
2200
|
+
}
|
|
2201
|
+
const An = { key: null, data: {} };
|
|
2202
|
+
function Pn(t, n, e = {}) {
|
|
2203
|
+
var k, Z, U, Y, bt, et, Ut, Yt, Jt;
|
|
2204
|
+
const {
|
|
2205
|
+
record: r = { ...An },
|
|
2206
|
+
components: i = {},
|
|
2207
|
+
onAction: s,
|
|
2208
|
+
onChange: a,
|
|
2209
|
+
onMapChange: o,
|
|
2210
|
+
initialState: c = {},
|
|
2211
|
+
effects: d = [],
|
|
2212
|
+
setupActions: y,
|
|
2213
|
+
onMount: l,
|
|
2214
|
+
onUnmount: u,
|
|
2215
|
+
onHide: h
|
|
2216
|
+
} = e, p = mn();
|
|
2217
|
+
Ae(n.meta);
|
|
2218
|
+
const f = /* @__PURE__ */ zt({
|
|
2219
|
+
// Static config
|
|
2220
|
+
meta: n.meta || {},
|
|
2221
|
+
registries: n.registries || {},
|
|
2222
|
+
actions: n.actions || {},
|
|
2223
|
+
// Component renderers
|
|
2224
|
+
components: i,
|
|
2225
|
+
// Dynamic state
|
|
2226
|
+
record: r,
|
|
2227
|
+
state: n.state || {},
|
|
2228
|
+
// Callbacks
|
|
2229
|
+
callbacks: { onAction: s, onChange: a, onMapChange: o },
|
|
2230
|
+
// Domain-specific state (forms: fieldErrors, isDirty, etc.)
|
|
2231
|
+
...c
|
|
2232
|
+
}), b = [];
|
|
2233
|
+
f.addGuard = (w) => (b.push(w), () => {
|
|
2234
|
+
const x = b.indexOf(w);
|
|
2235
|
+
x !== -1 && b.splice(x, 1);
|
|
2236
|
+
}), f.removeGuard = (w) => {
|
|
2237
|
+
const x = b.indexOf(w);
|
|
2238
|
+
x !== -1 && b.splice(x, 1);
|
|
2239
|
+
}, f._guards = b, f._getFieldValue = (w) => {
|
|
2240
|
+
var K, L;
|
|
2241
|
+
const x = (L = (K = f.registries) == null ? void 0 : K.fields) == null ? void 0 : L[w];
|
|
2242
|
+
return mt(f, w, x);
|
|
2243
|
+
}, f._setFieldValue = (w, x) => {
|
|
2244
|
+
var L, gt;
|
|
2245
|
+
const K = (gt = (L = f.registries) == null ? void 0 : L.fields) == null ? void 0 : gt[w];
|
|
2246
|
+
wt(f, w, K, x);
|
|
2247
|
+
}, f._scopeId = p, h && (f._onHide = h), y ? y(f, e) : s && (f.executeAction = async (w, x = {}) => {
|
|
2248
|
+
await s({
|
|
2249
|
+
action: w,
|
|
2250
|
+
record: f.record,
|
|
2251
|
+
meta: f.meta,
|
|
2252
|
+
registries: f.registries,
|
|
2253
|
+
...x
|
|
2254
|
+
});
|
|
2255
|
+
}), t.setAttribute("data-gst-scope", p), t.classList.contains("gst") || t.classList.add("gst"), t.setAttribute("role", "form");
|
|
2256
|
+
const _ = (k = n.meta) == null ? void 0 : k.title;
|
|
2257
|
+
_ && t.setAttribute("aria-label", _);
|
|
2258
|
+
let R = null;
|
|
2259
|
+
if (n.styles) {
|
|
2260
|
+
const w = $n(n.styles, p);
|
|
2261
|
+
w && (R = `gst-styles-${p}`, ae(w, R));
|
|
2262
|
+
}
|
|
2263
|
+
let v = null;
|
|
2264
|
+
const m = [
|
|
2265
|
+
tt(
|
|
2266
|
+
((Z = n.registries) == null ? void 0 : Z.components) || {},
|
|
2267
|
+
p,
|
|
2268
|
+
"gst-component"
|
|
2269
|
+
),
|
|
2270
|
+
tt(((U = n.registries) == null ? void 0 : U.fields) || {}, p, "field"),
|
|
2271
|
+
tt(((Y = n.registries) == null ? void 0 : Y.buttons) || {}, p, "button")
|
|
2272
|
+
].filter(Boolean).join(`
|
|
2273
|
+
|
|
2274
|
+
`);
|
|
2275
|
+
m && (v = `gst-registry-styles-${p}`, ae(m, v));
|
|
2276
|
+
const g = [], $ = n.layout || [];
|
|
2277
|
+
C() && j("mount", "mount-begin", `${$.length} layout items`, {
|
|
2278
|
+
title: (bt = n.meta) == null ? void 0 : bt.title,
|
|
2279
|
+
fieldCount: Object.keys(((et = n.registries) == null ? void 0 : et.fields) || {}).length,
|
|
2280
|
+
componentCount: Object.keys(((Ut = n.registries) == null ? void 0 : Ut.components) || {}).length,
|
|
2281
|
+
functionCount: Object.keys(((Yt = n.registries) == null ? void 0 : Yt.functions) || {}).length,
|
|
2282
|
+
hasStyles: !!n.styles,
|
|
2283
|
+
debugLevel: (Jt = n.meta) == null ? void 0 : Jt.debug
|
|
2284
|
+
});
|
|
2285
|
+
for (const w of $) {
|
|
2286
|
+
const x = Array.isArray(w) ? { rows: [w] } : w;
|
|
2287
|
+
yt(t, x, f, g);
|
|
2288
|
+
}
|
|
2289
|
+
const T = d.map((w) => w(f, e)), V = {
|
|
2290
|
+
update(w) {
|
|
2291
|
+
f.record.key = w.key ?? null;
|
|
2292
|
+
const x = w.data || {}, K = f.record.data;
|
|
2293
|
+
for (const L of Object.keys(K))
|
|
2294
|
+
L in x || delete K[L];
|
|
2295
|
+
for (const [L, gt] of Object.entries(x))
|
|
2296
|
+
K[L] = gt;
|
|
2297
|
+
},
|
|
2298
|
+
async executeAction(w, x = {}) {
|
|
2299
|
+
if (f.executeAction)
|
|
2300
|
+
return f.executeAction(w, x);
|
|
2301
|
+
},
|
|
2302
|
+
checkGuards() {
|
|
2303
|
+
for (const w of b) {
|
|
2304
|
+
const x = w();
|
|
2305
|
+
if (x === !1 || typeof x == "string") return x;
|
|
2306
|
+
}
|
|
2307
|
+
return !0;
|
|
2308
|
+
},
|
|
2309
|
+
unmount() {
|
|
2310
|
+
u && u(f), b.length = 0;
|
|
2311
|
+
for (const w of g) w();
|
|
2312
|
+
for (const w of T)
|
|
2313
|
+
w && q(w);
|
|
2314
|
+
R && ce(R), v && ce(v), t.innerHTML = "", t.removeAttribute("data-gst-scope"), t.removeAttribute("role"), t.removeAttribute("aria-label"), t.classList.remove("gst");
|
|
2315
|
+
},
|
|
2316
|
+
store: f
|
|
2317
|
+
};
|
|
2318
|
+
return l && l(f, V), V;
|
|
2319
|
+
}
|
|
2320
|
+
export {
|
|
2321
|
+
tt as A,
|
|
2322
|
+
$n as B,
|
|
2323
|
+
zt as C,
|
|
2324
|
+
jn as D,
|
|
2325
|
+
ce as E,
|
|
2326
|
+
kn as F,
|
|
2327
|
+
yt as G,
|
|
2328
|
+
Nn as H,
|
|
2329
|
+
ie as I,
|
|
2330
|
+
At as J,
|
|
2331
|
+
Ft as K,
|
|
2332
|
+
wt as L,
|
|
2333
|
+
q as M,
|
|
2334
|
+
A as N,
|
|
2335
|
+
se as a,
|
|
2336
|
+
re as b,
|
|
2337
|
+
Tn as c,
|
|
2338
|
+
Rn as d,
|
|
2339
|
+
kt as e,
|
|
2340
|
+
J as f,
|
|
2341
|
+
Cn as g,
|
|
2342
|
+
rn as h,
|
|
2343
|
+
sn as i,
|
|
2344
|
+
wn as j,
|
|
2345
|
+
In as k,
|
|
2346
|
+
mn as l,
|
|
2347
|
+
Lt as m,
|
|
2348
|
+
mt as n,
|
|
2349
|
+
xn as o,
|
|
2350
|
+
ae as p,
|
|
2351
|
+
Vn as q,
|
|
2352
|
+
ht as r,
|
|
2353
|
+
Pn as s,
|
|
2354
|
+
an as t,
|
|
2355
|
+
on as u,
|
|
2356
|
+
ne as v,
|
|
2357
|
+
Ve as w,
|
|
2358
|
+
Mn as x,
|
|
2359
|
+
Ln as y,
|
|
2360
|
+
Fn as z
|
|
2361
|
+
};
|
|
2362
|
+
//# sourceMappingURL=core-ovxYfJ25.js.map
|