@chamn/render 0.0.1-beta.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.
Files changed (50) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +30 -0
  3. package/.prettierrc.json +7 -0
  4. package/LICENSE +201 -0
  5. package/__tests__/demo.test.ts +3 -0
  6. package/build.config.js +20 -0
  7. package/dist/commonComponent/index.d.ts +12 -0
  8. package/dist/const/index.d.ts +2 -0
  9. package/dist/core/ReactErrorBoundary.d.ts +26 -0
  10. package/dist/core/adapter.d.ts +64 -0
  11. package/dist/core/adapterReact.d.ts +108 -0
  12. package/dist/core/designReactRender.d.ts +47 -0
  13. package/dist/core/refManager.d.ts +7 -0
  14. package/dist/core/render.d.ts +32 -0
  15. package/dist/core/storeManager.d.ts +11 -0
  16. package/dist/core/type.d.ts +9 -0
  17. package/dist/index.cjs.js +16 -0
  18. package/dist/index.cjs.js.map +1 -0
  19. package/dist/index.d.ts +5 -0
  20. package/dist/index.es.js +4432 -0
  21. package/dist/index.es.js.map +1 -0
  22. package/dist/util/assetsLoader.d.ts +15 -0
  23. package/dist/util/index.d.ts +17 -0
  24. package/dist/vite-env.d.ts +1 -0
  25. package/dist/vite.svg +1 -0
  26. package/index.html +16 -0
  27. package/jest.config.js +196 -0
  28. package/package.json +42 -0
  29. package/public/vite.svg +1 -0
  30. package/src/_dev_/components.tsx +12 -0
  31. package/src/_dev_/dev.tsx +12 -0
  32. package/src/_dev_/index.css +13 -0
  33. package/src/_dev_/page/DesignerRenderDemo.tsx +65 -0
  34. package/src/_dev_/page/RenderDemo.tsx +60 -0
  35. package/src/_dev_/router.tsx +15 -0
  36. package/src/commonComponent/index.tsx +184 -0
  37. package/src/const/index.ts +5 -0
  38. package/src/core/ReactErrorBoundary.ts +91 -0
  39. package/src/core/adapter.ts +133 -0
  40. package/src/core/adapterReact.ts +734 -0
  41. package/src/core/designReactRender.ts +325 -0
  42. package/src/core/refManager.ts +18 -0
  43. package/src/core/render.ts +123 -0
  44. package/src/core/storeManager.ts +57 -0
  45. package/src/core/type.ts +10 -0
  46. package/src/index.ts +5 -0
  47. package/src/util/assetsLoader.ts +72 -0
  48. package/src/util/index.ts +129 -0
  49. package/src/vite-env.d.ts +1 -0
  50. package/tsconfig.json +26 -0
