@scratch/scratch-vm 11.2.0-svg-sanitization → 11.2.0-svg-sanitization.2

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.
@@ -1,3 +1,51 @@
1
+ /*!
2
+ * decimal.js v10.5.0
3
+ * An arbitrary-precision Decimal type for JavaScript.
4
+ * https://github.com/MikeMcl/decimal.js
5
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
6
+ * MIT Licence
7
+ */
8
+
9
+ /*!
10
+ * CSS color - Resolve, parse, convert CSS color.
11
+ * @license MIT
12
+ * @copyright asamuzaK (Kazz)
13
+ * @see {@link https://github.com/asamuzaK/cssColor/blob/main/LICENSE}
14
+ */
15
+
16
+ /*!
17
+ * Copyright (c) 2015-2020, Salesforce.com, Inc.
18
+ * All rights reserved.
19
+ *
20
+ * Redistribution and use in source and binary forms, with or without
21
+ * modification, are permitted provided that the following conditions are met:
22
+ *
23
+ * 1. Redistributions of source code must retain the above copyright notice,
24
+ * this list of conditions and the following disclaimer.
25
+ *
26
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
27
+ * this list of conditions and the following disclaimer in the documentation
28
+ * and/or other materials provided with the distribution.
29
+ *
30
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
31
+ * be used to endorse or promote products derived from this software without
32
+ * specific prior written permission.
33
+ *
34
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
35
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
38
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
39
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
42
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
43
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44
+ * POSSIBILITY OF SUCH DAMAGE.
45
+ */
46
+
47
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
48
+
1
49
  /*! @source http://purl.eligrey.com/github/canvas-toBlob.js/blob/master/canvas-toBlob.js */
2
50
 
3
51
  /*! exports provided: Adler32 */
@@ -204,4 +252,298 @@
204
252
  !*** ./src/squeak/byte-take-iterator.js ***!
205
253
  \******************************************/
206
254
 
