web-music-score 6.0.0-pre.3 → 6.0.0-pre.5

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 (35) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/audio/index.d.ts +1 -1
  3. package/dist/audio/index.js +12 -2
  4. package/dist/audio/index.mjs +4 -4
  5. package/dist/audio-cg/index.js +1 -1
  6. package/dist/audio-cg/index.mjs +4 -4
  7. package/dist/audio-synth/index.js +1 -1
  8. package/dist/audio-synth/index.mjs +4 -4
  9. package/dist/{chunk-7OA6ZYVA.mjs → chunk-6R3N7WJC.mjs} +3 -3
  10. package/dist/{chunk-TM46RT77.mjs → chunk-DQFQEO6F.mjs} +4 -4
  11. package/dist/{chunk-QJ3X3GQ6.mjs → chunk-G3HIPFVF.mjs} +2 -2
  12. package/dist/{chunk-S5PIZUF6.mjs → chunk-JP3PJICN.mjs} +14 -4
  13. package/dist/{chunk-SCF6ZZFQ.mjs → chunk-U2D4H5TI.mjs} +3 -3
  14. package/dist/{chunk-AMTQ5XLI.mjs → chunk-Y67RBHW2.mjs} +2 -2
  15. package/dist/core/index.js +1740 -5
  16. package/dist/core/index.mjs +8 -14
  17. package/dist/iife/audio-cg.js +1 -1
  18. package/dist/iife/index.js +13 -13
  19. package/dist/{music-objects-DLmp5uL6.d.ts → music-objects-D-xO1oti.d.ts} +75 -5
  20. package/dist/{note-RVXvpfyV.d.ts → note-CJuq5aBy.d.ts} +1 -1
  21. package/dist/pieces/index.d.ts +3 -3
  22. package/dist/pieces/index.js +2 -2
  23. package/dist/pieces/index.mjs +3 -3
  24. package/dist/react-ui/index.d.ts +4 -3
  25. package/dist/react-ui/index.js +3 -1
  26. package/dist/react-ui/index.mjs +4 -2
  27. package/dist/{scale-B1M10_fu.d.ts → scale-DxGqFxlv.d.ts} +2 -2
  28. package/dist/score/index.d.ts +15 -56
  29. package/dist/score/index.js +731 -603
  30. package/dist/score/index.mjs +722 -605
  31. package/dist/{tempo-D-JF-8b_.d.ts → tempo-pCAa6qgo.d.ts} +1 -1
  32. package/dist/theory/index.d.ts +5 -5
  33. package/dist/theory/index.js +12 -2
  34. package/dist/theory/index.mjs +4 -4
  35. package/package.json +5 -4
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v6.0.0-pre.3 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
1
+ /* WebMusicScore v6.0.0-pre.5 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
21
21
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
22
 
23
23
  // src/core/index.ts
@@ -29,7 +29,1609 @@ __export(core_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(core_exports);
31
31
 
32
- // src/core/custom-css.ts
32
+ // node_modules/@tspro/ts-utils-lib/dist/index.mjs
33
+ var __defProp2 = Object.defineProperty;
34
+ var __export2 = (target, all) => {
35
+ for (var name in all)
36
+ __defProp2(target, name, { get: all[name], enumerable: true });
37
+ };
38
+ var assert_exports = {};
39
+ __export2(assert_exports, {
40
+ assert: () => assert,
41
+ doesNotThrow: () => doesNotThrow2,
42
+ doesThrow: () => doesThrow2,
43
+ fail: () => fail,
44
+ isArray: () => isArray2,
45
+ isArrayOrUndefined: () => isArrayOrUndefined2,
46
+ isBigInt: () => isBigInt2,
47
+ isBoolean: () => isBoolean2,
48
+ isBooleanOrUndefined: () => isBooleanOrUndefined2,
49
+ isDeepEqual: () => isDeepEqual2,
50
+ isDefined: () => isDefined2,
51
+ isEmptyArray: () => isEmptyArray2,
52
+ isEmptyArrayOrUndefined: () => isEmptyArrayOrUndefined2,
53
+ isEmptyObject: () => isEmptyObject2,
54
+ isEmptyString: () => isEmptyString2,
55
+ isEmptyStringOrUndefined: () => isEmptyStringOrUndefined2,
56
+ isEnumValue: () => isEnumValue2,
57
+ isEnumValueOrUndefined: () => isEnumValueOrUndefined2,
58
+ isEven: () => isEven2,
59
+ isFalse: () => isFalse2,
60
+ isFalseOrUndefined: () => isFalseOrUndefined2,
61
+ isFinite: () => isFinite3,
62
+ isFloat: () => isFloat2,
63
+ isFunction: () => isFunction2,
64
+ isFunctionOrUndefined: () => isFunctionOrUndefined2,
65
+ isIncluded: () => isIncluded2,
66
+ isIndex: () => isIndex2,
67
+ isInfinity: () => isInfinity2,
68
+ isInteger: () => isInteger2,
69
+ isIntegerBetween: () => isIntegerBetween2,
70
+ isIntegerBetweenExclusive: () => isIntegerBetweenExclusive2,
71
+ isIntegerEq: () => isIntegerEq2,
72
+ isIntegerGt: () => isIntegerGt2,
73
+ isIntegerGte: () => isIntegerGte2,
74
+ isIntegerLt: () => isIntegerLt2,
75
+ isIntegerLte: () => isIntegerLte2,
76
+ isIntegerOrUndefined: () => isIntegerOrUndefined2,
77
+ isMultipleOf: () => isMultipleOf2,
78
+ isNaNValue: () => isNaNValue2,
79
+ isNeg: () => isNeg2,
80
+ isNegInfinity: () => isNegInfinity2,
81
+ isNegZero: () => isNegZero2,
82
+ isNonEmptyArray: () => isNonEmptyArray2,
83
+ isNonEmptyArrayOrUndefined: () => isNonEmptyArrayOrUndefined2,
84
+ isNonEmptyString: () => isNonEmptyString2,
85
+ isNonEmptyStringOrUndefined: () => isNonEmptyStringOrUndefined2,
86
+ isNonNeg: () => isNonNeg2,
87
+ isNonNull: () => isNonNull2,
88
+ isNonPos: () => isNonPos2,
89
+ isNull: () => isNull2,
90
+ isNullish: () => isNullish2,
91
+ isNumber: () => isNumber2,
92
+ isNumberBetween: () => isNumberBetween2,
93
+ isNumberBetweenExclusive: () => isNumberBetweenExclusive2,
94
+ isNumberEq: () => isNumberEq2,
95
+ isNumberGt: () => isNumberGt2,
96
+ isNumberGte: () => isNumberGte2,
97
+ isNumberLt: () => isNumberLt2,
98
+ isNumberLte: () => isNumberLte2,
99
+ isNumberOrUndefined: () => isNumberOrUndefined2,
100
+ isNumericString: () => isNumericString2,
101
+ isObject: () => isObject2,
102
+ isObjectOrUndefined: () => isObjectOrUndefined2,
103
+ isOdd: () => isOdd2,
104
+ isPlainObject: () => isPlainObject2,
105
+ isPos: () => isPos2,
106
+ isPosInfinity: () => isPosInfinity2,
107
+ isPosZero: () => isPosZero2,
108
+ isPowerOfTwo: () => isPowerOfTwo2,
109
+ isSafeInteger: () => isSafeInteger2,
110
+ isSafeNumber: () => isSafeNumber2,
111
+ isStrictEqual: () => isStrictEqual2,
112
+ isString: () => isString2,
113
+ isStringOrUndefined: () => isStringOrUndefined2,
114
+ isTrue: () => isTrue2,
115
+ isTrueOrUndefined: () => isTrueOrUndefined2,
116
+ isTypedObject: () => isTypedObject2,
117
+ isUndefined: () => isUndefined2,
118
+ isZero: () => isZero2,
119
+ require: () => require2,
120
+ requireDefined: () => requireDefined,
121
+ requireElement: () => requireElement,
122
+ setErrorClass: () => setErrorClass
123
+ });
124
+ var str_exports = {};
125
+ __export2(str_exports, {
126
+ charCount: () => charCount,
127
+ chunkString: () => chunkString,
128
+ insertAt: () => insertAt,
129
+ isString: () => isString,
130
+ makeSentenceFromPascal: () => makeSentenceFromPascal,
131
+ removeAt: () => removeAt,
132
+ repeatString: () => repeatString,
133
+ replaceAt: () => replaceAt,
134
+ splitByCaps: () => splitByCaps,
135
+ splitByChars: () => splitByChars,
136
+ splitByStrings: () => splitByStrings,
137
+ stringify: () => stringify,
138
+ toCharArray: () => toCharArray
139
+ });
140
+ var obj_exports = {};
141
+ __export2(obj_exports, {
142
+ deepEqual: () => deepEqual,
143
+ getCtorName: () => getCtorName,
144
+ hasProperties: () => hasProperties,
145
+ isObject: () => isObject
146
+ });
147
+ var guard_exports = {};
148
+ __export2(guard_exports, {
149
+ doesNotThrow: () => doesNotThrow,
150
+ doesThrow: () => doesThrow,
151
+ isArray: () => isArray,
152
+ isArrayOrUndefined: () => isArrayOrUndefined,
153
+ isBigInt: () => isBigInt,
154
+ isBoolean: () => isBoolean,
155
+ isBooleanOrUndefined: () => isBooleanOrUndefined,
156
+ isDeepEqual: () => isDeepEqual,
157
+ isDefined: () => isDefined,
158
+ isEmptyArray: () => isEmptyArray,
159
+ isEmptyArrayOrUndefined: () => isEmptyArrayOrUndefined,
160
+ isEmptyObject: () => isEmptyObject,
161
+ isEmptyString: () => isEmptyString,
162
+ isEmptyStringOrUndefined: () => isEmptyStringOrUndefined,
163
+ isEnumValue: () => isEnumValue,
164
+ isEnumValueOrUndefined: () => isEnumValueOrUndefined,
165
+ isEven: () => isEven,
166
+ isFalse: () => isFalse,
167
+ isFalseOrUndefined: () => isFalseOrUndefined,
168
+ isFinite: () => isFinite2,
169
+ isFloat: () => isFloat,
170
+ isFunction: () => isFunction,
171
+ isFunctionOrUndefined: () => isFunctionOrUndefined,
172
+ isIncluded: () => isIncluded,
173
+ isIndex: () => isIndex,
174
+ isInfinity: () => isInfinity,
175
+ isInteger: () => isInteger,
176
+ isIntegerBetween: () => isIntegerBetween,
177
+ isIntegerBetweenExclusive: () => isIntegerBetweenExclusive,
178
+ isIntegerEq: () => isIntegerEq,
179
+ isIntegerGt: () => isIntegerGt,
180
+ isIntegerGte: () => isIntegerGte,
181
+ isIntegerLt: () => isIntegerLt,
182
+ isIntegerLte: () => isIntegerLte,
183
+ isIntegerOrUndefined: () => isIntegerOrUndefined,
184
+ isMultipleOf: () => isMultipleOf,
185
+ isNaNValue: () => isNaNValue,
186
+ isNeg: () => isNeg,
187
+ isNegInfinity: () => isNegInfinity,
188
+ isNegZero: () => isNegZero,
189
+ isNonEmptyArray: () => isNonEmptyArray,
190
+ isNonEmptyArrayOrUndefined: () => isNonEmptyArrayOrUndefined,
191
+ isNonEmptyString: () => isNonEmptyString,
192
+ isNonEmptyStringOrUndefined: () => isNonEmptyStringOrUndefined,
193
+ isNonNeg: () => isNonNeg,
194
+ isNonNull: () => isNonNull,
195
+ isNonPos: () => isNonPos,
196
+ isNull: () => isNull,
197
+ isNullish: () => isNullish,
198
+ isNumber: () => isNumber,
199
+ isNumberBetween: () => isNumberBetween,
200
+ isNumberBetweenExclusive: () => isNumberBetweenExclusive,
201
+ isNumberEq: () => isNumberEq,
202
+ isNumberGt: () => isNumberGt,
203
+ isNumberGte: () => isNumberGte,
204
+ isNumberLt: () => isNumberLt,
205
+ isNumberLte: () => isNumberLte,
206
+ isNumberOrUndefined: () => isNumberOrUndefined,
207
+ isNumericString: () => isNumericString,
208
+ isObject: () => isObject,
209
+ isObjectOrUndefined: () => isObjectOrUndefined,
210
+ isOdd: () => isOdd,
211
+ isPlainObject: () => isPlainObject,
212
+ isPos: () => isPos,
213
+ isPosInfinity: () => isPosInfinity,
214
+ isPosZero: () => isPosZero,
215
+ isPowerOfTwo: () => isPowerOfTwo,
216
+ isSafeInteger: () => isSafeInteger,
217
+ isSafeNumber: () => isSafeNumber,
218
+ isStrictEqual: () => isStrictEqual,
219
+ isString: () => isString,
220
+ isStringOrUndefined: () => isStringOrUndefined,
221
+ isTrue: () => isTrue,
222
+ isTrueOrUndefined: () => isTrueOrUndefined,
223
+ isTypedObject: () => isTypedObject,
224
+ isUndefined: () => isUndefined,
225
+ isZero: () => isZero,
226
+ tryOr: () => tryOr
227
+ });
228
+ var enum_exports = {};
229
+ __export2(enum_exports, {
230
+ forEachEnum: () => forEachEnum,
231
+ getEnumEntries: () => getEnumEntries,
232
+ getEnumKey: () => getEnumKey,
233
+ getEnumKeys: () => getEnumKeys,
234
+ getEnumValues: () => getEnumValues
235
+ });
236
+ function getEnumKeys(e) {
237
+ return Object.keys(e).filter((k) => isNaN(Number(k)));
238
+ }
239
+ function getEnumValues(e) {
240
+ return getEnumKeys(e).map((k) => e[k]);
241
+ }
242
+ function getEnumEntries(e) {
243
+ return getEnumKeys(e).map((k) => [k, e[k]]);
244
+ }
245
+ function getEnumKey(e, value) {
246
+ return getEnumKeys(e).find((k) => e[k] === value);
247
+ }
248
+ function forEachEnum(e, callback) {
249
+ for (const [k, v] of getEnumEntries(e)) callback(k, v);
250
+ }
251
+ function isStrictEqual(val1, val2) {
252
+ return val1 === val2;
253
+ }
254
+ function isDeepEqual(val1, val2) {
255
+ return deepEqual(val1, val2);
256
+ }
257
+ function isUndefined(val) {
258
+ return val === void 0;
259
+ }
260
+ function isNull(val) {
261
+ return val === null;
262
+ }
263
+ function isNullish(val) {
264
+ return val === void 0 || val === null;
265
+ }
266
+ function isDefined(val) {
267
+ return val !== void 0;
268
+ }
269
+ function isNonNull(val) {
270
+ return val !== null;
271
+ }
272
+ function isObject(val) {
273
+ return typeof val === "object" && val !== null && !isArray(val);
274
+ }
275
+ function isEmptyObject(val) {
276
+ return isObject(val) && Object.keys(val).length === 0;
277
+ }
278
+ function isObjectOrUndefined(val) {
279
+ return val === void 0 || isObject(val);
280
+ }
281
+ function isPlainObject(val) {
282
+ if (!isObject(val)) return false;
283
+ const proto = Object.getPrototypeOf(val);
284
+ return proto === Object.prototype || proto === null;
285
+ }
286
+ function isTypedObject(val, keys) {
287
+ return isObject(val) && keys.every((k) => k in val);
288
+ }
289
+ function isSet(val) {
290
+ return val instanceof Set;
291
+ }
292
+ function isArray(arr) {
293
+ return !!arr && Object.prototype.toString.call(arr) === "[object Array]";
294
+ }
295
+ function isArrayOrUndefined(arr) {
296
+ return arr === void 0 || isArray(arr);
297
+ }
298
+ function isEmptyArray(arr) {
299
+ return isArray(arr) && arr.length === 0;
300
+ }
301
+ function isNonEmptyArray(arr) {
302
+ return isArray(arr) && arr.length > 0;
303
+ }
304
+ function isEmptyArrayOrUndefined(arr) {
305
+ return isArray(arr) && arr.length === 0 || arr === void 0;
306
+ }
307
+ function isNonEmptyArrayOrUndefined(arr) {
308
+ return isArray(arr) && arr.length > 0 || arr === void 0;
309
+ }
310
+ function isString(val) {
311
+ return typeof val === "string";
312
+ }
313
+ function isEmptyString(val) {
314
+ return typeof val === "string" && val.length === 0;
315
+ }
316
+ function isNonEmptyString(val) {
317
+ return typeof val === "string" && val.length > 0;
318
+ }
319
+ function isStringOrUndefined(val) {
320
+ return val === void 0 || typeof val === "string";
321
+ }
322
+ function isEmptyStringOrUndefined(val) {
323
+ return typeof val === "string" && val.length === 0 || val === void 0;
324
+ }
325
+ function isNonEmptyStringOrUndefined(val) {
326
+ return typeof val === "string" && val.length > 0 || val === void 0;
327
+ }
328
+ function isBoolean(val) {
329
+ return typeof val === "boolean";
330
+ }
331
+ function isBooleanOrUndefined(val) {
332
+ return val === void 0 || typeof val === "boolean";
333
+ }
334
+ function isTrue(val) {
335
+ return val === true;
336
+ }
337
+ function isTrueOrUndefined(val) {
338
+ return val === true || val === void 0;
339
+ }
340
+ function isFalse(val) {
341
+ return val === false;
342
+ }
343
+ function isFalseOrUndefined(val) {
344
+ return val === false || val === void 0;
345
+ }
346
+ function isFunction(val) {
347
+ return typeof val === "function";
348
+ }
349
+ function isFunctionOrUndefined(val) {
350
+ return val === void 0 || typeof val === "function";
351
+ }
352
+ function isEnumValue(val, enumObj) {
353
+ return getEnumValues(enumObj).some((v) => v === val);
354
+ }
355
+ function isEnumValueOrUndefined(val, enumObj) {
356
+ return val === void 0 || getEnumValues(enumObj).some((v) => v === val);
357
+ }
358
+ function isNumericString(val) {
359
+ if (typeof val !== "string" || val.trim() === "") return false;
360
+ const n = +val;
361
+ return Number.isFinite(n);
362
+ }
363
+ function isBigInt(val) {
364
+ return typeof val === "bigint";
365
+ }
366
+ function isNumber(val) {
367
+ return typeof val === "number";
368
+ }
369
+ function isSafeNumber(val) {
370
+ return isNumber(val) && Number.isSafeInteger(val);
371
+ }
372
+ function isNumberOrUndefined(val) {
373
+ return typeof val === "number" || val === void 0;
374
+ }
375
+ function isNumberEq(val, ref) {
376
+ return isNumber(val) && val === ref;
377
+ }
378
+ function isNumberGt(val, ref) {
379
+ return isNumber(val) && isNumber(ref) && val > ref;
380
+ }
381
+ function isNumberGte(val, ref) {
382
+ return isNumber(val) && isNumber(ref) && val >= ref;
383
+ }
384
+ function isNumberLt(val, ref) {
385
+ return isNumber(val) && isNumber(ref) && val < ref;
386
+ }
387
+ function isNumberLte(val, ref) {
388
+ return isNumber(val) && isNumber(ref) && val <= ref;
389
+ }
390
+ function isNumberBetween(val, min, max) {
391
+ return isNumber(val) && isNumber(min) && isNumber(max) && val >= min && val <= max;
392
+ }
393
+ function isNumberBetweenExclusive(val, min, max) {
394
+ return isNumber(val) && isNumber(min) && isNumber(max) && val > min && val < max;
395
+ }
396
+ function isFinite2(val) {
397
+ return typeof val === "number" && Number.isFinite(val);
398
+ }
399
+ function isFloat(val) {
400
+ return isFinite2(val) && !isInteger(val);
401
+ }
402
+ function isInteger(val) {
403
+ return typeof val === "number" && isFinite2(val) && val === Math.trunc(val);
404
+ }
405
+ function isSafeInteger(val) {
406
+ return isInteger(val) && Number.isSafeInteger(val);
407
+ }
408
+ function isIntegerOrUndefined(val) {
409
+ return typeof val === "number" && isFinite2(val) && val === Math.trunc(val) || val === void 0;
410
+ }
411
+ function isIntegerEq(val, ref) {
412
+ return isInteger(val) && val === ref;
413
+ }
414
+ function isIntegerGt(val, ref) {
415
+ return isInteger(val) && isNumber(ref) && val > ref;
416
+ }
417
+ function isIntegerGte(val, ref) {
418
+ return isInteger(val) && isNumber(ref) && val >= ref;
419
+ }
420
+ function isIntegerLt(val, ref) {
421
+ return isInteger(val) && isNumber(ref) && val < ref;
422
+ }
423
+ function isIntegerLte(val, ref) {
424
+ return isInteger(val) && isNumber(ref) && val <= ref;
425
+ }
426
+ function isIntegerBetween(val, min, max) {
427
+ return isInteger(val) && isNumber(min) && isNumber(max) && val >= min && val <= max;
428
+ }
429
+ function isIntegerBetweenExclusive(val, min, max) {
430
+ return isInteger(val) && isNumber(min) && isNumber(max) && val > min && val < max;
431
+ }
432
+ function isNaNValue(val) {
433
+ return typeof val === "number" && Number.isNaN(val);
434
+ }
435
+ function isInfinity(val) {
436
+ return val === Infinity || val === -Infinity;
437
+ }
438
+ function isPosInfinity(val) {
439
+ return val === Infinity;
440
+ }
441
+ function isNegInfinity(val) {
442
+ return val === -Infinity;
443
+ }
444
+ function isPos(val) {
445
+ return typeof val === "number" && val > 0;
446
+ }
447
+ function isNeg(val) {
448
+ return typeof val === "number" && val < 0;
449
+ }
450
+ function isNonPos(val) {
451
+ return typeof val === "number" && val <= 0;
452
+ }
453
+ function isNonNeg(val) {
454
+ return typeof val === "number" && val >= 0;
455
+ }
456
+ function isZero(val) {
457
+ return typeof val === "number" && val === 0;
458
+ }
459
+ function isPosZero(val) {
460
+ return typeof val === "number" && val === 0 && 1 / val === Infinity;
461
+ }
462
+ function isNegZero(val) {
463
+ return typeof val === "number" && val === 0 && 1 / val === -Infinity;
464
+ }
465
+ function isOdd(val) {
466
+ return isInteger(val) && Math.abs(val) % 2 === 1;
467
+ }
468
+ function isEven(val) {
469
+ return isInteger(val) && val % 2 === 0;
470
+ }
471
+ function isMultipleOf(val, base) {
472
+ return typeof val === "number" && typeof base === "number" && val % base === 0;
473
+ }
474
+ function isPowerOfTwo(val) {
475
+ return isInteger(val) && val > 0 && (val & val - 1) === 0;
476
+ }
477
+ function isIncluded(val, container) {
478
+ if (isArray(container)) {
479
+ return container.includes(val);
480
+ }
481
+ if (isSet(container)) {
482
+ return container.has(val);
483
+ }
484
+ return false;
485
+ }
486
+ function isIndex(index, array) {
487
+ return isArray(array) ? isIntegerBetween(index, 0, array.length - 1) : isIntegerGte(index, 0);
488
+ }
489
+ function doesThrow(throwTestFn) {
490
+ try {
491
+ throwTestFn();
492
+ return false;
493
+ } catch (err) {
494
+ return true;
495
+ }
496
+ }
497
+ function doesNotThrow(throwTestFn) {
498
+ try {
499
+ throwTestFn();
500
+ return true;
501
+ } catch (err) {
502
+ return false;
503
+ }
504
+ }
505
+ function tryOr(tryFn, orVal) {
506
+ try {
507
+ return tryFn();
508
+ } catch (err) {
509
+ return isFunction(orVal) ? orVal() : orVal;
510
+ }
511
+ }
512
+ function hasProperties(obj, props) {
513
+ return isObject(obj) && props.every((p) => p in obj);
514
+ }
515
+ function deepEqual(a, b) {
516
+ if (a === b) return true;
517
+ if (a === null || b === null) return false;
518
+ if (typeof a !== "object" || typeof b !== "object") return false;
519
+ if (Array.isArray(a) && Array.isArray(b)) {
520
+ if (a.length !== b.length) return false;
521
+ return a.every((val, i) => deepEqual(val, b[i]));
522
+ }
523
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
524
+ const keysA = Object.keys(a);
525
+ const keysB = Object.keys(b);
526
+ if (keysA.length !== keysB.length) return false;
527
+ for (const key of keysA) {
528
+ if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
529
+ if (!deepEqual(a[key], b[key])) return false;
530
+ }
531
+ return true;
532
+ }
533
+ function getCtorName(obj) {
534
+ if (obj === null) return "null";
535
+ if (isArray(obj)) return "Array";
536
+ if (typeof obj !== "object") return typeof obj;
537
+ const tag = Object.prototype.toString.call(obj).slice(8, -1);
538
+ return tag || "Object";
539
+ }
540
+ function toCharArray(str2) {
541
+ return str2.split("");
542
+ }
543
+ function repeatString(repeatString2, repeatCount) {
544
+ if (!isInteger(repeatCount) || repeatCount < 0) {
545
+ throw new Error("repeatStr: Invalid repeatCount = " + repeatCount);
546
+ }
547
+ return new Array(repeatCount + 1).join(repeatString2);
548
+ }
549
+ function chunkString(str2, chunkSize) {
550
+ if (!isInteger(chunkSize) || chunkSize < 1) {
551
+ throw new Error("chunckString: Invalid chuckSize = " + chunkSize);
552
+ }
553
+ let result = [];
554
+ for (let i = 0; i < str2.length; i += chunkSize) {
555
+ result.push(str2.slice(i, i + chunkSize));
556
+ }
557
+ return result;
558
+ }
559
+ function replaceAt(str2, pos, removeCount, insert) {
560
+ if (!isInteger(removeCount) || removeCount < 0) {
561
+ throw new Error("replaceAt: Invalid removeCount = " + removeCount);
562
+ } else if (!isInteger(pos) || pos < 0 || pos + removeCount > str2.length) {
563
+ throw new Error("replaceAt: Invalid pos = " + pos + ", removeCount = " + removeCount + ", str.length = " + str2.length);
564
+ } else {
565
+ return str2.substring(0, pos) + insert + str2.substring(pos + removeCount);
566
+ }
567
+ }
568
+ function insertAt(str2, pos, insertStr) {
569
+ return replaceAt(str2, pos, 0, insertStr);
570
+ }
571
+ function removeAt(str2, pos, removeCount) {
572
+ return replaceAt(str2, pos, removeCount, "");
573
+ }
574
+ function charCount(str2, ch) {
575
+ if (ch.length !== 1 || str2.length === 0) return 0;
576
+ let count = 0;
577
+ for (let i = 0; i < str2.length; i++) {
578
+ if (str2[i] === ch) count++;
579
+ }
580
+ return count;
581
+ }
582
+ function makeSentenceFromPascal(PascalString) {
583
+ if (PascalString === "") {
584
+ return "";
585
+ }
586
+ let word = PascalString.charAt(0);
587
+ let sentence = "";
588
+ const addWord = () => {
589
+ if (word !== "") {
590
+ if (sentence === "") {
591
+ sentence += word.charAt(0).toUpperCase() + word.substring(1);
592
+ } else {
593
+ sentence += " " + word;
594
+ }
595
+ word = "";
596
+ }
597
+ };
598
+ const isLetterAndCapital = (c) => {
599
+ return c.toUpperCase() !== c.toLowerCase() && c === c.toUpperCase();
600
+ };
601
+ for (let i = 1; i < PascalString.length; i++) {
602
+ let c = PascalString.charAt(i);
603
+ if (isLetterAndCapital(c)) {
604
+ addWord();
605
+ }
606
+ word += c.toLowerCase();
607
+ }
608
+ addWord();
609
+ return sentence;
610
+ }
611
+ function stringify(value, maxDepth = 5, seen = /* @__PURE__ */ new WeakSet()) {
612
+ if (value === null) return "null";
613
+ if (value === void 0) return "undefined";
614
+ const t = typeof value;
615
+ switch (t) {
616
+ case "boolean":
617
+ return value ? "true" : "false";
618
+ case "number":
619
+ if (isNaNValue(value)) return "NaN";
620
+ if (!isFinite2(value))
621
+ return value < 0 ? "-Infinity" : "Infinity";
622
+ return value.toString();
623
+ case "bigint":
624
+ return `${value}n`;
625
+ case "string":
626
+ return `"${value}"`;
627
+ case "symbol":
628
+ return value.description ? `Symbol(${value.description})` : "Symbol()";
629
+ case "function":
630
+ return `[Function${value.name ? ` ${value.name}` : ""}]`;
631
+ }
632
+ if (seen.has(value))
633
+ return "[Circular]";
634
+ if (maxDepth <= 0)
635
+ return "[Depth limit]";
636
+ maxDepth--;
637
+ seen.add(value);
638
+ const strfy = (v) => stringify(v, maxDepth, seen);
639
+ if (isArray(value)) {
640
+ const inner = value.map((v) => strfy(v)).join(", ");
641
+ return inner.length === 0 ? "[ ]" : `[ ${inner} ]`;
642
+ }
643
+ if (ArrayBuffer.isView(value)) {
644
+ if (value instanceof DataView)
645
+ return `DataView(${value.byteLength})`;
646
+ const inner = Array.from(value).map((v) => strfy(v)).join(", ");
647
+ return `${value.constructor.name}[ ${inner} ]`;
648
+ }
649
+ if (value instanceof ArrayBuffer)
650
+ return `ArrayBuffer(${value.byteLength})`;
651
+ if (value instanceof Map) {
652
+ const entries = Array.from(value.entries()).map(([k, v]) => `${strfy(k)} => ${strfy(v)}`).join(", ");
653
+ return entries.length === 0 ? `Map(${value.size}){ }` : `Map(${value.size}){ ${entries} }`;
654
+ }
655
+ if (value instanceof Set) {
656
+ const entries = Array.from(value.values()).map((v) => strfy(v)).join(", ");
657
+ return entries.length === 0 ? `Set(${value.size}){ }` : `Set(${value.size}){ ${entries} }`;
658
+ }
659
+ if (value instanceof WeakMap)
660
+ return "WeakMap{ ? }";
661
+ if (value instanceof WeakSet)
662
+ return "WeakSet{ ? }";
663
+ if (value instanceof Date)
664
+ return `Date("${value.toISOString()}")`;
665
+ if (value instanceof RegExp)
666
+ return value.toString();
667
+ if (value instanceof Error)
668
+ return `${value.name}("${value.message}")`;
669
+ if (value instanceof Promise)
670
+ return "Promise{ ? }";
671
+ if (value instanceof URL)
672
+ return `URL("${value.href}")`;
673
+ if (value instanceof URLSearchParams)
674
+ return `URLSearchParams("${value.toString()}")`;
675
+ if (value === Math) return "Math";
676
+ if (value === JSON) return "JSON";
677
+ if (value === Reflect) return "Reflect";
678
+ if (value === Intl) return "Intl";
679
+ const hasCustomToString = typeof (value == null ? void 0 : value.toString) === "function" && value.toString !== Object.prototype.toString;
680
+ if (hasCustomToString) {
681
+ try {
682
+ const str2 = value.toString();
683
+ if (!/^\[object .+\]$/.test(str2)) return str2;
684
+ } catch (e) {
685
+ }
686
+ }
687
+ if (t === "object") {
688
+ const ctorName = getCtorName(value);
689
+ const entries = Object.entries(value).map(
690
+ ([key, val]) => `${strfy(key)}: ${strfy(val)}`
691
+ );
692
+ if (entries.length === 0) return `${ctorName}{ }`;
693
+ return `${ctorName}{ ${entries.join(", ")} }`;
694
+ }
695
+ return String(value);
696
+ }
697
+ function splitByCaps(str2) {
698
+ return str2.split(/(?=[A-Z])/).filter((x) => !!x);
699
+ }
700
+ function splitByStrings(str2, ...splitters) {
701
+ if (splitters.length === 0) return [str2];
702
+ const escaped = splitters.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
703
+ const regex = new RegExp(escaped.join("|"), "g");
704
+ return str2.split(regex);
705
+ }
706
+ function splitByChars(str2, splitters) {
707
+ return splitByStrings(str2, ...splitters.split(""));
708
+ }
709
+ var fmt = stringify;
710
+ var errorConstructor = Error;
711
+ function setErrorClass(errorClass) {
712
+ errorConstructor = errorClass != null ? errorClass : Error;
713
+ }
714
+ function _fail(...msgs) {
715
+ let msg = msgs.join(", ");
716
+ throw new errorConstructor("Assertion Failed!" + (msg === "" ? "" : " " + msg));
717
+ }
718
+ function assert(condition, msg) {
719
+ if (!condition) {
720
+ _fail(msg);
721
+ }
722
+ }
723
+ function require2(val, msg) {
724
+ if (val == null) {
725
+ _fail(`Expected ${fmt(val)} not to be nullish`, msg);
726
+ }
727
+ return val;
728
+ }
729
+ function requireDefined(val, msg) {
730
+ if (val === void 0) {
731
+ _fail(`Expected ${fmt(val)} not to be undefined`, msg);
732
+ }
733
+ return val;
734
+ }
735
+ function requireElement(index, array, msg) {
736
+ if (!guard_exports.isIndex(index, array))
737
+ _fail(`Expected ${index} to be index for array ${fmt(array)}`, msg);
738
+ return array[index];
739
+ }
740
+ function fail(msg) {
741
+ _fail(msg);
742
+ }
743
+ function isStrictEqual2(val1, val2, msg) {
744
+ if (!guard_exports.isStrictEqual(val1, val2))
745
+ _fail(`Expected ${fmt(val1)} to ne strict equal to ${val2}`, msg);
746
+ return val1;
747
+ }
748
+ function isDeepEqual2(val1, val2, msg) {
749
+ if (!guard_exports.isDeepEqual(val1, val2))
750
+ _fail(`Expected ${fmt(val1)} to deep equal with ${fmt(val2)}`, msg);
751
+ return val1;
752
+ }
753
+ function isUndefined2(val, msg) {
754
+ if (!guard_exports.isUndefined(val))
755
+ _fail(`Expected ${fmt(val)} to be undefined`, msg);
756
+ return val;
757
+ }
758
+ function isNull2(val, msg) {
759
+ if (!guard_exports.isNull(val))
760
+ _fail(`Expected ${fmt(val)} to be null`, msg);
761
+ return val;
762
+ }
763
+ function isNullish2(val, msg) {
764
+ if (!guard_exports.isNullish(val))
765
+ _fail(`Expected ${fmt(val)} to be null or undefined`, msg);
766
+ return val;
767
+ }
768
+ function isDefined2(val, msg) {
769
+ if (!guard_exports.isDefined(val)) {
770
+ _fail(`Expected ${fmt(val)} to be defined`, msg);
771
+ }
772
+ return val;
773
+ }
774
+ function isNonNull2(val, msg) {
775
+ if (!guard_exports.isNonNull(val)) {
776
+ _fail(`Expected ${fmt(val)} to be defined`, msg);
777
+ }
778
+ return val;
779
+ }
780
+ function isObject2(val, msg) {
781
+ if (!guard_exports.isObject(val))
782
+ _fail(`Expected ${fmt(val)} to be object`, msg);
783
+ return val;
784
+ }
785
+ function isEmptyObject2(val, msg) {
786
+ if (!guard_exports.isEmptyObject(val))
787
+ _fail(`Expected ${fmt(val)} to be empty object`, msg);
788
+ return val;
789
+ }
790
+ function isPlainObject2(val, msg) {
791
+ if (!guard_exports.isPlainObject(val))
792
+ _fail(`Expected ${fmt(val)} to be plain object`, msg);
793
+ return val;
794
+ }
795
+ function isObjectOrUndefined2(val, msg) {
796
+ if (!guard_exports.isObjectOrUndefined(val))
797
+ _fail(`Expected ${fmt(val)} to be object or undefined`, msg);
798
+ return val;
799
+ }
800
+ function isTypedObject2(val, keys, msg) {
801
+ if (!guard_exports.isTypedObject(val, keys))
802
+ _fail(`Expected ${fmt(val)} to have keys ${fmt(keys)}`, msg);
803
+ return val;
804
+ }
805
+ function isArray2(val, msg) {
806
+ if (!guard_exports.isArray(val))
807
+ _fail(`Expected ${fmt(val)} to be array`, msg);
808
+ return val;
809
+ }
810
+ function isArrayOrUndefined2(val, msg) {
811
+ if (!guard_exports.isArrayOrUndefined(val))
812
+ _fail(`Expected ${fmt(val)} to be array or undefined`, msg);
813
+ return true;
814
+ }
815
+ function isEmptyArray2(val, msg) {
816
+ if (!guard_exports.isEmptyArray(val))
817
+ _fail(`Expected ${fmt(val)} to be empty array`, msg);
818
+ }
819
+ function isNonEmptyArray2(val, msg) {
820
+ if (!guard_exports.isNonEmptyArray(val))
821
+ _fail(`Expected ${fmt(val)} to be non-empty array`, msg);
822
+ }
823
+ function isEmptyArrayOrUndefined2(val, msg) {
824
+ if (!guard_exports.isEmptyArrayOrUndefined(val))
825
+ _fail(`Expected ${fmt(val)} to be empty array or undefined`, msg);
826
+ }
827
+ function isNonEmptyArrayOrUndefined2(val, msg) {
828
+ if (!guard_exports.isNonEmptyArrayOrUndefined(val))
829
+ _fail(`Expected ${fmt(val)} to be non-empty array or undefined`, msg);
830
+ }
831
+ function isString2(val, msg) {
832
+ if (!guard_exports.isString(val))
833
+ _fail(`Expected ${fmt(val)} to be string`, msg);
834
+ return val;
835
+ }
836
+ function isEmptyString2(val, msg) {
837
+ if (!guard_exports.isEmptyString(val))
838
+ _fail(`Expected ${fmt(val)} to be empty string`, msg);
839
+ return val;
840
+ }
841
+ function isNonEmptyString2(val, msg) {
842
+ if (!guard_exports.isNonEmptyString(val))
843
+ _fail(`Expected ${fmt(val)} to be non-empty string`, msg);
844
+ return val;
845
+ }
846
+ function isStringOrUndefined2(val, msg) {
847
+ if (!guard_exports.isStringOrUndefined(val))
848
+ _fail(`Expected ${fmt(val)} to be string or undefined`, msg);
849
+ return val;
850
+ }
851
+ function isEmptyStringOrUndefined2(val, msg) {
852
+ if (!guard_exports.isEmptyStringOrUndefined(val))
853
+ _fail(`Expected ${fmt(val)} to be empty string or undefined`, msg);
854
+ return val;
855
+ }
856
+ function isNonEmptyStringOrUndefined2(val, msg) {
857
+ if (!guard_exports.isNonEmptyStringOrUndefined(val))
858
+ _fail(`Expected ${fmt(val)} to be non-empty string or undefined`, msg);
859
+ return val;
860
+ }
861
+ function isBoolean2(val, msg) {
862
+ if (!guard_exports.isBoolean(val))
863
+ _fail(`Expected ${fmt(val)} to be boolean`, msg);
864
+ return val;
865
+ }
866
+ function isBooleanOrUndefined2(val, msg) {
867
+ if (!guard_exports.isBooleanOrUndefined(val))
868
+ _fail(`Expected ${fmt(val)} to be boolean or undefined`, msg);
869
+ return val;
870
+ }
871
+ function isTrue2(val, msg) {
872
+ if (!guard_exports.isTrue(val))
873
+ _fail(`Expected ${fmt(val)} to be true`, msg);
874
+ return val;
875
+ }
876
+ function isTrueOrUndefined2(val, msg) {
877
+ if (!guard_exports.isTrueOrUndefined(val))
878
+ _fail(`Expected ${fmt(val)} to be true or undefined`, msg);
879
+ return val;
880
+ }
881
+ function isFalse2(val, msg) {
882
+ if (!guard_exports.isFalse(val))
883
+ _fail(`Expected ${fmt(val)} to be false`, msg);
884
+ return val;
885
+ }
886
+ function isFalseOrUndefined2(val, msg) {
887
+ if (!guard_exports.isFalseOrUndefined(val))
888
+ _fail(`Expected ${fmt(val)} to be false or undefined`, msg);
889
+ return val;
890
+ }
891
+ function isFunction2(val, msg) {
892
+ if (!guard_exports.isFunction(val))
893
+ _fail(`Expected ${fmt(val)} to be function`, msg);
894
+ return val;
895
+ }
896
+ function isFunctionOrUndefined2(val, msg) {
897
+ if (!guard_exports.isFunctionOrUndefined(val))
898
+ _fail(`Expected ${fmt(val)} to be function or undefined`, msg);
899
+ return val;
900
+ }
901
+ function isEnumValue2(val, enumObject, msg) {
902
+ if (!guard_exports.isEnumValue(val, enumObject))
903
+ _fail(`Expected ${fmt(val)} to be enum val`, msg);
904
+ return val;
905
+ }
906
+ function isEnumValueOrUndefined2(val, enumObject, msg) {
907
+ if (!guard_exports.isEnumValueOrUndefined(val, enumObject))
908
+ _fail(`Expected ${fmt(val)} to be enum val or undefined`, msg);
909
+ return val;
910
+ }
911
+ function isNumericString2(val, msg) {
912
+ if (!guard_exports.isNumericString(val))
913
+ _fail(`Expected ${fmt(val)} to be numeric string`, msg);
914
+ return val;
915
+ }
916
+ function isBigInt2(val, msg) {
917
+ if (!guard_exports.isBigInt(val))
918
+ _fail(`Expected ${fmt(val)} to be BigInt`, msg);
919
+ return val;
920
+ }
921
+ function isNumber2(val, msg) {
922
+ if (!guard_exports.isNumber(val))
923
+ _fail(`Expected ${fmt(val)} to be number`, msg);
924
+ return val;
925
+ }
926
+ function isSafeNumber2(val, msg) {
927
+ if (!guard_exports.isSafeNumber(val))
928
+ _fail(`Expected ${fmt(val)} to be safe number`, msg);
929
+ return val;
930
+ }
931
+ function isNumberOrUndefined2(val, msg) {
932
+ if (!guard_exports.isNumberOrUndefined(val))
933
+ _fail(`Expected ${fmt(val)} to be number or undefined`, msg);
934
+ return val;
935
+ }
936
+ function isNumberEq2(val, ref, msg) {
937
+ if (!guard_exports.isNumberEq(val, ref))
938
+ _fail(`Expected ${fmt(val)} to be number equal to ${fmt(ref)}`, msg);
939
+ return val;
940
+ }
941
+ function isNumberGt2(val, ref, msg) {
942
+ if (!guard_exports.isNumberGt(val, ref))
943
+ _fail(`Expected ${fmt(val)} to be number > ${fmt(ref)}`, msg);
944
+ return val;
945
+ }
946
+ function isNumberGte2(val, ref, msg) {
947
+ if (!guard_exports.isNumberGte(val, ref))
948
+ _fail(`Expected ${fmt(val)} to be number >= ${fmt(ref)}`, msg);
949
+ return val;
950
+ }
951
+ function isNumberLt2(val, ref, msg) {
952
+ if (!guard_exports.isNumberLt(val, ref))
953
+ _fail(`Expected ${fmt(val)} to be number < ${fmt(ref)}`, msg);
954
+ return val;
955
+ }
956
+ function isNumberLte2(val, ref, msg) {
957
+ if (!guard_exports.isNumberLte(val, ref))
958
+ _fail(`Expected ${fmt(val)} to be number <= ${fmt(ref)}`, msg);
959
+ return val;
960
+ }
961
+ function isNumberBetween2(val, min, max, msg) {
962
+ if (!guard_exports.isNumberBetween(val, min, max))
963
+ _fail(`Expected number ${fmt(min)} <= ${fmt(val)} <= ${fmt(max)}`, msg);
964
+ return val;
965
+ }
966
+ function isNumberBetweenExclusive2(val, min, max, msg) {
967
+ if (!guard_exports.isNumberBetweenExclusive(val, min, max))
968
+ _fail(`Expected number ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
969
+ return val;
970
+ }
971
+ function isFinite3(val, msg) {
972
+ if (!guard_exports.isFinite(val))
973
+ _fail(`Expected ${fmt(val)} to be finite`, msg);
974
+ return val;
975
+ }
976
+ function isFloat2(val, msg) {
977
+ if (!guard_exports.isFloat(val))
978
+ _fail(`Expected ${fmt(val)} to be float`, msg);
979
+ return val;
980
+ }
981
+ function isInteger2(val, msg) {
982
+ if (!guard_exports.isInteger(val))
983
+ _fail(`Expected ${fmt(val)} to be integer`, msg);
984
+ return val;
985
+ }
986
+ function isSafeInteger2(val, msg) {
987
+ if (!guard_exports.isSafeInteger(val))
988
+ _fail(`Expected ${fmt(val)} to be safe integer`, msg);
989
+ return val;
990
+ }
991
+ function isIntegerOrUndefined2(val, msg) {
992
+ if (!guard_exports.isIntegerOrUndefined(val))
993
+ _fail(`Expected ${fmt(val)} to be integer or undefined`, msg);
994
+ return val;
995
+ }
996
+ function isIntegerEq2(val, ref, msg) {
997
+ if (!guard_exports.isIntegerEq(val, ref))
998
+ _fail(`Expected ${fmt(val)} to be integer equal to ${fmt(ref)}`, msg);
999
+ return val;
1000
+ }
1001
+ function isIntegerGt2(val, ref, msg) {
1002
+ if (!guard_exports.isIntegerGt(val, ref))
1003
+ _fail(`Expected ${fmt(val)} to be integer > ${fmt(ref)}`, msg);
1004
+ return val;
1005
+ }
1006
+ function isIntegerGte2(val, ref, msg) {
1007
+ if (!guard_exports.isIntegerGte(val, ref))
1008
+ _fail(`Expected ${fmt(val)} to be integer >= ${fmt(ref)}`, msg);
1009
+ return val;
1010
+ }
1011
+ function isIntegerLt2(val, ref, msg) {
1012
+ if (!guard_exports.isIntegerLt(val, ref))
1013
+ _fail(`Expected ${fmt(val)} to be integer < ${fmt(ref)}`, msg);
1014
+ return val;
1015
+ }
1016
+ function isIntegerLte2(val, ref, msg) {
1017
+ if (!guard_exports.isIntegerLte(val, ref))
1018
+ _fail(`Expected ${fmt(val)} to be integer <= ${fmt(ref)}`, msg);
1019
+ return val;
1020
+ }
1021
+ function isIntegerBetween2(val, min, max, msg) {
1022
+ if (!guard_exports.isIntegerBetween(val, min, max))
1023
+ _fail(`Expected integer ${fmt(min)} <= ${fmt(val)} <= ${fmt(max)}`, msg);
1024
+ return val;
1025
+ }
1026
+ function isIntegerBetweenExclusive2(val, min, max, msg) {
1027
+ if (!guard_exports.isIntegerBetweenExclusive(val, min, max))
1028
+ _fail(`Expected integer ${fmt(min)} < ${fmt(val)} < ${fmt(max)}`, msg);
1029
+ return val;
1030
+ }
1031
+ function isNaNValue2(val, msg) {
1032
+ if (!guard_exports.isNaNValue(val))
1033
+ _fail(`Expected ${fmt(val)} to be NaN`, msg);
1034
+ return NaN;
1035
+ }
1036
+ function isInfinity2(val, msg) {
1037
+ if (!guard_exports.isInfinity(val))
1038
+ _fail(`Expected ${fmt(val)} to be +-Infinity`, msg);
1039
+ return val;
1040
+ }
1041
+ function isPosInfinity2(val, msg) {
1042
+ if (!guard_exports.isPosInfinity(val))
1043
+ _fail(`Expected ${fmt(val)} to be +Infinity`, msg);
1044
+ return val;
1045
+ }
1046
+ function isNegInfinity2(val, msg) {
1047
+ if (!guard_exports.isNegInfinity(val))
1048
+ _fail(`Expected ${fmt(val)} to be -Infinity`, msg);
1049
+ return val;
1050
+ }
1051
+ function isPos2(val, msg) {
1052
+ if (!guard_exports.isPos(val))
1053
+ _fail(`Expected ${fmt(val)} to be positive (> 0)`, msg);
1054
+ return val;
1055
+ }
1056
+ function isNeg2(val, msg) {
1057
+ if (!guard_exports.isNeg(val))
1058
+ _fail(`Expected ${fmt(val)} to be negative (< 0)`, msg);
1059
+ return val;
1060
+ }
1061
+ function isNonPos2(val, msg) {
1062
+ if (!guard_exports.isNonPos(val))
1063
+ _fail(`Expected ${fmt(val)} to be non-positive (<= 0)`, msg);
1064
+ return val;
1065
+ }
1066
+ function isNonNeg2(val, msg) {
1067
+ if (!guard_exports.isNonNeg(val))
1068
+ _fail(`Expected ${fmt(val)} to be non-negative (>= 0)`, msg);
1069
+ return val;
1070
+ }
1071
+ function isZero2(val, msg) {
1072
+ if (!guard_exports.isZero(val))
1073
+ _fail(`Expected ${fmt(val)} to be 0`, msg);
1074
+ return val;
1075
+ }
1076
+ function isPosZero2(val, msg) {
1077
+ if (!guard_exports.isPosZero(val))
1078
+ _fail(`Expected ${fmt(val)} to be +0`, msg);
1079
+ return val;
1080
+ }
1081
+ function isNegZero2(val, msg) {
1082
+ if (!guard_exports.isNegZero(val))
1083
+ _fail(`Expected ${fmt(val)} to be -0`, msg);
1084
+ return val;
1085
+ }
1086
+ function isOdd2(val, msg) {
1087
+ if (!guard_exports.isOdd(val))
1088
+ _fail(`Expected ${fmt(val)} to odd`, msg);
1089
+ return val;
1090
+ }
1091
+ function isEven2(val, msg) {
1092
+ if (!guard_exports.isEven(val))
1093
+ _fail(`Expected ${fmt(val)} to even`, msg);
1094
+ return val;
1095
+ }
1096
+ function isMultipleOf2(val, base, msg) {
1097
+ if (!guard_exports.isMultipleOf(val, base))
1098
+ _fail(`Expected ${fmt(val)} to be divisble bu ${fmt(base)}`, msg);
1099
+ return val;
1100
+ }
1101
+ function isPowerOfTwo2(val, msg) {
1102
+ if (!guard_exports.isPowerOfTwo(val))
1103
+ _fail(`Expected ${fmt(val)} to be power of two`, msg);
1104
+ return val;
1105
+ }
1106
+ function isIncluded2(val, arr, msg) {
1107
+ if (!guard_exports.isIncluded(val, arr))
1108
+ _fail(`Expected ${fmt(val)} to be included in ${fmt(arr)}`, msg);
1109
+ return val;
1110
+ }
1111
+ function isIndex2(...args) {
1112
+ const index = args.shift();
1113
+ const msg = guard_exports.isString(args[args.length - 1]) ? args.pop() : void 0;
1114
+ const arr = guard_exports.isArray(args[0]) ? args.shift() : void 0;
1115
+ if (!guard_exports.isIndex(index, arr)) {
1116
+ if (arr === void 0)
1117
+ _fail(`Expected ${index} to be index`, msg);
1118
+ else
1119
+ _fail(`Expected ${index} to be index for ${fmt(arr)}`, msg);
1120
+ }
1121
+ return index;
1122
+ }
1123
+ function doesThrow2(throwTestFn, msg) {
1124
+ if (!guard_exports.doesThrow(throwTestFn))
1125
+ _fail(`Expected to throw`, msg);
1126
+ return true;
1127
+ }
1128
+ function doesNotThrow2(throwTestFn, msg) {
1129
+ if (!guard_exports.doesNotThrow(throwTestFn))
1130
+ _fail(`Expected to throw`, msg);
1131
+ return true;
1132
+ }
1133
+ var cookies_exports = {};
1134
+ __export2(cookies_exports, {
1135
+ accept: () => accept,
1136
+ decline: () => decline,
1137
+ erase: () => erase,
1138
+ eraseAll: () => eraseAll,
1139
+ isConsentPending: () => isConsentPending,
1140
+ read: () => read,
1141
+ readBool: () => readBool,
1142
+ readInt: () => readInt,
1143
+ save: () => save,
1144
+ setExpireDays: () => setExpireDays
1145
+ });
1146
+ var ConsentCookieName = "ConsentCookie";
1147
+ var _consent;
1148
+ var _expires;
1149
+ var str = _read(ConsentCookieName);
1150
+ _consent = str === "accept" || str === "decline" ? str : void 0;
1151
+ function _getCookieList() {
1152
+ if (typeof document === "undefined")
1153
+ return [];
1154
+ let s = document.cookie;
1155
+ return s.split(";").map((c) => c.trim());
1156
+ }
1157
+ function _save(name, value) {
1158
+ let cookie = name + "=" + value.toString() + ";sameSite=Lax;";
1159
+ if (_expires) {
1160
+ cookie += "expires=" + _expires.toUTCString() + ";";
1161
+ }
1162
+ if (typeof document !== "undefined")
1163
+ document.cookie = cookie;
1164
+ return value;
1165
+ }
1166
+ function _read(name, defaultValue) {
1167
+ let str2 = _getCookieList().find((c) => c.startsWith(name + "="));
1168
+ return str2 === void 0 ? defaultValue : str2.substring(name.length + 1);
1169
+ }
1170
+ function _erase(name) {
1171
+ if (typeof document !== "undefined")
1172
+ document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC;";
1173
+ }
1174
+ function setExpireDays(days) {
1175
+ _expires = /* @__PURE__ */ new Date();
1176
+ _expires.setDate(_expires.getDate() + days);
1177
+ }
1178
+ function isConsentPending() {
1179
+ return _consent === void 0;
1180
+ }
1181
+ function accept() {
1182
+ _consent = "accept";
1183
+ _save(ConsentCookieName, _consent);
1184
+ }
1185
+ function decline() {
1186
+ _consent = "decline";
1187
+ _save(ConsentCookieName, _consent);
1188
+ }
1189
+ function save(name, value) {
1190
+ if (_consent === "accept")
1191
+ _save(name, value);
1192
+ return value;
1193
+ }
1194
+ function read(name, defaultValue) {
1195
+ var _a;
1196
+ if (_consent === "accept")
1197
+ return (_a = _read(name, defaultValue)) != null ? _a : defaultValue;
1198
+ else
1199
+ return defaultValue;
1200
+ }
1201
+ function readInt(name, defaultValue) {
1202
+ if (_consent === "accept") {
1203
+ let str2 = _read(name);
1204
+ return str2 === void 0 ? defaultValue : parseInt(str2);
1205
+ } else {
1206
+ return defaultValue;
1207
+ }
1208
+ }
1209
+ function readBool(name, defaultValue) {
1210
+ if (_consent === "accept") {
1211
+ let str2 = _read(name);
1212
+ return str2 === void 0 ? defaultValue : /true|1/i.test(str2);
1213
+ } else {
1214
+ return defaultValue;
1215
+ }
1216
+ }
1217
+ function erase(name) {
1218
+ if (_consent === "accept" || name === ConsentCookieName)
1219
+ _erase(name);
1220
+ }
1221
+ function eraseAll() {
1222
+ if (typeof document !== "undefined")
1223
+ document.cookie.split(";").forEach((c) => erase(c.trim().split("=")[0]));
1224
+ }
1225
+ var device_exports = {};
1226
+ __export2(device_exports, {
1227
+ DPI: () => DPI,
1228
+ FontSize: () => FontSize,
1229
+ HostAddress: () => HostAddress,
1230
+ IsMobileDevice: () => IsMobileDevice,
1231
+ IsTouchDevice: () => IsTouchDevice,
1232
+ PxPerMm: () => PxPerMm,
1233
+ ScrollbarWidth: () => ScrollbarWidth,
1234
+ mmToPx: () => mmToPx,
1235
+ pxToMm: () => pxToMm,
1236
+ toPx: () => toPx
1237
+ });
1238
+ function getDPI() {
1239
+ try {
1240
+ let el = document.createElement("div");
1241
+ el.style.width = "1in";
1242
+ document.body.appendChild(el);
1243
+ let dpi = el.offsetWidth;
1244
+ el.remove();
1245
+ return dpi || 96;
1246
+ } catch (e) {
1247
+ return 96;
1248
+ }
1249
+ }
1250
+ function getScrollBarWidth() {
1251
+ try {
1252
+ let outer = document.createElement("div");
1253
+ outer.style.visibility = "hidden";
1254
+ outer.style.width = "100px";
1255
+ document.body.appendChild(outer);
1256
+ let widthNoScroll = outer.offsetWidth;
1257
+ outer.style.overflow = "scroll";
1258
+ let inner = document.createElement("div");
1259
+ inner.style.width = "100%";
1260
+ outer.appendChild(inner);
1261
+ let widthWithScroll = inner.offsetWidth;
1262
+ if (outer.parentNode) {
1263
+ outer.parentNode.removeChild(outer);
1264
+ }
1265
+ return widthNoScroll - widthWithScroll;
1266
+ } catch (e) {
1267
+ return 0;
1268
+ }
1269
+ }
1270
+ function getSystemFontSize() {
1271
+ try {
1272
+ let tmpDiv = document.createElement("div");
1273
+ tmpDiv.style.cssText = "display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em";
1274
+ tmpDiv.appendChild(document.createTextNode("M"));
1275
+ document.body.appendChild(tmpDiv);
1276
+ let fontsize = tmpDiv.offsetHeight;
1277
+ document.body.removeChild(tmpDiv);
1278
+ return fontsize;
1279
+ } catch (e) {
1280
+ return 16;
1281
+ }
1282
+ }
1283
+ function getIsTouchDevice() {
1284
+ if (typeof window === "undefined")
1285
+ return false;
1286
+ if ("ontouchstart" in window || "DocumentTouch" in window || "createTouch" in document && "createTouchList" in document)
1287
+ return true;
1288
+ var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
1289
+ var mq = function(query2) {
1290
+ return window.matchMedia(query2).matches;
1291
+ };
1292
+ var query = ["(", prefixes.join("touch-enabled),("), "heartz", ")"].join("");
1293
+ return mq(query);
1294
+ }
1295
+ function getIsMobileDevice() {
1296
+ let a = navigator.userAgent || navigator.vendor || window.opera;
1297
+ return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4));
1298
+ }
1299
+ function getHostAddress() {
1300
+ if (typeof location === "undefined" || !location.host) {
1301
+ return "localhost";
1302
+ }
1303
+ return `${location.protocol}//${location.host}`;
1304
+ }
1305
+ var UnitRegExp = /^(mm|cm|in|inch|px|em)$/;
1306
+ var ValueUnitRegExp = /^([0-9\\.]+)(.*)$/;
1307
+ var DPI = getDPI();
1308
+ var PxPerMm = DPI / 25.4;
1309
+ var ScrollbarWidth = getScrollBarWidth();
1310
+ var FontSize = getSystemFontSize();
1311
+ var IsTouchDevice = getIsTouchDevice();
1312
+ var IsMobileDevice = getIsMobileDevice();
1313
+ var HostAddress = getHostAddress();
1314
+ function pxToMm(px) {
1315
+ return px / PxPerMm;
1316
+ }
1317
+ function mmToPx(mm) {
1318
+ return mm * PxPerMm;
1319
+ }
1320
+ function toPx(input) {
1321
+ if (typeof input === "number") {
1322
+ return input;
1323
+ }
1324
+ let value = NaN;
1325
+ let unit = void 0;
1326
+ let match = input.toString().match(ValueUnitRegExp);
1327
+ if (match && match[1]) {
1328
+ value = parseFloat(match[1]);
1329
+ let unitStr = match[2] ? match[2].toLowerCase() : "undefined";
1330
+ let unitStrOk = UnitRegExp.test(unitStr);
1331
+ unit = unitStrOk ? unitStr : void 0;
1332
+ if (!unit) {
1333
+ console.log("Unknown unit '" + unitStr + "' => using 'px'.");
1334
+ }
1335
+ } else {
1336
+ value = parseFloat(input);
1337
+ }
1338
+ assert_exports.isFinite(value, "value in function toPx");
1339
+ switch (unit) {
1340
+ case "mm":
1341
+ return mmToPx(value);
1342
+ case "cm":
1343
+ return mmToPx(value) * 10;
1344
+ case "in":
1345
+ case "inch":
1346
+ return mmToPx(value) * 25.4;
1347
+ case "em":
1348
+ return FontSize * value;
1349
+ default:
1350
+ case "px":
1351
+ return value;
1352
+ }
1353
+ }
1354
+ var utils_exports = {};
1355
+ __export2(utils_exports, {
1356
+ Arr: () => arr_exports,
1357
+ Dom: () => dom_exports,
1358
+ Enum: () => enum_exports,
1359
+ Math: () => math_exports,
1360
+ Obj: () => obj_exports,
1361
+ Str: () => str_exports
1362
+ });
1363
+ var arr_exports = {};
1364
+ __export2(arr_exports, {
1365
+ arrayContains: () => arrayContains,
1366
+ chunckArray: () => chunckArray,
1367
+ duplicate: () => duplicate,
1368
+ fillArray: () => fillArray,
1369
+ getRangeArray: () => getRangeArray,
1370
+ getSequenceArray: () => getSequenceArray,
1371
+ isArray: () => isArray,
1372
+ mapRangeArray: () => mapRangeArray,
1373
+ mapSequenceArray: () => mapSequenceArray,
1374
+ removeDuplicates: () => removeDuplicates,
1375
+ toArray: () => toArray
1376
+ });
1377
+ function toArray(a) {
1378
+ return isArray(a) ? a : [a];
1379
+ }
1380
+ function duplicate(a) {
1381
+ var _a;
1382
+ return (_a = a == null ? void 0 : a.slice()) != null ? _a : [];
1383
+ }
1384
+ function removeDuplicates(arr, compareFn) {
1385
+ return compareFn !== void 0 ? arr.filter((a, id, self) => id === self.findIndex((b) => compareFn(a, b))) : arr.filter((a, id, self) => id === self.indexOf(a));
1386
+ }
1387
+ function fillArray(fillValue, fillCount) {
1388
+ if (!isInteger(fillCount) || fillCount < 0) {
1389
+ throw new Error("fillArray: Invalid fillCount = " + fillCount);
1390
+ }
1391
+ return new Array(fillCount).fill(fillValue);
1392
+ }
1393
+ function mapSequenceArray(len, fn) {
1394
+ if (!isInteger(len) || len < 0) {
1395
+ throw new Error("mapSequenceArray: Invalid len = " + len);
1396
+ }
1397
+ let arr = new Array(len);
1398
+ for (let i = 0; i < len; i++) {
1399
+ arr[i] = fn(i);
1400
+ }
1401
+ return arr;
1402
+ }
1403
+ function getSequenceArray(len) {
1404
+ return mapSequenceArray(len, (i) => i);
1405
+ }
1406
+ function mapRangeArray(start, end, fn) {
1407
+ if (!isInteger(start)) {
1408
+ throw new Error("mapRangeArray: Invalid start = " + end);
1409
+ }
1410
+ if (!isInteger(end)) {
1411
+ throw new Error("mapRangeArray: Invalid end = " + end);
1412
+ }
1413
+ let len = Math.abs(end - start) + 1;
1414
+ let arr = new Array(len);
1415
+ for (let i = 0, s = start, inc = Math.sign(end - start); i < len; s += inc, i++) {
1416
+ arr[i] = fn(s);
1417
+ }
1418
+ return arr;
1419
+ }
1420
+ function getRangeArray(start, end) {
1421
+ return mapRangeArray(start, end, (i) => i);
1422
+ }
1423
+ function arrayContains(arg, item) {
1424
+ return arg.indexOf(item) >= 0;
1425
+ }
1426
+ function chunckArray(arr, chunckSize) {
1427
+ if (!isInteger(chunckSize) || chunckSize < 1) {
1428
+ throw new Error("chunckArray: Invalid chunckSize = " + chunckSize);
1429
+ }
1430
+ let result = [];
1431
+ for (let i = 0; i < arr.length; i += chunckSize) {
1432
+ result.push(arr.slice(i, i + chunckSize));
1433
+ }
1434
+ return result;
1435
+ }
1436
+ var dom_exports = {};
1437
+ __export2(dom_exports, {
1438
+ addClass: () => addClass,
1439
+ appendTo: () => appendTo,
1440
+ getButton: () => getButton,
1441
+ getCanvas: () => getCanvas,
1442
+ getCanvasTextWidth: () => getCanvasTextWidth,
1443
+ getDimension: () => getDimension,
1444
+ getHeight: () => getHeight,
1445
+ getOffset: () => getOffset,
1446
+ getPadding: () => getPadding,
1447
+ getWidth: () => getWidth,
1448
+ hasClass: () => hasClass,
1449
+ injectCss: () => injectCss,
1450
+ removeClass: () => removeClass,
1451
+ removeFromParent: () => removeFromParent,
1452
+ setHeight: () => setHeight,
1453
+ setOffset: () => setOffset,
1454
+ setRect: () => setRect,
1455
+ setVisibility: () => setVisibility,
1456
+ setWidth: () => setWidth,
1457
+ styleLayoutChanged: () => styleLayoutChanged
1458
+ });
1459
+ function _getElemById(id) {
1460
+ var _a;
1461
+ return typeof document === "undefined" ? void 0 : (_a = document.getElementById(id)) != null ? _a : void 0;
1462
+ }
1463
+ function toPx2(value) {
1464
+ return value === void 0 ? void 0 : device_exports.toPx(value);
1465
+ }
1466
+ function hasClass(el, className) {
1467
+ if (className.length === 0) {
1468
+ return false;
1469
+ } else if (el.classList) {
1470
+ return el.classList.contains(className);
1471
+ } else {
1472
+ return !!el.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)"));
1473
+ }
1474
+ }
1475
+ function addClass(el, className) {
1476
+ if (className.length === 0) {
1477
+ return;
1478
+ } else if (el.classList) {
1479
+ el.classList.add(className);
1480
+ } else if (!hasClass(el, className)) {
1481
+ el.className += " " + className;
1482
+ }
1483
+ }
1484
+ function removeClass(el, className) {
1485
+ if (className.length === 0) {
1486
+ return;
1487
+ } else if (el.classList) {
1488
+ el.classList.remove(className);
1489
+ } else if (hasClass(el, className)) {
1490
+ var reg = new RegExp("(\\s|^)" + className + "(\\s|$)");
1491
+ el.className = el.className.replace(reg, " ");
1492
+ }
1493
+ }
1494
+ function setOffset(el, left, top, unit = "px") {
1495
+ el.style.left = left + unit;
1496
+ el.style.top = top + unit;
1497
+ }
1498
+ function getOffset(el) {
1499
+ let { left, top } = el.getBoundingClientRect();
1500
+ if (typeof window !== "undefined") {
1501
+ left += window.pageXOffset;
1502
+ top += window.pageYOffset;
1503
+ }
1504
+ if (typeof document !== "undefined") {
1505
+ let de = document.documentElement;
1506
+ left -= de.clientLeft;
1507
+ top -= de.clientTop;
1508
+ }
1509
+ return { left, top };
1510
+ }
1511
+ function getWidth(el) {
1512
+ if (el instanceof Window) {
1513
+ return el.innerWidth;
1514
+ } else {
1515
+ let w = parseFloat(getComputedStyle(el, null).width.replace("px", ""));
1516
+ return isNaN(w) ? 0 : w;
1517
+ }
1518
+ }
1519
+ function setWidth(el, val) {
1520
+ el.style.width = val + "px";
1521
+ }
1522
+ function getHeight(el) {
1523
+ if (el instanceof Window) {
1524
+ return el.innerHeight;
1525
+ } else {
1526
+ let h = parseFloat(getComputedStyle(el, null).height.replace("px", ""));
1527
+ return isNaN(h) ? 0 : h;
1528
+ }
1529
+ }
1530
+ function setHeight(el, val) {
1531
+ el.style.height = val + "px";
1532
+ }
1533
+ function appendTo(el, to) {
1534
+ to.appendChild(el);
1535
+ }
1536
+ function removeFromParent(el) {
1537
+ el.remove();
1538
+ }
1539
+ function setVisibility(el, visible) {
1540
+ el.style.display = visible ? "block" : "none";
1541
+ }
1542
+ function setRect(el, left, top, width, height, unit = "px") {
1543
+ el.style.left = left + unit;
1544
+ el.style.top = top + unit;
1545
+ el.style.width = width + unit;
1546
+ el.style.height = height + unit;
1547
+ }
1548
+ function getButton(btn) {
1549
+ let el = typeof btn === "string" ? _getElemById(btn) : btn;
1550
+ return el instanceof HTMLButtonElement ? el : void 0;
1551
+ }
1552
+ function getCanvas(canvas2) {
1553
+ let el = typeof canvas2 === "string" ? _getElemById(canvas2) : canvas2;
1554
+ return el instanceof HTMLCanvasElement ? el : void 0;
1555
+ }
1556
+ function getPadding(style) {
1557
+ var _a;
1558
+ if (!style) {
1559
+ return { top: 0, right: 0, bottom: 0, left: 0 };
1560
+ }
1561
+ let top = toPx2(style.paddingTop);
1562
+ let right = toPx2(style.paddingRight);
1563
+ let bottom = toPx2(style.paddingBottom);
1564
+ let left = toPx2(style.paddingLeft);
1565
+ let padding = ((_a = style.padding) != null ? _a : "").toString().split(" ").filter((s) => s.length > 0);
1566
+ switch (padding.length) {
1567
+ case 0:
1568
+ break;
1569
+ case 1:
1570
+ top != null ? top : top = toPx2(padding[0]);
1571
+ right != null ? right : right = toPx2(padding[0]);
1572
+ bottom != null ? bottom : bottom = toPx2(padding[0]);
1573
+ left != null ? left : left = toPx2(padding[0]);
1574
+ break;
1575
+ case 2:
1576
+ top != null ? top : top = toPx2(padding[0]);
1577
+ right != null ? right : right = toPx2(padding[1]);
1578
+ bottom != null ? bottom : bottom = toPx2(padding[0]);
1579
+ left != null ? left : left = toPx2(padding[1]);
1580
+ break;
1581
+ case 3:
1582
+ top != null ? top : top = toPx2(padding[0]);
1583
+ right != null ? right : right = toPx2(padding[1]);
1584
+ bottom != null ? bottom : bottom = toPx2(padding[2]);
1585
+ left != null ? left : left = toPx2(padding[1]);
1586
+ break;
1587
+ case 4:
1588
+ default:
1589
+ top != null ? top : top = toPx2(padding[0]);
1590
+ right != null ? right : right = toPx2(padding[1]);
1591
+ bottom != null ? bottom : bottom = toPx2(padding[2]);
1592
+ left != null ? left : left = toPx2(padding[3]);
1593
+ break;
1594
+ }
1595
+ top != null ? top : top = 0;
1596
+ right != null ? right : right = 0;
1597
+ bottom != null ? bottom : bottom = 0;
1598
+ left != null ? left : left = 0;
1599
+ return { top, right, bottom, left };
1600
+ }
1601
+ function getDimension(style) {
1602
+ let left = toPx2(style == null ? void 0 : style.left);
1603
+ let right = toPx2(style == null ? void 0 : style.right);
1604
+ let top = toPx2(style == null ? void 0 : style.top);
1605
+ let bottom = toPx2(style == null ? void 0 : style.bottom);
1606
+ let width = toPx2(style == null ? void 0 : style.width);
1607
+ let height = toPx2(style == null ? void 0 : style.height);
1608
+ if (width === void 0 && left !== void 0 && right !== void 0) {
1609
+ width = right - left;
1610
+ }
1611
+ if (height === void 0 && top !== void 0 && bottom !== void 0) {
1612
+ height = bottom - top;
1613
+ }
1614
+ return { left, top, width, height };
1615
+ }
1616
+ function styleLayoutChanged(style1, style2) {
1617
+ if (!style1 && !style2) {
1618
+ return false;
1619
+ } else if (!style1 || !style2) {
1620
+ return true;
1621
+ } else {
1622
+ return style1.left !== style2.left || style1.top !== style2.top || style1.right !== style2.right || style1.bottom !== style2.bottom || style1.width !== style2.width || style1.height !== style2.height;
1623
+ }
1624
+ }
1625
+ var canvas;
1626
+ function getCanvasTextWidth(text, font) {
1627
+ if (!canvas && typeof document !== "undefined")
1628
+ canvas = document.createElement("canvas");
1629
+ let ctx = canvas == null ? void 0 : canvas.getContext("2d");
1630
+ if (!ctx)
1631
+ return 0;
1632
+ ctx.font = font;
1633
+ return ctx.measureText(text).width;
1634
+ }
33
1635
  function injectCss(styleId, styleCss) {
34
1636
  if (styleId === "" || styleCss === "") return;
35
1637
  if (typeof document === "undefined") return;
@@ -39,7 +1641,131 @@ function injectCss(styleId, styleCss) {
39
1641
  style.textContent = styleCss;
40
1642
  document.head.appendChild(style);
41
1643
  }
42
- injectCss("wms-custom-css", `
1644
+ var math_exports = {};
1645
+ __export2(math_exports, {
1646
+ avg: () => avg,
1647
+ calcNormal: () => calcNormal,
1648
+ clamp: () => clamp,
1649
+ cmp: () => cmp,
1650
+ interpolateCoord: () => interpolateCoord,
1651
+ interpolateY: () => interpolateY,
1652
+ isInteger: () => isInteger,
1653
+ isNumber: () => isNumber,
1654
+ linearToDecibels: () => linearToDecibels,
1655
+ mod: () => mod,
1656
+ romanize: () => romanize,
1657
+ sum: () => sum,
1658
+ toOrdinalNumber: () => toOrdinalNumber
1659
+ });
1660
+ function linearToDecibels(linearVolume) {
1661
+ if (!isFinite(linearVolume)) {
1662
+ throw new Error("linearToDecibel: Invalid linearVolume = " + linearVolume);
1663
+ } else if (linearVolume <= 0) {
1664
+ return -Infinity;
1665
+ } else {
1666
+ return 20 * Math.log10(linearVolume);
1667
+ }
1668
+ }
1669
+ function mod(m, n) {
1670
+ return (m % n + n) % n;
1671
+ }
1672
+ function romanize(n) {
1673
+ if (!isInteger(n) || n < 0) {
1674
+ throw new Error("romanize: Invalid n = " + n);
1675
+ }
1676
+ var digits = String(+n).split("");
1677
+ var key = [
1678
+ "",
1679
+ "C",
1680
+ "CC",
1681
+ "CCC",
1682
+ "CD",
1683
+ "D",
1684
+ "DC",
1685
+ "DCC",
1686
+ "DCCC",
1687
+ "CM",
1688
+ "",
1689
+ "X",
1690
+ "XX",
1691
+ "XXX",
1692
+ "XL",
1693
+ "L",
1694
+ "LX",
1695
+ "LXX",
1696
+ "LXXX",
1697
+ "XC",
1698
+ "",
1699
+ "I",
1700
+ "II",
1701
+ "III",
1702
+ "IV",
1703
+ "V",
1704
+ "VI",
1705
+ "VII",
1706
+ "VIII",
1707
+ "IX"
1708
+ ];
1709
+ var roman = "", i = 3;
1710
+ while (i--) roman = (key[+digits.pop() + i * 10] || "") + roman;
1711
+ return Array(+digits.join("") + 1).join("M") + roman;
1712
+ }
1713
+ function toOrdinalNumber(n) {
1714
+ if (!isInteger(n)) {
1715
+ throw new Error("toOrdinalNumber: Invalid n = " + n);
1716
+ }
1717
+ const nStr = n.toString();
1718
+ const lastDigit = Number(nStr.charAt(nStr.length - 1));
1719
+ if (n === 1 || n >= 20 && lastDigit === 1) {
1720
+ return nStr + "st";
1721
+ } else if (n === 2 || n >= 20 && lastDigit === 2) {
1722
+ return nStr + "nd";
1723
+ } else if (n === 3 || n >= 20 && lastDigit === 3) {
1724
+ return nStr + "rd";
1725
+ } else {
1726
+ return nStr + "th";
1727
+ }
1728
+ }
1729
+ function interpolateCoord(startX, startY, endX, endY, t) {
1730
+ return {
1731
+ x: startX + (endX - startX) * t,
1732
+ y: startY + (endY - startY) * t
1733
+ };
1734
+ }
1735
+ function interpolateY(startX, startY, endX, endY, x) {
1736
+ let t = (x - startX) / (endX - startX);
1737
+ return startY + (endY - startY) * t;
1738
+ }
1739
+ function clamp(num, min, max) {
1740
+ return Math.min(Math.max(num, min), max);
1741
+ }
1742
+ function calcNormal(x1, y1, x2, y2) {
1743
+ let dx = x2 - x1;
1744
+ let dy = y2 - y1;
1745
+ let nx = -dy;
1746
+ let ny = dx;
1747
+ let len = Math.sqrt(nx * nx + ny * ny);
1748
+ if (len > 0) {
1749
+ nx /= len;
1750
+ ny /= len;
1751
+ } else {
1752
+ nx = 0;
1753
+ ny = 1;
1754
+ }
1755
+ return { nx, ny };
1756
+ }
1757
+ function sum(arr) {
1758
+ return arr.reduce((prev, cur) => cur + prev, 0);
1759
+ }
1760
+ function avg(...values) {
1761
+ return sum(values) / values.length;
1762
+ }
1763
+ function cmp(a, b) {
1764
+ return a < b ? -1 : a > b ? 1 : 0;
1765
+ }
1766
+
1767
+ // src/core/custom-css.ts
1768
+ utils_exports.Dom.injectCss("wms-custom-css", `
43
1769
  /* Add custom wms-button and wms-button-group styles */
44
1770
 
45
1771
  .wms-button {
@@ -155,7 +1881,7 @@ function init() {
155
1881
  return;
156
1882
  }
157
1883
  initialized = true;
158
- console.log("%cWebMusicScore v6.0.0-pre.3 (cjs) initialized.", "background: black; color: white; padding: 2px;");
1884
+ console.log("%cWebMusicScore v6.0.0-pre.5 (cjs) initialized.", "background: black; color: white; padding: 2px;");
159
1885
  }
160
1886
  // Annotate the CommonJS export names for ESM import in node:
161
1887
  0 && (module.exports = {
@@ -163,4 +1889,13 @@ function init() {
163
1889
  MusicErrorType,
164
1890
  init
165
1891
  });
1892
+ /*! Bundled license information:
1893
+
1894
+ @tspro/ts-utils-lib/dist/index.mjs:
1895
+ (*!
1896
+ * TsUtilsLib v2.3.0 (esm)
1897
+ * (c) 2023-2025 PahkaSoft
1898
+ * Licensed under the MIT License
1899
+ *)
1900
+ */
166
1901
  //# sourceMappingURL=index.js.map