@widget-js/core 0.11.22-beta.1 → 0.11.22-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,595 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
3
27
  var __publicField = (obj, key, value) => {
4
28
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
29
  return value;
6
30
  };
7
31
 
32
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayReduce.js
33
+ var require_arrayReduce = __commonJS({
34
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayReduce.js"(exports, module) {
35
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
36
+ var index = -1, length = array == null ? 0 : array.length;
37
+ if (initAccum && length) {
38
+ accumulator = array[++index];
39
+ }
40
+ while (++index < length) {
41
+ accumulator = iteratee(accumulator, array[index], index, array);
42
+ }
43
+ return accumulator;
44
+ }
45
+ module.exports = arrayReduce;
46
+ }
47
+ });
48
+
49
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePropertyOf.js
50
+ var require_basePropertyOf = __commonJS({
51
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePropertyOf.js"(exports, module) {
52
+ function basePropertyOf(object) {
53
+ return function(key) {
54
+ return object == null ? void 0 : object[key];
55
+ };
56
+ }
57
+ module.exports = basePropertyOf;
58
+ }
59
+ });
60
+
61
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_deburrLetter.js
62
+ var require_deburrLetter = __commonJS({
63
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_deburrLetter.js"(exports, module) {
64
+ var basePropertyOf = require_basePropertyOf();
65
+ var deburredLetters = {
66
+ // Latin-1 Supplement block.
67
+ "\xC0": "A",
68
+ "\xC1": "A",
69
+ "\xC2": "A",
70
+ "\xC3": "A",
71
+ "\xC4": "A",
72
+ "\xC5": "A",
73
+ "\xE0": "a",
74
+ "\xE1": "a",
75
+ "\xE2": "a",
76
+ "\xE3": "a",
77
+ "\xE4": "a",
78
+ "\xE5": "a",
79
+ "\xC7": "C",
80
+ "\xE7": "c",
81
+ "\xD0": "D",
82
+ "\xF0": "d",
83
+ "\xC8": "E",
84
+ "\xC9": "E",
85
+ "\xCA": "E",
86
+ "\xCB": "E",
87
+ "\xE8": "e",
88
+ "\xE9": "e",
89
+ "\xEA": "e",
90
+ "\xEB": "e",
91
+ "\xCC": "I",
92
+ "\xCD": "I",
93
+ "\xCE": "I",
94
+ "\xCF": "I",
95
+ "\xEC": "i",
96
+ "\xED": "i",
97
+ "\xEE": "i",
98
+ "\xEF": "i",
99
+ "\xD1": "N",
100
+ "\xF1": "n",
101
+ "\xD2": "O",
102
+ "\xD3": "O",
103
+ "\xD4": "O",
104
+ "\xD5": "O",
105
+ "\xD6": "O",
106
+ "\xD8": "O",
107
+ "\xF2": "o",
108
+ "\xF3": "o",
109
+ "\xF4": "o",
110
+ "\xF5": "o",
111
+ "\xF6": "o",
112
+ "\xF8": "o",
113
+ "\xD9": "U",
114
+ "\xDA": "U",
115
+ "\xDB": "U",
116
+ "\xDC": "U",
117
+ "\xF9": "u",
118
+ "\xFA": "u",
119
+ "\xFB": "u",
120
+ "\xFC": "u",
121
+ "\xDD": "Y",
122
+ "\xFD": "y",
123
+ "\xFF": "y",
124
+ "\xC6": "Ae",
125
+ "\xE6": "ae",
126
+ "\xDE": "Th",
127
+ "\xFE": "th",
128
+ "\xDF": "ss",
129
+ // Latin Extended-A block.
130
+ "\u0100": "A",
131
+ "\u0102": "A",
132
+ "\u0104": "A",
133
+ "\u0101": "a",
134
+ "\u0103": "a",
135
+ "\u0105": "a",
136
+ "\u0106": "C",
137
+ "\u0108": "C",
138
+ "\u010A": "C",
139
+ "\u010C": "C",
140
+ "\u0107": "c",
141
+ "\u0109": "c",
142
+ "\u010B": "c",
143
+ "\u010D": "c",
144
+ "\u010E": "D",
145
+ "\u0110": "D",
146
+ "\u010F": "d",
147
+ "\u0111": "d",
148
+ "\u0112": "E",
149
+ "\u0114": "E",
150
+ "\u0116": "E",
151
+ "\u0118": "E",
152
+ "\u011A": "E",
153
+ "\u0113": "e",
154
+ "\u0115": "e",
155
+ "\u0117": "e",
156
+ "\u0119": "e",
157
+ "\u011B": "e",
158
+ "\u011C": "G",
159
+ "\u011E": "G",
160
+ "\u0120": "G",
161
+ "\u0122": "G",
162
+ "\u011D": "g",
163
+ "\u011F": "g",
164
+ "\u0121": "g",
165
+ "\u0123": "g",
166
+ "\u0124": "H",
167
+ "\u0126": "H",
168
+ "\u0125": "h",
169
+ "\u0127": "h",
170
+ "\u0128": "I",
171
+ "\u012A": "I",
172
+ "\u012C": "I",
173
+ "\u012E": "I",
174
+ "\u0130": "I",
175
+ "\u0129": "i",
176
+ "\u012B": "i",
177
+ "\u012D": "i",
178
+ "\u012F": "i",
179
+ "\u0131": "i",
180
+ "\u0134": "J",
181
+ "\u0135": "j",
182
+ "\u0136": "K",
183
+ "\u0137": "k",
184
+ "\u0138": "k",
185
+ "\u0139": "L",
186
+ "\u013B": "L",
187
+ "\u013D": "L",
188
+ "\u013F": "L",
189
+ "\u0141": "L",
190
+ "\u013A": "l",
191
+ "\u013C": "l",
192
+ "\u013E": "l",
193
+ "\u0140": "l",
194
+ "\u0142": "l",
195
+ "\u0143": "N",
196
+ "\u0145": "N",
197
+ "\u0147": "N",
198
+ "\u014A": "N",
199
+ "\u0144": "n",
200
+ "\u0146": "n",
201
+ "\u0148": "n",
202
+ "\u014B": "n",
203
+ "\u014C": "O",
204
+ "\u014E": "O",
205
+ "\u0150": "O",
206
+ "\u014D": "o",
207
+ "\u014F": "o",
208
+ "\u0151": "o",
209
+ "\u0154": "R",
210
+ "\u0156": "R",
211
+ "\u0158": "R",
212
+ "\u0155": "r",
213
+ "\u0157": "r",
214
+ "\u0159": "r",
215
+ "\u015A": "S",
216
+ "\u015C": "S",
217
+ "\u015E": "S",
218
+ "\u0160": "S",
219
+ "\u015B": "s",
220
+ "\u015D": "s",
221
+ "\u015F": "s",
222
+ "\u0161": "s",
223
+ "\u0162": "T",
224
+ "\u0164": "T",
225
+ "\u0166": "T",
226
+ "\u0163": "t",
227
+ "\u0165": "t",
228
+ "\u0167": "t",
229
+ "\u0168": "U",
230
+ "\u016A": "U",
231
+ "\u016C": "U",
232
+ "\u016E": "U",
233
+ "\u0170": "U",
234
+ "\u0172": "U",
235
+ "\u0169": "u",
236
+ "\u016B": "u",
237
+ "\u016D": "u",
238
+ "\u016F": "u",
239
+ "\u0171": "u",
240
+ "\u0173": "u",
241
+ "\u0174": "W",
242
+ "\u0175": "w",
243
+ "\u0176": "Y",
244
+ "\u0177": "y",
245
+ "\u0178": "Y",
246
+ "\u0179": "Z",
247
+ "\u017B": "Z",
248
+ "\u017D": "Z",
249
+ "\u017A": "z",
250
+ "\u017C": "z",
251
+ "\u017E": "z",
252
+ "\u0132": "IJ",
253
+ "\u0133": "ij",
254
+ "\u0152": "Oe",
255
+ "\u0153": "oe",
256
+ "\u0149": "'n",
257
+ "\u017F": "s"
258
+ };
259
+ var deburrLetter = basePropertyOf(deburredLetters);
260
+ module.exports = deburrLetter;
261
+ }
262
+ });
263
+
264
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js
265
+ var require_freeGlobal = __commonJS({
266
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js"(exports, module) {
267
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
268
+ module.exports = freeGlobal;
269
+ }
270
+ });
271
+
272
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js
273
+ var require_root = __commonJS({
274
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js"(exports, module) {
275
+ var freeGlobal = require_freeGlobal();
276
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
277
+ var root = freeGlobal || freeSelf || Function("return this")();
278
+ module.exports = root;
279
+ }
280
+ });
281
+
282
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js
283
+ var require_Symbol = __commonJS({
284
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js"(exports, module) {
285
+ var root = require_root();
286
+ var Symbol2 = root.Symbol;
287
+ module.exports = Symbol2;
288
+ }
289
+ });
290
+
291
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js
292
+ var require_arrayMap = __commonJS({
293
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js"(exports, module) {
294
+ function arrayMap(array, iteratee) {
295
+ var index = -1, length = array == null ? 0 : array.length, result = Array(length);
296
+ while (++index < length) {
297
+ result[index] = iteratee(array[index], index, array);
298
+ }
299
+ return result;
300
+ }
301
+ module.exports = arrayMap;
302
+ }
303
+ });
304
+
305
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js
306
+ var require_isArray = __commonJS({
307
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js"(exports, module) {
308
+ var isArray2 = Array.isArray;
309
+ module.exports = isArray2;
310
+ }
311
+ });
312
+
313
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js
314
+ var require_getRawTag = __commonJS({
315
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js"(exports, module) {
316
+ var Symbol2 = require_Symbol();
317
+ var objectProto = Object.prototype;
318
+ var hasOwnProperty = objectProto.hasOwnProperty;
319
+ var nativeObjectToString = objectProto.toString;
320
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
321
+ function getRawTag(value) {
322
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
323
+ try {
324
+ value[symToStringTag] = void 0;
325
+ var unmasked = true;
326
+ } catch (e) {
327
+ }
328
+ var result = nativeObjectToString.call(value);
329
+ if (unmasked) {
330
+ if (isOwn) {
331
+ value[symToStringTag] = tag;
332
+ } else {
333
+ delete value[symToStringTag];
334
+ }
335
+ }
336
+ return result;
337
+ }
338
+ module.exports = getRawTag;
339
+ }
340
+ });
341
+
342
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js
343
+ var require_objectToString = __commonJS({
344
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js"(exports, module) {
345
+ var objectProto = Object.prototype;
346
+ var nativeObjectToString = objectProto.toString;
347
+ function objectToString(value) {
348
+ return nativeObjectToString.call(value);
349
+ }
350
+ module.exports = objectToString;
351
+ }
352
+ });
353
+
354
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js
355
+ var require_baseGetTag = __commonJS({
356
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js"(exports, module) {
357
+ var Symbol2 = require_Symbol();
358
+ var getRawTag = require_getRawTag();
359
+ var objectToString = require_objectToString();
360
+ var nullTag = "[object Null]";
361
+ var undefinedTag = "[object Undefined]";
362
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
363
+ function baseGetTag(value) {
364
+ if (value == null) {
365
+ return value === void 0 ? undefinedTag : nullTag;
366
+ }
367
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
368
+ }
369
+ module.exports = baseGetTag;
370
+ }
371
+ });
372
+
373
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js
374
+ var require_isObjectLike = __commonJS({
375
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js"(exports, module) {
376
+ function isObjectLike(value) {
377
+ return value != null && typeof value == "object";
378
+ }
379
+ module.exports = isObjectLike;
380
+ }
381
+ });
382
+
383
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js
384
+ var require_isSymbol = __commonJS({
385
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js"(exports, module) {
386
+ var baseGetTag = require_baseGetTag();
387
+ var isObjectLike = require_isObjectLike();
388
+ var symbolTag = "[object Symbol]";
389
+ function isSymbol(value) {
390
+ return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
391
+ }
392
+ module.exports = isSymbol;
393
+ }
394
+ });
395
+
396
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js
397
+ var require_baseToString = __commonJS({
398
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js"(exports, module) {
399
+ var Symbol2 = require_Symbol();
400
+ var arrayMap = require_arrayMap();
401
+ var isArray2 = require_isArray();
402
+ var isSymbol = require_isSymbol();
403
+ var INFINITY = 1 / 0;
404
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
405
+ var symbolToString = symbolProto ? symbolProto.toString : void 0;
406
+ function baseToString(value) {
407
+ if (typeof value == "string") {
408
+ return value;
409
+ }
410
+ if (isArray2(value)) {
411
+ return arrayMap(value, baseToString) + "";
412
+ }
413
+ if (isSymbol(value)) {
414
+ return symbolToString ? symbolToString.call(value) : "";
415
+ }
416
+ var result = value + "";
417
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
418
+ }
419
+ module.exports = baseToString;
420
+ }
421
+ });
422
+
423
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js
424
+ var require_toString = __commonJS({
425
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js"(exports, module) {
426
+ var baseToString = require_baseToString();
427
+ function toString(value) {
428
+ return value == null ? "" : baseToString(value);
429
+ }
430
+ module.exports = toString;
431
+ }
432
+ });
433
+
434
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/deburr.js
435
+ var require_deburr = __commonJS({
436
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/deburr.js"(exports, module) {
437
+ var deburrLetter = require_deburrLetter();
438
+ var toString = require_toString();
439
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
440
+ var rsComboMarksRange = "\\u0300-\\u036f";
441
+ var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
442
+ var rsComboSymbolsRange = "\\u20d0-\\u20ff";
443
+ var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
444
+ var rsCombo = "[" + rsComboRange + "]";
445
+ var reComboMark = RegExp(rsCombo, "g");
446
+ function deburr(string) {
447
+ string = toString(string);
448
+ return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
449
+ }
450
+ module.exports = deburr;
451
+ }
452
+ });
453
+
454
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_asciiWords.js
455
+ var require_asciiWords = __commonJS({
456
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_asciiWords.js"(exports, module) {
457
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
458
+ function asciiWords(string) {
459
+ return string.match(reAsciiWord) || [];
460
+ }
461
+ module.exports = asciiWords;
462
+ }
463
+ });
464
+
465
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hasUnicodeWord.js
466
+ var require_hasUnicodeWord = __commonJS({
467
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hasUnicodeWord.js"(exports, module) {
468
+ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
469
+ function hasUnicodeWord(string) {
470
+ return reHasUnicodeWord.test(string);
471
+ }
472
+ module.exports = hasUnicodeWord;
473
+ }
474
+ });
475
+
476
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_unicodeWords.js
477
+ var require_unicodeWords = __commonJS({
478
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_unicodeWords.js"(exports, module) {
479
+ var rsAstralRange = "\\ud800-\\udfff";
480
+ var rsComboMarksRange = "\\u0300-\\u036f";
481
+ var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
482
+ var rsComboSymbolsRange = "\\u20d0-\\u20ff";
483
+ var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
484
+ var rsDingbatRange = "\\u2700-\\u27bf";
485
+ var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
486
+ var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
487
+ var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
488
+ var rsPunctuationRange = "\\u2000-\\u206f";
489
+ var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
490
+ var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
491
+ var rsVarRange = "\\ufe0e\\ufe0f";
492
+ var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
493
+ var rsApos = "['\u2019]";
494
+ var rsBreak = "[" + rsBreakRange + "]";
495
+ var rsCombo = "[" + rsComboRange + "]";
496
+ var rsDigits = "\\d+";
497
+ var rsDingbat = "[" + rsDingbatRange + "]";
498
+ var rsLower = "[" + rsLowerRange + "]";
499
+ var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
500
+ var rsFitz = "\\ud83c[\\udffb-\\udfff]";
501
+ var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
502
+ var rsNonAstral = "[^" + rsAstralRange + "]";
503
+ var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
504
+ var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
505
+ var rsUpper = "[" + rsUpperRange + "]";
506
+ var rsZWJ = "\\u200d";
507
+ var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")";
508
+ var rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")";
509
+ var rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
510
+ var rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
511
+ var reOptMod = rsModifier + "?";
512
+ var rsOptVar = "[" + rsVarRange + "]?";
513
+ var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
514
+ var rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])";
515
+ var rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])";
516
+ var rsSeq = rsOptVar + reOptMod + rsOptJoin;
517
+ var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
518
+ var reUnicodeWord = RegExp([
519
+ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
520
+ rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
521
+ rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
522
+ rsUpper + "+" + rsOptContrUpper,
523
+ rsOrdUpper,
524
+ rsOrdLower,
525
+ rsDigits,
526
+ rsEmoji
527
+ ].join("|"), "g");
528
+ function unicodeWords(string) {
529
+ return string.match(reUnicodeWord) || [];
530
+ }
531
+ module.exports = unicodeWords;
532
+ }
533
+ });
534
+
535
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/words.js
536
+ var require_words = __commonJS({
537
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/words.js"(exports, module) {
538
+ var asciiWords = require_asciiWords();
539
+ var hasUnicodeWord = require_hasUnicodeWord();
540
+ var toString = require_toString();
541
+ var unicodeWords = require_unicodeWords();
542
+ function words(string, pattern, guard) {
543
+ string = toString(string);
544
+ pattern = guard ? void 0 : pattern;
545
+ if (pattern === void 0) {
546
+ return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
547
+ }
548
+ return string.match(pattern) || [];
549
+ }
550
+ module.exports = words;
551
+ }
552
+ });
553
+
554
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createCompounder.js
555
+ var require_createCompounder = __commonJS({
556
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_createCompounder.js"(exports, module) {
557
+ var arrayReduce = require_arrayReduce();
558
+ var deburr = require_deburr();
559
+ var words = require_words();
560
+ var rsApos = "['\u2019]";
561
+ var reApos = RegExp(rsApos, "g");
562
+ function createCompounder(callback) {
563
+ return function(string) {
564
+ return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
565
+ };
566
+ }
567
+ module.exports = createCompounder;
568
+ }
569
+ });
570
+
571
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/kebabCase.js
572
+ var require_kebabCase = __commonJS({
573
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/kebabCase.js"(exports, module) {
574
+ var createCompounder = require_createCompounder();
575
+ var kebabCase2 = createCompounder(function(result, word, index) {
576
+ return result + (index ? "-" : "") + word.toLowerCase();
577
+ });
578
+ module.exports = kebabCase2;
579
+ }
580
+ });
581
+
582
+ // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/snakeCase.js
583
+ var require_snakeCase = __commonJS({
584
+ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/snakeCase.js"(exports, module) {
585
+ var createCompounder = require_createCompounder();
586
+ var snakeCase2 = createCompounder(function(result, word, index) {
587
+ return result + (index ? "_" : "") + word.toLowerCase();
588
+ });
589
+ module.exports = snakeCase2;
590
+ }
591
+ });
592
+
8
593
  // src/model/DeployMode.ts