255
+ /**
256
+ * @description Calculate deltaE OK which is the simple root sum of squares
257
+ * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1
258
+ * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1
259
+ * @return {number} How different a color sample is from reference
260
+ *
261
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
262
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
263
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js
264
+ */
265
+
266
+ /**
267
+ * @license MIT https://github.com/facelessuser/coloraide/blob/main/LICENSE.md
268
+ */
269
+
270
+ /**
271
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
272
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
273
+ *
274
+ * XYZ <-> LMS matrices recalculated for consistent reference white
275
+ * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484
276
+ */
277
+
278
+ /**
279
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
280
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
281
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
282
+ */
283
+
284
+ /**
285
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
286
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
287
+ */
288
+
289
+ /**
290
+ * @param {number} hue - Hue as degrees 0..360
291
+ * @param {number} white - Whiteness as percentage 0..100
292
+ * @param {number} black - Blackness as percentage 0..100
293
+ * @return {number[]} Array of RGB components 0..1
294
+ *
295
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
296
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
297
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js
298
+ */
299
+
300
+ /**
301
+ * @param {number} hue - Hue as degrees 0..360
302
+ * @param {number} sat - Saturation as percentage 0..100
303
+ * @param {number} light - Lightness as percentage 0..100
304
+ * @return {number[]} Array of sRGB components; in-gamut colors in range [0..1]
305
+ *
306
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
307
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
308
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js
309
+ */
310
+
311
+ /**
312
+ * Assuming XYZ is relative to D50, convert to CIE Lab
313
+ * from CIE standard, which now defines these as a rational fraction
314
+ *
315
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
316
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
317
+ */
318
+
319
+ /**
320
+ * Bradford chromatic adaptation from D50 to D65
321
+ *
322
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
323
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
324
+ */
325
+
326
+ /**
327
+ * Bradford chromatic adaptation from D65 to D50
328
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
329
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
330
+ * @see http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
331
+ */
332
+
333
+ /**
334
+ * Character class utilities for XML NS 1.0 edition 3.
335
+ *
336
+ * @author Louis-Dominique Dubeau
337
+ * @license MIT
338
+ * @copyright Louis-Dominique Dubeau
339
+ */
340
+
341
+ /**
342
+ * Character classes and associated utilities for the 2nd edition of XML 1.1.
343
+ *
344
+ * @author Louis-Dominique Dubeau
345
+ * @license MIT
346
+ * @copyright Louis-Dominique Dubeau
347
+ */
348
+
349
+ /**
350
+ * Character classes and associated utilities for the 5th edition of XML 1.0.
351
+ *
352
+ * @author Louis-Dominique Dubeau
353
+ * @license MIT
354
+ * @copyright Louis-Dominique Dubeau
355
+ */
356
+
357
+ /**
358
+ * Convert D50 XYZ to linear-light prophoto-rgb
359
+ *
360
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
361
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
362
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
363
+ */
364
+
365
+ /**
366
+ * Convert Lab to D50-adapted XYZ
367
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
368
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
369
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
370
+ */
371
+
372
+ /**
373
+ * Convert XYZ to linear-light P3
374
+ *
375
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
376
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
377
+ */
378
+
379
+ /**
380
+ * Convert XYZ to linear-light rec2020
381
+ *
382
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
383
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
384
+ */
385
+
386
+ /**
387
+ * Convert an array of a98-rgb values in the range 0.0 - 1.0
388
+ * to linear light (un-companded) form. Negative values are also now accepted
389
+ *
390
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
391
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
392
+ */
393
+
394
+ /**
395
+ * Convert an array of display-p3 RGB values in the range 0.0 - 1.0
396
+ * to linear light (un-companded) form.
397
+ *
398
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
399
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
400
+ */
401
+
402
+ /**
403
+ * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL.
404
+ *
405
+ * @param {Color} RGB [r, g, b]
406
+ * - Red component 0..1
407
+ * - Green component 0..1
408
+ * - Blue component 0..1
409
+ * @return {number[]} Array of HSL values: Hue as degrees 0..360, Saturation and Lightness as percentages 0..100
410
+ *
411
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
412
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
413
+ *
414
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/better-rgbToHsl.js
415
+ */
416
+
417
+ /**
418
+ * Convert an array of linear-light a98-rgb in the range 0.0-1.0
419
+ * to gamma corrected form. Negative values are also now accepted
420
+ *
421
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
422
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
423
+ */
424
+
425
+ /**
426
+ * Convert an array of linear-light a98-rgb values to CIE XYZ
427
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
428
+ * has greater numerical precision than section 4.3.5.3 of
429
+ * https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
430
+ * but the values below were calculated from first principles
431
+ * from the chromaticity coordinates of R G B W
432
+ *
433
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
434
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
435
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
436
+ * @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
437
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html
438
+ */
439
+
440
+ /**
441
+ * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0
442
+ * to gamma corrected form
443
+ *
444
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
445
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
446
+ */
447
+
448
+ /**
449
+ * Convert an array of linear-light display-p3 values to CIE XYZ
450
+ * using D65 (no chromatic adaptation)
451
+ *
452
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
453
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
454
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
455
+ */
456
+
457
+ /**
458
+ * Convert an array of linear-light prophoto-rgb in the range 0.0-1.0
459
+ * to gamma corrected form.
460
+ * Transfer curve is gamma 1.8 with a small linear portion.
461
+ *
462
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
463
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
464
+ */
465
+
466
+ /**
467
+ * Convert an array of linear-light prophoto-rgb values to CIE D50 XYZ.
468
+ * Matrix cannot be expressed in rational form, but is calculated to 64 bit accuracy.
469
+ *
470
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
471
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
472
+ * @see see https://github.com/w3c/csswg-drafts/issues/7675
473
+ */
474
+
475
+ /**
476
+ * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0
477
+ * to gamma corrected form ITU-R BT.2020-2 p.4
478
+ *
479
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
480
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
481
+ */
482
+
483
+ /**
484
+ * Convert an array of linear-light rec2020 values to CIE XYZ
485
+ * using D65 (no chromatic adaptation)
486
+ *
487
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
488
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
489
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
490
+ */
491
+
492
+ /**
493
+ * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form
494
+ * Extended transfer function:
495
+ * For negative values, linear portion extends on reflection
496
+ * of axis, then uses reflected pow below that
497
+ *
498
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
499
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
500
+ * @see https://en.wikipedia.org/wiki/SRGB
501
+ */
502
+
503
+ /**
504
+ * Convert an array of linear-light sRGB values to CIE XYZ
505
+ * using sRGB's own white, D65 (no chromatic adaptation)
506
+ *
507
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
508
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
509
+ */
510
+
511
+ /**
512
+ * Convert an array of of sRGB values where in-gamut values are in the range
513
+ * [0 - 1] to linear light (un-companded) form.
514
+ * Extended transfer function:
515
+ * For negative values, linear portion is extended on reflection of axis,
516
+ * then reflected power function is used.
517
+ *
518
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
519
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
520
+ * @see https://en.wikipedia.org/wiki/SRGB
521
+ */
522
+
523
+ /**
524
+ * Convert an array of prophoto-rgb values where in-gamut Colors are in the
525
+ * range [0.0 - 1.0] to linear light (un-companded) form. Transfer curve is
526
+ * gamma 1.8 with a small linear portion. Extended transfer function
527
+ *
528
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
529
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
530
+ */
531
+
532
+ /**
533
+ * Convert an array of rec2020 RGB values in the range 0.0 - 1.0
534
+ * to linear light (un-companded) form.
535
+ * ITU-R BT.2020-2 p.4
536
+ *
537
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
538
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
539
+ */
540
+
541
+ /**
542
+ * Given OKLab, convert to XYZ relative to D65
543
+ *
544
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
545
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
546
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
547
+ */
548
+
207
549
  /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */