| 1445 | return from + (to - from) * speed; |
| 1446 | } |
| 1447 | function svgBase64ToUrl(sgvBase64) { |
| 1448 | try { |
| 1449 | if (!/^data:image\/svg/.test(sgvBase64)) throw new Error("Invalid SVG"); |
| 1450 | const svgContent = atob(sgvBase64.split(",")[1]); |
| 1451 | const blob = new Blob([svgContent], { type: "image/svg+xml" }); |
| 1452 | const url = URL.createObjectURL(blob); |
| 1453 | setTimeout(() => URL.revokeObjectURL(url), 6e4); |
| 1454 | return url; |
| 1455 | } catch (e) { |
| 1456 | console.log("ERROR: ", e); |
| 1457 | return null; |
| 1458 | } |
| 1459 | } |
| 1460 | function svgToBlobUrl(svg) { |
| 1461 | let url = URL.createObjectURL(new Blob([svg], { type: "image/svg+xml" })); |
| 1462 | return url; |