9
594
  var HostedMode = /* @__PURE__ */ ((HostedMode2) => {
10
595
  HostedMode2[HostedMode2["NORMAL"] = 1] = "NORMAL";
@@ -42,7 +627,7 @@ function getTextByLanguageCode(langMap, langCode, fallbackToBrowser = true) {
42
627
  }
43
628
  }
44
629
  if (result == void 0) {
45
- let langCode2 = Object.keys(langMap);
630
+ const langCode2 = Object.keys(langMap);
46
631
  if (langCode2.length > 0) {
47
632
  return langMap[langCode2[0]];
48
633
  }
@@ -52,7 +637,7 @@ function getTextByLanguageCode(langMap, langCode, fallbackToBrowser = true) {
52
637
 
53
638
  // src/model/Page.ts
54
639
  var Page = class {
55
- //窗口名称,名称与包名类似,e.g. com.example.countdown
640
+ // 窗口名称,名称与包名类似,e.g. com.example.countdown
56
641
  name;
57
642
  /**
58
643
  * 窗口标题,显示在界面上的,
@@ -124,8 +709,9 @@ var Page = class {
124
709
  * @param lang 语言环境,不传则获取默认标题
125
710
  */
126
711
  getDescription(lang) {
127
- if (this.description == void 0)
712
+ if (this.description == void 0) {
128
713
  return void 0;
714
+ }
129
715
  return getTextByLanguageCode(this.description, lang);
130
716
  }
131
717
  static parseJSON(json) {
@@ -133,7 +719,7 @@ var Page = class {
133
719
  return this.parseObject(object);
134
720
  }
135
721
  static parseObject(obj) {
136
- let widget = new Page({
722
+ const widget = new Page({
137
723
  path: "",
138
724
  description: {},
139
725
  height: 0,
@@ -176,7 +762,7 @@ var Widget = class extends Page {
176
762
  return this.parseObject(object);
177
763
  }
178
764
  static parseObject(obj) {
179
- let widget = new Widget({
765
+ const widget = new Widget({
180
766
  path: "",
181
767
  description: {},
182
768
  height: 0,
@@ -241,7 +827,7 @@ var WebSocketEventType = /* @__PURE__ */ ((WebSocketEventType2) => {
241
827
  return WebSocketEventType2;
242
828
  })(WebSocketEventType || {});
243
829
  var WebSocketEvent = class {
244
- //类型
830
+ // 类型
245
831
  type;
246
832
  payload;
247
833
  constructor(type, payload) {
@@ -251,7 +837,7 @@ var WebSocketEvent = class {
251
837
  };
252
838
 
253
839
  // src/model/WidgetData.ts
254
- import kebabCase from "lodash/kebabCase";
840
+ var import_kebabCase = __toESM(require_kebabCase(), 1);
255
841
 
256
842
  // src/model/WidgetTheme.ts
257
843
  var DefaultWidgetTheme = {
@@ -320,9 +906,9 @@ var WidgetData = class {
320
906
  const properties = {};
321
907
  if (this.theme) {
322
908
  const prefix = "--widget-";
323
- let keys = Object.keys(this.theme);
909
+ const keys = Object.keys(this.theme);
324
910
  keys.filter((key) => this.theme[key] != void 0).map((key) => {
325
- properties[`${prefix}${kebabCase(key)}`] = `${this.theme[key]}`;
911
+ properties[`${prefix}${(0, import_kebabCase.default)(key)}`] = `${this.theme[key]}`;
326
912
  });
327
913
  }
328
914
  return properties;
@@ -339,6 +925,9 @@ var WidgetData = class {
339
925
  }
340
926
  };
341
927
 
928
+ // src/model/WidgetParams.ts
929
+ var import_snakeCase = __toESM(require_snakeCase(), 1);
930
+
342
931
  // src/router/encoding.ts
343
932
  var HASH_RE = /#/g;
344
933
  var AMPERSAND_RE = /&/g;
@@ -353,7 +942,7 @@ var ENC_PIPE_RE = /%7C/g;
353
942
  var ENC_CURLY_CLOSE_RE = /%7D/g;
354
943
  var ENC_SPACE_RE = /%20/g;
355
944
  function commonEncode(text) {
356
- return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
945
+ return encodeURI(`${text}`).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
357
946
  }
358
947
  function encodeQueryValue(text) {
359
948
  return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
@@ -363,18 +952,19 @@ function encodeQueryKey(text) {
363
952
  }
364
953
  function decode(text) {
365
954
  try {
366
- return decodeURIComponent("" + text);
955
+ return decodeURIComponent(`${text}`);
367
956
  } catch (err) {
368
957
  }
369
- return "" + text;
958
+ return `${text}`;
370
959
  }
371
960
 
372
961
  // src/router/query.ts
373
962
  var isArray = Array.isArray;
374
963
  function parseQuery(search) {
375
964
  const query = {};
376
- if (search === "" || search === "?")
965
+ if (search === "" || search === "?") {
377
966
  return query;
967
+ }
378
968
  const hasLeadingIM = search[0] === "?";
379
969
  const searchParams = (hasLeadingIM ? search.slice(1) : search).split("&");
380
970
  for (let i = 0; i < searchParams.length; ++i) {
@@ -410,8 +1000,9 @@ function stringifyQuery(query) {
410
1000
  values.forEach((value2) => {
411
1001
  if (value2 !== void 0) {
412
1002
  search += (search.length ? "&" : "") + key;
413
- if (value2 != null)
414
- search += "=" + value2;
1003
+ if (value2 != null) {
1004
+ search += `=${value2}`;
1005
+ }
415
1006
  }
416
1007
  });
417
1008
  }
@@ -419,31 +1010,30 @@ function stringifyQuery(query) {
419
1010
  }
420
1011
 
421
1012
  // src/model/WidgetParams.ts
422
- import snakeCase from "lodash/snakeCase";
423
1013
  var _WidgetParams = class {
424
- //组件id
1014
+ // 组件id
425
1015
  id;
426
- //网格宽度,1就代表宽度占用1格
1016
+ // 网格宽度,1就代表宽度占用1格
427
1017
  width;
428
- //宽度,单位px
1018
+ // 宽度,单位px
429
1019
  widthPx;
430
- //宽度,单位px
1020
+ // 宽度,单位px
431
1021
  heightPx;
432
- //网格高度,2就代表高度占用2格
1022
+ // 网格高度,2就代表高度占用2格
433
1023
  height;
434
1024
  x;
435
1025
  y;
436
- //是否是预览模式,添加组件时,预览状态
1026
+ // 是否是预览模式,添加组件时,预览状态
437
1027
  preview;
438
- //语言环境:zh,en,jp...
1028
+ // 语言环境:zh,en,jp...
439
1029
  lang;
440
- //主题:浅色,深色
1030
+ // 主题:浅色,深色
441
1031
  theme;
442
1032
  //
443
1033
  mode;
444
- //系统设置的组件圆角半径
1034
+ // 系统设置的组件圆角半径
445
1035
  radius;
446
- //组件名
1036
+ // 组件名
447
1037
  name;
448
1038
  title;
449
1039
  /**
@@ -454,11 +1044,11 @@ var _WidgetParams = class {
454
1044
  toUrlParams() {
455
1045
  const urlParams = new URLSearchParams();
456
1046
  const ownPropertyNames = Object.getOwnPropertyNames(this);
457
- for (let ownPropertyName of ownPropertyNames) {
1047
+ for (const ownPropertyName of ownPropertyNames) {
458
1048
  const key = ownPropertyName;
459
1049
  const value = this[key];
460
1050
  if (value) {
461
- urlParams.append(_WidgetParams.PARAM_PREFIX + snakeCase(ownPropertyName), value.toString());
1051
+ urlParams.append(_WidgetParams.PARAM_PREFIX + (0, import_snakeCase.default)(ownPropertyName), value.toString());
462
1052
  }
463
1053
  }
464
1054
  return urlParams;
@@ -474,17 +1064,17 @@ var _WidgetParams = class {
474
1064
  */
475
1065
  static fromCurrentLocation() {
476
1066
  const href = window.location.href;
477
- let strings = href.split("?");
1067
+ const strings = href.split("?");
478
1068
  if (strings.length > 1) {
479
- let queryString = strings[1];
1069
+ const queryString = strings[1];
480
1070
  return this.fromObject(parseQuery(queryString));
481
1071
  }
482
1072
  return new _WidgetParams();
483
1073
  }
484
1074
  static fromLocation(url) {
485
- let strings = url.split("?");
1075
+ const strings = url.split("?");
486
1076
  if (strings.length > 1) {
487
- let queryString = strings[1];
1077
+ const queryString = strings[1];
488
1078
  return this.fromObject(parseQuery(queryString));
489
1079
  }
490
1080
  return new _WidgetParams();
@@ -494,25 +1084,25 @@ var _WidgetParams = class {
494
1084
  if (keyWithoutPrefix == _WidgetParams.PARAM_ID) {
495
1085
  widgetEnv.id = value;
496
1086
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_X) {
497
- widgetEnv.x = parseInt(value);
1087
+ widgetEnv.x = Number.parseInt(value);
498
1088
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_Y) {
499
- widgetEnv.y = parseInt(value);
1089
+ widgetEnv.y = Number.parseInt(value);
500
1090
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_HEIGHT) {
501
- widgetEnv.height = parseInt(value);
1091
+ widgetEnv.height = Number.parseInt(value);
502
1092
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_WIDTH) {
503
- widgetEnv.width = parseInt(value);
1093
+ widgetEnv.width = Number.parseInt(value);
504
1094
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_LANG) {
505
1095
  widgetEnv.lang = value;
506
1096
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_THEME) {
507
1097
  widgetEnv.theme = value;
508
1098
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_MODE) {
509
- widgetEnv.mode = parseInt(value);
1099
+ widgetEnv.mode = Number.parseInt(value);
510
1100
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_RADIUS) {
511
- widgetEnv.radius = parseInt(value);
1101
+ widgetEnv.radius = Number.parseInt(value);
512
1102
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_WIDTH_PX) {
513
- widgetEnv.widthPx = parseInt(value);
1103
+ widgetEnv.widthPx = Number.parseInt(value);
514
1104
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_HEIGHT_PX) {
515
- widgetEnv.heightPx = parseInt(value);
1105
+ widgetEnv.heightPx = Number.parseInt(value);
516
1106
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_NAME) {
517
1107
  widgetEnv.name = value;
518
1108
  } else if (keyWithoutPrefix == _WidgetParams.PARAM_TITLE) {
@@ -530,7 +1120,7 @@ var _WidgetParams = class {
530
1120
  static fromObject(object) {
531
1121
  const widgetEnv = new _WidgetParams();
532
1122
  const ownPropertyNames = Object.getOwnPropertyNames(object);
533
- for (let ownPropertyName of ownPropertyNames) {
1123
+ for (const ownPropertyName of ownPropertyNames) {
534
1124
  const key = ownPropertyName;
535
1125
  const value = object[key];
536
1126
  this.setValue(widgetEnv, key, value);
@@ -662,15 +1252,15 @@ var supportedProtocols = /* @__PURE__ */ new Set([
662
1252
  "http:",
663
1253
  "file:"
664
1254
  ]);
665
- var hasCustomProtocol = (urlString) => {
1255
+ function hasCustomProtocol(urlString) {
666
1256
  try {
667
1257
  const { protocol } = new URL(urlString);
668
1258
  return protocol.endsWith(":") && !supportedProtocols.has(protocol);
669
1259
  } catch {
670
1260
  return false;
671
1261
  }
672
- };
673
- var normalizeDataURL = (urlString, option) => {
1262
+ }
1263
+ function normalizeDataURL(urlString, option) {
674
1264
  const match = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(urlString);
675
1265
  if (!match) {
676
1266
  throw new Error(`Invalid URL: ${urlString}`);
@@ -704,7 +1294,7 @@ var normalizeDataURL = (urlString, option) => {
704
1294
  normalizedMediaType.unshift(mimeType);
705
1295
  }
706
1296
  return `data:${normalizedMediaType.join(";")},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ""}`;
707
- };
1297
+ }
708
1298
  function normalizeUrl(urlString, options) {
709
1299
  options = {
710
1300
  defaultProtocol: "http",
@@ -792,7 +1382,7 @@ function normalizeUrl(urlString, options) {
792
1382
  const lastComponent = pathComponents[pathComponents.length - 1];
793
1383
  if (testParameter(lastComponent, options.removeDirectoryIndex)) {
794
1384
  pathComponents = pathComponents.slice(0, -1);
795
- urlObject.pathname = pathComponents.slice(1).join("/") + "/";
1385
+ urlObject.pathname = `${pathComponents.slice(1).join("/")}/`;
796
1386
  }
797
1387
  }
798
1388
  if (urlObject.hostname) {
@@ -961,7 +1551,7 @@ var WidgetPackage = class {
961
1551
  this.devOptions = options.devOptions;
962
1552
  this.remote = options.remote;
963
1553
  if (options.widgets) {
964
- for (let widget of options.widgets) {
1554
+ for (const widget of options.widgets) {
965
1555
  this.widgets.push(widget);
966
1556
  }
967
1557
  }
@@ -971,7 +1561,7 @@ var WidgetPackage = class {
971
1561
  return this.parseObject(object);
972
1562
  }
973
1563
  static parseObject(obj) {
974
- let widgetPackage = new WidgetPackage({
1564
+ const widgetPackage = new WidgetPackage({
975
1565
  author: "",
976
1566
  description: {
977
1567
  "zh-CN": ""
@@ -988,8 +1578,8 @@ var WidgetPackage = class {
988
1578
  Object.assign(widgetPackage, obj);
989
1579
  const widgets = [];
990
1580
  if (widgetPackage.widgets) {
991
- for (let jsonWidget of widgetPackage.widgets) {
992
- let widget = new Widget({
1581
+ for (const jsonWidget of widgetPackage.widgets) {
1582
+ const widget = new Widget({
993
1583
  previewImage: "",
994
1584
  path: "",
995
1585
  description: { "zh-CN": "" },
@@ -1108,10 +1698,10 @@ var GridSystem = class extends GridRect {
1108
1698
  * @param screenY
1109
1699
  */
1110
1700
  constructor(cellSize, padding, screenWidth, screenHeight, screenX, screenY) {
1111
- let gridMaxWidth = screenWidth - padding * 2;
1112
- let gridMaxHeight = screenHeight - padding * 2;
1113
- let horizontalPadding = gridMaxWidth % cellSize / 2 + padding;
1114
- let verticalPadding = gridMaxHeight % cellSize / 2 + padding;
1701
+ const gridMaxWidth = screenWidth - padding * 2;
1702
+ const gridMaxHeight = screenHeight - padding * 2;
1703
+ const horizontalPadding = gridMaxWidth % cellSize / 2 + padding;
1704
+ const verticalPadding = gridMaxHeight % cellSize / 2 + padding;
1115
1705
  const horizontalCellCount = Math.floor(gridMaxWidth / cellSize);
1116
1706
  const verticalCellCount = Math.floor(gridMaxHeight / cellSize);
1117
1707
  super(horizontalPadding, verticalPadding, horizontalCellCount * cellSize, verticalCellCount * cellSize);
@@ -1132,8 +1722,8 @@ var GridSystem = class extends GridRect {
1132
1722
  * @param gridSystem
1133
1723
  */
1134
1724
  snapCanvasPosition(x, y) {
1135
- let newX = this.getRangeValue(x - this.left, 0, this.right);
1136
- let newY = this.getRangeValue(y - this.top, 0, this.bottom);
1725
+ const newX = this.getRangeValue(x - this.left, 0, this.right);
1726
+ const newY = this.getRangeValue(y - this.top, 0, this.bottom);
1137
1727
  return this.snapPosition(newX, newY);
1138
1728
  }
1139
1729
  snapPosition(newX, newY) {
@@ -1154,8 +1744,8 @@ var GridSystem = class extends GridRect {
1154
1744
  snapSize(width, height) {
1155
1745
  let newWidth = Math.floor(width);
1156
1746
  let newHeight = Math.floor(height);
1157
- let diffWidth = newWidth % this.cellSize;
1158
- let diffHeight = newHeight % this.cellSize;
1747
+ const diffWidth = newWidth % this.cellSize;
1748
+ const diffHeight = newHeight % this.cellSize;
1159
1749
  if (diffWidth > this.cellSize / 2) {
1160
1750
  newWidth = width + this.cellSize - diffWidth;
1161
1751
  } else {
@@ -1177,7 +1767,7 @@ var GridSystem = class extends GridRect {
1177
1767
  * @param maxHeight
1178
1768
  */
1179
1769
  snapCanvasRect(rect, minWidth, maxWidth, minHeight, maxHeight) {
1180
- let [newX, newY] = this.snapCanvasPosition(rect.left, rect.top);
1770
+ const [newX, newY] = this.snapCanvasPosition(rect.left, rect.top);
1181
1771
  return this.snapRect(rect, minWidth, maxWidth, minHeight, maxHeight, newX, newY);
1182
1772
  }
1183
1773
  snapRect(rect, minWidth, maxWidth, minHeight, maxHeight, newX, newY) {
@@ -1203,7 +1793,7 @@ var GridSystem = class extends GridRect {
1203
1793
  snapWindow(rect, minWidth, maxWidth, minHeight, maxHeight) {
1204
1794
  rect.left = rect.left - (this.screenLeft ?? 0);
1205
1795
  rect.top = rect.top - (this.screenTop ?? 0);
1206
- let result = this.snapCanvasRect(rect, minWidth, maxWidth, minHeight, maxHeight);
1796
+ const result = this.snapCanvasRect(rect, minWidth, maxWidth, minHeight, maxHeight);
1207
1797
  return new GridRect(
1208
1798
  result.left + (this.screenLeft ?? 0),
1209
1799
  result.top + (this.screenTop ?? 0),
@@ -1355,35 +1945,42 @@ var WidgetApiImpl = class extends BaseApi {
1355
1945
  */
1356
1946
  async getWidgetConfigUrl(widgetName, widgetParams) {
1357
1947
  const widget = await this.getWidget(widgetName);
1358
- if (!widget)
1948
+ if (!widget) {
1359
1949
  return null;
1950
+ }
1360
1951
  const configPagePath = widget.configPagePath;
1361
- if (!configPagePath)
1952
+ if (!configPagePath) {
1362
1953
  return null;
1954
+ }
1363
1955
  const widgetPackage = await this.getWidgetPackage(widget.packageName);
1364
- if (!widgetPackage)
1956
+ if (!widgetPackage) {
1365
1957
  return null;
1958
+ }
1366
1959
  return WidgetUrlUtils.getWidgetUrl(configPagePath, widgetPackage, widgetParams);
1367
1960
  }
1368
1961
  async getWidgetUrl(widgetName, widgetParams) {
1369
1962
  const widget = await this.getWidget(widgetName);
1370
- if (!widget)
1963
+ if (!widget) {
1371
1964
  return null;
1965
+ }
1372
1966
  const widgetPackage = await this.getWidgetPackage(widget.packageName);
1373
- if (!widgetPackage)
1967
+ if (!widgetPackage) {
1374
1968
  return null;
1969
+ }
1375
1970
  return WidgetUrlUtils.getWidgetUrl(widget.path, widgetPackage, widgetParams);
1376
1971
  }
1377
1972
  async getWidgetPackageIndexUrl(packageName, hash) {
1378
1973
  const widgetPackage = await this.getWidgetPackage(packageName);
1379
- if (!widgetPackage)
1974
+ if (!widgetPackage) {
1380
1975
  return null;
1976
+ }
1381
1977
  return widgetPackage.getIndexUrl(hash);
1382
1978
  }
1383
1979
  async getWidgetPackageUrl(packageName) {
1384
1980
  const widgetPackage = await this.getWidgetPackage(packageName);
1385
- if (!widgetPackage)
1981
+ if (!widgetPackage) {
1386
1982
  return null;
1983
+ }
1387
1984
  return widgetPackage.url;
1388
1985
  }
1389
1986
  // /**
@@ -1435,8 +2032,8 @@ var WidgetDataApiImpl = class {
1435
2032
  * @param options
1436
2033
  */
1437
2034
  async save(data, options = { sendBroadcast: true }) {
1438
- let store = this.getStore(data.name);
1439
- let json = JSON.stringify(data);
2035
+ const store = this.getStore(data.name);
2036
+ const json = JSON.stringify(data);
1440
2037
  const result = await store.setItem(this.getKey(data.name, data.id), json);
1441
2038
  if (options.sendBroadcast) {
1442
2039
  const broadcastEvent = new BroadcastEvent({
@@ -1447,16 +2044,12 @@ var WidgetDataApiImpl = class {
1447
2044
  }
1448
2045
  return result;
1449
2046
  }
1450
- /**
1451
- * 获取组件 LocalForage 存储实例
1452
- * @param name
1453
- */
1454
- getStore(name) {
1455
- if (this.stores.has(name)) {
1456
- return this.stores.get(name);
2047
+ getStore(widgetName, storeName) {
2048
+ if (this.stores.has(widgetName)) {
2049
+ return this.stores.get(widgetName);
1457
2050
  }
1458
- const store = localforage.createInstance({ name });
1459
- this.stores.set(name, store);
2051
+ const store = localforage.createInstance({ name: widgetName, storeName });
2052
+ this.stores.set(widgetName, store);
1460
2053
  return store;
1461
2054
  }
1462
2055
  /**
@@ -1489,7 +2082,7 @@ var WidgetDataApiImpl = class {
1489
2082
  data = args[0];
1490
2083
  name = data.name;
1491
2084
  }
1492
- let store = this.getStore(name);
2085
+ const store = this.getStore(name);
1493
2086
  dbStr = await store.getItem(name);
1494
2087
  if (dbStr) {
1495
2088
  data.parseJSON(JSON.parse(dbStr));
@@ -1498,8 +2091,8 @@ var WidgetDataApiImpl = class {
1498
2091
  return void 0;
1499
2092
  }
1500
2093
  async find(name, id, type) {
1501
- let store = this.getStore(name);
1502
- let result = await store.getItem(this.getKey(name, id));
2094
+ const store = this.getStore(name);
2095
+ const result = await store.getItem(this.getKey(name, id));
1503
2096
  if (result) {
1504
2097
  const widgetData = new type(name, id);
1505
2098
  widgetData.parseJSON(JSON.parse(result));
@@ -2126,6 +2719,12 @@ var FileApiImpl = class extends BaseApi {
2126
2719
  }
2127
2720
  };
2128
2721
  var FileApi = new FileApiImpl();
2722
+
2723
+ // src/api/SystemApi.ts
2724
+ var SystemApiEvent = /* @__PURE__ */ ((SystemApiEvent2) => {
2725
+ SystemApiEvent2["DATE_CHANGED"] = "event::cn.widgetjs.core.sys.date.changed";
2726
+ return SystemApiEvent2;
2727
+ })(SystemApiEvent || {});
2129
2728
  export {
2130
2729
  ApiConstants,
2131
2730
  AppApi,
@@ -2163,6 +2762,7 @@ export {
2163
2762
  ShortcutApi,
2164
2763
  ShortcutApiEvent,
2165
2764
  StoreApi,
2765
+ SystemApiEvent,
2166
2766
  ThemeMode,
2167
2767
  WebSocketEvent,
2168
2768
  WebSocketEventType,