@@ -0,0 +1,4432 @@
1
+ var ea = Object.defineProperty;
2
+ var ra = (t, e, r) => e in t ? ea(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var g = (t, e, r) => (ra(t, typeof e != "symbol" ? e + "" : e, r), r);
4
+ import w, { Component as na, createElement as oa, useEffect as aa, useRef as Dn, useMemo as sa } from "react";
5
+ import * as ia from "react-dom";
6
+ const ca = (t) => () => {
7
+ console.warn(`${t} need to be implement getComponent`);
8
+ }, ua = ["customPageRootRender"], Dr = [
9
+ "pageRender",
10
+ "render",
11
+ "convertModelToComponent",
12
+ "getComponent",
13
+ "getContext",
14
+ "getUtils",
15
+ "getDataLink",
16
+ "createDataLink",
17
+ "transformProps",
18
+ "transformData",
19
+ "transformGlobalData",
20
+ "errorCatch",
21
+ "clear"
22
+ ], la = (t) => [...Dr, ...ua].reduce((r, n) => {
23
+ var o;
24
+ return t != null && t[n] ? r[n] = (o = t[n]) == null ? void 0 : o.bind(t) : Dr.includes(n) && (r[n] = ca), r;
25
+ }, {});
26
+ var fa = Object.defineProperty, pa = (t, e, r) => e in t ? fa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, _ = (t, e, r) => (pa(t, typeof e != "symbol" ? e + "" : e, r), r), da = typeof global == "object" && global && global.Object === Object && global;
27
+ const Rn = da;
28
+ var ha = typeof self == "object" && self && self.Object === Object && self, va = Rn || ha || Function("return this")();
29
+ const Y = va;
30
+ var ma = Y.Symbol;
31
+ const z = ma;
32
+ var In = Object.prototype, ya = In.hasOwnProperty, ga = In.toString, Bt = z ? z.toStringTag : void 0;
33
+ function ba(t) {
34
+ var e = ya.call(t, Bt), r = t[Bt];
35
+ try {
36
+ t[Bt] = void 0;
37
+ var n = !0;
38
+ } catch {
39
+ }
40
+ var o = ga.call(t);
41
+ return n && (e ? t[Bt] = r : delete t[Bt]), o;
42
+ }
43
+ var _a = Object.prototype, ja = _a.toString;
44
+ function wa(t) {
45
+ return ja.call(t);
46
+ }
47
+ var Sa = "[object Null]", Oa = "[object Undefined]", Rr = z ? z.toStringTag : void 0;
48
+ function pt(t) {
49
+ return t == null ? t === void 0 ? Oa : Sa : Rr && Rr in Object(t) ? ba(t) : wa(t);
50
+ }
51
+ function Q(t) {
52
+ return t != null && typeof t == "object";
53
+ }
54
+ var Ca = "[object Symbol]";
55
+ function Ke(t) {
56
+ return typeof t == "symbol" || Q(t) && pt(t) == Ca;
57
+ }
58
+ function Ze(t, e) {
59
+ for (var r = -1, n = t == null ? 0 : t.length, o = Array(n); ++r < n; )
60
+ o[r] = e(t[r], r, t);
61
+ return o;
62
+ }
63
+ var Ea = Array.isArray;
64
+ const M = Ea;
65
+ var xa = 1 / 0, Ir = z ? z.prototype : void 0, Lr = Ir ? Ir.toString : void 0;
66
+ function Ln(t) {
67
+ if (typeof t == "string")
68
+ return t;
69
+ if (M(t))
70
+ return Ze(t, Ln) + "";
71
+ if (Ke(t))
72
+ return Lr ? Lr.call(t) : "";
73
+ var e = t + "";
74
+ return e == "0" && 1 / t == -xa ? "-0" : e;
75
+ }
76
+ function J(t) {
77
+ var e = typeof t;
78
+ return t != null && (e == "object" || e == "function");
79
+ }
80
+ function tr(t) {
81
+ return t;
82
+ }
83
+ var Na = "[object AsyncFunction]", $a = "[object Function]", Ta = "[object GeneratorFunction]", Aa = "[object Proxy]";
84
+ function er(t) {
85
+ if (!J(t))
86
+ return !1;
87
+ var e = pt(t);
88
+ return e == $a || e == Ta || e == Na || e == Aa;
89
+ }
90
+ var Ma = Y["__core-js_shared__"];
91
+ const xe = Ma;
92
+ var Fr = function() {
93
+ var t = /[^.]+$/.exec(xe && xe.keys && xe.keys.IE_PROTO || "");
94
+ return t ? "Symbol(src)_1." + t : "";
95
+ }();
96
+ function Pa(t) {
97
+ return !!Fr && Fr in t;
98
+ }
99
+ var Da = Function.prototype, Ra = Da.toString;
100
+ function dt(t) {
101
+ if (t != null) {
102
+ try {
103
+ return Ra.call(t);
104
+ } catch {
105
+ }
106
+ try {
107
+ return t + "";
108
+ } catch {
109
+ }
110
+ }
111
+ return "";
112
+ }
113
+ var Ia = /[\\^$.*+?()[\]{}|]/g, La = /^\[object .+?Constructor\]$/, Fa = Function.prototype, Ba = Object.prototype, Ua = Fa.toString, ka = Ba.hasOwnProperty, za = RegExp(
114
+ "^" + Ua.call(ka).replace(Ia, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
115
+ );
116
+ function Ga(t) {
117
+ if (!J(t) || Pa(t))
118
+ return !1;
119
+ var e = er(t) ? za : La;
120
+ return e.test(dt(t));
121
+ }
122
+ function Ha(t, e) {
123
+ return t == null ? void 0 : t[e];
124
+ }
125
+ function ht(t, e) {
126
+ var r = Ha(t, e);
127
+ return Ga(r) ? r : void 0;
128
+ }
129
+ var Va = ht(Y, "WeakMap");
130
+ const Re = Va;
131
+ var Br = Object.create, Wa = function() {
132
+ function t() {
133
+ }
134
+ return function(e) {
135
+ if (!J(e))
136
+ return {};
137
+ if (Br)
138
+ return Br(e);
139
+ t.prototype = e;
140
+ var r = new t();
141
+ return t.prototype = void 0, r;
142
+ };
143
+ }();
144
+ const Ja = Wa;
145
+ function qa(t, e, r) {
146
+ switch (r.length) {
147
+ case 0:
148
+ return t.call(e);
149
+ case 1:
150
+ return t.call(e, r[0]);
151
+ case 2:
152
+ return t.call(e, r[0], r[1]);
153
+ case 3:
154
+ return t.call(e, r[0], r[1], r[2]);
155
+ }
156
+ return t.apply(e, r);
157
+ }
158
+ function Qa() {
159
+ }
160
+ function Fn(t, e) {
161
+ var r = -1, n = t.length;
162
+ for (e || (e = Array(n)); ++r < n; )
163
+ e[r] = t[r];
164
+ return e;
165
+ }
166
+ var Ya = 800, Xa = 16, Ka = Date.now;
167
+ function Za(t) {
168
+ var e = 0, r = 0;
169
+ return function() {
170
+ var n = Ka(), o = Xa - (n - r);
171
+ if (r = n, o > 0) {
172
+ if (++e >= Ya)
173
+ return arguments[0];
174
+ } else
175
+ e = 0;
176
+ return t.apply(void 0, arguments);
177
+ };
178
+ }
179
+ function ts(t) {
180
+ return function() {
181
+ return t;
182
+ };
183
+ }
184
+ var es = function() {
185
+ try {
186
+ var t = ht(Object, "defineProperty");
187
+ return t({}, "", {}), t;
188
+ } catch {
189
+ }
190
+ }();
191
+ const ce = es;
192
+ var rs = ce ? function(t, e) {
193
+ return ce(t, "toString", {
194
+ configurable: !0,
195
+ enumerable: !1,
196
+ value: ts(e),
197
+ writable: !0
198
+ });
199
+ } : tr;
200
+ const ns = rs;
201
+ var os = Za(ns);
202
+ const Bn = os;
203
+ function as(t, e) {
204
+ for (var r = -1, n = t == null ? 0 : t.length; ++r < n && e(t[r], r, t) !== !1; )
205
+ ;
206
+ return t;
207
+ }
208
+ function ss(t, e, r, n) {
209
+ for (var o = t.length, a = r + (n ? 1 : -1); n ? a-- : ++a < o; )
210
+ if (e(t[a], a, t))
211
+ return a;
212
+ return -1;
213
+ }
214
+ function is(t) {
215
+ return t !== t;
216
+ }
217
+ function cs(t, e, r) {
218
+ for (var n = r - 1, o = t.length; ++n < o; )
219
+ if (t[n] === e)
220
+ return n;
221
+ return -1;
222
+ }
223
+ function us(t, e, r) {
224
+ return e === e ? cs(t, e, r) : ss(t, is, r);
225
+ }
226
+ function ls(t, e) {
227
+ var r = t == null ? 0 : t.length;
228
+ return !!r && us(t, e, 0) > -1;
229
+ }
230
+ var fs = 9007199254740991, ps = /^(?:0|[1-9]\d*)$/;
231
+ function de(t, e) {
232
+ var r = typeof t;
233
+ return e = e == null ? fs : e, !!e && (r == "number" || r != "symbol" && ps.test(t)) && t > -1 && t % 1 == 0 && t < e;
234
+ }
235
+ function rr(t, e, r) {
236
+ e == "__proto__" && ce ? ce(t, e, {
237
+ configurable: !0,
238
+ enumerable: !0,
239
+ value: r,
240
+ writable: !0
241
+ }) : t[e] = r;
242
+ }
243
+ function Zt(t, e) {
244
+ return t === e || t !== t && e !== e;
245
+ }
246
+ var ds = Object.prototype, hs = ds.hasOwnProperty;
247
+ function nr(t, e, r) {
248
+ var n = t[e];
249
+ (!(hs.call(t, e) && Zt(n, r)) || r === void 0 && !(e in t)) && rr(t, e, r);
250
+ }
251
+ function xt(t, e, r, n) {
252
+ var o = !r;
253
+ r || (r = {});
254
+ for (var a = -1, i = e.length; ++a < i; ) {
255
+ var s = e[a], c = n ? n(r[s], t[s], s, r, t) : void 0;
256
+ c === void 0 && (c = t[s]), o ? rr(r, s, c) : nr(r, s, c);
257
+ }
258
+ return r;
259
+ }
260
+ var Ur = Math.max;
261
+ function Un(t, e, r) {
262
+ return e = Ur(e === void 0 ? t.length - 1 : e, 0), function() {
263
+ for (var n = arguments, o = -1, a = Ur(n.length - e, 0), i = Array(a); ++o < a; )
264
+ i[o] = n[e + o];
265
+ o = -1;
266
+ for (var s = Array(e + 1); ++o < e; )
267
+ s[o] = n[o];
268
+ return s[e] = r(i), qa(t, this, s);
269
+ };
270
+ }
271
+ function kn(t, e) {
272
+ return Bn(Un(t, e, tr), t + "");
273
+ }
274
+ var vs = 9007199254740991;
275
+ function or(t) {
276
+ return typeof t == "number" && t > -1 && t % 1 == 0 && t <= vs;
277
+ }
278
+ function he(t) {
279
+ return t != null && or(t.length) && !er(t);
280
+ }
281
+ function ms(t, e, r) {
282
+ if (!J(r))
283
+ return !1;
284
+ var n = typeof e;
285
+ return (n == "number" ? he(r) && de(e, r.length) : n == "string" && e in r) ? Zt(r[e], t) : !1;
286
+ }
287
+ function ys(t) {
288
+ return kn(function(e, r) {
289
+ var n = -1, o = r.length, a = o > 1 ? r[o - 1] : void 0, i = o > 2 ? r[2] : void 0;
290
+ for (a = t.length > 3 && typeof a == "function" ? (o--, a) : void 0, i && ms(r[0], r[1], i) && (a = o < 3 ? void 0 : a, o = 1), e = Object(e); ++n < o; ) {
291
+ var s = r[n];
292
+ s && t(e, s, n, a);
293
+ }
294
+ return e;
295
+ });
296
+ }
297
+ var gs = Object.prototype;
298
+ function ar(t) {
299
+ var e = t && t.constructor, r = typeof e == "function" && e.prototype || gs;
300
+ return t === r;
301
+ }
302
+ function bs(t, e) {
303
+ for (var r = -1, n = Array(t); ++r < t; )
304
+ n[r] = e(r);
305
+ return n;
306
+ }
307
+ var _s = "[object Arguments]";
308
+ function kr(t) {
309
+ return Q(t) && pt(t) == _s;
310
+ }
311
+ var zn = Object.prototype, js = zn.hasOwnProperty, ws = zn.propertyIsEnumerable, Ss = kr(function() {
312
+ return arguments;
313
+ }()) ? kr : function(t) {
314
+ return Q(t) && js.call(t, "callee") && !ws.call(t, "callee");
315
+ };
316
+ const Vt = Ss;
317
+ function Os() {
318
+ return !1;
319
+ }
320
+ var Gn = typeof exports == "object" && exports && !exports.nodeType && exports, zr = Gn && typeof module == "object" && module && !module.nodeType && module, Cs = zr && zr.exports === Gn, Gr = Cs ? Y.Buffer : void 0, Es = Gr ? Gr.isBuffer : void 0, xs = Es || Os;
321
+ const Wt = xs;
322
+ var Ns = "[object Arguments]", $s = "[object Array]", Ts = "[object Boolean]", As = "[object Date]", Ms = "[object Error]", Ps = "[object Function]", Ds = "[object Map]", Rs = "[object Number]", Is = "[object Object]", Ls = "[object RegExp]", Fs = "[object Set]", Bs = "[object String]", Us = "[object WeakMap]", ks = "[object ArrayBuffer]", zs = "[object DataView]", Gs = "[object Float32Array]", Hs = "[object Float64Array]", Vs = "[object Int8Array]", Ws = "[object Int16Array]", Js = "[object Int32Array]", qs = "[object Uint8Array]", Qs = "[object Uint8ClampedArray]", Ys = "[object Uint16Array]", Xs = "[object Uint32Array]", x = {};
323
+ x[Gs] = x[Hs] = x[Vs] = x[Ws] = x[Js] = x[qs] = x[Qs] = x[Ys] = x[Xs] = !0;
324
+ x[Ns] = x[$s] = x[ks] = x[Ts] = x[zs] = x[As] = x[Ms] = x[Ps] = x[Ds] = x[Rs] = x[Is] = x[Ls] = x[Fs] = x[Bs] = x[Us] = !1;
325
+ function Ks(t) {
326
+ return Q(t) && or(t.length) && !!x[pt(t)];
327
+ }
328
+ function sr(t) {
329
+ return function(e) {
330
+ return t(e);
331
+ };
332
+ }
333
+ var Hn = typeof exports == "object" && exports && !exports.nodeType && exports, kt = Hn && typeof module == "object" && module && !module.nodeType && module, Zs = kt && kt.exports === Hn, Ne = Zs && Rn.process, ti = function() {
334
+ try {
335
+ var t = kt && kt.require && kt.require("util").types;
336
+ return t || Ne && Ne.binding && Ne.binding("util");
337
+ } catch {
338
+ }
339
+ }();
340
+ const _t = ti;
341
+ var Hr = _t && _t.isTypedArray, ei = Hr ? sr(Hr) : Ks;
342
+ const ir = ei;
343
+ var ri = Object.prototype, ni = ri.hasOwnProperty;
344
+ function Vn(t, e) {
345
+ var r = M(t), n = !r && Vt(t), o = !r && !n && Wt(t), a = !r && !n && !o && ir(t), i = r || n || o || a, s = i ? bs(t.length, String) : [], c = s.length;
346
+ for (var u in t)
347
+ (e || ni.call(t, u)) && !(i && (u == "length" || o && (u == "offset" || u == "parent") || a && (u == "buffer" || u == "byteLength" || u == "byteOffset") || de(u, c))) && s.push(u);
348
+ return s;
349
+ }
350
+ function Wn(t, e) {
351
+ return function(r) {
352
+ return t(e(r));
353
+ };
354
+ }
355
+ var oi = Wn(Object.keys, Object);
356
+ const ai = oi;
357
+ var si = Object.prototype, ii = si.hasOwnProperty;
358
+ function ci(t) {
359
+ if (!ar(t))
360
+ return ai(t);
361
+ var e = [];
362
+ for (var r in Object(t))
363
+ ii.call(t, r) && r != "constructor" && e.push(r);
364
+ return e;
365
+ }
366
+ function ve(t) {
367
+ return he(t) ? Vn(t) : ci(t);
368
+ }
369
+ function ui(t) {
370
+ var e = [];
371
+ if (t != null)
372
+ for (var r in Object(t))
373
+ e.push(r);
374
+ return e;
375
+ }
376
+ var li = Object.prototype, fi = li.hasOwnProperty;
377
+ function pi(t) {
378
+ if (!J(t))
379
+ return ui(t);
380
+ var e = ar(t), r = [];
381
+ for (var n in t)
382
+ n == "constructor" && (e || !fi.call(t, n)) || r.push(n);
383
+ return r;
384
+ }
385
+ function te(t) {
386
+ return he(t) ? Vn(t, !0) : pi(t);
387
+ }
388
+ var di = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, hi = /^\w*$/;
389
+ function cr(t, e) {
390
+ if (M(t))
391
+ return !1;
392
+ var r = typeof t;
393
+ return r == "number" || r == "symbol" || r == "boolean" || t == null || Ke(t) ? !0 : hi.test(t) || !di.test(t) || e != null && t in Object(e);
394
+ }
395
+ var vi = ht(Object, "create");
396
+ const Jt = vi;
397
+ function mi() {
398
+ this.__data__ = Jt ? Jt(null) : {}, this.size = 0;
399
+ }
400
+ function yi(t) {
401
+ var e = this.has(t) && delete this.__data__[t];
402
+ return this.size -= e ? 1 : 0, e;
403
+ }
404
+ var gi = "__lodash_hash_undefined__", bi = Object.prototype, _i = bi.hasOwnProperty;
405
+ function ji(t) {
406
+ var e = this.__data__;
407
+ if (Jt) {
408
+ var r = e[t];
409
+ return r === gi ? void 0 : r;
410
+ }
411
+ return _i.call(e, t) ? e[t] : void 0;
412
+ }
413
+ var wi = Object.prototype, Si = wi.hasOwnProperty;
414
+ function Oi(t) {
415
+ var e = this.__data__;
416
+ return Jt ? e[t] !== void 0 : Si.call(e, t);
417
+ }
418
+ var Ci = "__lodash_hash_undefined__";
419
+ function Ei(t, e) {
420
+ var r = this.__data__;
421
+ return this.size += this.has(t) ? 0 : 1, r[t] = Jt && e === void 0 ? Ci : e, this;
422
+ }
423
+ function ut(t) {
424
+ var e = -1, r = t == null ? 0 : t.length;
425
+ for (this.clear(); ++e < r; ) {
426
+ var n = t[e];
427
+ this.set(n[0], n[1]);
428
+ }
429
+ }
430
+ ut.prototype.clear = mi;
431
+ ut.prototype.delete = yi;
432
+ ut.prototype.get = ji;
433
+ ut.prototype.has = Oi;
434
+ ut.prototype.set = Ei;
435
+ function xi() {
436
+ this.__data__ = [], this.size = 0;
437
+ }
438
+ function me(t, e) {
439
+ for (var r = t.length; r--; )
440
+ if (Zt(t[r][0], e))
441
+ return r;
442
+ return -1;
443
+ }
444
+ var Ni = Array.prototype, $i = Ni.splice;
445
+ function Ti(t) {
446
+ var e = this.__data__, r = me(e, t);
447
+ if (r < 0)
448
+ return !1;
449
+ var n = e.length - 1;
450
+ return r == n ? e.pop() : $i.call(e, r, 1), --this.size, !0;
451
+ }
452
+ function Ai(t) {
453
+ var e = this.__data__, r = me(e, t);
454
+ return r < 0 ? void 0 : e[r][1];
455
+ }
456
+ function Mi(t) {
457
+ return me(this.__data__, t) > -1;
458
+ }
459
+ function Pi(t, e) {
460
+ var r = this.__data__, n = me(r, t);
461
+ return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
462
+ }
463
+ function et(t) {
464
+ var e = -1, r = t == null ? 0 : t.length;
465
+ for (this.clear(); ++e < r; ) {
466
+ var n = t[e];
467
+ this.set(n[0], n[1]);
468
+ }
469
+ }
470
+ et.prototype.clear = xi;
471
+ et.prototype.delete = Ti;
472
+ et.prototype.get = Ai;
473
+ et.prototype.has = Mi;
474
+ et.prototype.set = Pi;
475
+ var Di = ht(Y, "Map");
476
+ const qt = Di;
477
+ function Ri() {
478
+ this.size = 0, this.__data__ = {
479
+ hash: new ut(),
480
+ map: new (qt || et)(),
481
+ string: new ut()
482
+ };
483
+ }
484
+ function Ii(t) {
485
+ var e = typeof t;
486
+ return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
487
+ }
488
+ function ye(t, e) {
489
+ var r = t.__data__;
490
+ return Ii(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
491
+ }
492
+ function Li(t) {
493
+ var e = ye(this, t).delete(t);
494
+ return this.size -= e ? 1 : 0, e;
495
+ }
496
+ function Fi(t) {
497
+ return ye(this, t).get(t);
498
+ }
499
+ function Bi(t) {
500
+ return ye(this, t).has(t);
501
+ }
502
+ function Ui(t, e) {
503
+ var r = ye(this, t), n = r.size;
504
+ return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
505
+ }
506
+ function rt(t) {
507
+ var e = -1, r = t == null ? 0 : t.length;
508
+ for (this.clear(); ++e < r; ) {
509
+ var n = t[e];
510
+ this.set(n[0], n[1]);
511
+ }
512
+ }
513
+ rt.prototype.clear = Ri;
514
+ rt.prototype.delete = Li;
515
+ rt.prototype.get = Fi;
516
+ rt.prototype.has = Bi;
517
+ rt.prototype.set = Ui;
518
+ var ki = "Expected a function";
519
+ function ur(t, e) {
520
+ if (typeof t != "function" || e != null && typeof e != "function")
521
+ throw new TypeError(ki);
522
+ var r = function() {
523
+ var n = arguments, o = e ? e.apply(this, n) : n[0], a = r.cache;
524
+ if (a.has(o))
525
+ return a.get(o);
526
+ var i = t.apply(this, n);
527
+ return r.cache = a.set(o, i) || a, i;
528
+ };
529
+ return r.cache = new (ur.Cache || rt)(), r;
530
+ }
531
+ ur.Cache = rt;
532
+ var zi = 500;
533
+ function Gi(t) {
534
+ var e = ur(t, function(n) {
535
+ return r.size === zi && r.clear(), n;
536
+ }), r = e.cache;
537
+ return e;
538
+ }
539
+ var Hi = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Vi = /\\(\\)?/g, Wi = Gi(function(t) {
540
+ var e = [];
541
+ return t.charCodeAt(0) === 46 && e.push(""), t.replace(Hi, function(r, n, o, a) {
542
+ e.push(o ? a.replace(Vi, "$1") : n || r);
543
+ }), e;
544
+ });
545
+ const Ji = Wi;
546
+ function qi(t) {
547
+ return t == null ? "" : Ln(t);
548
+ }
549
+ function Nt(t, e) {
550
+ return M(t) ? t : cr(t, e) ? [t] : Ji(qi(t));
551
+ }
552
+ var Qi = 1 / 0;
553
+ function $t(t) {
554
+ if (typeof t == "string" || Ke(t))
555
+ return t;
556
+ var e = t + "";
557
+ return e == "0" && 1 / t == -Qi ? "-0" : e;
558
+ }
559
+ function ge(t, e) {
560
+ e = Nt(e, t);
561
+ for (var r = 0, n = e.length; t != null && r < n; )
562
+ t = t[$t(e[r++])];
563
+ return r && r == n ? t : void 0;
564
+ }
565
+ function Jn(t, e, r) {
566
+ var n = t == null ? void 0 : ge(t, e);
567
+ return n === void 0 ? r : n;
568
+ }
569
+ function lr(t, e) {
570
+ for (var r = -1, n = e.length, o = t.length; ++r < n; )
571
+ t[o + r] = e[r];
572
+ return t;
573
+ }
574
+ var Vr = z ? z.isConcatSpreadable : void 0;
575
+ function Yi(t) {
576
+ return M(t) || Vt(t) || !!(Vr && t && t[Vr]);
577
+ }
578
+ function fr(t, e, r, n, o) {
579
+ var a = -1, i = t.length;
580
+ for (r || (r = Yi), o || (o = []); ++a < i; ) {
581
+ var s = t[a];
582
+ e > 0 && r(s) ? e > 1 ? fr(s, e - 1, r, n, o) : lr(o, s) : n || (o[o.length] = s);
583
+ }
584
+ return o;
585
+ }
586
+ function Xi(t) {
587
+ var e = t == null ? 0 : t.length;
588
+ return e ? fr(t, 1) : [];
589
+ }
590
+ function Ki(t) {
591
+ return Bn(Un(t, void 0, Xi), t + "");
592
+ }
593
+ var Zi = Wn(Object.getPrototypeOf, Object);
594
+ const pr = Zi;
595
+ var tc = "[object Object]", ec = Function.prototype, rc = Object.prototype, qn = ec.toString, nc = rc.hasOwnProperty, oc = qn.call(Object);
596
+ function B(t) {
597
+ if (!Q(t) || pt(t) != tc)
598
+ return !1;
599
+ var e = pr(t);
600
+ if (e === null)
601
+ return !0;
602
+ var r = nc.call(e, "constructor") && e.constructor;
603
+ return typeof r == "function" && r instanceof r && qn.call(r) == oc;
604
+ }
605
+ function ac(t, e, r) {
606
+ var n = -1, o = t.length;
607
+ e < 0 && (e = -e > o ? 0 : o + e), r = r > o ? o : r, r < 0 && (r += o), o = e > r ? 0 : r - e >>> 0, e >>>= 0;
608
+ for (var a = Array(o); ++n < o; )
609
+ a[n] = t[n + e];
610
+ return a;
611
+ }
612
+ function sc() {
613
+ this.__data__ = new et(), this.size = 0;
614
+ }
615
+ function ic(t) {
616
+ var e = this.__data__, r = e.delete(t);
617
+ return this.size = e.size, r;
618
+ }
619
+ function cc(t) {
620
+ return this.__data__.get(t);
621
+ }
622
+ function uc(t) {
623
+ return this.__data__.has(t);
624
+ }
625
+ var lc = 200;
626
+ function fc(t, e) {
627
+ var r = this.__data__;
628
+ if (r instanceof et) {
629
+ var n = r.__data__;
630
+ if (!qt || n.length < lc - 1)
631
+ return n.push([t, e]), this.size = ++r.size, this;
632
+ r = this.__data__ = new rt(n);
633
+ }
634
+ return r.set(t, e), this.size = r.size, this;
635
+ }
636
+ function V(t) {
637
+ var e = this.__data__ = new et(t);
638
+ this.size = e.size;
639
+ }
640
+ V.prototype.clear = sc;
641
+ V.prototype.delete = ic;
642
+ V.prototype.get = cc;
643
+ V.prototype.has = uc;
644
+ V.prototype.set = fc;
645
+ function pc(t, e) {
646
+ return t && xt(e, ve(e), t);
647
+ }
648
+ function dc(t, e) {
649
+ return t && xt(e, te(e), t);
650
+ }
651
+ var Qn = typeof exports == "object" && exports && !exports.nodeType && exports, Wr = Qn && typeof module == "object" && module && !module.nodeType && module, hc = Wr && Wr.exports === Qn, Jr = hc ? Y.Buffer : void 0, qr = Jr ? Jr.allocUnsafe : void 0;
652
+ function Yn(t, e) {
653
+ if (e)
654
+ return t.slice();
655
+ var r = t.length, n = qr ? qr(r) : new t.constructor(r);
656
+ return t.copy(n), n;
657
+ }
658
+ function vc(t, e) {
659
+ for (var r = -1, n = t == null ? 0 : t.length, o = 0, a = []; ++r < n; ) {
660
+ var i = t[r];
661
+ e(i, r, t) && (a[o++] = i);
662
+ }
663
+ return a;
664
+ }
665
+ function Xn() {
666
+ return [];
667
+ }
668
+ var mc = Object.prototype, yc = mc.propertyIsEnumerable, Qr = Object.getOwnPropertySymbols, gc = Qr ? function(t) {
669
+ return t == null ? [] : (t = Object(t), vc(Qr(t), function(e) {
670
+ return yc.call(t, e);
671
+ }));
672
+ } : Xn;
673
+ const dr = gc;
674
+ function bc(t, e) {
675
+ return xt(t, dr(t), e);
676
+ }
677
+ var _c = Object.getOwnPropertySymbols, jc = _c ? function(t) {
678
+ for (var e = []; t; )
679
+ lr(e, dr(t)), t = pr(t);
680
+ return e;
681
+ } : Xn;
682
+ const Kn = jc;
683
+ function wc(t, e) {
684
+ return xt(t, Kn(t), e);
685
+ }
686
+ function Zn(t, e, r) {
687
+ var n = e(t);
688
+ return M(t) ? n : lr(n, r(t));
689
+ }
690
+ function Ie(t) {
691
+ return Zn(t, ve, dr);
692
+ }
693
+ function hr(t) {
694
+ return Zn(t, te, Kn);
695
+ }
696
+ var Sc = ht(Y, "DataView");
697
+ const Le = Sc;
698
+ var Oc = ht(Y, "Promise");
699
+ const Fe = Oc;
700
+ var Cc = ht(Y, "Set");
701
+ const bt = Cc;
702
+ var Yr = "[object Map]", Ec = "[object Object]", Xr = "[object Promise]", Kr = "[object Set]", Zr = "[object WeakMap]", tn = "[object DataView]", xc = dt(Le), Nc = dt(qt), $c = dt(Fe), Tc = dt(bt), Ac = dt(Re), ct = pt;
703
+ (Le && ct(new Le(new ArrayBuffer(1))) != tn || qt && ct(new qt()) != Yr || Fe && ct(Fe.resolve()) != Xr || bt && ct(new bt()) != Kr || Re && ct(new Re()) != Zr) && (ct = function(t) {
704
+ var e = pt(t), r = e == Ec ? t.constructor : void 0, n = r ? dt(r) : "";
705
+ if (n)
706
+ switch (n) {
707
+ case xc:
708
+ return tn;
709
+ case Nc:
710
+ return Yr;
711
+ case $c:
712
+ return Xr;
713
+ case Tc:
714
+ return Kr;
715
+ case Ac:
716
+ return Zr;
717
+ }
718
+ return e;
719
+ });
720
+ const Qt = ct;
721
+ var Mc = Object.prototype, Pc = Mc.hasOwnProperty;
722
+ function Dc(t) {
723
+ var e = t.length, r = new t.constructor(e);
724
+ return e && typeof t[0] == "string" && Pc.call(t, "index") && (r.index = t.index, r.input = t.input), r;
725
+ }
726
+ var Rc = Y.Uint8Array;
727
+ const ue = Rc;
728
+ function vr(t) {
729
+ var e = new t.constructor(t.byteLength);
730
+ return new ue(e).set(new ue(t)), e;
731
+ }
732
+ function Ic(t, e) {
733
+ var r = e ? vr(t.buffer) : t.buffer;
734
+ return new t.constructor(r, t.byteOffset, t.byteLength);
735
+ }
736
+ var Lc = /\w*$/;
737
+ function Fc(t) {
738
+ var e = new t.constructor(t.source, Lc.exec(t));
739
+ return e.lastIndex = t.lastIndex, e;
740
+ }
741
+ var en = z ? z.prototype : void 0, rn = en ? en.valueOf : void 0;
742
+ function Bc(t) {
743
+ return rn ? Object(rn.call(t)) : {};
744
+ }
745
+ function to(t, e) {
746
+ var r = e ? vr(t.buffer) : t.buffer;
747
+ return new t.constructor(r, t.byteOffset, t.length);
748
+ }
749
+ var Uc = "[object Boolean]", kc = "[object Date]", zc = "[object Map]", Gc = "[object Number]", Hc = "[object RegExp]", Vc = "[object Set]", Wc = "[object String]", Jc = "[object Symbol]", qc = "[object ArrayBuffer]", Qc = "[object DataView]", Yc = "[object Float32Array]", Xc = "[object Float64Array]", Kc = "[object Int8Array]", Zc = "[object Int16Array]", tu = "[object Int32Array]", eu = "[object Uint8Array]", ru = "[object Uint8ClampedArray]", nu = "[object Uint16Array]", ou = "[object Uint32Array]";
750
+ function au(t, e, r) {
751
+ var n = t.constructor;
752
+ switch (e) {
753
+ case qc:
754
+ return vr(t);
755
+ case Uc:
756
+ case kc:
757
+ return new n(+t);
758
+ case Qc:
759
+ return Ic(t, r);
760
+ case Yc:
761
+ case Xc:
762
+ case Kc:
763
+ case Zc:
764
+ case tu:
765
+ case eu:
766
+ case ru:
767
+ case nu:
768
+ case ou:
769
+ return to(t, r);
770
+ case zc:
771
+ return new n();
772
+ case Gc:
773
+ case Wc:
774
+ return new n(t);
775
+ case Hc:
776
+ return Fc(t);
777
+ case Vc:
778
+ return new n();
779
+ case Jc:
780
+ return Bc(t);
781
+ }
782
+ }
783
+ function eo(t) {
784
+ return typeof t.constructor == "function" && !ar(t) ? Ja(pr(t)) : {};
785
+ }
786
+ var su = "[object Map]";
787
+ function iu(t) {
788
+ return Q(t) && Qt(t) == su;
789
+ }
790
+ var nn = _t && _t.isMap, cu = nn ? sr(nn) : iu;
791
+ const uu = cu;
792
+ var lu = "[object Set]";
793
+ function fu(t) {
794
+ return Q(t) && Qt(t) == lu;
795
+ }
796
+ var on = _t && _t.isSet, pu = on ? sr(on) : fu;
797
+ const du = pu;
798
+ var hu = 1, vu = 2, mu = 4, ro = "[object Arguments]", yu = "[object Array]", gu = "[object Boolean]", bu = "[object Date]", _u = "[object Error]", no = "[object Function]", ju = "[object GeneratorFunction]", wu = "[object Map]", Su = "[object Number]", oo = "[object Object]", Ou = "[object RegExp]", Cu = "[object Set]", Eu = "[object String]", xu = "[object Symbol]", Nu = "[object WeakMap]", $u = "[object ArrayBuffer]", Tu = "[object DataView]", Au = "[object Float32Array]", Mu = "[object Float64Array]", Pu = "[object Int8Array]", Du = "[object Int16Array]", Ru = "[object Int32Array]", Iu = "[object Uint8Array]", Lu = "[object Uint8ClampedArray]", Fu = "[object Uint16Array]", Bu = "[object Uint32Array]", E = {};
799
+ E[ro] = E[yu] = E[$u] = E[Tu] = E[gu] = E[bu] = E[Au] = E[Mu] = E[Pu] = E[Du] = E[Ru] = E[wu] = E[Su] = E[oo] = E[Ou] = E[Cu] = E[Eu] = E[xu] = E[Iu] = E[Lu] = E[Fu] = E[Bu] = !0;
800
+ E[_u] = E[no] = E[Nu] = !1;
801
+ function zt(t, e, r, n, o, a) {
802
+ var i, s = e & hu, c = e & vu, u = e & mu;
803
+ if (r && (i = o ? r(t, n, o, a) : r(t)), i !== void 0)
804
+ return i;
805
+ if (!J(t))
806
+ return t;
807
+ var l = M(t);
808
+ if (l) {
809
+ if (i = Dc(t), !s)
810
+ return Fn(t, i);
811
+ } else {
812
+ var p = Qt(t), f = p == no || p == ju;
813
+ if (Wt(t))
814
+ return Yn(t, s);
815
+ if (p == oo || p == ro || f && !o) {
816
+ if (i = c || f ? {} : eo(t), !s)
817
+ return c ? wc(t, dc(i, t)) : bc(t, pc(i, t));
818
+ } else {
819
+ if (!E[p])
820
+ return o ? t : {};
821
+ i = au(t, p, s);
822
+ }
823
+ }
824
+ a || (a = new V());
825
+ var d = a.get(t);
826
+ if (d)
827
+ return d;
828
+ a.set(t, i), du(t) ? t.forEach(function(b) {
829
+ i.add(zt(b, e, r, b, t, a));
830
+ }) : uu(t) && t.forEach(function(b, j) {
831
+ i.set(j, zt(b, e, r, j, t, a));
832
+ });
833
+ var h = u ? c ? hr : Ie : c ? te : ve, y = l ? void 0 : h(t);
834
+ return as(y || t, function(b, j) {
835
+ y && (j = b, b = t[j]), nr(i, j, zt(b, e, r, j, t, a));
836
+ }), i;
837
+ }
838
+ var Uu = 1, ku = 4;
839
+ function ao(t) {
840
+ return zt(t, Uu | ku);
841
+ }
842
+ var zu = "__lodash_hash_undefined__";
843
+ function Gu(t) {
844
+ return this.__data__.set(t, zu), this;
845
+ }
846
+ function Hu(t) {
847
+ return this.__data__.has(t);
848
+ }
849
+ function Yt(t) {
850
+ var e = -1, r = t == null ? 0 : t.length;
851
+ for (this.__data__ = new rt(); ++e < r; )
852
+ this.add(t[e]);
853
+ }
854
+ Yt.prototype.add = Yt.prototype.push = Gu;
855
+ Yt.prototype.has = Hu;
856
+ function Vu(t, e) {
857
+ for (var r = -1, n = t == null ? 0 : t.length; ++r < n; )
858
+ if (e(t[r], r, t))
859
+ return !0;
860
+ return !1;
861
+ }
862
+ function so(t, e) {
863
+ return t.has(e);
864
+ }
865
+ var Wu = 1, Ju = 2;
866
+ function io(t, e, r, n, o, a) {
867
+ var i = r & Wu, s = t.length, c = e.length;
868
+ if (s != c && !(i && c > s))
869
+ return !1;
870
+ var u = a.get(t), l = a.get(e);
871
+ if (u && l)
872
+ return u == e && l == t;
873
+ var p = -1, f = !0, d = r & Ju ? new Yt() : void 0;
874
+ for (a.set(t, e), a.set(e, t); ++p < s; ) {
875
+ var h = t[p], y = e[p];
876
+ if (n)
877
+ var b = i ? n(y, h, p, e, t, a) : n(h, y, p, t, e, a);
878
+ if (b !== void 0) {
879
+ if (b)
880
+ continue;
881
+ f = !1;
882
+ break;
883
+ }
884
+ if (d) {
885
+ if (!Vu(e, function(j, O) {
886
+ if (!so(d, O) && (h === j || o(h, j, r, n, a)))
887
+ return d.push(O);
888
+ })) {
889
+ f = !1;
890
+ break;
891
+ }
892
+ } else if (!(h === y || o(h, y, r, n, a))) {
893
+ f = !1;
894
+ break;
895
+ }
896
+ }
897
+ return a.delete(t), a.delete(e), f;
898
+ }
899
+ function qu(t) {
900
+ var e = -1, r = Array(t.size);
901
+ return t.forEach(function(n, o) {
902
+ r[++e] = [o, n];
903
+ }), r;
904
+ }
905
+ function mr(t) {
906
+ var e = -1, r = Array(t.size);
907
+ return t.forEach(function(n) {
908
+ r[++e] = n;
909
+ }), r;
910
+ }
911
+ var Qu = 1, Yu = 2, Xu = "[object Boolean]", Ku = "[object Date]", Zu = "[object Error]", tl = "[object Map]", el = "[object Number]", rl = "[object RegExp]", nl = "[object Set]", ol = "[object String]", al = "[object Symbol]", sl = "[object ArrayBuffer]", il = "[object DataView]", an = z ? z.prototype : void 0, $e = an ? an.valueOf : void 0;
912
+ function cl(t, e, r, n, o, a, i) {
913
+ switch (r) {
914
+ case il:
915
+ if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset)
916
+ return !1;
917
+ t = t.buffer, e = e.buffer;
918
+ case sl:
919
+ return !(t.byteLength != e.byteLength || !a(new ue(t), new ue(e)));
920
+ case Xu:
921
+ case Ku:
922
+ case el:
923
+ return Zt(+t, +e);
924
+ case Zu:
925
+ return t.name == e.name && t.message == e.message;
926
+ case rl:
927
+ case ol:
928
+ return t == e + "";
929
+ case tl:
930
+ var s = qu;
931
+ case nl:
932
+ var c = n & Qu;
933
+ if (s || (s = mr), t.size != e.size && !c)
934
+ return !1;
935
+ var u = i.get(t);
936
+ if (u)
937
+ return u == e;
938
+ n |= Yu, i.set(t, e);
939
+ var l = io(s(t), s(e), n, o, a, i);
940
+ return i.delete(t), l;
941
+ case al:
942
+ if ($e)
943
+ return $e.call(t) == $e.call(e);
944
+ }
945
+ return !1;
946
+ }
947
+ var ul = 1, ll = Object.prototype, fl = ll.hasOwnProperty;
948
+ function pl(t, e, r, n, o, a) {
949
+ var i = r & ul, s = Ie(t), c = s.length, u = Ie(e), l = u.length;
950
+ if (c != l && !i)
951
+ return !1;
952
+ for (var p = c; p--; ) {
953
+ var f = s[p];
954
+ if (!(i ? f in e : fl.call(e, f)))
955
+ return !1;
956
+ }
957
+ var d = a.get(t), h = a.get(e);
958
+ if (d && h)
959
+ return d == e && h == t;
960
+ var y = !0;
961
+ a.set(t, e), a.set(e, t);
962
+ for (var b = i; ++p < c; ) {
963
+ f = s[p];
964
+ var j = t[f], O = e[f];
965
+ if (n)
966
+ var P = i ? n(O, j, f, e, t, a) : n(j, O, f, t, e, a);
967
+ if (!(P === void 0 ? j === O || o(j, O, r, n, a) : P)) {
968
+ y = !1;
969
+ break;
970
+ }
971
+ b || (b = f == "constructor");
972
+ }
973
+ if (y && !b) {
974
+ var $ = t.constructor, D = e.constructor;
975
+ $ != D && "constructor" in t && "constructor" in e && !(typeof $ == "function" && $ instanceof $ && typeof D == "function" && D instanceof D) && (y = !1);
976
+ }
977
+ return a.delete(t), a.delete(e), y;
978
+ }
979
+ var dl = 1, sn = "[object Arguments]", cn = "[object Array]", se = "[object Object]", hl = Object.prototype, un = hl.hasOwnProperty;
980
+ function vl(t, e, r, n, o, a) {
981
+ var i = M(t), s = M(e), c = i ? cn : Qt(t), u = s ? cn : Qt(e);
982
+ c = c == sn ? se : c, u = u == sn ? se : u;
983
+ var l = c == se, p = u == se, f = c == u;
984
+ if (f && Wt(t)) {
985
+ if (!Wt(e))
986
+ return !1;
987
+ i = !0, l = !1;
988
+ }
989
+ if (f && !l)
990
+ return a || (a = new V()), i || ir(t) ? io(t, e, r, n, o, a) : cl(t, e, c, r, n, o, a);
991
+ if (!(r & dl)) {
992
+ var d = l && un.call(t, "__wrapped__"), h = p && un.call(e, "__wrapped__");
993
+ if (d || h) {
994
+ var y = d ? t.value() : t, b = h ? e.value() : e;
995
+ return a || (a = new V()), o(y, b, r, n, a);
996
+ }
997
+ }
998
+ return f ? (a || (a = new V()), pl(t, e, r, n, o, a)) : !1;
999
+ }
1000
+ function yr(t, e, r, n, o) {
1001
+ return t === e ? !0 : t == null || e == null || !Q(t) && !Q(e) ? t !== t && e !== e : vl(t, e, r, n, yr, o);
1002
+ }
1003
+ var ml = 1, yl = 2;
1004
+ function gl(t, e, r, n) {
1005
+ var o = r.length, a = o, i = !n;
1006
+ if (t == null)
1007
+ return !a;
1008
+ for (t = Object(t); o--; ) {
1009
+ var s = r[o];
1010
+ if (i && s[2] ? s[1] !== t[s[0]] : !(s[0] in t))
1011
+ return !1;
1012
+ }
1013
+ for (; ++o < a; ) {
1014
+ s = r[o];
1015
+ var c = s[0], u = t[c], l = s[1];
1016
+ if (i && s[2]) {
1017
+ if (u === void 0 && !(c in t))
1018
+ return !1;
1019
+ } else {
1020
+ var p = new V();
1021
+ if (n)
1022
+ var f = n(u, l, c, t, e, p);
1023
+ if (!(f === void 0 ? yr(l, u, ml | yl, n, p) : f))
1024
+ return !1;
1025
+ }
1026
+ }
1027
+ return !0;
1028
+ }
1029
+ function co(t) {
1030
+ return t === t && !J(t);
1031
+ }
1032
+ function bl(t) {
1033
+ for (var e = ve(t), r = e.length; r--; ) {
1034
+ var n = e[r], o = t[n];
1035
+ e[r] = [n, o, co(o)];
1036
+ }
1037
+ return e;
1038
+ }
1039
+ function uo(t, e) {
1040
+ return function(r) {
1041
+ return r == null ? !1 : r[t] === e && (e !== void 0 || t in Object(r));
1042
+ };
1043
+ }
1044
+ function _l(t) {
1045
+ var e = bl(t);
1046
+ return e.length == 1 && e[0][2] ? uo(e[0][0], e[0][1]) : function(r) {
1047
+ return r === t || gl(r, t, e);
1048
+ };
1049
+ }
1050
+ function jl(t, e) {
1051
+ return t != null && e in Object(t);
1052
+ }
1053
+ function wl(t, e, r) {
1054
+ e = Nt(e, t);
1055
+ for (var n = -1, o = e.length, a = !1; ++n < o; ) {
1056
+ var i = $t(e[n]);
1057
+ if (!(a = t != null && r(t, i)))
1058
+ break;
1059
+ t = t[i];
1060
+ }
1061
+ return a || ++n != o ? a : (o = t == null ? 0 : t.length, !!o && or(o) && de(i, o) && (M(t) || Vt(t)));
1062
+ }
1063
+ function Sl(t, e) {
1064
+ return t != null && wl(t, e, jl);
1065
+ }
1066
+ var Ol = 1, Cl = 2;
1067
+ function El(t, e) {
1068
+ return cr(t) && co(e) ? uo($t(t), e) : function(r) {
1069
+ var n = Jn(r, t);
1070
+ return n === void 0 && n === e ? Sl(r, t) : yr(e, n, Ol | Cl);
1071
+ };
1072
+ }
1073
+ function xl(t) {
1074
+ return function(e) {
1075
+ return e == null ? void 0 : e[t];
1076
+ };
1077
+ }
1078
+ function Nl(t) {
1079
+ return function(e) {
1080
+ return ge(e, t);
1081
+ };
1082
+ }
1083
+ function $l(t) {
1084
+ return cr(t) ? xl($t(t)) : Nl(t);
1085
+ }
1086
+ function gr(t) {
1087
+ return typeof t == "function" ? t : t == null ? tr : typeof t == "object" ? M(t) ? El(t[0], t[1]) : _l(t) : $l(t);
1088
+ }
1089
+ function Tl(t) {
1090
+ return function(e, r, n) {
1091
+ for (var o = -1, a = Object(e), i = n(e), s = i.length; s--; ) {
1092
+ var c = i[t ? s : ++o];
1093
+ if (r(a[c], c, a) === !1)
1094
+ break;
1095
+ }
1096
+ return e;
1097
+ };
1098
+ }
1099
+ var Al = Tl();
1100
+ const Ml = Al;
1101
+ function Be(t, e, r) {
1102
+ (r !== void 0 && !Zt(t[e], r) || r === void 0 && !(e in t)) && rr(t, e, r);
1103
+ }
1104
+ function Ue(t) {
1105
+ return Q(t) && he(t);
1106
+ }
1107
+ function ke(t, e) {
1108
+ if (!(e === "constructor" && typeof t[e] == "function") && e != "__proto__")
1109
+ return t[e];
1110
+ }
1111
+ function Pl(t) {
1112
+ return xt(t, te(t));
1113
+ }
1114
+ function Dl(t, e, r, n, o, a, i) {
1115
+ var s = ke(t, r), c = ke(e, r), u = i.get(c);
1116
+ if (u) {
1117
+ Be(t, r, u);
1118
+ return;
1119
+ }
1120
+ var l = a ? a(s, c, r + "", t, e, i) : void 0, p = l === void 0;
1121
+ if (p) {
1122
+ var f = M(c), d = !f && Wt(c), h = !f && !d && ir(c);
1123
+ l = c, f || d || h ? M(s) ? l = s : Ue(s) ? l = Fn(s) : d ? (p = !1, l = Yn(c, !0)) : h ? (p = !1, l = to(c, !0)) : l = [] : B(c) || Vt(c) ? (l = s, Vt(s) ? l = Pl(s) : (!J(s) || er(s)) && (l = eo(c))) : p = !1;
1124
+ }
1125
+ p && (i.set(c, l), o(l, c, n, a, i), i.delete(c)), Be(t, r, l);
1126
+ }
1127
+ function lo(t, e, r, n, o) {
1128
+ t !== e && Ml(e, function(a, i) {
1129
+ if (o || (o = new V()), J(a))
1130
+ Dl(t, e, i, r, lo, n, o);
1131
+ else {
1132
+ var s = n ? n(ke(t, i), a, i + "", t, e, o) : void 0;
1133
+ s === void 0 && (s = a), Be(t, i, s);
1134
+ }
1135
+ }, te);
1136
+ }
1137
+ function Rl(t, e, r) {
1138
+ for (var n = -1, o = t == null ? 0 : t.length; ++n < o; )
1139
+ if (r(e, t[n]))
1140
+ return !0;
1141
+ return !1;
1142
+ }
1143
+ function fo(t) {
1144
+ var e = t == null ? 0 : t.length;
1145
+ return e ? t[e - 1] : void 0;
1146
+ }
1147
+ function Il(t, e) {
1148
+ return e.length < 2 ? t : ge(t, ac(e, 0, -1));
1149
+ }
1150
+ var Ll = ys(function(t, e, r) {
1151
+ lo(t, e, r);
1152
+ });
1153
+ const po = Ll;
1154
+ var Fl = "Expected a function";
1155
+ function Bl(t) {
1156
+ if (typeof t != "function")
1157
+ throw new TypeError(Fl);
1158
+ return function() {
1159
+ var e = arguments;
1160
+ switch (e.length) {
1161
+ case 0:
1162
+ return !t.call(this);
1163
+ case 1:
1164
+ return !t.call(this, e[0]);
1165
+ case 2:
1166
+ return !t.call(this, e[0], e[1]);
1167
+ case 3:
1168
+ return !t.call(this, e[0], e[1], e[2]);
1169
+ }
1170
+ return !t.apply(this, e);
1171
+ };
1172
+ }
1173
+ function Ul(t, e) {
1174
+ return e = Nt(e, t), t = Il(t, e), t == null || delete t[$t(fo(e))];
1175
+ }
1176
+ function kl(t) {
1177
+ return B(t) ? void 0 : t;
1178
+ }
1179
+ var zl = 1, Gl = 2, Hl = 4, Vl = Ki(function(t, e) {
1180
+ var r = {};
1181
+ if (t == null)
1182
+ return r;
1183
+ var n = !1;
1184
+ e = Ze(e, function(a) {
1185
+ return a = Nt(a, t), n || (n = a.length > 1), a;
1186
+ }), xt(t, hr(t), r), n && (r = zt(r, zl | Gl | Hl, kl));
1187
+ for (var o = e.length; o--; )
1188
+ Ul(r, e[o]);
1189
+ return r;
1190
+ });
1191
+ const ho = Vl;
1192
+ function Wl(t, e, r, n) {
1193
+ if (!J(t))
1194
+ return t;
1195
+ e = Nt(e, t);
1196
+ for (var o = -1, a = e.length, i = a - 1, s = t; s != null && ++o < a; ) {
1197
+ var c = $t(e[o]), u = r;
1198
+ if (c === "__proto__" || c === "constructor" || c === "prototype")
1199
+ return t;
1200
+ if (o != i) {
1201
+ var l = s[c];
1202
+ u = n ? n(l, c, s) : void 0, u === void 0 && (u = J(l) ? l : de(e[o + 1]) ? [] : {});
1203
+ }
1204
+ nr(s, c, u), s = s[c];
1205
+ }
1206
+ return t;
1207
+ }
1208
+ function Jl(t, e, r) {
1209
+ for (var n = -1, o = e.length, a = {}; ++n < o; ) {
1210
+ var i = e[n], s = ge(t, i);
1211
+ r(s, i) && Wl(a, Nt(i, t), s);
1212
+ }
1213
+ return a;
1214
+ }
1215
+ function ql(t, e) {
1216
+ if (t == null)
1217
+ return {};
1218
+ var r = Ze(hr(t), function(n) {
1219
+ return [n];
1220
+ });
1221
+ return e = gr(e), Jl(t, r, function(n, o) {
1222
+ return e(n, o[0]);
1223
+ });
1224
+ }
1225
+ function Ql(t, e) {
1226
+ return ql(t, Bl(gr(e)));
1227
+ }
1228
+ var Yl = 1 / 0, Xl = bt && 1 / mr(new bt([, -0]))[1] == Yl ? function(t) {
1229
+ return new bt(t);
1230
+ } : Qa;
1231
+ const Kl = Xl;
1232
+ var Zl = 200;
1233
+ function tf(t, e, r) {
1234
+ var n = -1, o = ls, a = t.length, i = !0, s = [], c = s;
1235
+ if (r)
1236
+ i = !1, o = Rl;
1237
+ else if (a >= Zl) {
1238
+ var u = e ? null : Kl(t);
1239
+ if (u)
1240
+ return mr(u);
1241
+ i = !1, o = so, c = new Yt();
1242
+ } else
1243
+ c = e ? [] : s;
1244
+ t:
1245
+ for (; ++n < a; ) {
1246
+ var l = t[n], p = e ? e(l) : l;
1247
+ if (l = r || l !== 0 ? l : 0, i && p === p) {
1248
+ for (var f = c.length; f--; )
1249
+ if (c[f] === p)
1250
+ continue t;
1251
+ e && c.push(p), s.push(l);
1252
+ } else
1253
+ o(c, p, r) || (c !== s && c.push(p), s.push(l));
1254
+ }
1255
+ return s;
1256
+ }
1257
+ var ef = kn(function(t) {
1258
+ var e = fo(t);
1259
+ return Ue(e) && (e = void 0), tf(fr(t, 1, Ue, !0), gr(e));
1260
+ });
1261
+ const rf = ef;
1262
+ class vo extends TypeError {
1263
+ constructor(e, r) {
1264
+ let n;
1265
+ const {
1266
+ message: o,
1267
+ ...a
1268
+ } = e, {
1269
+ path: i
1270
+ } = e, s = i.length === 0 ? o : `At path: ${i.join(".")} -- ${o}`;
1271
+ super(s), this.value = void 0, this.key = void 0, this.type = void 0, this.refinement = void 0, this.path = void 0, this.branch = void 0, this.failures = void 0, Object.assign(this, a), this.name = this.constructor.name, this.failures = () => n != null ? n : n = [e, ...r()];
1272
+ }
1273
+ }
1274
+ function nf(t) {
1275
+ return W(t) && typeof t[Symbol.iterator] == "function";
1276
+ }
1277
+ function W(t) {
1278
+ return typeof t == "object" && t != null;
1279
+ }
1280
+ function U(t) {
1281
+ return typeof t == "symbol" ? t.toString() : typeof t == "string" ? JSON.stringify(t) : `${t}`;
1282
+ }
1283
+ function of(t) {
1284
+ const {
1285
+ done: e,
1286
+ value: r
1287
+ } = t.next();
1288
+ return e ? void 0 : r;
1289
+ }
1290
+ function af(t, e, r, n) {
1291
+ if (t === !0)
1292
+ return;
1293
+ t === !1 ? t = {} : typeof t == "string" && (t = {
1294
+ message: t
1295
+ });
1296
+ const {
1297
+ path: o,
1298
+ branch: a
1299
+ } = e, {
1300
+ type: i
1301
+ } = r, {
1302
+ refinement: s,
1303
+ message: c = `Expected a value of type \`${i}\`${s ? ` with refinement \`${s}\`` : ""}, but received: \`${U(n)}\``
1304
+ } = t;
1305
+ return {
1306
+ value: n,
1307
+ type: i,
1308
+ refinement: s,
1309
+ key: o[o.length - 1],
1310
+ path: o,
1311
+ branch: a,
1312
+ ...t,
1313
+ message: c
1314
+ };
1315
+ }
1316
+ function* ln(t, e, r, n) {
1317
+ nf(t) || (t = [t]);
1318
+ for (const o of t) {
1319
+ const a = af(o, e, r, n);
1320
+ a && (yield a);
1321
+ }
1322
+ }
1323
+ function* br(t, e, r) {
1324
+ r === void 0 && (r = {});
1325
+ const {
1326
+ path: n = [],
1327
+ branch: o = [t],
1328
+ coerce: a = !1,
1329
+ mask: i = !1
1330
+ } = r, s = {
1331
+ path: n,
1332
+ branch: o
1333
+ };
1334
+ if (a && (t = e.coercer(t, s), i && e.type !== "type" && W(e.schema) && W(t) && !Array.isArray(t)))
1335
+ for (const u in t)
1336
+ e.schema[u] === void 0 && delete t[u];
1337
+ let c = "valid";
1338
+ for (const u of e.validator(t, s))
1339
+ c = "not_valid", yield [u, void 0];
1340
+ for (let [u, l, p] of e.entries(t, s)) {
1341
+ const f = br(l, p, {
1342
+ path: u === void 0 ? n : [...n, u],
1343
+ branch: u === void 0 ? o : [...o, l],
1344
+ coerce: a,
1345
+ mask: i
1346
+ });
1347
+ for (const d of f)
1348
+ d[0] ? (c = d[0].refinement != null ? "not_refined" : "not_valid", yield [d[0], void 0]) : a && (l = d[1], u === void 0 ? t = l : t instanceof Map ? t.set(u, l) : t instanceof Set ? t.add(l) : W(t) && (l !== void 0 || u in t) && (t[u] = l));
1349
+ }
1350
+ if (c !== "not_valid")
1351
+ for (const u of e.refiner(t, s))
1352
+ c = "not_refined", yield [u, void 0];
1353
+ c === "valid" && (yield [void 0, t]);
1354
+ }
1355
+ class X {
1356
+ constructor(e) {
1357
+ this.TYPE = void 0, this.type = void 0, this.schema = void 0, this.coercer = void 0, this.validator = void 0, this.refiner = void 0, this.entries = void 0;
1358
+ const {
1359
+ type: r,
1360
+ schema: n,
1361
+ validator: o,
1362
+ refiner: a,
1363
+ coercer: i = (c) => c,
1364
+ entries: s = function* () {
1365
+ }
1366
+ } = e;
1367
+ this.type = r, this.schema = n, this.entries = s, this.coercer = i, o ? this.validator = (c, u) => {
1368
+ const l = o(c, u);
1369
+ return ln(l, u, this, c);
1370
+ } : this.validator = () => [], a ? this.refiner = (c, u) => {
1371
+ const l = a(c, u);
1372
+ return ln(l, u, this, c);
1373
+ } : this.refiner = () => [];
1374
+ }
1375
+ assert(e) {
1376
+ return mo(e, this);
1377
+ }
1378
+ create(e) {
1379
+ return sf(e, this);
1380
+ }
1381
+ is(e) {
1382
+ return uf(e, this);
1383
+ }
1384
+ mask(e) {
1385
+ return cf(e, this);
1386
+ }
1387
+ validate(e, r) {
1388
+ return r === void 0 && (r = {}), Tt(e, this, r);
1389
+ }
1390
+ }
1391
+ function mo(t, e) {
1392
+ const r = Tt(t, e);
1393
+ if (r[0])
1394
+ throw r[0];
1395
+ }
1396
+ function sf(t, e) {
1397
+ const r = Tt(t, e, {
1398
+ coerce: !0
1399
+ });
1400
+ if (r[0])
1401
+ throw r[0];
1402
+ return r[1];
1403
+ }
1404
+ function cf(t, e) {
1405
+ const r = Tt(t, e, {
1406
+ coerce: !0,
1407
+ mask: !0
1408
+ });
1409
+ if (r[0])
1410
+ throw r[0];
1411
+ return r[1];
1412
+ }
1413
+ function uf(t, e) {
1414
+ return !Tt(t, e)[0];
1415
+ }
1416
+ function Tt(t, e, r) {
1417
+ r === void 0 && (r = {});
1418
+ const n = br(t, e, r), o = of(n);
1419
+ return o[0] ? [new vo(o[0], function* () {
1420
+ for (const a of n)
1421
+ a[0] && (yield a[0]);
1422
+ }), void 0] : [void 0, o[1]];
1423
+ }
1424
+ function _r() {
1425
+ for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)
1426
+ e[r] = arguments[r];
1427
+ const n = e[0].type === "type", o = e.map((i) => i.schema), a = Object.assign({}, ...o);
1428
+ return n ? _o(a) : S(a);
1429
+ }
1430
+ function st(t, e) {
1431
+ return new X({
1432
+ type: t,
1433
+ schema: null,
1434
+ validator: e
1435
+ });
1436
+ }
1437
+ function jt(t) {
1438
+ return new X({
1439
+ type: "dynamic",
1440
+ schema: null,
1441
+ *entries(e, r) {
1442
+ yield* t(e, r).entries(e, r);
1443
+ },
1444
+ validator(e, r) {
1445
+ return t(e, r).validator(e, r);
1446
+ },
1447
+ coercer(e, r) {
1448
+ return t(e, r).coercer(e, r);
1449
+ },
1450
+ refiner(e, r) {
1451
+ return t(e, r).refiner(e, r);
1452
+ }
1453
+ });
1454
+ }
1455
+ function yo(t, e) {
1456
+ const {
1457
+ schema: r
1458
+ } = t, n = {
1459
+ ...r
1460
+ };
1461
+ for (const o of e)
1462
+ delete n[o];
1463
+ switch (t.type) {
1464
+ case "type":
1465
+ return _o(n);
1466
+ default:
1467
+ return S(n);
1468
+ }
1469
+ }
1470
+ function R() {
1471
+ return st("any", () => !0);
1472
+ }
1473
+ function A(t) {
1474
+ return new X({
1475
+ type: "array",
1476
+ schema: t,
1477
+ *entries(e) {
1478
+ if (t && Array.isArray(e))
1479
+ for (const [r, n] of e.entries())
1480
+ yield [r, n, t];
1481
+ },
1482
+ coercer(e) {
1483
+ return Array.isArray(e) ? e.slice() : e;
1484
+ },
1485
+ validator(e) {
1486
+ return Array.isArray(e) || `Expected an array value, but received: ${U(e)}`;
1487
+ }
1488
+ });
1489
+ }
1490
+ function tt() {
1491
+ return st("boolean", (t) => typeof t == "boolean");
1492
+ }
1493
+ function ze(t) {
1494
+ const e = {}, r = t.map((n) => U(n)).join();
1495
+ for (const n of t)
1496
+ e[n] = n;
1497
+ return new X({
1498
+ type: "enums",
1499
+ schema: e,
1500
+ validator(n) {
1501
+ return t.includes(n) || `Expected one of \`${r}\`, but received: ${U(n)}`;
1502
+ }
1503
+ });
1504
+ }
1505
+ function go() {
1506
+ return st("func", (t) => typeof t == "function" || `Expected a function, but received: ${U(t)}`);
1507
+ }
1508
+ function F(t) {
1509
+ const e = U(t), r = typeof t;
1510
+ return new X({
1511
+ type: "literal",
1512
+ schema: r === "string" || r === "number" || r === "boolean" ? t : null,
1513
+ validator(n) {
1514
+ return n === t || `Expected the literal \`${e}\`, but received: ${U(n)}`;
1515
+ }
1516
+ });
1517
+ }
1518
+ function lf() {
1519
+ return st("never", () => !1);
1520
+ }
1521
+ function bo() {
1522
+ return st("number", (t) => typeof t == "number" && !isNaN(t) || `Expected a number, but received: ${U(t)}`);
1523
+ }
1524
+ function S(t) {
1525
+ const e = t ? Object.keys(t) : [], r = lf();
1526
+ return new X({
1527
+ type: "object",
1528
+ schema: t || null,
1529
+ *entries(n) {
1530
+ if (t && W(n)) {
1531
+ const o = new Set(Object.keys(n));
1532
+ for (const a of e)
1533
+ o.delete(a), yield [a, n[a], t[a]];
1534
+ for (const a of o)
1535
+ yield [a, n[a], r];
1536
+ }
1537
+ },
1538
+ validator(n) {
1539
+ return W(n) || `Expected an object, but received: ${U(n)}`;
1540
+ },
1541
+ coercer(n) {
1542
+ return W(n) ? {
1543
+ ...n
1544
+ } : n;
1545
+ }
1546
+ });
1547
+ }
1548
+ function m(t) {
1549
+ return new X({
1550
+ ...t,
1551
+ validator: (e, r) => e === void 0 || t.validator(e, r),
1552
+ refiner: (e, r) => e === void 0 || t.refiner(e, r)
1553
+ });
1554
+ }
1555
+ function Gt(t, e) {
1556
+ return new X({
1557
+ type: "record",
1558
+ schema: null,
1559
+ *entries(r) {
1560
+ if (W(r))
1561
+ for (const n in r) {
1562
+ const o = r[n];
1563
+ yield [n, n, t], yield [n, o, e];
1564
+ }
1565
+ },
1566
+ validator(r) {
1567
+ return W(r) || `Expected an object, but received: ${U(r)}`;
1568
+ }
1569
+ });
1570
+ }
1571
+ function v() {
1572
+ return st("string", (t) => typeof t == "string" || `Expected a string, but received: ${U(t)}`);
1573
+ }
1574
+ function _o(t) {
1575
+ const e = Object.keys(t);
1576
+ return new X({
1577
+ type: "type",
1578
+ schema: t,
1579
+ *entries(r) {
1580
+ if (W(r))
1581
+ for (const n of e)
1582
+ yield [n, r[n], t[n]];
1583
+ },
1584
+ validator(r) {
1585
+ return W(r) || `Expected an object, but received: ${U(r)}`;
1586
+ }
1587
+ });
1588
+ }
1589
+ function L(t) {
1590
+ const e = t.map((r) => r.type).join(" | ");
1591
+ return new X({
1592
+ type: "union",
1593
+ schema: null,
1594
+ coercer(r, n) {
1595
+ return (t.find((o) => {
1596
+ const [a] = o.validate(r, {
1597
+ coerce: !0
1598
+ });
1599
+ return !a;
1600
+ }) || ff()).coercer(r, n);
1601
+ },
1602
+ validator(r, n) {
1603
+ const o = [];
1604
+ for (const a of t) {
1605
+ const [...i] = br(r, a, n), [s] = i;
1606
+ if (s[0])
1607
+ for (const [c] of i)
1608
+ c && o.push(c);
1609
+ else
1610
+ return [];
1611
+ }
1612
+ return [`Expected the value to satisfy a union of \`${e}\`, but received: ${U(r)}`, ...o];
1613
+ }
1614
+ });
1615
+ }
1616
+ function ff() {
1617
+ return st("unknown", () => !0);
1618
+ }
1619
+ const jr = S({
1620
+ package: v(),
1621
+ version: v(),
1622
+ exportName: v(),
1623
+ destructuring: m(tt()),
1624
+ subName: m(v()),
1625
+ main: m(v())
1626
+ }), pf = A(jr), df = [
1627
+ "CBlock",
1628
+ "CContainer",
1629
+ "CImage",
1630
+ "CCanvas",
1631
+ "CVideo",
1632
+ "CAudio",
1633
+ "CText",
1634
+ "CNativeTag"
1635
+ ];
1636
+ var k = /* @__PURE__ */ ((t) => (t.SLOT = "SLOT", t.FUNCTION = "FUNCTION", t.EXPRESSION = "EXPRESSION", t))(k || {}), wr = /* @__PURE__ */ ((t) => (t.DESIGN = "design", t.SAVE = "save", t))(wr || {}), Ge = /* @__PURE__ */ ((t) => (t.FUNC = "FUNC", t.COMP = "COMP", t))(Ge || {});
1637
+ const hf = () => st("normalObj", (t) => !B(t) || [k.SLOT, k.EXPRESSION, k.FUNCTION].includes(t == null ? void 0 : t.type) ? !1 : (Tt(t, Gt(v(), Sr)), !0)), Sr = L([
1638
+ v(),
1639
+ bo(),
1640
+ tt(),
1641
+ S({
1642
+ type: F(k.SLOT),
1643
+ renderType: ze([Ge.FUNC, Ge.COMP]),
1644
+ params: m(A(v())),
1645
+ value: jt(() => L([wt, A(wt)]))
1646
+ }),
1647
+ S({
1648
+ type: F(k.EXPRESSION),
1649
+ value: v()
1650
+ }),
1651
+ S({
1652
+ type: F(k.FUNCTION),
1653
+ value: v()
1654
+ }),
1655
+ hf(),
1656
+ A(
1657
+ jt(() => Sr)
1658
+ )
1659
+ ]), fn = S({
1660
+ type: F(k.EXPRESSION),
1661
+ value: v()
1662
+ }), wt = S({
1663
+ id: m(v()),
1664
+ title: m(v()),
1665
+ componentName: v(),
1666
+ props: m(Gt(v(), Sr)),
1667
+ stateName: m(v()),
1668
+ state: m(Gt(v(), R())),
1669
+ children: jt(() => m(A(L([v(), wt])))),
1670
+ configure: m(R()),
1671
+ css: m(R()),
1672
+ style: m(R()),
1673
+ classNames: m(A(R())),
1674
+ refId: m(v()),
1675
+ extra: m(Gt(R(), R())),
1676
+ condition: m(L([tt(), fn])),
1677
+ tempDevConfig: m(R()),
1678
+ loop: m(
1679
+ S({
1680
+ open: tt(),
1681
+ data: L([A(R()), fn]),
1682
+ args: m(A(v())),
1683
+ forName: m(v()),
1684
+ forIndex: m(v()),
1685
+ key: m(R()),
1686
+ name: m(v())
1687
+ })
1688
+ )
1689
+ }), le = L([
1690
+ v(),
1691
+ S({
1692
+ label: v(),
1693
+ tip: m(v())
1694
+ })
1695
+ ]), vf = S({
1696
+ type: F("shape"),
1697
+ value: A(
1698
+ S({
1699
+ name: v(),
1700
+ title: le,
1701
+ valueType: jt(() => be)
1702
+ })
1703
+ )
1704
+ }), mf = S({
1705
+ type: F("enums"),
1706
+ value: A(v())
1707
+ });
1708
+ S({
1709
+ type: F("array"),
1710
+ value: jt(() => be)
1711
+ });
1712
+ const yf = S({
1713
+ type: F("array"),
1714
+ value: jt(() => A(be))
1715
+ }), be = L([
1716
+ ze(["array", "boolean", "number", "object", "string"]),
1717
+ ze(["component", "expression", "function"]),
1718
+ vf,
1719
+ mf,
1720
+ yf
1721
+ ]), gf = L([
1722
+ v(),
1723
+ S({
1724
+ componentName: v(),
1725
+ props: m(R()),
1726
+ initialValue: m(R()),
1727
+ component: m(R())
1728
+ })
1729
+ ]), Te = S({
1730
+ name: v(),
1731
+ title: le,
1732
+ valueType: be,
1733
+ description: m(v()),
1734
+ defaultValue: R(),
1735
+ setters: m(A(gf)),
1736
+ condition: m(go())
1737
+ }), bf = L([v(), go()]);
1738
+ var He = /* @__PURE__ */ ((t) => (t.SINGLE = "single", t.GROUP = "group", t))(He || {});
1739
+ L([
1740
+ v(),
1741
+ S({
1742
+ name: v(),
1743
+ describe: m(v()),
1744
+ params: m(
1745
+ S({
1746
+ name: v(),
1747
+ description: v()
1748
+ })
1749
+ ),
1750
+ template: v()
1751
+ })
1752
+ ]);
1753
+ const _f = S({
1754
+ id: m(v()),
1755
+ title: v(),
1756
+ snapshot: L([v(), R()]),
1757
+ snapshotText: m(v()),
1758
+ description: m(v()),
1759
+ tags: m(A(v())),
1760
+ groupName: m(v()),
1761
+ category: m(v()),
1762
+ schema: _r(yo(wt, ["id"]), S({ componentName: m(v()) }))
1763
+ }), jf = S({
1764
+ componentName: v(),
1765
+ title: v(),
1766
+ screenshot: m(v()),
1767
+ icon: m(v()),
1768
+ tags: m(A(v())),
1769
+ groupName: m(v()),
1770
+ category: m(v()),
1771
+ priority: m(bo()),
1772
+ npm: m(jr),
1773
+ snippets: A(_f),
1774
+ props: A(
1775
+ L([
1776
+ Te,
1777
+ S({
1778
+ title: m(le),
1779
+ type: F("single"),
1780
+ content: Te
1781
+ }),
1782
+ S({
1783
+ title: m(le),
1784
+ type: F("group"),
1785
+ content: A(Te)
1786
+ })
1787
+ ])
1788
+ ),
1789
+ fixedProps: m(R()),
1790
+ isContainer: m(
1791
+ L([
1792
+ tt(),
1793
+ S({
1794
+ placeholder: v(),
1795
+ width: v(),
1796
+ height: v()
1797
+ })
1798
+ ])
1799
+ ),
1800
+ isModal: m(
1801
+ L([
1802
+ tt(),
1803
+ S({
1804
+ visibleKey: v()
1805
+ })
1806
+ ])
1807
+ ),
1808
+ isSupportStyle: m(tt()),
1809
+ isSupportDispatchNativeEvent: m(tt()),
1810
+ isLayout: m(tt()),
1811
+ rootSelector: m(v()),
1812
+ selectionToolBars: m(A(bf)),
1813
+ extra: m(Gt(R(), R()))
1814
+ }), wf = (t) => ({ data: e, message: r, throwError: n }) => {
1815
+ const o = t({ data: e, message: r, throwError: n });
1816
+ if (o.isValidate)
1817
+ return o;
1818
+ if (n)
1819
+ throw o.message || r ? new Error(
1820
+ `${o.message || r}
1821
+ originData: ${JSON.stringify(
1822
+ e
1823
+ )}`
1824
+ ) : new Error(
1825
+ `${JSON.stringify(e)}
1826
+ data struct format is invalidate`
1827
+ );
1828
+ return o;
1829
+ }, Or = (t) => {
1830
+ const { data: e, message: r, throwError: n, dataStruct: o } = t;
1831
+ return wf(({ data: a }) => {
1832
+ try {
1833
+ return mo(a, o), {
1834
+ isValidate: !0
1835
+ };
1836
+ } catch (i) {
1837
+ let s = i;
1838
+ return i instanceof vo && (s = i.failures().map((c) => `\u3010${c.path.join(".")}\u3011: ${c.message}
1839
+ `)), {
1840
+ isValidate: !1,
1841
+ message: s,
1842
+ error: i
1843
+ };
1844
+ }
1845
+ })({ data: e, message: r, throwError: n });
1846
+ };
1847
+ var At = /* @__PURE__ */ ((t) => (t.ROOT_CONTAINER = "RootContainer", t))(At || {});
1848
+ const Sf = S({
1849
+ type: F(k.FUNCTION),
1850
+ value: v()
1851
+ }), Of = _r(
1852
+ yo(wt, ["componentName"]),
1853
+ S({
1854
+ componentName: F("RootContainer")
1855
+ })
1856
+ );
1857
+ function Cf(t) {
1858
+ return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
1859
+ var n = t.get(e);
1860
+ n ? n.push(r) : t.set(e, [r]);
1861
+ }, off: function(e, r) {
1862
+ var n = t.get(e);
1863
+ n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t.set(e, []));
1864
+ }, emit: function(e, r) {
1865
+ var n = t.get(e);
1866
+ n && n.slice().map(function(o) {
1867
+ o(r);
1868
+ }), (n = t.get("*")) && n.slice().map(function(o) {
1869
+ o(e, r);
1870
+ });
1871
+ } };
1872
+ }
1873
+ const ee = Cf(), Ef = (t, e) => {
1874
+ const r = {
1875
+ ...t,
1876
+ value: []
1877
+ }, n = t.value;
1878
+ let o = new lt([]);
1879
+ return e && (o = e.materialsMode || new lt([])), n && (M(n) ? r.value = n.map(
1880
+ (a) => new T(a, {
1881
+ parent: e,
1882
+ materials: o
1883
+ })
1884
+ ) : B(n) && r.value.push(
1885
+ new T(n, {
1886
+ parent: e,
1887
+ materials: o
1888
+ })
1889
+ )), r;
1890
+ };
1891
+ class St {
1892
+ constructor(e, r) {
1893
+ _(this, "nodeType", "SLOT"), _(this, "rawData"), _(this, "parent"), _(this, "emitter", ee), _(this, "data"), _(this, "id"), _(this, "materialsMode"), this.parent = (r == null ? void 0 : r.parent) || null, this.rawData = e;
1894
+ const n = (r == null ? void 0 : r.materials) || new lt([]);
1895
+ this.materialsMode = n, this.id = K(), this.data = Ef(e, this);
1896
+ }
1897
+ get value() {
1898
+ return this.data;
1899
+ }
1900
+ export(e) {
1901
+ const r = this.data, n = (o) => {
1902
+ if (o instanceof T)
1903
+ return o.export(e);
1904
+ if (B(o)) {
1905
+ const a = {};
1906
+ return Object.keys(o || {}).forEach((i) => {
1907
+ a[i] = n(o[i]);
1908
+ }), a;
1909
+ }
1910
+ return M(o) ? o.map((a) => n(a)) : (e === "design" && delete o.id, o);
1911
+ };
1912
+ return n(r);
1913
+ }
1914
+ }
1915
+ const jo = (t) => {
1916
+ let e = [];
1917
+ return t.forEach((r) => {
1918
+ const n = r;
1919
+ n.type ? n.type === He.SINGLE ? e.push(n.content) : n.type === He.GROUP && (e = [...e, ...jo(n.content)]) : e.push(r);
1920
+ }), e;
1921
+ }, Ve = (t, e, r) => {
1922
+ if (t.type)
1923
+ return t.type === k.SLOT ? new St(t, { parent: e, materials: r }) : t;
1924
+ if (B(t)) {
1925
+ const n = {};
1926
+ return Object.keys(t).forEach((o) => {
1927
+ n[o] = We(t[o], e, r);
1928
+ }), n;
1929
+ } else
1930
+ return Array.isArray(t) ? t.map((n) => Ve(n, e, r)) : t;
1931
+ }, We = (t, e, r) => B(t) ? Ve(t, e, r) : M(t) ? t.map((n) => Ve(n, e, r)) : t;
1932
+ class at {
1933
+ constructor(e, r, n) {
1934
+ _(this, "nodeType", "PROP"), _(this, "rawData"), _(this, "parent"), _(this, "emitter", ee), _(this, "data"), _(this, "name"), _(this, "materialsMode");
1935
+ const o = (n == null ? void 0 : n.materials) || new lt([]);
1936
+ this.materialsMode = o, this.parent = n == null ? void 0 : n.parent, this.rawData = r, this.name = e, this.data = We(r, this, o);
1937
+ }
1938
+ isIncludeSlot() {
1939
+ return !1;
1940
+ }
1941
+ isIncludeExpression() {
1942
+ return !1;
1943
+ }
1944
+ get value() {
1945
+ return this.data;
1946
+ }
1947
+ updateValue(e) {
1948
+ const r = this.data;
1949
+ this.data = We(e != null ? e : r, this, this.materialsMode), this.emitter.emit("onPropChange", {
1950
+ value: this.data,
1951
+ preValue: r,
1952
+ node: this
1953
+ }), this.parent && !(this.parent instanceof St) && this.emitter.emit("onNodeChange", {
1954
+ value: this.parent.value,
1955
+ preValue: this.parent.value,
1956
+ node: this.parent
1957
+ });
1958
+ }
1959
+ get material() {
1960
+ const e = this.parent;
1961
+ if (e instanceof T) {
1962
+ const r = e.material;
1963
+ return jo((r == null ? void 0 : r.value.props) || []).find((n) => n.name === this.name);
1964
+ } else
1965
+ return null;
1966
+ }
1967
+ export(e) {
1968
+ const r = this.data, n = (o) => {
1969
+ if (o instanceof at || o instanceof St || o instanceof T)
1970
+ return o.export(e);
1971
+ if (M(o))
1972
+ return o.map((a) => n(a));
1973
+ if (B(o)) {
1974
+ const a = {};
1975
+ return Object.keys(o || {}).forEach((i) => {
1976
+ a[i] = n(o[i]);
1977
+ }), a;
1978
+ }
1979
+ return o;
1980
+ };
1981
+ return n(r);
1982
+ }
1983
+ }
1984
+ const xf = (t) => {
1985
+ if (typeof t == "string")
1986
+ return !0;
1987
+ Or({
1988
+ data: t,
1989
+ dataStruct: wt,
1990
+ throwError: !0
1991
+ });
1992
+ }, pn = (t, e, r = new lt([])) => {
1993
+ var n;
1994
+ if (typeof t == "string")
1995
+ return t;
1996
+ const o = {
1997
+ ...t,
1998
+ id: (n = t.id) != null ? n : K(),
1999
+ children: [],
2000
+ props: {},
2001
+ configure: po(t.configure || {}, {
2002
+ propsSetter: {},
2003
+ advanceSetter: {}
2004
+ })
2005
+ }, a = Object.keys(t.props || {});
2006
+ return a.length && a.forEach((i) => {
2007
+ var s;
2008
+ const c = (s = t.props) == null ? void 0 : s[i];
2009
+ if (c instanceof at) {
2010
+ o.props[i] = c;
2011
+ return;
2012
+ }
2013
+ o.props[i] = new at(i, c || "", {
2014
+ parent: e,
2015
+ materials: r
2016
+ });
2017
+ }), t.children && (Array.isArray(t.children) ? o.children = t.children.map((i) => {
2018
+ if (i instanceof T)
2019
+ return i;
2020
+ if (B(i)) {
2021
+ const s = i;
2022
+ return new T(s, {
2023
+ parent: e,
2024
+ materials: r
2025
+ });
2026
+ } else
2027
+ return i;
2028
+ }) : (t.children instanceof T && (o.children = [t.children]), o.children = [
2029
+ new T(t.children, {
2030
+ parent: e,
2031
+ materials: r
2032
+ })
2033
+ ])), o;
2034
+ };
2035
+ class T {
2036
+ constructor(e, r) {
2037
+ _(this, "nodeType", "NODE"), _(this, "rawData"), _(this, "data"), _(this, "emitter", ee), _(this, "parent"), _(this, "materialsModel"), _(this, "listenerHandle"), _(this, "onChangeCbQueue"), this.rawData = JSON.parse(JSON.stringify(e)), xf(e);
2038
+ const n = (r == null ? void 0 : r.materials) || new lt([]);
2039
+ this.parent = (r == null ? void 0 : r.parent) || null, this.materialsModel = n, this.data = pn(e, this, n), this.listenerHandle = [], this.onChangeCbQueue = [], this.registerListener();
2040
+ }
2041
+ registerListener() {
2042
+ const e = (r) => {
2043
+ const { node: n } = r;
2044
+ n === this && n.id === this.id && this.onChangeCbQueue.forEach((o) => o(r));
2045
+ };
2046
+ this.emitter.on("onNodeChange", e), this.listenerHandle.push(() => {
2047
+ this.emitter.off("onNodeChange", e);
2048
+ });
2049
+ }
2050
+ onChange(e) {
2051
+ return this.onChangeCbQueue.push(e), () => {
2052
+ this.onChangeCbQueue = this.onChangeCbQueue.filter((r) => r !== e);
2053
+ };
2054
+ }
2055
+ destroy() {
2056
+ this.listenerHandle.forEach((e) => e());
2057
+ }
2058
+ get id() {
2059
+ return this.data.id;
2060
+ }
2061
+ get value() {
2062
+ return this.data;
2063
+ }
2064
+ clone(e) {
2065
+ const r = {
2066
+ ...this.export("design"),
2067
+ id: e || K()
2068
+ };
2069
+ return new T(r, {
2070
+ materials: this.materialsModel
2071
+ });
2072
+ }
2073
+ updateValue(e) {
2074
+ const r = this.data, n = {
2075
+ ...this.data,
2076
+ ...e
2077
+ };
2078
+ this.data = pn(n, this), this.emitter.emit("onNodeChange", {
2079
+ value: n,
2080
+ preValue: r,
2081
+ node: this
2082
+ });
2083
+ }
2084
+ contains(e) {
2085
+ return Er(this, e);
2086
+ }
2087
+ get props() {
2088
+ return this.data.props;
2089
+ }
2090
+ get material() {
2091
+ const e = this.materialsModel;
2092
+ return e == null ? void 0 : e.findByComponentName(this.data.componentName);
2093
+ }
2094
+ getPlainProps() {
2095
+ const e = this.data, r = {};
2096
+ return Object.keys(e.props || {}).forEach((n) => {
2097
+ r[n] = e.props[n].export("design");
2098
+ }), r;
2099
+ }
2100
+ export(e) {
2101
+ var r;
2102
+ const n = this.data;
2103
+ if (typeof n == "string")
2104
+ return n;
2105
+ const o = {};
2106
+ Object.keys(n.props || {}).forEach((l) => {
2107
+ o[l] = n.props[l].export(e);
2108
+ });
2109
+ const a = (r = n.children) == null ? void 0 : r.map((l) => l instanceof T ? l.export(e) : l), i = n.configure || {}, s = i.propsSetter || {}, c = {};
2110
+ Object.keys(s).forEach((l) => {
2111
+ const p = Jn(s, l, !1);
2112
+ p && (c[l] = p);
2113
+ }), i.propsSetter = c, this.material && this.materialsModel.usedMaterials.push(this.material);
2114
+ let u = {
2115
+ ...n,
2116
+ configure: i,
2117
+ props: o,
2118
+ children: a
2119
+ };
2120
+ return e === "design" && delete u.id, u = Cr(u), u;
2121
+ }
2122
+ }
2123
+ const dn = (t, e, r) => {
2124
+ const n = {
2125
+ ...t,
2126
+ id: K(),
2127
+ props: {},
2128
+ componentName: At.ROOT_CONTAINER,
2129
+ children: [],
2130
+ configure: po(t.configure || {}, {
2131
+ propsSetter: {},
2132
+ advanceSetter: {}
2133
+ })
2134
+ };
2135
+ let o = [];
2136
+ M(t.children) ? o = t.children.map((i) => i instanceof T ? i : B(i) ? new T(i, { parent: e, materials: r }) : i) : t.children instanceof T ? o.push(t.children) : t.children && B(t.children) && o.push(new T(t.children, { parent: e, materials: r }));
2137
+ const a = Object.keys(t.props || {});
2138
+ return a.length && a.forEach((i) => {
2139
+ var s;
2140
+ const c = (s = t.props) == null ? void 0 : s[i];
2141
+ c instanceof at ? n.props[i] = c : n.props[i] = new at(i, c || "", {
2142
+ parent: e,
2143
+ materials: r
2144
+ });
2145
+ }), n.children = o, n;
2146
+ };
2147
+ class Xt {
2148
+ constructor(e, { parent: r, materials: n }) {
2149
+ _(this, "rawData"), _(this, "data"), _(this, "nodeType", At.ROOT_CONTAINER), _(this, "emitter", ee), _(this, "materialsModel"), _(this, "listenerHandle"), _(this, "onChangeCbQueue"), _(this, "parent"), this.materialsModel = n, this.rawData = JSON.parse(JSON.stringify(e)), this.data = dn(e, this, n), this.listenerHandle = [], this.onChangeCbQueue = [], this.registerListener(), this.parent = r;
2150
+ }
2151
+ registerListener() {
2152
+ const e = (r) => {
2153
+ const { node: n } = r;
2154
+ n === this && n.id === this.id && this.onChangeCbQueue.forEach((o) => o(r));
2155
+ };
2156
+ this.emitter.on("onNodeChange", e), this.listenerHandle.push(() => {
2157
+ this.emitter.off("onNodeChange", e);
2158
+ });
2159
+ }
2160
+ onChange(e) {
2161
+ return this.onChangeCbQueue.push(e), () => {
2162
+ this.onChangeCbQueue = this.onChangeCbQueue.filter((r) => r !== e);
2163
+ };
2164
+ }
2165
+ get id() {
2166
+ return this.data.id;
2167
+ }
2168
+ get value() {
2169
+ return this.data;
2170
+ }
2171
+ get props() {
2172
+ return this.data.props;
2173
+ }
2174
+ get material() {
2175
+ const e = this.materialsModel;
2176
+ return e == null ? void 0 : e.findByComponentName(this.data.componentName);
2177
+ }
2178
+ updateValue(e) {
2179
+ const r = this.data, n = {
2180
+ ...this.data,
2181
+ ...e
2182
+ };
2183
+ this.data = dn(n, this, this.materialsModel), this.emitter.emit("onNodeChange", {
2184
+ value: this.data,
2185
+ preValue: r,
2186
+ node: this
2187
+ });
2188
+ }
2189
+ contains(e) {
2190
+ return Er(this, e);
2191
+ }
2192
+ export(e = wr.SAVE) {
2193
+ var r;
2194
+ const n = this.data, o = {};
2195
+ Object.keys(n.props || {}).forEach((c) => {
2196
+ o[c] = n.props[c].export(e);
2197
+ });
2198
+ const a = ((r = n.children) == null ? void 0 : r.map((c) => {
2199
+ var u;
2200
+ return (u = c == null ? void 0 : c.export) == null ? void 0 : u.call(c, e);
2201
+ })) || [], i = {
2202
+ ...n,
2203
+ props: o,
2204
+ children: a.filter((c) => c)
2205
+ };
2206
+ let s = ho(i, ["id"]);
2207
+ return s = Cr(s), s;
2208
+ }
2209
+ getPlainProps() {
2210
+ const e = this.data, r = {};
2211
+ return Object.keys(e.props || {}).forEach((n) => {
2212
+ r[n] = e.props[n].export("design");
2213
+ }), r;
2214
+ }
2215
+ destroy() {
2216
+ this.listenerHandle.forEach((e) => e());
2217
+ }
2218
+ clone(e) {
2219
+ const r = {
2220
+ ...this.export("design"),
2221
+ id: e || K()
2222
+ };
2223
+ return new Xt(r, {
2224
+ materials: this.materialsModel,
2225
+ parent: null
2226
+ });
2227
+ }
2228
+ }
2229
+ const it = (t) => (t == null ? void 0 : t.type) === k.EXPRESSION, Nf = (t) => (t == null ? void 0 : t.type) == k.FUNCTION, K = () => Math.random().toString(32).slice(3, 9), $f = (t) => (t == null ? void 0 : t.nodeType) === "NODE", Ae = (t) => (t == null ? void 0 : t.nodeType) === "PROP", Tf = (t) => (t == null ? void 0 : t.nodeType) === "SLOT", Cr = (t) => Ql(t, (e) => B(e) ? !Object.keys(e).length : M(e) ? !e.length : !e);
2230
+ function Er(t, e) {
2231
+ const r = [t];
2232
+ for (; r.length; ) {
2233
+ const n = r.shift();
2234
+ if ((n == null ? void 0 : n.id) === e)
2235
+ return n;
2236
+ const o = (n == null ? void 0 : n.props) || {}, a = (s) => {
2237
+ if (s instanceof T) {
2238
+ r.push(s);
2239
+ return;
2240
+ }
2241
+ if (s instanceof St && a(s.value.value), s instanceof at) {
2242
+ a(s.value);
2243
+ return;
2244
+ }
2245
+ if (B(s)) {
2246
+ const c = s;
2247
+ Object.keys(c).map((u) => {
2248
+ a(c[u]);
2249
+ });
2250
+ return;
2251
+ }
2252
+ if (M(s)) {
2253
+ s.forEach((c) => {
2254
+ a(c);
2255
+ });
2256
+ return;
2257
+ }
2258
+ };
2259
+ a(o);
2260
+ const i = (n == null ? void 0 : n.value.children.filter((s) => s instanceof T)) || [];
2261
+ r.push(...i);
2262
+ }
2263
+ return null;
2264
+ }
2265
+ const Af = (t) => {
2266
+ const e = ao(t), r = e.snippets;
2267
+ return delete e.snippets, e.snippets = r.map((n) => ({
2268
+ ...e,
2269
+ ...n,
2270
+ id: n.id || `${t.componentName}-${K()}`,
2271
+ title: n.title || t.title,
2272
+ category: n.category || t.category,
2273
+ tags: [...n.tags || [], ...t.tags || []],
2274
+ groupName: n.groupName || t.groupName,
2275
+ snapshot: n.snapshot || t.icon,
2276
+ snapshotText: n.snapshotText,
2277
+ schema: {
2278
+ ...n.schema,
2279
+ componentName: n.schema.componentName || t.componentName
2280
+ }
2281
+ })), e;
2282
+ };
2283
+ class Mf {
2284
+ constructor(e) {
2285
+ _(this, "rawData"), _(this, "data"), this.rawData = e, this.data = Af(e);
2286
+ }
2287
+ get value() {
2288
+ return this.data;
2289
+ }
2290
+ get rawValue() {
2291
+ return this.rawData;
2292
+ }
2293
+ get componentName() {
2294
+ return this.data.componentName;
2295
+ }
2296
+ get snippets() {
2297
+ return this.data.snippets;
2298
+ }
2299
+ getSnippetById(e) {
2300
+ return this.data.snippets.find((r) => r.id === e);
2301
+ }
2302
+ }
2303
+ const Pf = (t) => {
2304
+ if (!M(t))
2305
+ throw new Error("Materials must be a array");
2306
+ return t.map((e) => new Mf(e));
2307
+ }, Df = (t) => {
2308
+ t == null || t.forEach((e) => {
2309
+ Or({
2310
+ data: e,
2311
+ dataStruct: jf,
2312
+ throwError: !0
2313
+ });
2314
+ });
2315
+ };
2316
+ class lt {
2317
+ constructor(e) {
2318
+ _(this, "rawData"), _(this, "data"), _(this, "usedMaterials", []), this.rawData = e, Df(e), this.data = Pf(e);
2319
+ }
2320
+ findByComponentName(e) {
2321
+ return this.data.find((r) => r.componentName === e);
2322
+ }
2323
+ findSnippetById(e) {
2324
+ const r = [...this.data];
2325
+ let n = null;
2326
+ for (; !n && r.length; ) {
2327
+ const o = r.pop();
2328
+ n = o == null ? void 0 : o.getSnippetById(e);
2329
+ }
2330
+ return n;
2331
+ }
2332
+ getAllSnippets() {
2333
+ let e = this.data.reduce((a, i) => (a.push(...i.snippets), a), []);
2334
+ const r = [], n = {
2335
+ default: []
2336
+ };
2337
+ e = e.sort((a, i) => (a.category || "") > (i.category || "") ? 1 : -1), e.forEach((a) => {
2338
+ const i = a.groupName || "default";
2339
+ r.includes(i) || (r.push(i), n[i] = []), n[i].push(a);
2340
+ });
2341
+ const o = [];
2342
+ return r.forEach((a) => {
2343
+ const i = ["default"], s = {
2344
+ default: []
2345
+ }, c = n[a];
2346
+ if (c.length !== 0) {
2347
+ c.forEach((p) => {
2348
+ const f = p.category || "default";
2349
+ i.includes(f) || (i.push(f), s[f] = []), s[f].push(p);
2350
+ });
2351
+ const u = [];
2352
+ i.forEach((p) => {
2353
+ s[p].length && u.push({
2354
+ name: p,
2355
+ list: s[p]
2356
+ });
2357
+ });
2358
+ const l = {
2359
+ name: a,
2360
+ list: u
2361
+ };
2362
+ o.push(l);
2363
+ }
2364
+ }), o;
2365
+ }
2366
+ get value() {
2367
+ return this.data;
2368
+ }
2369
+ get rawValue() {
2370
+ return this.rawData;
2371
+ }
2372
+ }
2373
+ const Rf = S({
2374
+ version: v(),
2375
+ name: v(),
2376
+ css: m(v()),
2377
+ renderType: m(L([F("COMPONENT"), F("PAGE")])),
2378
+ methods: m(A(Sf)),
2379
+ componentsMeta: A(
2380
+ _r(
2381
+ S({
2382
+ componentName: v()
2383
+ }),
2384
+ jr
2385
+ )
2386
+ ),
2387
+ thirdLibs: m(pf),
2388
+ componentsTree: Of,
2389
+ assets: m(A(R()))
2390
+ }), wo = (t) => (Or({
2391
+ data: t,
2392
+ dataStruct: Rf,
2393
+ throwError: !0
2394
+ }), t), Me = (t, e, r) => ({
2395
+ ...t,
2396
+ componentsTree: new Xt(t.componentsTree, {
2397
+ parent: e,
2398
+ materials: r
2399
+ })
2400
+ });
2401
+ class fe {
2402
+ constructor(e, r) {
2403
+ _(this, "nodeType", "PAGE"), _(this, "rawData"), _(this, "emitter", ee), _(this, "data"), _(this, "parent"), _(this, "materialsModel"), _(this, "assetPackagesList"), wo(e), this.assetPackagesList = (r == null ? void 0 : r.assetPackagesList) || [], this.rawData = JSON.parse(JSON.stringify(e)), this.materialsModel = new lt((r == null ? void 0 : r.materials) || []), this.data = Me(e, this, this.materialsModel);
2404
+ }
2405
+ updatePage(e) {
2406
+ const r = this.data;
2407
+ this.rawData = JSON.parse(JSON.stringify(e)), this.data = Me(e, this, this.materialsModel), this.emitter.emit("onPageChange", {
2408
+ value: this.data,
2409
+ preValue: r,
2410
+ node: this
2411
+ });
2412
+ }
2413
+ reloadPage(e) {
2414
+ const r = this.data;
2415
+ this.rawData = JSON.parse(JSON.stringify(e)), this.data = Me(e, this, this.materialsModel), this.emitter.emit("onReloadPage", {
2416
+ value: this.data,
2417
+ preValue: r,
2418
+ node: this
2419
+ });
2420
+ }
2421
+ get value() {
2422
+ return this.data;
2423
+ }
2424
+ getNode(e) {
2425
+ const r = this.data.componentsTree;
2426
+ return Er(r, e);
2427
+ }
2428
+ addNode(e, r, n = "AFTER") {
2429
+ var o, a, i;
2430
+ if (n === "AFTER" || n === "BEFORE") {
2431
+ const s = r.parent;
2432
+ if (s === null && r instanceof Xt)
2433
+ return console.warn("Not found parent node"), !1;
2434
+ if (s instanceof at)
2435
+ return console.warn("CProp can not add node"), !1;
2436
+ if (s instanceof St) {
2437
+ const u = s.value.value, l = (o = u.findIndex((p) => p === r)) != null ? o : -1;
2438
+ return l >= 0 ? (n === "BEFORE" ? u.splice(l, 0, e) : u.splice(l + 1, 0, e), e.parent = s, (a = s.parent) == null || a.updateValue(), !0) : !1;
2439
+ }
2440
+ if (s instanceof fe)
2441
+ return !1;
2442
+ const c = (i = s == null ? void 0 : s.value.children.findIndex((u) => u === r)) != null ? i : -1;
2443
+ return c >= 0 ? (n === "BEFORE" ? s == null || s.value.children.splice(c, 0, e) : s == null || s.value.children.splice(c + 1, 0, e), e.parent = s, s == null || s.updateValue(), !0) : (console.warn("Not found target node"), !1);
2444
+ }
2445
+ if (n === "CHILD_START")
2446
+ return r.value.children.unshift(e), e.parent = r, r.updateValue(), !0;
2447
+ if (n === "CHILD_END")
2448
+ return r.value.children.push(e), e.parent = r, r.updateValue(), !0;
2449
+ if (B(n)) {
2450
+ const s = n;
2451
+ if (s.type === "CHILD") {
2452
+ const c = s.pos, u = s.index || 0;
2453
+ return c === "BEFORE" ? r == null || r.value.children.splice(u, 0, e) : r == null || r.value.children.splice(u + 1, 0, e), e.parent = r, r.updateValue(), !0;
2454
+ } else
2455
+ console.warn("Can not parse pos obj");
2456
+ }
2457
+ return !1;
2458
+ }
2459
+ createNode(e) {
2460
+ return delete e.id, new T(e, {
2461
+ parent: null,
2462
+ materials: this.materialsModel
2463
+ });
2464
+ }
2465
+ addNodeById(e, r, n = "AFTER") {
2466
+ const o = this.getNode(r);
2467
+ return o ? this.addNode(e, o, n) : (console.warn(`Not find a node by ${r}, pls check it`), !1);
2468
+ }
2469
+ copyNode(e) {
2470
+ const r = e.export("design");
2471
+ r.id = K();
2472
+ const n = new T(r, {
2473
+ parent: e.parent,
2474
+ materials: this.materialsModel
2475
+ });
2476
+ return this.addNode(n, e, "AFTER"), n;
2477
+ }
2478
+ copyNodeById(e) {
2479
+ const r = this.getNode(e);
2480
+ return r && r instanceof T ? this.copyNode(r) : !1;
2481
+ }
2482
+ moveNode(e, r, n) {
2483
+ this.deleteNode(e);
2484
+ let o = r;
2485
+ return ["AFTER", "BEFORE"].includes(n) && (o = r.parent), e.parent = o, this.addNode(e, r, n);
2486
+ }
2487
+ moveNodeById(e, r, n) {
2488
+ const o = this.getNode(e), a = this.getNode(r);
2489
+ return o && a && o instanceof T && a instanceof T ? this.moveNode(o, a, n) : !1;
2490
+ }
2491
+ deleteNode(e) {
2492
+ var r;
2493
+ const n = e.parent;
2494
+ if (!n)
2495
+ throw new Error("parent node is null or undefined, pls check it");
2496
+ if (n instanceof St) {
2497
+ const o = n.value.value, a = o.findIndex((s) => s === e), i = o[a];
2498
+ return o.splice(a, 1), (r = n.parent) == null || r.updateValue(), i;
2499
+ }
2500
+ if (n instanceof T || n instanceof Xt) {
2501
+ const o = n.value.children, a = o.findIndex((s) => s === e), i = o[a];
2502
+ return o.splice(a, 1), n.updateValue(), i;
2503
+ }
2504
+ }
2505
+ deleteNodeById(e) {
2506
+ const r = this.getNode(e);
2507
+ if (r)
2508
+ return this.deleteNode(r);
2509
+ }
2510
+ export(e = wr.SAVE) {
2511
+ var r;
2512
+ const n = this.data.componentsTree.export(e), o = this.assetPackagesList, a = [], i = this.materialsModel.usedMaterials.map((c) => {
2513
+ const u = o.find((l) => {
2514
+ var p;
2515
+ return l.package === ((p = c.value.npm) == null ? void 0 : p.package);
2516
+ });
2517
+ return u && a.push(u), {
2518
+ componentName: c.componentName,
2519
+ ...ao(c.value.npm || {})
2520
+ };
2521
+ }).filter((c) => {
2522
+ if (c.componentName && c.package && c.version)
2523
+ return !0;
2524
+ });
2525
+ this.materialsModel.usedMaterials = [];
2526
+ let s = {
2527
+ ...this.data,
2528
+ componentsTree: Cr(n),
2529
+ componentsMeta: i,
2530
+ thirdLibs: this.data.thirdLibs,
2531
+ assets: []
2532
+ };
2533
+ return (r = this.data.thirdLibs) == null || r.forEach((c) => {
2534
+ const u = o.find((l) => {
2535
+ l.package, l.package;
2536
+ });
2537
+ u && a.push(u);
2538
+ }), s.assets = rf(a, (c) => c.package), s = ho(s, ["id"]), JSON.parse(JSON.stringify(s));
2539
+ }
2540
+ }
2541
+ At.ROOT_CONTAINER;
2542
+ var If = typeof global == "object" && global && global.Object === Object && global;
2543
+ const So = If;
2544
+ var Lf = typeof self == "object" && self && self.Object === Object && self, Ff = So || Lf || Function("return this")();
2545
+ const Mt = Ff;
2546
+ var Bf = Mt.Symbol;
2547
+ const Ot = Bf;
2548
+ var Oo = Object.prototype, Uf = Oo.hasOwnProperty, kf = Oo.toString, Ut = Ot ? Ot.toStringTag : void 0;
2549
+ function zf(t) {
2550
+ var e = Uf.call(t, Ut), r = t[Ut];
2551
+ try {
2552
+ t[Ut] = void 0;
2553
+ var n = !0;
2554
+ } catch {
2555
+ }
2556
+ var o = kf.call(t);
2557
+ return n && (e ? t[Ut] = r : delete t[Ut]), o;
2558
+ }
2559
+ var Gf = Object.prototype, Hf = Gf.toString;
2560
+ function Vf(t) {
2561
+ return Hf.call(t);
2562
+ }
2563
+ var Wf = "[object Null]", Jf = "[object Undefined]", hn = Ot ? Ot.toStringTag : void 0;
2564
+ function re(t) {
2565
+ return t == null ? t === void 0 ? Jf : Wf : hn && hn in Object(t) ? zf(t) : Vf(t);
2566
+ }
2567
+ function Pt(t) {
2568
+ return t != null && typeof t == "object";
2569
+ }
2570
+ var qf = "[object Symbol]";
2571
+ function Qf(t) {
2572
+ return typeof t == "symbol" || Pt(t) && re(t) == qf;
2573
+ }
2574
+ function Yf(t, e) {
2575
+ for (var r = -1, n = t == null ? 0 : t.length, o = Array(n); ++r < n; )
2576
+ o[r] = e(t[r], r, t);
2577
+ return o;
2578
+ }
2579
+ var Xf = Array.isArray;
2580
+ const Ct = Xf;
2581
+ var Kf = 1 / 0, vn = Ot ? Ot.prototype : void 0, mn = vn ? vn.toString : void 0;
2582
+ function Co(t) {
2583
+ if (typeof t == "string")
2584
+ return t;
2585
+ if (Ct(t))
2586
+ return Yf(t, Co) + "";
2587
+ if (Qf(t))
2588
+ return mn ? mn.call(t) : "";
2589
+ var e = t + "";
2590
+ return e == "0" && 1 / t == -Kf ? "-0" : e;
2591
+ }
2592
+ function vt(t) {
2593
+ var e = typeof t;
2594
+ return t != null && (e == "object" || e == "function");
2595
+ }
2596
+ function Eo(t) {
2597
+ return t;
2598
+ }
2599
+ var Zf = "[object AsyncFunction]", tp = "[object Function]", ep = "[object GeneratorFunction]", rp = "[object Proxy]";
2600
+ function xr(t) {
2601
+ if (!vt(t))
2602
+ return !1;
2603
+ var e = re(t);
2604
+ return e == tp || e == ep || e == Zf || e == rp;
2605
+ }
2606
+ var np = Mt["__core-js_shared__"];
2607
+ const Pe = np;
2608
+ var yn = function() {
2609
+ var t = /[^.]+$/.exec(Pe && Pe.keys && Pe.keys.IE_PROTO || "");
2610
+ return t ? "Symbol(src)_1." + t : "";
2611
+ }();
2612
+ function op(t) {
2613
+ return !!yn && yn in t;
2614
+ }
2615
+ var ap = Function.prototype, sp = ap.toString;
2616
+ function ip(t) {
2617
+ if (t != null) {
2618
+ try {
2619
+ return sp.call(t);
2620
+ } catch {
2621
+ }
2622
+ try {
2623
+ return t + "";
2624
+ } catch {
2625
+ }
2626
+ }
2627
+ return "";
2628
+ }
2629
+ var cp = /[\\^$.*+?()[\]{}|]/g, up = /^\[object .+?Constructor\]$/, lp = Function.prototype, fp = Object.prototype, pp = lp.toString, dp = fp.hasOwnProperty, hp = RegExp(
2630
+ "^" + pp.call(dp).replace(cp, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2631
+ );
2632
+ function vp(t) {
2633
+ if (!vt(t) || op(t))
2634
+ return !1;
2635
+ var e = xr(t) ? hp : up;
2636
+ return e.test(ip(t));
2637
+ }
2638
+ function mp(t, e) {
2639
+ return t == null ? void 0 : t[e];
2640
+ }
2641
+ function Nr(t, e) {
2642
+ var r = mp(t, e);
2643
+ return vp(r) ? r : void 0;
2644
+ }
2645
+ var gn = Object.create, yp = function() {
2646
+ function t() {
2647
+ }
2648
+ return function(e) {
2649
+ if (!vt(e))
2650
+ return {};
2651
+ if (gn)
2652
+ return gn(e);
2653
+ t.prototype = e;
2654
+ var r = new t();
2655
+ return t.prototype = void 0, r;
2656
+ };
2657
+ }();
2658
+ const gp = yp;
2659
+ function bp(t, e, r) {
2660
+ switch (r.length) {
2661
+ case 0:
2662
+ return t.call(e);
2663
+ case 1:
2664
+ return t.call(e, r[0]);
2665
+ case 2:
2666
+ return t.call(e, r[0], r[1]);
2667
+ case 3:
2668
+ return t.call(e, r[0], r[1], r[2]);
2669
+ }
2670
+ return t.apply(e, r);
2671
+ }
2672
+ function _p(t, e) {
2673
+ var r = -1, n = t.length;
2674
+ for (e || (e = Array(n)); ++r < n; )
2675
+ e[r] = t[r];
2676
+ return e;
2677
+ }
2678
+ var jp = 800, wp = 16, Sp = Date.now;
2679
+ function Op(t) {
2680
+ var e = 0, r = 0;
2681
+ return function() {
2682
+ var n = Sp(), o = wp - (n - r);
2683
+ if (r = n, o > 0) {
2684
+ if (++e >= jp)
2685
+ return arguments[0];
2686
+ } else
2687
+ e = 0;
2688
+ return t.apply(void 0, arguments);
2689
+ };
2690
+ }
2691
+ function Cp(t) {
2692
+ return function() {
2693
+ return t;
2694
+ };
2695
+ }
2696
+ var Ep = function() {
2697
+ try {
2698
+ var t = Nr(Object, "defineProperty");
2699
+ return t({}, "", {}), t;
2700
+ } catch {
2701
+ }
2702
+ }();
2703
+ const pe = Ep;
2704
+ var xp = pe ? function(t, e) {
2705
+ return pe(t, "toString", {
2706
+ configurable: !0,
2707
+ enumerable: !1,
2708
+ value: Cp(e),
2709
+ writable: !0
2710
+ });
2711
+ } : Eo;
2712
+ const Np = xp;
2713
+ var $p = Op(Np);
2714
+ const Tp = $p;
2715
+ var Ap = 9007199254740991, Mp = /^(?:0|[1-9]\d*)$/;
2716
+ function xo(t, e) {
2717
+ var r = typeof t;
2718
+ return e = e == null ? Ap : e, !!e && (r == "number" || r != "symbol" && Mp.test(t)) && t > -1 && t % 1 == 0 && t < e;
2719
+ }
2720
+ function $r(t, e, r) {
2721
+ e == "__proto__" && pe ? pe(t, e, {
2722
+ configurable: !0,
2723
+ enumerable: !0,
2724
+ value: r,
2725
+ writable: !0
2726
+ }) : t[e] = r;
2727
+ }
2728
+ function _e(t, e) {
2729
+ return t === e || t !== t && e !== e;
2730
+ }
2731
+ var Pp = Object.prototype, Dp = Pp.hasOwnProperty;
2732
+ function Rp(t, e, r) {
2733
+ var n = t[e];
2734
+ (!(Dp.call(t, e) && _e(n, r)) || r === void 0 && !(e in t)) && $r(t, e, r);
2735
+ }
2736
+ function Ip(t, e, r, n) {
2737
+ var o = !r;
2738
+ r || (r = {});
2739
+ for (var a = -1, i = e.length; ++a < i; ) {
2740
+ var s = e[a], c = n ? n(r[s], t[s], s, r, t) : void 0;
2741
+ c === void 0 && (c = t[s]), o ? $r(r, s, c) : Rp(r, s, c);
2742
+ }
2743
+ return r;
2744
+ }
2745
+ var bn = Math.max;
2746
+ function Lp(t, e, r) {
2747
+ return e = bn(e === void 0 ? t.length - 1 : e, 0), function() {
2748
+ for (var n = arguments, o = -1, a = bn(n.length - e, 0), i = Array(a); ++o < a; )
2749
+ i[o] = n[e + o];
2750
+ o = -1;
2751
+ for (var s = Array(e + 1); ++o < e; )
2752
+ s[o] = n[o];
2753
+ return s[e] = r(i), bp(t, this, s);
2754
+ };
2755
+ }
2756
+ function Fp(t, e) {
2757
+ return Tp(Lp(t, e, Eo), t + "");
2758
+ }
2759
+ var Bp = 9007199254740991;
2760
+ function No(t) {
2761
+ return typeof t == "number" && t > -1 && t % 1 == 0 && t <= Bp;
2762
+ }
2763
+ function Tr(t) {
2764
+ return t != null && No(t.length) && !xr(t);
2765
+ }
2766
+ function Up(t, e, r) {
2767
+ if (!vt(r))
2768
+ return !1;
2769
+ var n = typeof e;
2770
+ return (n == "number" ? Tr(r) && xo(e, r.length) : n == "string" && e in r) ? _e(r[e], t) : !1;
2771
+ }
2772
+ function kp(t) {
2773
+ return Fp(function(e, r) {
2774
+ var n = -1, o = r.length, a = o > 1 ? r[o - 1] : void 0, i = o > 2 ? r[2] : void 0;
2775
+ for (a = t.length > 3 && typeof a == "function" ? (o--, a) : void 0, i && Up(r[0], r[1], i) && (a = o < 3 ? void 0 : a, o = 1), e = Object(e); ++n < o; ) {
2776
+ var s = r[n];
2777
+ s && t(e, s, n, a);
2778
+ }
2779
+ return e;
2780
+ });
2781
+ }
2782
+ var zp = Object.prototype;
2783
+ function $o(t) {
2784
+ var e = t && t.constructor, r = typeof e == "function" && e.prototype || zp;
2785
+ return t === r;
2786
+ }
2787
+ function Gp(t, e) {
2788
+ for (var r = -1, n = Array(t); ++r < t; )
2789
+ n[r] = e(r);
2790
+ return n;
2791
+ }
2792
+ var Hp = "[object Arguments]";
2793
+ function _n(t) {
2794
+ return Pt(t) && re(t) == Hp;
2795
+ }
2796
+ var To = Object.prototype, Vp = To.hasOwnProperty, Wp = To.propertyIsEnumerable, Jp = _n(function() {
2797
+ return arguments;
2798
+ }()) ? _n : function(t) {
2799
+ return Pt(t) && Vp.call(t, "callee") && !Wp.call(t, "callee");
2800
+ };
2801
+ const Je = Jp;
2802
+ function qp() {
2803
+ return !1;
2804
+ }
2805
+ var Ao = typeof exports == "object" && exports && !exports.nodeType && exports, jn = Ao && typeof module == "object" && module && !module.nodeType && module, Qp = jn && jn.exports === Ao, wn = Qp ? Mt.Buffer : void 0, Yp = wn ? wn.isBuffer : void 0, Xp = Yp || qp;
2806
+ const Mo = Xp;
2807
+ var Kp = "[object Arguments]", Zp = "[object Array]", td = "[object Boolean]", ed = "[object Date]", rd = "[object Error]", nd = "[object Function]", od = "[object Map]", ad = "[object Number]", sd = "[object Object]", id = "[object RegExp]", cd = "[object Set]", ud = "[object String]", ld = "[object WeakMap]", fd = "[object ArrayBuffer]", pd = "[object DataView]", dd = "[object Float32Array]", hd = "[object Float64Array]", vd = "[object Int8Array]", md = "[object Int16Array]", yd = "[object Int32Array]", gd = "[object Uint8Array]", bd = "[object Uint8ClampedArray]", _d = "[object Uint16Array]", jd = "[object Uint32Array]", N = {};
2808
+ N[dd] = N[hd] = N[vd] = N[md] = N[yd] = N[gd] = N[bd] = N[_d] = N[jd] = !0;
2809
+ N[Kp] = N[Zp] = N[fd] = N[td] = N[pd] = N[ed] = N[rd] = N[nd] = N[od] = N[ad] = N[sd] = N[id] = N[cd] = N[ud] = N[ld] = !1;
2810
+ function wd(t) {
2811
+ return Pt(t) && No(t.length) && !!N[re(t)];
2812
+ }
2813
+ function Sd(t) {
2814
+ return function(e) {
2815
+ return t(e);
2816
+ };
2817
+ }
2818
+ var Po = typeof exports == "object" && exports && !exports.nodeType && exports, Ht = Po && typeof module == "object" && module && !module.nodeType && module, Od = Ht && Ht.exports === Po, De = Od && So.process, Cd = function() {
2819
+ try {
2820
+ var t = Ht && Ht.require && Ht.require("util").types;
2821
+ return t || De && De.binding && De.binding("util");
2822
+ } catch {
2823
+ }
2824
+ }();
2825
+ const Sn = Cd;
2826
+ var On = Sn && Sn.isTypedArray, Ed = On ? Sd(On) : wd;
2827
+ const Do = Ed;
2828
+ var xd = Object.prototype, Nd = xd.hasOwnProperty;
2829
+ function $d(t, e) {
2830
+ var r = Ct(t), n = !r && Je(t), o = !r && !n && Mo(t), a = !r && !n && !o && Do(t), i = r || n || o || a, s = i ? Gp(t.length, String) : [], c = s.length;
2831
+ for (var u in t)
2832
+ (e || Nd.call(t, u)) && !(i && (u == "length" || o && (u == "offset" || u == "parent") || a && (u == "buffer" || u == "byteLength" || u == "byteOffset") || xo(u, c))) && s.push(u);
2833
+ return s;
2834
+ }
2835
+ function Td(t, e) {
2836
+ return function(r) {
2837
+ return t(e(r));
2838
+ };
2839
+ }
2840
+ function Ad(t) {
2841
+ var e = [];
2842
+ if (t != null)
2843
+ for (var r in Object(t))
2844
+ e.push(r);
2845
+ return e;
2846
+ }
2847
+ var Md = Object.prototype, Pd = Md.hasOwnProperty;
2848
+ function Dd(t) {
2849
+ if (!vt(t))
2850
+ return Ad(t);
2851
+ var e = $o(t), r = [];
2852
+ for (var n in t)
2853
+ n == "constructor" && (e || !Pd.call(t, n)) || r.push(n);
2854
+ return r;
2855
+ }
2856
+ function Ro(t) {
2857
+ return Tr(t) ? $d(t, !0) : Dd(t);
2858
+ }
2859
+ var Rd = Nr(Object, "create");
2860
+ const Kt = Rd;
2861
+ function Id() {
2862
+ this.__data__ = Kt ? Kt(null) : {}, this.size = 0;
2863
+ }
2864
+ function Ld(t) {
2865
+ var e = this.has(t) && delete this.__data__[t];
2866
+ return this.size -= e ? 1 : 0, e;
2867
+ }
2868
+ var Fd = "__lodash_hash_undefined__", Bd = Object.prototype, Ud = Bd.hasOwnProperty;
2869
+ function kd(t) {
2870
+ var e = this.__data__;
2871
+ if (Kt) {
2872
+ var r = e[t];
2873
+ return r === Fd ? void 0 : r;
2874
+ }
2875
+ return Ud.call(e, t) ? e[t] : void 0;
2876
+ }
2877
+ var zd = Object.prototype, Gd = zd.hasOwnProperty;
2878
+ function Hd(t) {
2879
+ var e = this.__data__;
2880
+ return Kt ? e[t] !== void 0 : Gd.call(e, t);
2881
+ }
2882
+ var Vd = "__lodash_hash_undefined__";
2883
+ function Wd(t, e) {
2884
+ var r = this.__data__;
2885
+ return this.size += this.has(t) ? 0 : 1, r[t] = Kt && e === void 0 ? Vd : e, this;
2886
+ }
2887
+ function ft(t) {
2888
+ var e = -1, r = t == null ? 0 : t.length;
2889
+ for (this.clear(); ++e < r; ) {
2890
+ var n = t[e];
2891
+ this.set(n[0], n[1]);
2892
+ }
2893
+ }
2894
+ ft.prototype.clear = Id;
2895
+ ft.prototype.delete = Ld;
2896
+ ft.prototype.get = kd;
2897
+ ft.prototype.has = Hd;
2898
+ ft.prototype.set = Wd;
2899
+ function Jd() {
2900
+ this.__data__ = [], this.size = 0;
2901
+ }
2902
+ function je(t, e) {
2903
+ for (var r = t.length; r--; )
2904
+ if (_e(t[r][0], e))
2905
+ return r;
2906
+ return -1;
2907
+ }
2908
+ var qd = Array.prototype, Qd = qd.splice;
2909
+ function Yd(t) {
2910
+ var e = this.__data__, r = je(e, t);
2911
+ if (r < 0)
2912
+ return !1;
2913
+ var n = e.length - 1;
2914
+ return r == n ? e.pop() : Qd.call(e, r, 1), --this.size, !0;
2915
+ }
2916
+ function Xd(t) {
2917
+ var e = this.__data__, r = je(e, t);
2918
+ return r < 0 ? void 0 : e[r][1];
2919
+ }
2920
+ function Kd(t) {
2921
+ return je(this.__data__, t) > -1;
2922
+ }
2923
+ function Zd(t, e) {
2924
+ var r = this.__data__, n = je(r, t);
2925
+ return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
2926
+ }
2927
+ function nt(t) {
2928
+ var e = -1, r = t == null ? 0 : t.length;
2929
+ for (this.clear(); ++e < r; ) {
2930
+ var n = t[e];
2931
+ this.set(n[0], n[1]);
2932
+ }
2933
+ }
2934
+ nt.prototype.clear = Jd;
2935
+ nt.prototype.delete = Yd;
2936
+ nt.prototype.get = Xd;
2937
+ nt.prototype.has = Kd;
2938
+ nt.prototype.set = Zd;
2939
+ var th = Nr(Mt, "Map");
2940
+ const Io = th;
2941
+ function eh() {
2942
+ this.size = 0, this.__data__ = {
2943
+ hash: new ft(),
2944
+ map: new (Io || nt)(),
2945
+ string: new ft()
2946
+ };
2947
+ }
2948
+ function rh(t) {
2949
+ var e = typeof t;
2950
+ return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
2951
+ }
2952
+ function we(t, e) {
2953
+ var r = t.__data__;
2954
+ return rh(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
2955
+ }
2956
+ function nh(t) {
2957
+ var e = we(this, t).delete(t);
2958
+ return this.size -= e ? 1 : 0, e;
2959
+ }
2960
+ function oh(t) {
2961
+ return we(this, t).get(t);
2962
+ }
2963
+ function ah(t) {
2964
+ return we(this, t).has(t);
2965
+ }
2966
+ function sh(t, e) {
2967
+ var r = we(this, t), n = r.size;
2968
+ return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
2969
+ }
2970
+ function Dt(t) {
2971
+ var e = -1, r = t == null ? 0 : t.length;
2972
+ for (this.clear(); ++e < r; ) {
2973
+ var n = t[e];
2974
+ this.set(n[0], n[1]);
2975
+ }
2976
+ }
2977
+ Dt.prototype.clear = eh;
2978
+ Dt.prototype.delete = nh;
2979
+ Dt.prototype.get = oh;
2980
+ Dt.prototype.has = ah;
2981
+ Dt.prototype.set = sh;
2982
+ function Lo(t) {
2983
+ return t == null ? "" : Co(t);
2984
+ }
2985
+ var ih = Td(Object.getPrototypeOf, Object);
2986
+ const Fo = ih;
2987
+ var ch = "[object Object]", uh = Function.prototype, lh = Object.prototype, Bo = uh.toString, fh = lh.hasOwnProperty, ph = Bo.call(Object);
2988
+ function Et(t) {
2989
+ if (!Pt(t) || re(t) != ch)
2990
+ return !1;
2991
+ var e = Fo(t);
2992
+ if (e === null)
2993
+ return !0;
2994
+ var r = fh.call(e, "constructor") && e.constructor;
2995
+ return typeof r == "function" && r instanceof r && Bo.call(r) == ph;
2996
+ }
2997
+ function dh(t, e, r) {
2998
+ var n = -1, o = t.length;
2999
+ e < 0 && (e = -e > o ? 0 : o + e), r = r > o ? o : r, r < 0 && (r += o), o = e > r ? 0 : r - e >>> 0, e >>>= 0;
3000
+ for (var a = Array(o); ++n < o; )
3001
+ a[n] = t[n + e];
3002
+ return a;
3003
+ }
3004
+ function hh(t, e, r) {
3005
+ var n = t.length;
3006
+ return r = r === void 0 ? n : r, !e && r >= n ? t : dh(t, e, r);
3007
+ }
3008
+ var vh = "\\ud800-\\udfff", mh = "\\u0300-\\u036f", yh = "\\ufe20-\\ufe2f", gh = "\\u20d0-\\u20ff", bh = mh + yh + gh, _h = "\\ufe0e\\ufe0f", jh = "\\u200d", wh = RegExp("[" + jh + vh + bh + _h + "]");
3009
+ function Uo(t) {
3010
+ return wh.test(t);
3011
+ }
3012
+ function Sh(t) {
3013
+ return t.split("");
3014
+ }
3015
+ var ko = "\\ud800-\\udfff", Oh = "\\u0300-\\u036f", Ch = "\\ufe20-\\ufe2f", Eh = "\\u20d0-\\u20ff", xh = Oh + Ch + Eh, Nh = "\\ufe0e\\ufe0f", $h = "[" + ko + "]", qe = "[" + xh + "]", Qe = "\\ud83c[\\udffb-\\udfff]", Th = "(?:" + qe + "|" + Qe + ")", zo = "[^" + ko + "]", Go = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ho = "[\\ud800-\\udbff][\\udc00-\\udfff]", Ah = "\\u200d", Vo = Th + "?", Wo = "[" + Nh + "]?", Mh = "(?:" + Ah + "(?:" + [zo, Go, Ho].join("|") + ")" + Wo + Vo + ")*", Ph = Wo + Vo + Mh, Dh = "(?:" + [zo + qe + "?", qe, Go, Ho, $h].join("|") + ")", Rh = RegExp(Qe + "(?=" + Qe + ")|" + Dh + Ph, "g");
3016
+ function Ih(t) {
3017
+ return t.match(Rh) || [];
3018
+ }
3019
+ function Lh(t) {
3020
+ return Uo(t) ? Ih(t) : Sh(t);
3021
+ }
3022
+ function Fh(t) {
3023
+ return function(e) {
3024
+ e = Lo(e);
3025
+ var r = Uo(e) ? Lh(e) : void 0, n = r ? r[0] : e.charAt(0), o = r ? hh(r, 1).join("") : e.slice(1);
3026
+ return n[t]() + o;
3027
+ };
3028
+ }
3029
+ var Bh = Fh("toUpperCase");
3030
+ const Uh = Bh;
3031
+ function kh(t) {
3032
+ return Uh(Lo(t).toLowerCase());
3033
+ }
3034
+ function zh() {
3035
+ this.__data__ = new nt(), this.size = 0;
3036
+ }
3037
+ function Gh(t) {
3038
+ var e = this.__data__, r = e.delete(t);
3039
+ return this.size = e.size, r;
3040
+ }
3041
+ function Hh(t) {
3042
+ return this.__data__.get(t);
3043
+ }
3044
+ function Vh(t) {
3045
+ return this.__data__.has(t);
3046
+ }
3047
+ var Wh = 200;
3048
+ function Jh(t, e) {
3049
+ var r = this.__data__;
3050
+ if (r instanceof nt) {
3051
+ var n = r.__data__;
3052
+ if (!Io || n.length < Wh - 1)
3053
+ return n.push([t, e]), this.size = ++r.size, this;
3054
+ r = this.__data__ = new Dt(n);
3055
+ }
3056
+ return r.set(t, e), this.size = r.size, this;
3057
+ }
3058
+ function Rt(t) {
3059
+ var e = this.__data__ = new nt(t);
3060
+ this.size = e.size;
3061
+ }
3062
+ Rt.prototype.clear = zh;
3063
+ Rt.prototype.delete = Gh;
3064
+ Rt.prototype.get = Hh;
3065
+ Rt.prototype.has = Vh;
3066
+ Rt.prototype.set = Jh;
3067
+ var Jo = typeof exports == "object" && exports && !exports.nodeType && exports, Cn = Jo && typeof module == "object" && module && !module.nodeType && module, qh = Cn && Cn.exports === Jo, En = qh ? Mt.Buffer : void 0, xn = En ? En.allocUnsafe : void 0;
3068
+ function Qh(t, e) {
3069
+ if (e)
3070
+ return t.slice();
3071
+ var r = t.length, n = xn ? xn(r) : new t.constructor(r);
3072
+ return t.copy(n), n;
3073
+ }
3074
+ var Yh = Mt.Uint8Array;
3075
+ const Nn = Yh;
3076
+ function Xh(t) {
3077
+ var e = new t.constructor(t.byteLength);
3078
+ return new Nn(e).set(new Nn(t)), e;
3079
+ }
3080
+ function Kh(t, e) {
3081
+ var r = e ? Xh(t.buffer) : t.buffer;
3082
+ return new t.constructor(r, t.byteOffset, t.length);
3083
+ }
3084
+ function Zh(t) {
3085
+ return typeof t.constructor == "function" && !$o(t) ? gp(Fo(t)) : {};
3086
+ }
3087
+ function tv(t) {
3088
+ return function(e, r, n) {
3089
+ for (var o = -1, a = Object(e), i = n(e), s = i.length; s--; ) {
3090
+ var c = i[t ? s : ++o];
3091
+ if (r(a[c], c, a) === !1)
3092
+ break;
3093
+ }
3094
+ return e;
3095
+ };
3096
+ }
3097
+ var ev = tv();
3098
+ const rv = ev;
3099
+ function Ye(t, e, r) {
3100
+ (r !== void 0 && !_e(t[e], r) || r === void 0 && !(e in t)) && $r(t, e, r);
3101
+ }
3102
+ function nv(t) {
3103
+ return Pt(t) && Tr(t);
3104
+ }
3105
+ function Xe(t, e) {
3106
+ if (!(e === "constructor" && typeof t[e] == "function") && e != "__proto__")
3107
+ return t[e];
3108
+ }
3109
+ function ov(t) {
3110
+ return Ip(t, Ro(t));
3111
+ }
3112
+ function av(t, e, r, n, o, a, i) {
3113
+ var s = Xe(t, r), c = Xe(e, r), u = i.get(c);
3114
+ if (u) {
3115
+ Ye(t, r, u);
3116
+ return;
3117
+ }
3118
+ var l = a ? a(s, c, r + "", t, e, i) : void 0, p = l === void 0;
3119
+ if (p) {
3120
+ var f = Ct(c), d = !f && Mo(c), h = !f && !d && Do(c);
3121
+ l = c, f || d || h ? Ct(s) ? l = s : nv(s) ? l = _p(s) : d ? (p = !1, l = Qh(c, !0)) : h ? (p = !1, l = Kh(c, !0)) : l = [] : Et(c) || Je(c) ? (l = s, Je(s) ? l = ov(s) : (!vt(s) || xr(s)) && (l = Zh(c))) : p = !1;
3122
+ }
3123
+ p && (i.set(c, l), o(l, c, n, a, i), i.delete(c)), Ye(t, r, l);
3124
+ }
3125
+ function qo(t, e, r, n, o) {
3126
+ t !== e && rv(e, function(a, i) {
3127
+ if (o || (o = new Rt()), vt(a))
3128
+ av(t, e, i, r, qo, n, o);
3129
+ else {
3130
+ var s = n ? n(Xe(t, i), a, i + "", t, e, o) : void 0;
3131
+ s === void 0 && (s = a), Ye(t, i, s);
3132
+ }
3133
+ }, Ro);
3134
+ }
3135
+ var sv = kp(function(t, e, r) {
3136
+ qo(t, e, r);
3137
+ });
3138
+ const iv = sv;
3139
+ function cv(t) {
3140
+ const e = t.prototype;
3141
+ return !!(e && e.isReactComponent);
3142
+ }
3143
+ function uv(t) {
3144
+ var n, o;
3145
+ const r = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.forward_ref") : 60112;
3146
+ return (t == null ? void 0 : t.$$typeof) === r || ((n = t == null ? void 0 : t.prototype) == null ? void 0 : n.isReactComponent) || ((o = t == null ? void 0 : t.prototype) == null ? void 0 : o.setState) || t._forwardRef;
3147
+ }
3148
+ function lv(t) {
3149
+ class e extends na {
3150
+ render() {
3151
+ return oa(t, this.props);
3152
+ }
3153
+ }
3154
+ return e.displayName = t.displayName, e;
3155
+ }
3156
+ const gt = (t, e) => {
3157
+ const r = (n) => {
3158
+ const a = `
3159
+ ${Object.keys(e).map((i) => `const ${i} = $$context['${i}'];`).join(`
3160
+ `)}
3161
+ return ${n};
3162
+ `;
3163
+ return new Function("$$context", a)(e);
3164
+ };
3165
+ try {
3166
+ return r(t);
3167
+ } catch (n) {
3168
+ console.warn(n);
3169
+ const o = `[${t}] expression run failed`;
3170
+ return console.warn(o), null;
3171
+ }
3172
+ }, fv = (t, e, r) => function(...o) {
3173
+ try {
3174
+ const a = `
3175
+ var f = ${t};
3176
+ var args = Array.from(arguments);
3177
+ var __$$storeManager__ = args.pop();
3178
+ var $$context = args.pop();
3179
+ $$context.stateManager = __$$storeManager__.getStateSnapshot();
3180
+ return f.apply(f, args)
3181
+ `;
3182
+ new Function(a)(...o, e, r);
3183
+ } catch (a) {
3184
+ console.warn(a);
3185
+ }
3186
+ }, $n = (t, e) => {
3187
+ const r = {};
3188
+ return e.forEach((n, o) => {
3189
+ r[n] = t[o];
3190
+ }), r;
3191
+ }, Tn = (t) => {
3192
+ const e = {};
3193
+ return Object.keys(t).forEach((r) => {
3194
+ let n = r.replace("-webkit", "Webkit");
3195
+ n = n.replace("-ms", "ms"), n = n.replace("-moz", "Moz"), n = n.replace("-o", "O");
3196
+ let o = n.split("-");
3197
+ o.length >= 2 && (o = o.map((a, i) => i !== 0 ? kh(a) : a)), e[o.join("")] = t[r];
3198
+ }), e;
3199
+ }, An = (t) => {
3200
+ let e = "";
3201
+ return Object.keys(t).forEach((r) => {
3202
+ e += `${r}:${t[r]};`;
3203
+ }), e;
3204
+ }, ie = "DYNAMIC", pv = ["$$context", "$$nodeModel"], Mn = (t) => {
3205
+ let e;
3206
+ const r = /* @__PURE__ */ new Set(), n = (c, u) => {
3207
+ const l = typeof c == "function" ? c(e) : c;
3208
+ if (!Object.is(l, e)) {
3209
+ const p = e;
3210
+ e = (u != null ? u : typeof l != "object") ? l : Object.assign({}, e, l), r.forEach((f) => f(e, p));
3211
+ }
3212
+ }, o = () => e, s = { setState: n, getState: o, subscribe: (c) => (r.add(c), () => r.delete(c)), destroy: () => {
3213
+ ({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && console.warn(
3214
+ "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."
3215
+ ), r.clear();
3216
+ } };
3217
+ return e = t(n, o, s), s;
3218
+ }, dv = (t) => t ? Mn(t) : Mn;
3219
+ var hv = (t) => (({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && console.warn(
3220
+ "[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'."
3221
+ ), dv(t));
3222
+ class vv {
3223
+ constructor() {
3224
+ g(this, "storeMap", /* @__PURE__ */ new Map());
3225
+ }
3226
+ addStore(e, r) {
3227
+ const n = hv(r);
3228
+ return this.storeMap.set(e, n), n.name = e, n;
3229
+ }
3230
+ setStore(e, r) {
3231
+ this.storeMap.set(e, r);
3232
+ }
3233
+ removeStore(e) {
3234
+ this.storeMap.delete(e);
3235
+ }
3236
+ getStore(e) {
3237
+ return this.storeMap.get(e);
3238
+ }
3239
+ connect(e, r) {
3240
+ const n = this.storeMap.get(e);
3241
+ return n ? n.subscribe(r) : (console.warn("store not exits"), () => {
3242
+ });
3243
+ }
3244
+ getStateSnapshot() {
3245
+ const e = {};
3246
+ return this.storeMap.forEach((r, n) => {
3247
+ e[n] = {
3248
+ state: r.getState(),
3249
+ updateState: (o) => {
3250
+ r.setState(o);
3251
+ }
3252
+ };
3253
+ }), e;
3254
+ }
3255
+ destroy() {
3256
+ this.storeMap.forEach((e) => {
3257
+ e.destroy();
3258
+ }), this.storeMap = /* @__PURE__ */ new Map();
3259
+ }
3260
+ }
3261
+ class mv {
3262
+ constructor() {
3263
+ g(this, "renderMode", "normal");
3264
+ g(this, "components", {});
3265
+ g(this, "storeManager", new vv());
3266
+ g(this, "runtimeComponentCache", /* @__PURE__ */ new Map());
3267
+ g(this, "onGetRef");
3268
+ g(this, "onGetComponent");
3269
+ g(this, "onComponentMount");
3270
+ g(this, "onComponentDestroy");
3271
+ g(this, "processNodeConfigHook");
3272
+ }
3273
+ getComponent(e) {
3274
+ var o;
3275
+ const r = e.value.componentName;
3276
+ let n = this.components[r] || (() => `Component [${r}] not found`);
3277
+ return uv(n) || (n = lv(n), this.components[r] = n), this.onGetComponent && (n = (o = this.onGetComponent) == null ? void 0 : o.call(this, n, e)), n;
3278
+ }
3279
+ getContext(e = {}, r) {
3280
+ let n = e;
3281
+ return r && (n = {
3282
+ ...e
3283
+ }, n.__proto__ = r || null), n;
3284
+ }
3285
+ pageRender(e, {
3286
+ components: r,
3287
+ onGetRef: n,
3288
+ $$context: o = {},
3289
+ onGetComponent: a,
3290
+ onComponentMount: i,
3291
+ onComponentDestroy: s,
3292
+ renderMode: c,
3293
+ processNodeConfigHook: u
3294
+ }) {
3295
+ this.renderMode = c, this.components = r, this.onGetRef = n, this.onGetComponent = a, this.onComponentMount = i, this.onComponentDestroy = s, this.processNodeConfigHook = u;
3296
+ const l = e.value.componentsTree, p = this.getComponent(l), f = this.convertModelToComponent(p, e.value.componentsTree), d = {}, h = l.props;
3297
+ return Object.keys(h).forEach((y) => {
3298
+ d[y] = h[y].value;
3299
+ }), d.$$context = o, this.render(f, d);
3300
+ }
3301
+ transformProps(e = {}, {
3302
+ $$context: r
3303
+ }) {
3304
+ const n = e, o = (i) => {
3305
+ if (Array.isArray(i))
3306
+ return i.map((s) => o(s));
3307
+ if (Ae(i))
3308
+ return o(i.value);
3309
+ if (Tf(i)) {
3310
+ const s = i.value, c = s.value;
3311
+ if (!c)
3312
+ return console.warn("slot value is null, this maybe cause some error, pls check it", e), () => {
3313
+ };
3314
+ const u = (l) => {
3315
+ const p = `${l.id}-${ie}`;
3316
+ if (this.runtimeComponentCache.get(l.id))
3317
+ return {
3318
+ key: p,
3319
+ component: this.runtimeComponentCache.get(l.id)
3320
+ };
3321
+ const f = this.getComponent(l), d = this.convertModelToComponent(f, l), h = s.params || [];
3322
+ return {
3323
+ component: (...j) => {
3324
+ const O = $n(j, h), P = this.getContext(
3325
+ {
3326
+ params: O
3327
+ },
3328
+ r
3329
+ );
3330
+ return this.render(d, {
3331
+ $$context: P,
3332
+ key: p
3333
+ });
3334
+ },
3335
+ key: p
3336
+ };
3337
+ };
3338
+ if (Array.isArray(c)) {
3339
+ const l = c == null ? void 0 : c.map((p) => u(p));
3340
+ return (...p) => l.map((f) => cv(f.component) ? w.createElement(f.component, {
3341
+ $$context: r,
3342
+ key: f.key
3343
+ }) : f.component(...p));
3344
+ } else
3345
+ return u(c).component;
3346
+ } else {
3347
+ if (it(i))
3348
+ return gt(i.value, r || {});
3349
+ if (Nf(i))
3350
+ return fv(i.value, r, this.storeManager);
3351
+ if (Et(i)) {
3352
+ let s = i;
3353
+ Ae(i) && (s = i.value);
3354
+ const c = s, u = {};
3355
+ return Object.keys(s).forEach((l) => {
3356
+ u[l] = o(c[l]);
3357
+ }), u;
3358
+ } else
3359
+ return i;
3360
+ }
3361
+ }, a = {};
3362
+ return Object.keys(n).forEach((i) => {
3363
+ const s = n[i];
3364
+ a[i] = o(s);
3365
+ }), a;
3366
+ }
3367
+ collectSpecialProps(e = {}, r) {
3368
+ const n = [], o = (a, i) => {
3369
+ let s = i;
3370
+ Ae(i) && (s = i.value), r(s) ? n.push({
3371
+ keyPath: a,
3372
+ val: s
3373
+ }) : Ct(s) ? s.forEach((c, u) => {
3374
+ o([...a, String(u)], c);
3375
+ }) : Et(s) && Object.keys(s).forEach((c) => {
3376
+ o([...a, c], s[c]);
3377
+ });
3378
+ };
3379
+ return o(["$root"], e), n;
3380
+ }
3381
+ convertModelToComponent(e, r) {
3382
+ const n = this;
3383
+ class o extends w.Component {
3384
+ constructor(s) {
3385
+ super(s);
3386
+ g(this, "_CONDITION", !0);
3387
+ g(this, "_DESIGN_BOX", !1);
3388
+ g(this, "_NODE_MODEL", r);
3389
+ g(this, "_NODE_ID", r.id);
3390
+ g(this, "UNIQUE_ID", `${r.id}_${K()}`);
3391
+ g(this, "targetComponentRef");
3392
+ g(this, "listenerHandle", []);
3393
+ g(this, "storeState");
3394
+ g(this, "staticState", {});
3395
+ g(this, "storeListenDisposeLint", []);
3396
+ g(this, "domHeader");
3397
+ g(this, "mediaStyleDomMap", {});
3398
+ g(this, "updateState", (s) => {
3399
+ this.storeState.setState(s), this.forceUpdate();
3400
+ });
3401
+ g(this, "getStyleDomById", (s) => {
3402
+ const c = this.mediaStyleDomMap;
3403
+ let u = c[s];
3404
+ return u || (u = document.createElement("style"), u.type = "text/css", c[s] = u), u.id = s, u;
3405
+ });
3406
+ g(this, "addMediaCSS", () => {
3407
+ var u;
3408
+ let s = this.domHeader;
3409
+ if (s || (s = (u = document.getElementsByTagName("head")) == null ? void 0 : u[0], this.domHeader = s), !this.domHeader)
3410
+ return;
3411
+ const c = this._NODE_MODEL.value.css;
3412
+ !c || c.value.forEach((l) => {
3413
+ var d;
3414
+ const p = `${this.UNIQUE_ID}_${l.state}`;
3415
+ let f = `.${c.class}`;
3416
+ if (l.state !== "normal" && (f = `${f}:${l.state}`), Object.keys(l.style).length !== 0) {
3417
+ const h = this.getStyleDomById(p);
3418
+ h.innerText = `${f} { ${An(l.style)} }`, s == null || s.appendChild(h);
3419
+ }
3420
+ (d = l.media) != null && d.length && l.media.forEach((h) => {
3421
+ const y = `${p}_${h.type}_${h.value}`, b = this.getStyleDomById(y);
3422
+ b.media = `screen and (${h.type}:${h.value}px)`, b.innerHTML = `${f} { ${An(h.style)} }`, s == null || s.appendChild(b);
3423
+ });
3424
+ });
3425
+ });
3426
+ g(this, "removeMediaCSS", () => {
3427
+ const s = this.mediaStyleDomMap;
3428
+ Object.keys(s).forEach((c) => {
3429
+ var u;
3430
+ (u = this.domHeader) == null || u.removeChild(s[c]);
3431
+ });
3432
+ });
3433
+ g(this, "rebuildNode", () => {
3434
+ this.storeListenDisposeLint.forEach((s) => s()), this.removeMediaCSS(), this.connectStore(), this.addMediaCSS(), this.forceUpdate();
3435
+ });
3436
+ this.targetComponentRef = w.createRef(), this.state = r.value.state || {};
3437
+ const c = r.value.stateName || r.id, u = n.storeManager.getStore(c);
3438
+ u ? (this.storeState = u, u.setState({
3439
+ ...r.value.state || {}
3440
+ })) : this.storeState = n.storeManager.addStore(c, () => ({
3441
+ ...r.value.state || {}
3442
+ })), this.storeState.subscribe((l) => {
3443
+ this.setState({
3444
+ ...l
3445
+ });
3446
+ }), this.connectStore();
3447
+ }
3448
+ connectStore() {
3449
+ const s = n.collectSpecialProps(r.props, (f) => !!it(f)), c = n.collectSpecialProps(
3450
+ {
3451
+ css: r.value.css,
3452
+ class: r.value.classNames
3453
+ },
3454
+ (f) => !!it(f)
3455
+ ), u = [...s, ...c].map((f) => {
3456
+ const d = f.val, y = /\$\$context.stateManager\.(.+?)\./gim.exec(d.value);
3457
+ return y != null && y.length ? y[1] : "";
3458
+ }).filter(Boolean), l = Array.from(new Set(u)), p = [];
3459
+ l.length && l.forEach((f) => {
3460
+ n.storeManager.getStore(f) || (n.storeManager.addStore(f, () => ({})), console.log(n.storeManager, f, "not exits"));
3461
+ const h = n.storeManager.connect(f, () => {
3462
+ this.forceUpdate();
3463
+ });
3464
+ p.push(h);
3465
+ }), this.storeListenDisposeLint = p;
3466
+ }
3467
+ componentDidMount() {
3468
+ var c;
3469
+ this.addMediaCSS(), n.onGetRef && n.onGetRef(this.targetComponentRef, r, this), (c = n.onComponentMount) == null || c.call(n, this, r);
3470
+ const s = () => {
3471
+ n.storeManager.setStore(r.value.stateName || r.id, this.storeState), this.storeState.setState({
3472
+ ...this.state,
3473
+ ...r.value.state || {}
3474
+ }), this.rebuildNode();
3475
+ };
3476
+ r.onChange(s);
3477
+ }
3478
+ componentWillUnmount() {
3479
+ var s;
3480
+ this.storeListenDisposeLint.forEach((c) => c()), this.removeMediaCSS(), (s = n.onComponentDestroy) == null || s.call(n, this, r);
3481
+ }
3482
+ render() {
3483
+ var mt, C, It;
3484
+ const { $$context: s, ...c } = this.props, u = {
3485
+ key: r.id,
3486
+ ...r.props,
3487
+ ...c
3488
+ }, l = {
3489
+ state: this.state || {},
3490
+ updateState: this.updateState,
3491
+ staticState: this.staticState
3492
+ };
3493
+ r.value.componentName === At.ROOT_CONTAINER && (l.globalState = this.state, l.updateGlobalState = this.updateState), l.stateManager = n.storeManager.getStateSnapshot();
3494
+ const p = n.getContext(l, s), f = r.value.loop;
3495
+ let d = [];
3496
+ if (f && f.open) {
3497
+ this.targetComponentRef.current = [];
3498
+ let I = f.data || [];
3499
+ if (it(f.data)) {
3500
+ const Z = f.data;
3501
+ I = gt(Z.value, p || {});
3502
+ }
3503
+ return d = I.map((...Z) => {
3504
+ var Ar, Mr;
3505
+ const Lt = Z[1], yt = [f.forName || "item", f.forIndex || "index"], Se = $n(Z, yt);
3506
+ let Oe = "loopData";
3507
+ f.name && (Oe = `${Oe}${f.name}`);
3508
+ const Ft = n.getContext(
3509
+ {
3510
+ [Oe]: Se,
3511
+ staticState: this.staticState
3512
+ },
3513
+ p
3514
+ ), q = n.transformProps(u, {
3515
+ $$context: Ft
3516
+ }), Ko = ((Ar = r.value.classNames) == null ? void 0 : Ar.map((H) => {
3517
+ var ae;
3518
+ const oe = H.name;
3519
+ return (it(H.status) ? gt(String(((ae = H.status) == null ? void 0 : ae.value) || ""), Ft) : !1) ? oe : "";
3520
+ })) || [];
3521
+ let Ce = `${(Mr = q.className) != null ? Mr : ""} ${Ko.join(" ")}`.trim();
3522
+ r.value.css && (Ce = `${r.value.css.class} ${Ce}`.trim()), q.className = Ce;
3523
+ const Zo = n.transformProps(r.value.style, {
3524
+ $$context: Ft
3525
+ });
3526
+ r.value.style && (q.style = Tn(Zo || {}));
3527
+ const { children: ne } = q;
3528
+ let Ee = [];
3529
+ if (ne !== void 0)
3530
+ delete q.children, Ee = Array.isArray(ne) ? ne : [ne];
3531
+ else {
3532
+ const H = [];
3533
+ r.value.children.forEach((Pr, ae) => {
3534
+ const ta = n.buildComponent(Pr, {
3535
+ $$context: Ft,
3536
+ idx: ae
3537
+ });
3538
+ H.push(ta);
3539
+ }), Ee = H;
3540
+ }
3541
+ if (q.key = `${q.key}-${Lt}`, it(f.key)) {
3542
+ const H = f.key, oe = gt(H.value, Ft || {});
3543
+ q.key += `-${oe}`;
3544
+ }
3545
+ return q.ref = (H) => {
3546
+ this.targetComponentRef.current = this.targetComponentRef.current || [], this.targetComponentRef.current[Lt] = H;
3547
+ }, n.render(e, q, ...Ee);
3548
+ }), d;
3549
+ }
3550
+ const h = n.transformProps(u, {
3551
+ $$context: p
3552
+ }), { children: y } = h;
3553
+ let b = [];
3554
+ if (y !== void 0)
3555
+ delete h.children, b = Array.isArray(y) ? y : [y];
3556
+ else {
3557
+ const I = [];
3558
+ r.value.children.forEach((Lt, yt) => {
3559
+ const Se = n.buildComponent(Lt, {
3560
+ $$context: p,
3561
+ idx: yt
3562
+ });
3563
+ I.push(Se);
3564
+ }), b = I;
3565
+ }
3566
+ h.ref = this.targetComponentRef;
3567
+ const j = ((mt = r.value.classNames) == null ? void 0 : mt.map((I) => {
3568
+ var yt;
3569
+ const Z = I.name;
3570
+ return (it(I.status) ? gt(((yt = I.status) == null ? void 0 : yt.value) || "", p) : !1) ? Z : "";
3571
+ })) || [];
3572
+ let O = `${(C = h.className) != null ? C : ""} ${j.join(" ")}`.trim();
3573
+ r.value.css && (O = `${r.value.css.class} ${O}`.trim()), h.className = O;
3574
+ const P = n.transformProps(r.value.style, {
3575
+ $$context: p
3576
+ });
3577
+ r.value.style && (h.style = Tn(P || {}));
3578
+ let $ = (It = r.value.condition) != null ? It : !0;
3579
+ typeof $ != "boolean" && ($ = gt($.value, p || {}));
3580
+ let D = {
3581
+ condition: $,
3582
+ props: h
3583
+ };
3584
+ n.processNodeConfigHook && (D = n.processNodeConfigHook(D, r));
3585
+ const G = n.render(e, D.props, ...b);
3586
+ return this._CONDITION = D.condition, D.condition ? G : w.createElement(
3587
+ "div",
3588
+ {
3589
+ style: {
3590
+ display: "none"
3591
+ }
3592
+ },
3593
+ G
3594
+ );
3595
+ }
3596
+ }
3597
+ return g(o, "__CP_TYPE__", ie), o.displayName = `${r.value.componentName}Dynamic`, o;
3598
+ }
3599
+ buildComponent(e, {
3600
+ $$context: r = {}
3601
+ }) {
3602
+ const n = this.runtimeComponentCache;
3603
+ return typeof e == "string" ? this.render(e) : $f(e) ? (({ currentNode: a }) => {
3604
+ const i = a.value.id;
3605
+ let s = null;
3606
+ if (n.get(i))
3607
+ s = n.get(i);
3608
+ else {
3609
+ const l = this.getComponent(a);
3610
+ s = this.convertModelToComponent(l, a);
3611
+ }
3612
+ !n.get(i) && this.renderMode !== "design" && n.set(i, s);
3613
+ const c = `${i}-${ie}`, u = {
3614
+ $$context: r,
3615
+ $$nodeModel: e,
3616
+ key: c
3617
+ };
3618
+ return this.render(s, u);
3619
+ })({
3620
+ currentNode: e
3621
+ }) : void 0;
3622
+ }
3623
+ render(e, r = {}, ...n) {
3624
+ return typeof e == "string" || typeof e == "number" ? String(e) : (pv.forEach((a) => {
3625
+ a in r && e.__CP_TYPE__ !== ie && delete r[a];
3626
+ }), w.createElement(e, r, ...n));
3627
+ }
3628
+ clear() {
3629
+ this.runtimeComponentCache.clear(), this.storeManager.destroy();
3630
+ }
3631
+ }
3632
+ const Lv = la(new mv()), yv = [
3633
+ "a",
3634
+ "abbr",
3635
+ "acronym",
3636
+ "address",
3637
+ "applet",
3638
+ "area",
3639
+ "article",
3640
+ "aside",
3641
+ "audio",
3642
+ "b",
3643
+ "base",
3644
+ "basefont",
3645
+ "bdi",
3646
+ "bdo",
3647
+ "bgsound",
3648
+ "big",
3649
+ "blink",
3650
+ "blockquote",
3651
+ "body",
3652
+ "br",
3653
+ "button",
3654
+ "canvas",
3655
+ "caption",
3656
+ "center",
3657
+ "cite",
3658
+ "code",
3659
+ "col",
3660
+ "colgroup",
3661
+ "command",
3662
+ "content",
3663
+ "data",
3664
+ "datalist",
3665
+ "dd",
3666
+ "del",
3667
+ "details",
3668
+ "dfn",
3669
+ "dialog",
3670
+ "dir",
3671
+ "div",
3672
+ "dl",
3673
+ "dt",
3674
+ "element",
3675
+ "em",
3676
+ "embed",
3677
+ "fieldset",
3678
+ "figcaption",
3679
+ "figure",
3680
+ "font",
3681
+ "footer",
3682
+ "form",
3683
+ "frame",
3684
+ "frameset",
3685
+ "h1",
3686
+ "h2",
3687
+ "h3",
3688
+ "h4",
3689
+ "h5",
3690
+ "h6",
3691
+ "head",
3692
+ "header",
3693
+ "hgroup",
3694
+ "hr",
3695
+ "html",
3696
+ "i",
3697
+ "iframe",
3698
+ "image",
3699
+ "img",
3700
+ "input",
3701
+ "ins",
3702
+ "isindex",
3703
+ "kbd",
3704
+ "keygen",
3705
+ "label",
3706
+ "legend",
3707
+ "li",
3708
+ "link",
3709
+ "listing",
3710
+ "main",
3711
+ "map",
3712
+ "mark",
3713
+ "marquee",
3714
+ "math",
3715
+ "menu",
3716
+ "menuitem",
3717
+ "meta",
3718
+ "meter",
3719
+ "multicol",
3720
+ "nav",
3721
+ "nextid",
3722
+ "nobr",
3723
+ "noembed",
3724
+ "noframes",
3725
+ "noscript",
3726
+ "object",
3727
+ "ol",
3728
+ "optgroup",
3729
+ "option",
3730
+ "output",
3731
+ "p",
3732
+ "param",
3733
+ "picture",
3734
+ "plaintext",
3735
+ "pre",
3736
+ "progress",
3737
+ "q",
3738
+ "rb",
3739
+ "rbc",
3740
+ "rp",
3741
+ "rt",
3742
+ "rtc",
3743
+ "ruby",
3744
+ "s",
3745
+ "samp",
3746
+ "script",
3747
+ "search",
3748
+ "section",
3749
+ "select",
3750
+ "shadow",
3751
+ "slot",
3752
+ "small",
3753
+ "source",
3754
+ "spacer",
3755
+ "span",
3756
+ "strike",
3757
+ "strong",
3758
+ "style",
3759
+ "sub",
3760
+ "summary",
3761
+ "sup",
3762
+ "svg",
3763
+ "table",
3764
+ "tbody",
3765
+ "td",
3766
+ "template",
3767
+ "textarea",
3768
+ "tfoot",
3769
+ "th",
3770
+ "thead",
3771
+ "time",
3772
+ "title",
3773
+ "tr",
3774
+ "track",
3775
+ "tt",
3776
+ "u",
3777
+ "ul",
3778
+ "var",
3779
+ "video",
3780
+ "wbr",
3781
+ "xmp"
3782
+ ], ot = (t) => {
3783
+ const e = {};
3784
+ return t.forEach((r) => {
3785
+ e[r.key] = r.value;
3786
+ }), e;
3787
+ }, gv = [...yv, ...df], bv = gv.reduce((t, e) => (t[e] = ({
3788
+ children: r,
3789
+ $$attributes: n = [],
3790
+ ...o
3791
+ }) => {
3792
+ let a = r;
3793
+ return Array.isArray(r) || (a = [r]), w.createElement(e, {
3794
+ ...o,
3795
+ ...ot(n)
3796
+ }, ...a);
3797
+ }, t), {}), _v = ({
3798
+ children: t,
3799
+ width: e,
3800
+ height: r,
3801
+ $$attributes: n = [],
3802
+ ...o
3803
+ }) => {
3804
+ let a = t;
3805
+ Array.isArray(t) || (a = [t]), a = a.filter((u) => u !== void 0);
3806
+ const {
3807
+ style: i = {},
3808
+ ...s
3809
+ } = ot(n), c = {
3810
+ height: r,
3811
+ width: e,
3812
+ ...i,
3813
+ ...o.style || {}
3814
+ };
3815
+ return w.createElement("div", {
3816
+ ...o,
3817
+ ...s,
3818
+ style: c
3819
+ }, ...a);
3820
+ }, jv = ({
3821
+ children: t,
3822
+ $$attributes: e = [],
3823
+ ...r
3824
+ }) => {
3825
+ let n = t;
3826
+ return Array.isArray(t) || (n = [t]), w.createElement("canvas", {
3827
+ ...r,
3828
+ ...ot(e)
3829
+ }, ...n);
3830
+ }, wv = ({
3831
+ children: t,
3832
+ $$attributes: e = [],
3833
+ ...r
3834
+ }) => {
3835
+ let n = t;
3836
+ return Array.isArray(t) || (n = [t]), w.createElement("img", {
3837
+ ...r,
3838
+ ...ot(e)
3839
+ }, ...n);
3840
+ }, Sv = ({
3841
+ children: t,
3842
+ $$attributes: e = [],
3843
+ ...r
3844
+ }) => {
3845
+ let n = t;
3846
+ return Array.isArray(t) || (n = [t]), w.createElement("video", {
3847
+ ...r,
3848
+ ...ot(e)
3849
+ }, ...n);
3850
+ }, Ov = ({
3851
+ children: t,
3852
+ $$attributes: e = [],
3853
+ ...r
3854
+ }) => {
3855
+ let n = t;
3856
+ return Array.isArray(t) || (n = [t]), w.createElement("video", {
3857
+ ...r,
3858
+ ...ot(e)
3859
+ }, ...n);
3860
+ }, Cv = ({
3861
+ children: t,
3862
+ $$attributes: e = [],
3863
+ content: r,
3864
+ ...n
3865
+ }) => w.createElement("span", {
3866
+ ...n,
3867
+ ...ot(e)
3868
+ }, r), Ev = ({
3869
+ children: t,
3870
+ $$attributes: e = [],
3871
+ afterMount: r,
3872
+ beforeDestroy: n,
3873
+ ...o
3874
+ }) => {
3875
+ let a = t;
3876
+ return Array.isArray(t) || (a = [t]), aa(() => (r == null || r(o), () => {
3877
+ n == null || n(o);
3878
+ }), []), w.createElement("div", {
3879
+ ...o,
3880
+ ...ot(e)
3881
+ }, ...a);
3882
+ }, xv = ({
3883
+ children: t,
3884
+ $$attributes: e = [],
3885
+ htmlTag: r = "div",
3886
+ ...n
3887
+ }) => {
3888
+ let o = t;
3889
+ return Array.isArray(t) || (o = [t]), w.createElement(r, {
3890
+ ...n,
3891
+ ...ot(e)
3892
+ }, ...o);
3893
+ }, Nv = {
3894
+ RootContainer: ({
3895
+ children: t
3896
+ }) => t,
3897
+ ...bv,
3898
+ CContainer: Ev,
3899
+ CVideo: Sv,
3900
+ CAudio: Ov,
3901
+ CBlock: _v,
3902
+ CImage: wv,
3903
+ CText: Cv,
3904
+ CCanvas: jv,
3905
+ CNativeTag: xv
3906
+ };
3907
+ class $v {
3908
+ constructor() {
3909
+ g(this, "refMap", /* @__PURE__ */ new Map());
3910
+ }
3911
+ get(e) {
3912
+ return this.refMap.get(e);
3913
+ }
3914
+ add(e, r) {
3915
+ this.refMap.set(e, r);
3916
+ }
3917
+ remove(e) {
3918
+ this.refMap.delete(e);
3919
+ }
3920
+ destroy() {
3921
+ this.refMap.clear();
3922
+ }
3923
+ }
3924
+ class Tv extends w.Component {
3925
+ constructor(r) {
3926
+ super(r);
3927
+ g(this, "refManager");
3928
+ g(this, "dynamicComponentInstanceMap", /* @__PURE__ */ new Map());
3929
+ g(this, "onGetRef", (r, n, o) => {
3930
+ var a, i;
3931
+ (i = (a = this.props).onGetRef) == null || i.call(a, r, n, o), this.dynamicComponentInstanceMap.set(n.id, o), this.refManager.add(n.value.refId || n.id, r);
3932
+ });
3933
+ g(this, "rerender", (r) => {
3934
+ if (this.props.adapter.clear(), (r == null ? void 0 : r.nodeType) === "PAGE" && r)
3935
+ this.setState({
3936
+ pageModel: r
3937
+ });
3938
+ else if (Et(r) && wo(r)) {
3939
+ const n = r;
3940
+ this.setState({
3941
+ pageModel: new fe(n, {
3942
+ materials: this.state.pageModel.materialsModel.rawValue
3943
+ })
3944
+ });
3945
+ }
3946
+ });
3947
+ this.state = {
3948
+ pageModel: r.pageModel || new fe(r.page)
3949
+ }, this.refManager = new $v();
3950
+ }
3951
+ getPageModel() {
3952
+ return this.state.pageModel;
3953
+ }
3954
+ componentDidMount() {
3955
+ const { render: r } = this.props;
3956
+ r && (r.ref.current = this);
3957
+ }
3958
+ componentWillUnmount() {
3959
+ this.refManager.destroy();
3960
+ }
3961
+ render() {
3962
+ const { props: r } = this, { adapter: n, onGetComponent: o, onComponentDestroy: a, onComponentMount: i } = r, { pageModel: s } = this.state;
3963
+ if (!s)
3964
+ return console.warn("pageModel is null"), null;
3965
+ const c = {
3966
+ ...Nv,
3967
+ ...r.components
3968
+ };
3969
+ return n.pageRender(s, {
3970
+ libs: {},
3971
+ components: c,
3972
+ onGetRef: this.onGetRef,
3973
+ onGetComponent: o,
3974
+ onComponentMount: i,
3975
+ onComponentDestroy: a,
3976
+ $$context: {
3977
+ refs: this.refManager
3978
+ },
3979
+ renderMode: r.renderMode,
3980
+ processNodeConfigHook: r.processNodeConfigHook
3981
+ });
3982
+ }
3983
+ }
3984
+ const Fv = () => {
3985
+ const t = Dn(null);
3986
+ return {
3987
+ ref: t,
3988
+ rerender: function(...e) {
3989
+ t.current && t.current.rerender(...e);
3990
+ }
3991
+ };
3992
+ };
3993
+ class Av extends w.Component {
3994
+ constructor(r) {
3995
+ super(r);
3996
+ g(this, "onDoubleClick", () => {
3997
+ this.setState({
3998
+ hasError: !1,
3999
+ error: null
4000
+ });
4001
+ });
4002
+ this.state = { hasError: !1, error: "" };
4003
+ }
4004
+ static getDerivedStateFromError(r) {
4005
+ return { hasError: !0, error: r };
4006
+ }
4007
+ componentDidCatch(r, n) {
4008
+ var o, a;
4009
+ (a = (o = this.props).onError) == null || a.call(o, n);
4010
+ }
4011
+ render() {
4012
+ if (this.state.hasError) {
4013
+ const { onDoubleClick: r } = this, n = this.props.node.value;
4014
+ console.error(this.props.node, this.props.children);
4015
+ const o = w.createElement(
4016
+ "div",
4017
+ {
4018
+ style: {
4019
+ backgroundColor: "rgb(255 206 215 / 13%)",
4020
+ padding: "5px",
4021
+ color: "#ff0000b0",
4022
+ textAlign: "center",
4023
+ fontSize: "12px"
4024
+ }
4025
+ },
4026
+ "Render error, node id: ",
4027
+ n.id,
4028
+ ", node name\uFF1A",
4029
+ n.title,
4030
+ " component name\uFF1A",
4031
+ n.title || n.componentName,
4032
+ w.createElement("p", null, "msg: ", String(this.state.error)),
4033
+ w.createElement(
4034
+ "button",
4035
+ {
4036
+ onDoubleClick: r,
4037
+ style: {
4038
+ border: "1px solid rgba(100,100,100,0.1)",
4039
+ backgroundColor: "#fff",
4040
+ padding: "5px 10px",
4041
+ borderRadius: "2px",
4042
+ color: "gray",
4043
+ cursor: "pointer",
4044
+ marginTop: "5px"
4045
+ }
4046
+ },
4047
+ "double click to refresh"
4048
+ ),
4049
+ w.createElement("div", {
4050
+ style: {
4051
+ display: "none"
4052
+ }
4053
+ })
4054
+ );
4055
+ return w.createElement(this.props.targetComponent, { onlyRenderChild: !0 }, o);
4056
+ }
4057
+ return this.props.children;
4058
+ }
4059
+ }
4060
+ class Mv {
4061
+ constructor() {
4062
+ g(this, "instanceMap", /* @__PURE__ */ new Map());
4063
+ }
4064
+ get(e) {
4065
+ return this.instanceMap.get(e);
4066
+ }
4067
+ add(e, r) {
4068
+ const n = this.instanceMap.get(e);
4069
+ n ? n.push(r) : this.instanceMap.set(e, [r]);
4070
+ }
4071
+ remove(e, r) {
4072
+ const n = this.instanceMap.get(e);
4073
+ if (r !== void 0 && Array.isArray(n)) {
4074
+ const o = n.filter((a) => a !== r);
4075
+ this.instanceMap.set(e, o);
4076
+ } else
4077
+ this.instanceMap.delete(e);
4078
+ }
4079
+ destroy() {
4080
+ this.instanceMap.clear();
4081
+ }
4082
+ }
4083
+ const Pv = (t) => {
4084
+ const { node: e } = t, r = sa(() => {
4085
+ var c, u;
4086
+ const s = (u = (c = e.material) == null ? void 0 : c.value) == null ? void 0 : u.isContainer;
4087
+ return Et(s) ? s : {
4088
+ placeholder: "Drag the component to place it",
4089
+ width: "100%",
4090
+ height: "100%",
4091
+ style: {}
4092
+ };
4093
+ }, [t.node]), { placeholder: n, height: o, width: a, style: i } = r;
4094
+ return w.createElement(
4095
+ "div",
4096
+ {
4097
+ style: {
4098
+ display: "flex",
4099
+ alignItems: "center",
4100
+ justifyContent: "center",
4101
+ backgroundColor: "rgba(200,200,200,0.1)",
4102
+ border: "1px solid rgba(0,0,0,0.1)",
4103
+ borderRadius: "2px",
4104
+ fontSize: "14px",
4105
+ color: "gray",
4106
+ cursor: "default",
4107
+ minWidth: "300px",
4108
+ minHeight: "50px",
4109
+ width: a,
4110
+ height: o,
4111
+ ...i
4112
+ }
4113
+ },
4114
+ n
4115
+ );
4116
+ };
4117
+ class Bv extends w.Component {
4118
+ constructor(r) {
4119
+ super(r);
4120
+ g(this, "instanceManager", new Mv());
4121
+ g(this, "renderRef");
4122
+ g(this, "dropPlaceholder", Pv);
4123
+ g(this, "onGetComponent", (r, n) => {
4124
+ const o = this;
4125
+ class a extends w.Component {
4126
+ constructor() {
4127
+ super(...arguments);
4128
+ g(this, "_DESIGN_BOX", !0);
4129
+ g(this, "_NODE_MODEL", n);
4130
+ g(this, "_NODE_ID", n.id);
4131
+ g(this, "_UNIQUE_ID", `${n.id}_${K()}`);
4132
+ g(this, "_STATUS");
4133
+ }
4134
+ componentDidMount() {
4135
+ o.instanceManager.add(n.id, this);
4136
+ }
4137
+ componentWillUnmount() {
4138
+ this._STATUS = "DESTROY", o.instanceManager.remove(n.id, this);
4139
+ }
4140
+ render() {
4141
+ var d;
4142
+ const { children: c = [], onlyRenderChild: u, ...l } = this.props;
4143
+ let p = c;
4144
+ return Ct(c) || (p = [c]), !Boolean(p.filter(Boolean).length) && (((d = n.material) == null ? void 0 : d.value.isContainer) || n.value.componentName === At.ROOT_CONTAINER) && p.push(
4145
+ w.createElement(o.dropPlaceholder, {
4146
+ node: n
4147
+ })
4148
+ ), u ? p : w.createElement(r, l, ...p);
4149
+ }
4150
+ }
4151
+ return w.forwardRef(function(s, c) {
4152
+ return w.createElement(
4153
+ Av,
4154
+ {
4155
+ node: n,
4156
+ targetComponent: a
4157
+ },
4158
+ w.createElement(a, {
4159
+ ref: c,
4160
+ ...s
4161
+ })
4162
+ );
4163
+ });
4164
+ });
4165
+ this.renderRef = w.createRef(), r.dropPlaceholder && (this.dropPlaceholder = r.dropPlaceholder);
4166
+ }
4167
+ componentDidMount() {
4168
+ var r, n;
4169
+ (n = (r = this.props).onMount) == null || n.call(r, this);
4170
+ }
4171
+ getPageModel() {
4172
+ var r;
4173
+ return (r = this.renderRef.current) == null ? void 0 : r.state.pageModel;
4174
+ }
4175
+ rerender(r) {
4176
+ var n;
4177
+ return (n = this.renderRef.current) == null ? void 0 : n.rerender(r);
4178
+ }
4179
+ getInstancesById(r, n) {
4180
+ let o = [...this.instanceManager.get(r) || []];
4181
+ return n !== void 0 && (o = o.filter((a) => n === (a == null ? void 0 : a._UNIQUE_ID))), o;
4182
+ }
4183
+ getInstanceByDom(r) {
4184
+ const n = Qo(r);
4185
+ if (!n)
4186
+ return null;
4187
+ const o = Yo(n);
4188
+ return (o == null ? void 0 : o.stateNode) || null;
4189
+ }
4190
+ getDomsById(r, n) {
4191
+ const o = this.getInstancesById(r), a = [];
4192
+ return o == null || o.forEach((i) => {
4193
+ if ((i == null ? void 0 : i._STATUS) === "DESTROY")
4194
+ return;
4195
+ const s = ia.findDOMNode(i);
4196
+ if (s && !(s instanceof Text))
4197
+ if (n) {
4198
+ const c = Array.from(s.querySelectorAll(n));
4199
+ a.push(...c);
4200
+ } else
4201
+ a.push(s);
4202
+ }), a;
4203
+ }
4204
+ getDomRectById(r, n) {
4205
+ return this.getDomsById(r, n).map((i) => i == null ? void 0 : i.getBoundingClientRect()).filter(Boolean);
4206
+ }
4207
+ render() {
4208
+ const { props: r, onGetComponent: n } = this, { render: o, ...a } = r;
4209
+ return o && (o.ref.current = this), w.createElement(Tv, {
4210
+ onGetComponent: n,
4211
+ ...a,
4212
+ processNodeConfigHook: (i, s) => {
4213
+ var h, y;
4214
+ if (s.nodeType !== "NODE")
4215
+ return i;
4216
+ const { props: c, condition: u } = i;
4217
+ let l = { ...c };
4218
+ const p = ((h = s.value.configure) == null ? void 0 : h.devState) || {}, f = (y = s.material) == null ? void 0 : y.value.fixedProps;
4219
+ if (f !== void 0) {
4220
+ if (Et(f))
4221
+ l = {
4222
+ ...l,
4223
+ ...f
4224
+ };
4225
+ else if (typeof f == "function") {
4226
+ const b = f(l);
4227
+ l = {
4228
+ ...l,
4229
+ ...b
4230
+ };
4231
+ }
4232
+ }
4233
+ let d = u;
4234
+ return p.condition === !1 && (d = p.condition), {
4235
+ props: iv(l, p.props || {}),
4236
+ condition: d
4237
+ };
4238
+ },
4239
+ ref: this.renderRef
4240
+ });
4241
+ }
4242
+ }
4243
+ const Qo = (t) => {
4244
+ if (!t)
4245
+ return null;
4246
+ const e = Object.keys(t).find((r) => r.startsWith("__reactInternalInstance$") || r.startsWith("__reactFiber$")) || "";
4247
+ return e ? t[e] : Qo(t.parentElement);
4248
+ }, Yo = (t) => {
4249
+ var e;
4250
+ return t ? (e = t == null ? void 0 : t.stateNode) != null && e._DESIGN_BOX ? t : Yo(t.return) : null;
4251
+ }, Uv = () => {
4252
+ const t = Dn(null);
4253
+ return {
4254
+ ref: t,
4255
+ rerender: function(...e) {
4256
+ t.current && t.current.rerender(...e);
4257
+ },
4258
+ getInstancesById(e, r) {
4259
+ var n;
4260
+ return ((n = t.current) == null ? void 0 : n.getInstancesById(e, r)) || [];
4261
+ },
4262
+ getInstanceByDom(e) {
4263
+ var r;
4264
+ return ((r = t.current) == null ? void 0 : r.getInstanceByDom(e)) || null;
4265
+ },
4266
+ getDomsById(e, r) {
4267
+ var n;
4268
+ return ((n = t.current) == null ? void 0 : n.getDomsById(e, r)) || [];
4269
+ },
4270
+ getDomRectById(e, r) {
4271
+ var n;
4272
+ return ((n = t.current) == null ? void 0 : n.getDomRectById(e, r)) || [];
4273
+ }
4274
+ };
4275
+ };
4276
+ var Dv = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Xo = { exports: {} };
4277
+ (function(t, e) {
4278
+ (function(r, n) {
4279
+ t.exports = n();
4280
+ })(Dv, function() {
4281
+ var r = function() {
4282
+ }, n = {}, o = {}, a = {};
4283
+ function i(f, d) {
4284
+ f = f.push ? f : [f];
4285
+ var h = [], y = f.length, b = y, j, O, P, $;
4286
+ for (j = function(D, G) {
4287
+ G.length && h.push(D), b--, b || d(h);
4288
+ }; y--; ) {
4289
+ if (O = f[y], P = o[O], P) {
4290
+ j(O, P);
4291
+ continue;
4292
+ }
4293
+ $ = a[O] = a[O] || [], $.push(j);
4294
+ }
4295
+ }
4296
+ function s(f, d) {
4297
+ if (!!f) {
4298
+ var h = a[f];
4299
+ if (o[f] = d, !!h)
4300
+ for (; h.length; )
4301
+ h[0](f, d), h.splice(0, 1);
4302
+ }
4303
+ }
4304
+ function c(f, d) {
4305
+ f.call && (f = { success: f }), d.length ? (f.error || r)(d) : (f.success || r)(f);
4306
+ }
4307
+ function u(f, d, h, y) {
4308
+ var b = document, j = h.async, O = (h.numRetries || 0) + 1, P = h.before || r, $ = f.replace(/[\?|#].*$/, ""), D = f.replace(/^(css|img|module|nomodule)!/, ""), G, mt, C;
4309
+ if (y = y || 0, /(^css!|\.css$)/.test($))
4310
+ C = b.createElement("link"), C.rel = "stylesheet", C.href = D, G = "hideFocus" in C, G && C.relList && (G = 0, C.rel = "preload", C.as = "style");
4311
+ else if (/(^img!|\.(png|gif|jpg|svg|webp)$)/.test($))
4312
+ C = b.createElement("img"), C.src = D;
4313
+ else if (C = b.createElement("script"), C.src = D, C.async = j === void 0 ? !0 : j, mt = "noModule" in C, /^module!/.test($)) {
4314
+ if (!mt)
4315
+ return d(f, "l");
4316
+ C.type = "module";
4317
+ } else if (/^nomodule!/.test($) && mt)
4318
+ return d(f, "l");
4319
+ C.onload = C.onerror = C.onbeforeload = function(It) {
4320
+ var I = It.type[0];
4321
+ if (G)
4322
+ try {
4323
+ C.sheet.cssText.length || (I = "e");
4324
+ } catch (Z) {
4325
+ Z.code != 18 && (I = "e");
4326
+ }
4327
+ if (I == "e") {
4328
+ if (y += 1, y < O)
4329
+ return u(f, d, h, y);
4330
+ } else if (C.rel == "preload" && C.as == "style")
4331
+ return C.rel = "stylesheet";
4332
+ d(f, I, It.defaultPrevented);
4333
+ }, P(f, C) !== !1 && b.head.appendChild(C);
4334
+ }
4335
+ function l(f, d, h) {
4336
+ f = f.push ? f : [f];
4337
+ var y = f.length, b = y, j = [], O, P;
4338
+ for (O = function($, D, G) {
4339
+ if (D == "e" && j.push($), D == "b")
4340
+ if (G)
4341
+ j.push($);
4342
+ else
4343
+ return;
4344
+ y--, y || d(j);
4345
+ }, P = 0; P < b; P++)
4346
+ u(f[P], O, h);
4347
+ }
4348
+ function p(f, d, h) {
4349
+ var y, b;
4350
+ if (d && d.trim && (y = d), b = (y ? h : d) || {}, y) {
4351
+ if (y in n)
4352
+ throw "LoadJS";
4353
+ n[y] = !0;
4354
+ }
4355
+ function j(O, P) {
4356
+ l(f, function($) {
4357
+ c(b, $), O && c({ success: O, error: P }, $), s(y, $);
4358
+ }, b);
4359
+ }
4360
+ if (b.returnPromise)
4361
+ return new Promise(j);
4362
+ j();
4363
+ }
4364
+ return p.ready = function(d, h) {
4365
+ return i(d, function(y) {
4366
+ c(h, y);
4367
+ }), p;
4368
+ }, p.done = function(d) {
4369
+ s(d, []);
4370
+ }, p.reset = function() {
4371
+ n = {}, o = {}, a = {};
4372
+ }, p.isDefined = function(d) {
4373
+ return d in n;
4374
+ }, p;
4375
+ });
4376
+ })(Xo);
4377
+ const Pn = Xo.exports;
4378
+ class kv {
4379
+ constructor(e, r) {
4380
+ g(this, "assets");
4381
+ g(this, "loadStatus");
4382
+ g(this, "win", window);
4383
+ g(this, "_onSuccessList", []);
4384
+ g(this, "_onErrorList", []);
4385
+ this.assets = e, this.loadStatus = "INIT", r != null && r.window && (this.win = r.window);
4386
+ }
4387
+ load() {
4388
+ const e = this.assets || [], r = [];
4389
+ for (let n = 0; n < e.length; n++) {
4390
+ const o = e[n];
4391
+ o.id || (o.id = K()), r.push(o.id);
4392
+ const a = o.resources.map((i) => i.src);
4393
+ Pn(a, o.id, {
4394
+ async: !1,
4395
+ before: (i, s) => (this.win.document.body.appendChild(s), !1)
4396
+ });
4397
+ }
4398
+ if (e.length === 0) {
4399
+ this._onSuccessList.forEach((n) => n());
4400
+ return;
4401
+ }
4402
+ return setTimeout(() => {
4403
+ Pn.ready(r, {
4404
+ success: () => {
4405
+ this._onSuccessList.forEach((n) => n());
4406
+ },
4407
+ error: (n) => {
4408
+ this._onErrorList.forEach((o) => o(n));
4409
+ }
4410
+ });
4411
+ }, 0), this;
4412
+ }
4413
+ onSuccess(e) {
4414
+ return this._onSuccessList.push(e), this;
4415
+ }
4416
+ onError(e) {
4417
+ return this._onErrorList.push(e), this;
4418
+ }
4419
+ }
4420
+ export {
4421
+ kv as AssetLoader,
4422
+ Mv as ComponentInstanceManager,
4423
+ Pv as DefaultDropPlaceholder,
4424
+ mv as DefineReactAdapter,
4425
+ Bv as DesignRender,
4426
+ Lv as ReactAdapter,
4427
+ Tv as Render,
4428
+ la as getAdapter,
4429
+ Uv as useDesignRender,
4430
+ Fv as useRender
4431
+ };
4432
+ //# sourceMappingURL=index.es.js.map