Socket
Socket
Sign inDemoInstall

@lottiefiles/lottie-js

Package Overview
Dependencies
28
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.3 to 0.3.5

2

CHANGELOG.md
# Changelog
## 0.3.3
## 0.3.5

@@ -5,0 +5,0 @@ ### Patch Changes

/*!
* @lottiefiles/lottie-js - v0.3.3
* Compiled Wed, 12 Jan 2022 08:56:12 UTC
* @lottiefiles/lottie-js - v0.3.5
* Compiled Mon, 31 Jan 2022 08:09:59 UTC
*

@@ -213,2 +213,17 @@ * Copyright LottieFiles. All rights reserved.

class FontList {
constructor() {
this.list = [];
}
fromJSON(json) {
this.list = json.list;
return this;
}
toJSON() {
return {
list: this.list
};
}
}
class KeyFrame {

@@ -1000,4 +1015,6 @@ constructor(frame = 0, value = 0) {

this.position.fromJSON(json.p);
this.innerRadius.fromJSON(json.ir);
this.innerRoundness.fromJSON(json.is);
if (json.sy === 1) {
this.innerRadius.fromJSON(json.ir);
this.innerRoundness.fromJSON(json.is);
}
this.outerRadius.fromJSON(json.or);

@@ -1020,4 +1037,4 @@ this.outerRoundness.fromJSON(json.os);

p: this.position,
ir: this.innerRadius,
is: this.innerRoundness,
...this.starType === 1 && {ir: this.innerRadius},
...this.starType === 1 && {is: this.innerRoundness},
or: this.outerRadius,

@@ -1384,2 +1401,4 @@ os: this.outerRoundness,

return new MergeShape(this);
} else if (type === exports.ShapeType.STAR) {
return new StarShape(this);
}

@@ -1658,3 +1677,3 @@ throw new Error(`Invalid or unknown shape type: ${type}`);

this.keywords = [];
this.generator = "@lottiefiles/lottie-js 0.3.3";
this.generator = "@lottiefiles/lottie-js 0.3.5";
this.parent = parent;

@@ -1695,2 +1714,3 @@ }

this.width = 0;
this.fonts = new FontList();
}

@@ -1753,9 +1773,9 @@ static async fromURL(url) {

}
parentPath(shape, paths = []) {
if (shape.parent === void 0) {
paths.push(shape.name);
parentPath(shape2, paths = []) {
if (shape2.parent === void 0) {
paths.push(shape2.name);
return paths;
}
paths.push(shape.name);
return this.parentPath(shape.parent, paths);
paths.push(shape2.name);
return this.parentPath(shape2.parent, paths);
}

@@ -1863,2 +1883,5 @@ get duration() {

}
if ("fonts" in json) {
this.fonts.fromJSON(json.fonts);
}
return this;

@@ -1872,2 +1895,36 @@ }

}
getShapeById(id) {
let queried_shape = null;
if (typeof id !== "string") {
throw new Error(`ID value must be a string`);
}
this.layers.forEach((layer) => {
if (layer instanceof ShapeLayer) {
layer.shapes.forEach((shape2) => {
if (shape2.id === id) {
queried_shape = shape2;
return;
}
});
}
});
return queried_shape;
}
getShapesByClassName(className) {
const shapes = [];
if (typeof className !== "string") {
throw new Error(`ID value must be a string`);
}
this.layers.forEach((layer) => {
if (layer instanceof ShapeLayer) {
layer.shapes.forEach((shape2) => {
var _a;
if ((_a = shape2.classNames) == null ? void 0 : _a.includes(className)) {
shapes.push(shape2);
}
});
}
});
return shapes;
}
getLayersByClassName(className) {

@@ -1901,3 +1958,4 @@ if (typeof className !== "string") {

v: this.version || "5.6.0",
w: this.width
w: this.width,
...this.fonts.list.length > 0 && {fonts: this.fonts.toJSON()}
};

@@ -1904,0 +1962,0 @@ }

@@ -518,2 +518,21 @@ declare abstract class Asset {

declare class Font {
fname: string;
fFamily: string;
fStyle: string;
ascent: number;
fPath: string;
fWeight: string;
origin: number;
fClass: string;
fromJSON(json: Record<string, any>): Font;
toJSON(): Record<string, any>;
}
declare class FontList {
list: Font[];
fromJSON(json: Record<string, any>): FontList;
toJSON(): Record<string, any>;
}
declare class Marker {

@@ -552,2 +571,3 @@ comment: string;

width: number;
fonts: FontList;
static fromURL(url: string): Promise<Animation>;

@@ -571,2 +591,4 @@ static isLottie(json: Record<string, any>): boolean;

getLayerById(id: string): Layer | undefined;
getShapeById(id: string): Shape | null;
getShapesByClassName(className: string): Shape[];
getLayersByClassName(className: string): Layer[];

@@ -573,0 +595,0 @@ getLayersByType(type: LayerType): Layer[];

/*!
* @lottiefiles/lottie-js - v0.3.3
* Compiled Wed, 12 Jan 2022 08:56:12 UTC
* @lottiefiles/lottie-js - v0.3.5
* Compiled Mon, 31 Jan 2022 08:09:59 UTC
*

@@ -220,2 +220,17 @@ * Copyright LottieFiles. All rights reserved.

class FontList {
constructor() {
this.list = [];
}
fromJSON(json) {
this.list = json.list;
return this;
}
toJSON() {
return {
list: this.list
};
}
}
class KeyFrame {

@@ -1007,4 +1022,6 @@ constructor(frame = 0, value = 0) {

this.position.fromJSON(json.p);
this.innerRadius.fromJSON(json.ir);
this.innerRoundness.fromJSON(json.is);
if (json.sy === 1) {
this.innerRadius.fromJSON(json.ir);
this.innerRoundness.fromJSON(json.is);
}
this.outerRadius.fromJSON(json.or);

@@ -1027,4 +1044,4 @@ this.outerRoundness.fromJSON(json.os);

p: this.position,
ir: this.innerRadius,
is: this.innerRoundness,
...this.starType === 1 && {ir: this.innerRadius},
...this.starType === 1 && {is: this.innerRoundness},
or: this.outerRadius,

@@ -1391,2 +1408,4 @@ os: this.outerRoundness,

return new MergeShape(this);
} else if (type === ShapeType.STAR) {
return new StarShape(this);
}

@@ -1665,3 +1684,3 @@ throw new Error(`Invalid or unknown shape type: ${type}`);

this.keywords = [];
this.generator = "@lottiefiles/lottie-js 0.3.3";
this.generator = "@lottiefiles/lottie-js 0.3.5";
this.parent = parent;

@@ -1702,2 +1721,3 @@ }

this.width = 0;
this.fonts = new FontList();
}

@@ -1760,9 +1780,9 @@ static async fromURL(url) {

}
parentPath(shape, paths = []) {
if (shape.parent === void 0) {
paths.push(shape.name);
parentPath(shape2, paths = []) {
if (shape2.parent === void 0) {
paths.push(shape2.name);
return paths;
}
paths.push(shape.name);
return this.parentPath(shape.parent, paths);
paths.push(shape2.name);
return this.parentPath(shape2.parent, paths);
}

@@ -1870,2 +1890,5 @@ get duration() {

}
if ("fonts" in json) {
this.fonts.fromJSON(json.fonts);
}
return this;

@@ -1879,2 +1902,36 @@ }

}
getShapeById(id) {
let queried_shape = null;
if (typeof id !== "string") {
throw new Error(`ID value must be a string`);
}
this.layers.forEach((layer) => {
if (layer instanceof ShapeLayer) {
layer.shapes.forEach((shape2) => {
if (shape2.id === id) {
queried_shape = shape2;
return;
}
});
}
});
return queried_shape;
}
getShapesByClassName(className) {
const shapes = [];
if (typeof className !== "string") {
throw new Error(`ID value must be a string`);
}
this.layers.forEach((layer) => {
if (layer instanceof ShapeLayer) {
layer.shapes.forEach((shape2) => {
var _a;
if ((_a = shape2.classNames) == null ? void 0 : _a.includes(className)) {
shapes.push(shape2);
}
});
}
});
return shapes;
}
getLayersByClassName(className) {

@@ -1908,3 +1965,4 @@ if (typeof className !== "string") {

v: this.version || "5.6.0",
w: this.width
w: this.width,
...this.fonts.list.length > 0 && {fonts: this.fonts.toJSON()}
};

@@ -1911,0 +1969,0 @@ }

/*!
* @lottiefiles/lottie-js - v0.3.3
* Compiled Wed, 12 Jan 2022 08:56:12 UTC
* @lottiefiles/lottie-js - v0.3.5
* Compiled Mon, 31 Jan 2022 08:09:59 UTC
*
* Copyright LottieFiles. All rights reserved.
*/(function(i,g){typeof exports=="object"&&typeof module!="undefined"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(i=typeof globalThis!="undefined"?globalThis:i||self,g(i.Lottie={}))})(this,function(i){"use strict";class g{constructor(t){this.parent=t}}class q extends g{fromJSON(t){return this.data=t.p,this.id=t.id,this.height=t.h,this.path=t.u,this.width=t.w,this}toJSON(){return{h:this.height,i:this.id,p:this.data,u:this.path,w:this.width}}}(function(t){t[t.PRECOMPOSITION=0]="PRECOMPOSITION",t[t.IMAGE=1]="IMAGE"})(i.AssetType||(i.AssetType={}));class $ extends g{constructor(){super(...arguments);this.type=i.AssetType.PRECOMPOSITION,this.layers=[],this.id=""}fromJSON(t){return this.id=t.id,this.timeRemap=t.tm,this.layers=this.parent.createLayersFromJSONArray(t.layers),this}toJSON(){return{id:this.id,layers:this.layers.map(t=>t.toJSON()),tm:this.timeRemap}}}var mt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ct(t,s,r){return r={path:s,exports:{},require:function(a,l){return ft(a,l??r.path)}},t(r,r.exports),r.exports}function ft(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var ut=ct(function(t,s){var r=function(a){function l(){this.fetch=!1,this.DOMException=a.DOMException}return l.prototype=a,new l}(typeof self!="undefined"?self:mt);(function(a){var l=function(d){var f={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function N(e){return e&&DataView.prototype.isPrototypeOf(e)}if(f.arrayBuffer)var T=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],I=ArrayBuffer.isView||function(e){return e&&T.indexOf(Object.prototype.toString.call(e))>-1};function P(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function at(e){return typeof e!="string"&&(e=String(e)),e}function K(e){var h={next:function(){var o=e.shift();return{done:o===void 0,value:o}}};return f.iterable&&(h[Symbol.iterator]=function(){return h}),h}function c(e){this.map={},e instanceof c?e.forEach(function(h,o){this.append(o,h)},this):Array.isArray(e)?e.forEach(function(h){this.append(h[0],h[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(h){this.append(h,e[h])},this)}c.prototype.append=function(e,h){e=P(e),h=at(h);var o=this.map[e];this.map[e]=o?o+", "+h:h},c.prototype.delete=function(e){delete this.map[P(e)]},c.prototype.get=function(e){return e=P(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(P(e))},c.prototype.set=function(e,h){this.map[P(e)]=at(h)},c.prototype.forEach=function(e,h){for(var o in this.map)this.map.hasOwnProperty(o)&&e.call(h,this.map[o],o,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(h,o){e.push(o)}),K(e)},c.prototype.values=function(){var e=[];return this.forEach(function(h){e.push(h)}),K(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(h,o){e.push([o,h])}),K(e)},f.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);function z(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function ot(e){return new Promise(function(h,o){e.onload=function(){h(e.result)},e.onerror=function(){o(e.error)}})}function Lt(e){var h=new FileReader,o=ot(h);return h.readAsArrayBuffer(e),o}function vt(e){var h=new FileReader,o=ot(h);return h.readAsText(e),o}function Dt(e){for(var h=new Uint8Array(e),o=new Array(h.length),O=0;O<h.length;O++)o[O]=String.fromCharCode(h[O]);return o.join("")}function lt(e){if(e.slice)return e.slice(0);var h=new Uint8Array(e.byteLength);return h.set(new Uint8Array(e)),h.buffer}function dt(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:f.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:f.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():f.arrayBuffer&&f.blob&&N(e)?(this._bodyArrayBuffer=lt(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||I(e))?this._bodyArrayBuffer=lt(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var e=z(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?z(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Lt)}),this.text=function(){var e=z(this);if(e)return e;if(this._bodyBlob)return vt(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Dt(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(_t)}),this.json=function(){return this.text().then(JSON.parse)},this}var Ct=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Mt(e){var h=e.toUpperCase();return Ct.indexOf(h)>-1?h:e}function w(e,h){h=h||{};var o=h.body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,h.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!o&&e._bodyInit!=null&&(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new c(h.headers)),this.method=Mt(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})};function _t(e){var h=new FormData;return e.trim().split("&").forEach(function(o){if(o){var O=o.split("="),u=O.shift().replace(/\+/g," "),m=O.join("=").replace(/\+/g," ");h.append(decodeURIComponent(u),decodeURIComponent(m))}}),h}function Ut(e){var h=new c,o=e.replace(/\r?\n[\t ]+/g," ");return o.split(/\r?\n/).forEach(function(O){var u=O.split(":"),m=u.shift().trim();if(m){var L=u.join(":").trim();h.append(m,L)}}),h}dt.call(w.prototype);function S(e,h){h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"OK",this.headers=new c(h.headers),this.url=h.url||"",this._initBody(e)}dt.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var Ht=[301,302,303,307,308];S.redirect=function(e,h){if(Ht.indexOf(h)===-1)throw new RangeError("Invalid status code");return new S(null,{status:h,headers:{location:e}})},d.DOMException=a.DOMException;try{new d.DOMException}catch(e){d.DOMException=function(h,o){this.message=h,this.name=o;var O=Error(h);this.stack=O.stack},d.DOMException.prototype=Object.create(Error.prototype),d.DOMException.prototype.constructor=d.DOMException}function X(e,h){return new Promise(function(o,O){var u=new w(e,h);if(u.signal&&u.signal.aborted)return O(new d.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function L(){m.abort()}m.onload=function(){var b={status:m.status,statusText:m.statusText,headers:Ut(m.getAllResponseHeaders()||"")};b.url="responseURL"in m?m.responseURL:b.headers.get("X-Request-URL");var W="response"in m?m.response:m.responseText;o(new S(W,b))},m.onerror=function(){O(new TypeError("Network request failed"))},m.ontimeout=function(){O(new TypeError("Network request failed"))},m.onabort=function(){O(new d.DOMException("Aborted","AbortError"))},m.open(u.method,u.url,!0),u.credentials==="include"?m.withCredentials=!0:u.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&f.blob&&(m.responseType="blob"),u.headers.forEach(function(b,W){m.setRequestHeader(W,b)}),u.signal&&(u.signal.addEventListener("abort",L),m.onreadystatechange=function(){m.readyState===4&&u.signal.removeEventListener("abort",L)}),m.send(typeof u._bodyInit=="undefined"?null:u._bodyInit)})}return X.polyfill=!0,a.fetch||(a.fetch=X,a.Headers=c,a.Request=w,a.Response=S),d.Headers=c,d.Request=w,d.Response=S,d.fetch=X,d}({})})(r),delete r.fetch.polyfill,s=r.fetch,s.default=r.fetch,s.fetch=r.fetch,s.Headers=r.Headers,s.Request=r.Request,s.Response=r.Response,t.exports=s});(function(t){t[t.NORMAL=0]="NORMAL",t[t.MULTIPLY=1]="MULTIPLY",t[t.SCREEN=2]="SCREEN",t[t.OVERLAY=3]="OVERLAY",t[t.DARKEN=4]="DARKEN",t[t.LIGHTEN=5]="LIGHTEN",t[t.COLOR_DODGE=6]="COLOR_DODGE",t[t.COLOR_BURN=7]="COLOR_BURN",t[t.HARD_LIGHT=8]="HARD_LIGHT",t[t.SOFT_LIGHT=9]="SOFT_LIGHT",t[t.DIFFERENCE=10]="DIFFERENCE",t[t.EXCLUSION=11]="EXCLUSION",t[t.HUE=12]="HUE",t[t.SATURATION=13]="SATURATION",t[t.COLOR=14]="COLOR",t[t.LUMINOSITY=15]="LUMINOSITY"})(i.BlendMode||(i.BlendMode={})),function(t){t[t.EVEN_ODD=1]="EVEN_ODD",t[t.NONZERO=2]="NONZERO"}(i.FillRuleType||(i.FillRuleType={})),function(t){t[t.NONE=0]="NONE",t[t.LINEAR=1]="LINEAR",t[t.RADIAL=2]="RADIAL",t[t.ANGULAR=4]="ANGULAR",t[t.REFLECTED=5]="REFLECTED",t[t.DIAMOND=6]="DIAMOND"}(i.GradientFillType||(i.GradientFillType={})),function(t){t[t.LINEAR=1]="LINEAR",t[t.RADIAL=2]="RADIAL"}(i.GradientStrokeType||(i.GradientStrokeType={})),function(t){t[t.PRECOMPOSITION=0]="PRECOMPOSITION",t[t.SOLID=1]="SOLID",t[t.IMAGE=2]="IMAGE",t[t.GROUP=3]="GROUP",t[t.SHAPE=4]="SHAPE",t[t.TEXT=5]="TEXT",t[t.AUDIO=6]="AUDIO",t[t.VIDEO_PLACEHOLDER=7]="VIDEO_PLACEHOLDER",t[t.IMAGE_SEQUENCE=8]="IMAGE_SEQUENCE",t[t.VIDEO=9]="VIDEO",t[t.IMAGE_PLACEHOLDER=10]="IMAGE_PLACEHOLDER",t[t.GUIDE=11]="GUIDE",t[t.ADJUSTMENT=12]="ADJUSTMENT",t[t.CAMERA=13]="CAMERA",t[t.LIGHT=14]="LIGHT"}(i.LayerType||(i.LayerType={})),function(t){t[t.BUTT=1]="BUTT",t[t.ROUND=2]="ROUND",t[t.PROJECTING=3]="PROJECTING"}(i.LineCapType||(i.LineCapType={})),function(t){t[t.MITER=1]="MITER",t[t.ROUND=2]="ROUND",t[t.BEVEL=3]="BEVEL"}(i.LineJoinType||(i.LineJoinType={})),function(t){t.None="n",t.Add="a",t.Subtract="s",t.Intersect="i",t.Lighten="l",t.Darken="d",t.Difference="f"}(i.MaskMode||(i.MaskMode={})),function(t){t.ANCHOR="a",t.OPACITY="o",t.POSITION="p",t.ROTATION="r",t.ROTATION_X="rx",t.ROTATION_Y="ry",t.ROTATION_Z="rz",t.SCALE="s",t.SKEW_AXIS="sa",t.SKEW="sk",t.SHAPE="sh",t.EXPANSION="x",t.FEATHER="f",t.SIZE="sz",t.ROUNDNESS="rd",t.MITER_LIMIT="ml",t.STROKE_WIDTH="sw",t.NUMBER="nu",t.COLOR="cl",t.ORIENTATION="or",t.GRADIENT="gr"}(i.PropertyType||(i.PropertyType={})),function(t){t.ELLIPSE="el",t.FILL="fl",t.GRADIENT_FILL="gf",t.GRADIENT_STROKE="gs",t.GROUP="gr",t.MERGE="mm",t.OFFSET_PATH="op",t.PATH="sh",t.RECTANGLE="rc",t.REPEATER="rp",t.ROUNDED_CORNERS="rd",t.STAR="sr",t.STROKE="st",t.TRIM="tm",t.TWIST="tw"}(i.ShapeType||(i.ShapeType={})),function(t){t[t.SIMULTANEOUSLY=1]="SIMULTANEOUSLY",t[t.INDIVIDUALLY=2]="INDIVIDUALLY"}(i.TrimMode||(i.TrimMode={})),function(t){t[t.ABOVE=1]="ABOVE",t[t.BELOW=2]="BELOW"}(i.RepeaterComposite||(i.RepeaterComposite={})),function(t){t[t.STAR=1]="STAR",t[t.POLYGON=2]="POLYGON"}(i.StarType||(i.StarType={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ALPHA=1]="ALPHA",t[t.INVERTED_ALPHA=2]="INVERTED_ALPHA",t[t.LUMA=3]="LUMA",t[t.INVERTED_LUMA=4]="INVERTED_LUMA"}(i.MatteMode||(i.MatteMode={}));class p{constructor(t=0,s=0){this.frame=0,this.value=0,this.frameInTangent=[0,0],this.frameOutTangent=[1,1],this.hold=!1,this.frame=t,this.value=s}fromJSON(t,s=void 0){this.frame=t.t,s===void 0?this.value=t.s:this.value=s.fromJSON(t.s);const r="i"in t&&"o"in t,a="ti"in t&&"to"in t;return this.frameInTangent=r?[t.i.x,t.i.y]:void 0,this.frameOutTangent=r?[t.o.x,t.o.y]:void 0,a&&("x"in t.ti&&"y"in t.ti?this.valueInTangent=[t.ti.x,t.ti.y]:this.valueInTangent=t.ti,"x"in t.to&&"y"in t.to?this.valueOutTangent=[t.to.x,t.to.y]:this.valueOutTangent=t.to),this.hold="h"in t&&t.h,this}toJSON(){const t={t:this.frame,s:this.value};return this.hold?t.h=1:this.frameInTangent&&this.frameOutTangent&&(t.i={x:this.frameInTangent[0],y:this.frameInTangent[1]},t.o={x:this.frameOutTangent[0],y:this.frameOutTangent[1]}),this.valueInTangent&&this.valueOutTangent&&(t.ti=this.valueInTangent,t.to=this.valueOutTangent),t}}const yt=new Map;function R(){return yt}class J{toJSON(){return this.toRgbArray()}static fromJSON(t){return t.length>3?v.fromJSON(t):t.length==3?A.fromJSON(t):new A(0,0,0)}}class A extends J{constructor(t,s,r){super();this.r=t,this.g=s,this.b=r}toRgbArray(){return[this.r,this.g,this.b]}static fromJSON(t){return new A(t[0],t[1],t[2])}}class v extends A{constructor(t,s,r,a=1){super(t,s,r);this.a=a}toRgbArray(){return[this.r,this.g,this.b,this.a]}static fromJSON(t){return new v(t[0],t[1],t[2],t[3])}}class n{constructor(t,s,r=[]){this.UID=0,this.isAnimated=!1,this.values=[],this._parent=t,this.type=s,this.values=r,this.isAnimated=r.length>1,R().set(this,t)}getParent(){return this._parent}fromJSON(t){this.expression="x"in t?t.x:void 0,this.index=t.ix,this.isAnimated=t.a===1;let s;return this.type==i.PropertyType.COLOR&&(s=J),this.values=this.isAnimated?t.k.map(r=>new p().fromJSON(r,s)):[new p().fromJSON({t:0,s:t.k},s)],this.type===i.PropertyType.COLOR&&(this.maxColors="p"in t?t.p:void 0),this}toJSON(){let t;const s=this.isAnimated!==!1||this.values.length>1;return s?t=this.values:t=this.values.length?this.values[0].value:0,{x:this.expression,ix:this.index,a:s?1:0,k:t,p:this.maxColors}}}class D{constructor(){this.anchor=new n(this,i.PropertyType.ANCHOR,[new p(0,[0,0])]),this.opacity=new n(this,i.PropertyType.OPACITY,[new p(0,100)]),this.position=new n(this,i.PropertyType.POSITION,[new p(0,[0,0])]),this.rotation=new n(this,i.PropertyType.ROTATION,[new p(0,0)]),this.scale=new n(this,i.PropertyType.SCALE,[new p(0,[100,100])]),this.skew=new n(this,i.PropertyType.SKEW),this.skewAxis=new n(this,i.PropertyType.SKEW_AXIS)}fromJSON(t){return this.rotation="r"in t?new n(this,i.PropertyType.ROTATION).fromJSON(t.r):void 0,"o"in t&&this.opacity.fromJSON(t.o),"p"in t&&this.position.fromJSON(t.p),"a"in t&&this.anchor.fromJSON(t.a),"s"in t&&this.scale.fromJSON(t.s),this.skew="sk"in t?new n(this,i.PropertyType.SKEW).fromJSON(t.sk):void 0,this.skewAxis="sa"in t?new n(this,i.PropertyType.SKEW_AXIS).fromJSON(t.sa):void 0,"or"in t&&(this.orientation=new n(this,i.PropertyType.ORIENTATION).fromJSON(t.or)),"rx"in t&&(this.rotationX=new n(this,i.PropertyType.ROTATION_X).fromJSON(t.rx)),"ry"in t&&(this.rotationY=new n(this,i.PropertyType.ROTATION_Y).fromJSON(t.ry)),"rz"in t&&(this.rotationZ=new n(this,i.PropertyType.ROTATION_Z).fromJSON(t.rz)),this}toJSON(){return{a:this.anchor,o:this.opacity,p:this.position,r:this.rotation,s:this.scale,sk:this.skew,sa:this.skewAxis,rx:this.rotationX,ry:this.rotationY,rz:this.rotationZ,or:this.orientation}}}class E{constructor(t){this.autoOrient=!1,this.blendMode=i.BlendMode.NORMAL,this.classNames=[],this.height=0,this.id="",this.inPoint=0,this.is3D=!1,this.name="",this.outPoint=0,this.startTime=0,this.timeStretch=1,this.width=0,this.transform=new D,this.parent=t}get colors(){const t=new Set,s=R();return[...s.keys()].filter(r=>s.get(r)===this&&r.type===i.PropertyType.COLOR).forEach(r=>{r.values.forEach(a=>{t.add(JSON.stringify(a.value))})}),Array.from(t).map(r=>JSON.parse(r))}get totalFrames(){return this.outPoint-this.inPoint}}var Ot=Object.assign;class Z extends E{constructor(){super(...arguments);this.type=i.LayerType.GROUP}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this}toJSON(){var t;return{ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:Ot({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sr:this.timeStretch,st:this.startTime,ty:this.type,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0}}}var pt=Object.assign;class Q extends E{constructor(){super(...arguments);this.type=i.LayerType.IMAGE}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this.refId=t.refId,this}toJSON(){var t;return{ty:this.type,ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:pt({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sr:this.timeStretch,st:this.startTime,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0,refId:this.refId}}}var Nt=Object.assign;class x extends E{constructor(){super(...arguments);this.type=i.LayerType.PRECOMPOSITION}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this.refId=t.refId,this}toJSON(){var t;return{ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:Nt({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,refId:this.refId,sr:this.timeStretch,st:this.startTime,ty:this.type,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0}}}class j{constructor(t=0,s=[]){this.offset=t,this.color=s}get hasAlpha(){return this.color.length>3}get red(){return this.color[0]}get green(){return this.color[1]}get blue(){return this.color[2]}get alpha(){return this.color[3]}}class St extends n{constructor(){super(...arguments);this.colorCount=0}keyframeValue(t){return t>=this.values.length?[]:this.values[t].value}keyframeHasAlpha(t){return this.keyframeValue(t).length==this.colorCount*6}keframeStops(t){const s=this.keyframeValue(t),r=[],a=this.keyframeHasAlpha(t);for(let l=0;l<this.colorCount;l++){const d=s.slice(l,3);a&&d.push(s[this.colorCount*4+l*2]),r.push(new j(s[l*4],d))}return r}setKeyframeStops(t,s){if(t>=this.values.length)return;s.length>this.colorCount&&(this.colorCount=s.length),this.values[t].value=this.stopsToArray(s)}addKeyframe(t,s){const r=new p(t,this.stopsToArray(s));return s.length>this.colorCount&&(this.colorCount=s.length),this.values.push(r),r}stopsToArray(t){let s=!1;const r=[];for(const a of t)r.push(a.offset),r.push(a.red),r.push(a.green),r.push(a.blue),a.hasAlpha&&(s=!0);if(s)for(const a of t)r.push(a.offset),r.push(a.alpha!==void 0?a.alpha:1);return r}}class C{constructor(){this.gradientColors=new St(this,i.PropertyType.GRADIENT)}get colorCount(){return this.gradientColors.colorCount}set colorCount(t){this.gradientColors.colorCount=t}toJSON(){return{p:this.colorCount,k:this.gradientColors}}fromJSON(t){return this.gradientColors.fromJSON(t.k),this.colorCount=t.p,this}}class y{constructor(t){this.isHidden=!1,this.parent=t}}class M extends y{constructor(){super(...arguments);this.type=i.ShapeType.ELLIPSE,this.position=new n(this,i.PropertyType.POSITION),this.size=new n(this,i.PropertyType.SIZE),this.direction=1}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.position.fromJSON(t.p),this.size.fromJSON(t.s),this.direction=t.d,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,p:this.position,s:this.size,d:this.direction}}}class _ extends y{constructor(){super(...arguments);this.type=i.ShapeType.FILL,this.blendMode=i.BlendMode.NORMAL,this.color=new n(this,i.PropertyType.COLOR),this.fillRule=i.FillRuleType.EVEN_ODD,this.opacity=new n(this,i.PropertyType.OPACITY,[new p(0,100)])}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm,this.color.fromJSON(t.c),this.fillRule=t.r in i.FillRuleType?t.r:i.FillRuleType.EVEN_ODD,this.opacity.fromJSON(t.o),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,c:this.color,r:this.fillRule,o:this.opacity}}}class U extends y{constructor(){super(...arguments);this.type=i.ShapeType.GRADIENT_FILL,this.blendMode=i.BlendMode.NORMAL,this.endPoint=new n(this,i.PropertyType.POSITION),this.gradientColors=new C,this.gradientType=i.GradientFillType.LINEAR,this.highlightAngle=new n(this,i.PropertyType.NUMBER),this.highlightLength=new n(this,i.PropertyType.NUMBER),this.opacity=new n(this,i.PropertyType.OPACITY),this.startPoint=new n(this,i.PropertyType.POSITION),this.fillRule=i.FillRuleType.EVEN_ODD}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm,this.endPoint.fromJSON(t.e),this.gradientColors.fromJSON(t.g),this.gradientType=t.t,this.opacity.fromJSON(t.o),this.startPoint.fromJSON(t.s),this.fillRule=t.r,this.gradientType===i.GradientFillType.RADIAL&&(this.highlightAngle.fromJSON(t.a),this.highlightLength.fromJSON(t.h)),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,e:this.endPoint,g:this.gradientColors,t:this.gradientType,a:this.highlightAngle,h:this.highlightLength,o:this.opacity,r:this.fillRule,s:this.startPoint}}}class H extends y{constructor(){super(...arguments);this.type=i.ShapeType.MERGE,this.mergeMode=1}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.mergeMode=t.mm,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,mm:this.mergeMode}}}class k extends y{constructor(){super(...arguments);this.type=i.ShapeType.PATH,this.vertices=new n(this,i.PropertyType.SHAPE)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.itemIndex=t.ind,this.shapeIndex=t.ix,this.direction=t.d,this.vertices=t.ks,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,ind:this.itemIndex,ix:this.shapeIndex,d:this.direction,ks:this.vertices}}}class G extends y{constructor(){super(...arguments);this.type=i.ShapeType.RECTANGLE,this.position=new n(this,i.PropertyType.POSITION),this.roundness=new n(this,i.PropertyType.ROUNDNESS),this.size=new n(this,i.PropertyType.SIZE)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.direction=t.d,this.position.fromJSON(t.p),this.roundness.fromJSON(t.r),this.size.fromJSON(t.s),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,d:this.direction,p:this.position,r:this.roundness,s:this.size}}}class tt extends y{constructor(){super(...arguments);this.type=i.ShapeType.STAR,this.position=new n(this,i.PropertyType.POSITION),this.innerRadius=new n(this,i.PropertyType.NUMBER),this.innerRoundness=new n(this,i.PropertyType.NUMBER),this.outerRadius=new n(this,i.PropertyType.NUMBER),this.outerRoundness=new n(this,i.PropertyType.NUMBER),this.rotation=new n(this,i.PropertyType.ROTATION),this.points=new n(this,i.PropertyType.NUMBER),this.starType=i.StarType.STAR}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.position.fromJSON(t.p),this.innerRadius.fromJSON(t.ir),this.innerRoundness.fromJSON(t.is),this.outerRadius.fromJSON(t.or),this.outerRoundness.fromJSON(t.os),this.rotation.fromJSON(t.r),this.points.fromJSON(t.pt),this.starType=t.sy,this.direction=t.d,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,p:this.position,ir:this.innerRadius,is:this.innerRoundness,or:this.outerRadius,os:this.outerRoundness,r:this.rotation,pt:this.points,sy:this.starType,d:this.direction}}}class B extends y{constructor(){super(...arguments);this.type=i.ShapeType.STROKE,this.blendMode=i.BlendMode.NORMAL,this.color=new n(this,i.PropertyType.COLOR),this.lineCapType=i.LineCapType.ROUND,this.lineJoinType=i.LineJoinType.ROUND,this.opacity=new n(this,i.PropertyType.OPACITY,[new p(0,100)]),this.width=new n(this,i.PropertyType.STROKE_WIDTH)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm in i.BlendMode?t.bm:i.BlendMode.NORMAL,this.color.fromJSON(t.c),this.lineCapType=t.lc in i.LineCapType?t.lc:i.LineCapType.ROUND,this.lineJoinType=t.lj in i.LineJoinType?t.lj:i.LineJoinType.ROUND,this.miterLimit=t.ml,this.opacity.fromJSON(t.o),this.width.fromJSON(t.w),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,c:this.color,lc:this.lineCapType,lj:this.lineJoinType,ml:this.miterLimit,o:this.opacity,w:this.width}}}class F extends y{constructor(){super(...arguments);this.type=i.ShapeType.TRIM,this.blendMode=i.BlendMode.NORMAL,this.trimEnd=new n(this,i.PropertyType.NUMBER),this.trimOffset=new n(this,i.PropertyType.NUMBER),this.trimStart=new n(this,i.PropertyType.NUMBER),this.trimMultipleShapes=i.TrimMode.SIMULTANEOUSLY}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm in i.BlendMode?t.bm:i.BlendMode.NORMAL,this.trimEnd.fromJSON(t.e),this.trimOffset.fromJSON(t.o),this.trimStart.fromJSON(t.s),this.trimMultipleShapes=t.m in i.TrimMode?t.m:i.TrimMode.INDIVIDUALLY,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,e:this.trimEnd,o:this.trimOffset,s:this.trimStart,m:this.trimMultipleShapes}}}var Tt=Object.assign;class V extends y{constructor(){super(...arguments);this.type=i.ShapeType.GROUP,this.blendMode=i.BlendMode.NORMAL,this.isHidden=!1,this.numProperties=0,this.transform=new D,this.shapes=[]}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm,this.contentPropertyIndex=t.cix,this.propertyIndex=t.ix,this.numProperties=t.np,this.shapes=t.it.map(s=>{try{if(s.ty!=="tr"){const r=this.createShape(s.ty);return r.fromJSON(s)}this.transform.fromJSON(s)}catch(r){}return!1}).filter(Boolean),this}createShape(t){if(t===i.ShapeType.PATH)return new k(this);if(t===i.ShapeType.GROUP)return new V(this);if(t===i.ShapeType.FILL)return new _(this);if(t===i.ShapeType.RECTANGLE)return new G(this);if(t===i.ShapeType.ELLIPSE)return new M(this);if(t===i.ShapeType.STROKE)return new B(this);if(t===i.ShapeType.GRADIENT_FILL)return new U(this);if(t===i.ShapeType.TRIM)return new F(this);if(t===i.ShapeType.MERGE)return new H(this);if(t===i.ShapeType.STAR)return new tt(this);throw new Error(`Invalid or unknown shape type: ${t}`)}addShape(t){return t instanceof y||(t=this.createShape(t)),this.shapes.push(t),t}toJSON(){const t=JSON.parse(JSON.stringify(this.shapes));return t.push(Tt({ty:"tr",nm:"Transform"},this.transform.toJSON())),{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,cix:this.contentPropertyIndex,it:t,ix:this.propertyIndex,np:this.numProperties}}}class gt extends y{constructor(){super(...arguments);this.type=i.ShapeType.GRADIENT_STROKE,this.blendMode=i.BlendMode.NORMAL,this.endPoint=new n(this,i.PropertyType.POSITION),this.gradientColors=new C,this.gradientType=i.GradientFillType.LINEAR,this.highlightAngle=new n(this,i.PropertyType.NUMBER),this.highlightLength=new n(this,i.PropertyType.NUMBER),this.opacity=new n(this,i.PropertyType.OPACITY),this.startPoint=new n(this,i.PropertyType.POSITION),this.lineCapType=i.LineCapType.ROUND,this.lineJoinType=i.LineJoinType.ROUND,this.width=new n(this,i.PropertyType.STROKE_WIDTH)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm,this.opacity.fromJSON(t.o),this.endPoint.fromJSON(t.e),this.gradientColors.fromJSON(t.g),this.gradientType=t.t,this.startPoint.fromJSON(t.s),this.gradientType===i.GradientFillType.RADIAL&&(this.highlightAngle.fromJSON(t.a),this.highlightLength.fromJSON(t.h)),this.lineCapType=t.lc in i.LineCapType?t.lc:i.LineCapType.ROUND,this.lineJoinType=t.lj in i.LineJoinType?t.lj:i.LineJoinType.ROUND,this.miterLimit=t.ml,this.width.fromJSON(t.w),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,o:this.opacity,e:this.endPoint,g:this.gradientColors,t:this.gradientType,a:this.highlightAngle,h:this.highlightLength,s:this.startPoint,lc:this.lineCapType,lj:this.lineJoinType,ml:this.miterLimit,w:this.width}}}class Et extends y{constructor(){super(...arguments);this.type=i.ShapeType.REPEATER,this.anchor=new n(this,i.PropertyType.ANCHOR),this.startOpacity=new n(this,i.PropertyType.OPACITY),this.endOpacity=new n(this,i.PropertyType.OPACITY),this.position=new n(this,i.PropertyType.POSITION),this.rotation=new n(this,i.PropertyType.ROTATION),this.scale=new n(this,i.PropertyType.SCALE),this.shapes=[],this.skew=new n(this,i.PropertyType.SKEW),this.skewAxis=new n(this,i.PropertyType.SKEW_AXIS),this.copies=new n(this,i.PropertyType.NUMBER),this.offset=new n(this,i.PropertyType.NUMBER),this.composition=i.RepeaterComposite.ABOVE}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.copies.fromJSON(t.c),this.composition=t.m,this.offset.fromJSON(t.o),this.anchor.fromJSON(t.tr.a),this.startOpacity.fromJSON(t.tr.so),this.endOpacity.fromJSON(t.tr.eo),this.position.fromJSON(t.tr.p),this.rotation.fromJSON(t.tr.r),this.scale.fromJSON(t.tr.s),t.tr.sk&&this.skew.fromJSON(t.tr.sk),t.tr.sa&&this.skewAxis.fromJSON(t.tr.sa),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,m:this.composition,c:this.copies,o:this.offset,tr:{a:this.anchor,so:this.startOpacity,eo:this.endOpacity,p:this.position,r:this.rotation,s:this.scale,sk:this.skew,sa:this.skewAxis}}}}class wt extends y{constructor(){super(...arguments);this.type=i.ShapeType.ROUNDED_CORNERS,this.roundness=new n(this,i.PropertyType.NUMBER)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.roundness.fromJSON(t.r),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,r:this.roundness}}}var Rt=Object.assign;class it extends E{constructor(){super(...arguments);this.type=i.LayerType.SHAPE,this.shapes=[]}createShape(t){if(t===i.ShapeType.PATH)return new k(this);if(t===i.ShapeType.GROUP)return new V(this);if(t===i.ShapeType.FILL)return new _(this);if(t===i.ShapeType.RECTANGLE)return new G(this);if(t===i.ShapeType.ELLIPSE)return new M(this);if(t===i.ShapeType.STROKE)return new B(this);if(t===i.ShapeType.GRADIENT_FILL)return new U(this);if(t===i.ShapeType.TRIM)return new F(this);if(t===i.ShapeType.MERGE)return new H(this);throw new Error(`Invalid or unknown shape type: ${t}`)}addShape(t){return t instanceof y||(t=this.createShape(t)),this.shapes.push(t),t}createShapeFromJSON(t){try{const s=this.createShape(t.ty);return s.fromJSON(t)}catch(s){throw new Error(`Unable to create shape from JSON: ${t.ty}`)}}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,this.classNames="cl"in t?t.cl.split(" "):[],this.transform.fromJSON(t.ks),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.shapes=t.shapes.map(s=>this.createShapeFromJSON(s)).filter(Boolean),this}toJSON(){var t;return{ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:Rt({},this.transform.toJSON()),shapes:this.shapes.map(s=>s.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sr:this.timeStretch,st:this.startTime,ty:this.type,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0}}}var At=Object.assign;class et extends E{constructor(){super(...arguments);this.type=i.LayerType.SOLID,this.solidColor="#000000",this.solidHeight=1,this.solidWidth=1}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this.solidColor=t.sc,this.solidHeight=t.sh,this.solidWidth=t.sw,this}toJSON(){var t;return{ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:At({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sc:this.solidColor,sh:this.solidHeight,sw:this.solidWidth,sr:this.timeStretch,st:this.startTime,ty:this.type,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0}}}var It=Object.assign;class st extends E{constructor(){super(...arguments);this.type=i.LayerType.TEXT}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this.textData=t.t,this}toJSON(){var t;return{ty:this.type,ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:It({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sr:this.timeStretch,st:this.startTime,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0,t:this.textData}}}class rt{constructor(){this.comment="",this.duration=0,this.time=0}fromJSON(t){return this.comment=t.cm,this.duration=t.dr,this.time=t.tm,this}toJSON(){return{cm:this.comment,dr:this.duration,tm:this.time}}}function ht(t){let s=(+t[0]).toString(16),r=(+t[1]).toString(16),a=(+t[2]).toString(16),l=Math.round(+t[3]*255).toString(16);return s.length==1&&(s="0"+s),r.length==1&&(r="0"+r),a.length==1&&(a="0"+a),l.length==1&&(l="0"+l),"#"+s+r+a+l}function Pt(t,s){const r=parseInt(t.slice(1,3),16),a=parseInt(t.slice(3,5),16),l=parseInt(t.slice(5,7),16);return s?[r/255,a/255,l/255,s]:[r/255,a/255,l/255]}class nt{constructor(t){this.keywords=[],this.generator="@lottiefiles/lottie-js 0.3.3",this.parent=t}fromJSON(t){return this.author=t.a,this.keywords="k"in t?t.k.split(",").map(s=>s.trim()):[t.k],this.generator=t.g,this.description=t.d,this.themeColor=t.tc,this}toJSON(){return{a:this.author,k:this.keywords.length?this.keywords:void 0,g:this.generator,d:this.description,tc:this.themeColor}}}var bt=(t,s,r)=>new Promise((a,l)=>{var d=T=>{try{N(r.next(T))}catch(I){l(I)}},f=T=>{try{N(r.throw(T))}catch(I){l(I)}},N=T=>T.done?a(T.value):Promise.resolve(T.value).then(d,f);N((r=r.apply(t,s)).next())});class Y{constructor(){this.assets=[],this.frameRate=60,this.height=0,this.inPoint=0,this.is3D=!1,this.layers=[],this.markers=[],this.meta=new nt(this),this.name="",this.outPoint=0,this.version="",this.width=0}static fromURL(t){return bt(this,null,function*(){if(typeof t!="string")throw new Error("The url value must be a string");let s;try{const a=new URL(t),l=yield ut(a.toString());s=yield l.json()}catch(a){throw new Error("An error occurred while trying to load the Lottie file from URL")}const r=new Y;return r.fromJSON(s)})}static isLottie(t){const s=["v","ip","op","layers","fr","w","h"];return s.every(r=>Object.prototype.hasOwnProperty.call(t,r))}get colors(){const t=new Set;return[...R().keys()].filter(s=>s.type===i.PropertyType.COLOR).forEach(s=>{s.values.forEach(r=>{t.add(JSON.stringify(r.value))})}),Array.from(t).map(s=>J.fromJSON(JSON.parse(s)))}get colorsVerbose(){const t={};return[...R().keys()].filter(s=>s.type===i.PropertyType.COLOR).forEach((s,r)=>{const a=s.getParent(),l=this.parentPath(a),d=l.slice();s.values.forEach(f=>{d.unshift("Frame "+f.frame),d.unshift(r.toString());const N=f.value;t[d.join(".")]=ht([Math.round(N[0]*255),Math.round(N[1]*255),Math.round(N[2]*255),N[3]])})}),t}get textLayers(){const t={},s=this.getLayersByType(i.LayerType.TEXT);return s.forEach((r,a)=>{t[a+"."+r.name]=r.textData.d.k[0].s.t}),t}parentPath(t,s=[]){return t.parent===void 0?(s.push(t.name),s):(s.push(t.name),this.parentPath(t.parent,s))}get duration(){return this.totalFrames/this.frameRate}get fileSize(){return new TextEncoder().encode(JSON.stringify(this)).length}get totalFrames(){return this.outPoint-this.inPoint}createAsset(t){if(t===i.AssetType.PRECOMPOSITION)return new $(this);if(t===i.AssetType.IMAGE)return new q(this);throw new Error(`Invalid or unknown asset type ${t}`)}createAssetFromJSON(t){try{const s=this.createAsset("layers"in t?i.AssetType.PRECOMPOSITION:i.AssetType.IMAGE);return s.fromJSON(t)}catch(s){throw new Error("Unable to create asset from JSON")}}createLayer(t){if(t===i.LayerType.PRECOMPOSITION)return new x(this);if(t===i.LayerType.SHAPE)return new it(this);if(t===i.LayerType.GROUP)return new Z(this);if(t===i.LayerType.SOLID)return new et(this);if(t===i.LayerType.IMAGE)return new Q(this);if(t===i.LayerType.TEXT)return new st(this);throw new Error(`Invalid or unknown layer type: ${t}`)}createLayerFromJSON(t){try{const s=this.createLayer(t.ty);return s.fromJSON(t)}catch(s){throw console.log(s),new Error(`Unable to create layer type from JSON: ${t.ty}`)}}createLayersFromJSONArray(t){const s=new Map,r=[],a=[];return t.forEach(l=>{const d=this.createLayerFromJSON(l);d&&(l.parent!==void 0&&r.push([d,l.parent]),d.index!==void 0&&s.set(d.index,d),a.push(d))}),r.forEach(([l,d])=>{l.parent=s.get(d)}),a}createMarker(){return new rt}createMarkerFromJSON(t){try{const s=this.createMarker();return s.fromJSON(t)}catch(s){throw console.log(s),new Error("Unable to create marker from JSON")}}fromJSON(t){if(Y.isLottie(t)===!1)throw new Error("The given object is not a valid Lottie JSON structure");return this.frameRate=t.fr,this.height=t.h,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.version=t.v,this.width=t.w,this.assets=t.assets.map(s=>this.createAssetFromJSON(s)).filter(Boolean),this.layers=this.createLayersFromJSONArray(t.layers),this.markers=t.markers.map(s=>this.createMarkerFromJSON(s)).filter(Boolean),"meta"in t&&this.meta.fromJSON(t.meta),this}getLayerById(t){if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.find(s=>s.id===t)}getLayersByClassName(t){if(typeof t!="string")throw new Error("Class name value must be a string");return this.layers.filter(s=>s.classNames.includes(t))}getLayersByType(t){if(t in i.LayerType===!1)throw new Error("Type value must be a valid LayerType value");return this.layers.filter(s=>s.type===t)}toJSON(t){return t?void 0:{assets:this.assets,ddd:this.is3D?1:0,fr:this.frameRate,h:this.height,ip:this.inPoint,layers:this.layers.map(s=>s.toJSON()),markers:this.markers.map(s=>s.toJSON()),meta:this.meta,nm:this.name,op:this.outPoint,v:this.version||"5.6.0",w:this.width}}}class Jt{constructor(){this.isInverted=!1,this.name="",this.mode=i.MaskMode.Add}fromJSON(t){return this.isInverted=t.inv,this.mode=t.mode,this.name=t.nm,this.points=t.pt,this.opacity=t.o,this}toJSON(){return{inv:this.isInverted,mode:this.mode,nm:this.name,o:this.opacity,pt:this.points}}}i.Animation=Y,i.Asset=g,i.Color=J,i.ColorRgb=A,i.ColorRgba=v,i.EllipseShape=M,i.FillShape=_,i.Gradient=C,i.GradientFillShape=U,i.GradientStop=j,i.GradientStrokeShape=gt,i.GroupLayer=Z,i.GroupShape=V,i.ImageAsset=q,i.ImageLayer=Q,i.KeyFrame=p,i.Layer=E,i.Marker=rt,i.Mask=Jt,i.MergeShape=H,i.Meta=nt,i.PathShape=k,i.PrecompositionAsset=$,i.PrecompositionLayer=x,i.Property=n,i.RectangleShape=G,i.RepeaterShape=Et,i.RoundedCornersShape=wt,i.Shape=y,i.ShapeLayer=it,i.SolidLayer=et,i.StarShape=tt,i.StrokeShape=B,i.TextLayer=st,i.Transform=D,i.TrimShape=F,i.hexToRgba=Pt,i.rgbaToHex=ht,i.useRegistry=R,Object.defineProperty(i,"__esModule",{value:!0})});
*/(function(i,g){typeof exports=="object"&&typeof module!="undefined"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(i=typeof globalThis!="undefined"?globalThis:i||self,g(i.Lottie={}))})(this,function(i){"use strict";class g{constructor(t){this.parent=t}}class Q extends g{fromJSON(t){return this.data=t.p,this.id=t.id,this.height=t.h,this.path=t.u,this.width=t.w,this}toJSON(){return{h:this.height,i:this.id,p:this.data,u:this.path,w:this.width}}}(function(t){t[t.PRECOMPOSITION=0]="PRECOMPOSITION",t[t.IMAGE=1]="IMAGE"})(i.AssetType||(i.AssetType={}));class x extends g{constructor(){super(...arguments);this.type=i.AssetType.PRECOMPOSITION,this.layers=[],this.id=""}fromJSON(t){return this.id=t.id,this.timeRemap=t.tm,this.layers=this.parent.createLayersFromJSONArray(t.layers),this}toJSON(){return{id:this.id,layers:this.layers.map(t=>t.toJSON()),tm:this.timeRemap}}}var ct=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ft(t,s,r){return r={path:s,exports:{},require:function(n,l){return ut(n,l??r.path)}},t(r,r.exports),r.exports}function ut(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var yt=ft(function(t,s){var r=function(n){function l(){this.fetch=!1,this.DOMException=n.DOMException}return l.prototype=n,new l}(typeof self!="undefined"?self:ct);(function(n){var l=function(d){var f={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function N(e){return e&&DataView.prototype.isPrototypeOf(e)}if(f.arrayBuffer)var T=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],I=ArrayBuffer.isView||function(e){return e&&T.indexOf(Object.prototype.toString.call(e))>-1};function P(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function ot(e){return typeof e!="string"&&(e=String(e)),e}function W(e){var h={next:function(){var o=e.shift();return{done:o===void 0,value:o}}};return f.iterable&&(h[Symbol.iterator]=function(){return h}),h}function c(e){this.map={},e instanceof c?e.forEach(function(h,o){this.append(o,h)},this):Array.isArray(e)?e.forEach(function(h){this.append(h[0],h[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(h){this.append(h,e[h])},this)}c.prototype.append=function(e,h){e=P(e),h=ot(h);var o=this.map[e];this.map[e]=o?o+", "+h:h},c.prototype.delete=function(e){delete this.map[P(e)]},c.prototype.get=function(e){return e=P(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(P(e))},c.prototype.set=function(e,h){this.map[P(e)]=ot(h)},c.prototype.forEach=function(e,h){for(var o in this.map)this.map.hasOwnProperty(o)&&e.call(h,this.map[o],o,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(h,o){e.push(o)}),W(e)},c.prototype.values=function(){var e=[];return this.forEach(function(h){e.push(h)}),W(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(h,o){e.push([o,h])}),W(e)},f.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);function q(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function lt(e){return new Promise(function(h,o){e.onload=function(){h(e.result)},e.onerror=function(){o(e.error)}})}function Ct(e){var h=new FileReader,o=lt(h);return h.readAsArrayBuffer(e),o}function Mt(e){var h=new FileReader,o=lt(h);return h.readAsText(e),o}function _t(e){for(var h=new Uint8Array(e),o=new Array(h.length),O=0;O<h.length;O++)o[O]=String.fromCharCode(h[O]);return o.join("")}function dt(e){if(e.slice)return e.slice(0);var h=new Uint8Array(e.byteLength);return h.set(new Uint8Array(e)),h.buffer}function mt(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:f.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:f.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():f.arrayBuffer&&f.blob&&N(e)?(this._bodyArrayBuffer=dt(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||I(e))?this._bodyArrayBuffer=dt(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var e=q(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?q(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Ct)}),this.text=function(){var e=q(this);if(e)return e;if(this._bodyBlob)return Mt(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(_t(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(kt)}),this.json=function(){return this.text().then(JSON.parse)},this}var Ut=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ht(e){var h=e.toUpperCase();return Ut.indexOf(h)>-1?h:e}function w(e,h){h=h||{};var o=h.body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,h.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!o&&e._bodyInit!=null&&(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new c(h.headers)),this.method=Ht(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})};function kt(e){var h=new FormData;return e.trim().split("&").forEach(function(o){if(o){var O=o.split("="),u=O.shift().replace(/\+/g," "),m=O.join("=").replace(/\+/g," ");h.append(decodeURIComponent(u),decodeURIComponent(m))}}),h}function Gt(e){var h=new c,o=e.replace(/\r?\n[\t ]+/g," ");return o.split(/\r?\n/).forEach(function(O){var u=O.split(":"),m=u.shift().trim();if(m){var L=u.join(":").trim();h.append(m,L)}}),h}mt.call(w.prototype);function S(e,h){h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"OK",this.headers=new c(h.headers),this.url=h.url||"",this._initBody(e)}mt.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var Bt=[301,302,303,307,308];S.redirect=function(e,h){if(Bt.indexOf(h)===-1)throw new RangeError("Invalid status code");return new S(null,{status:h,headers:{location:e}})},d.DOMException=n.DOMException;try{new d.DOMException}catch(e){d.DOMException=function(h,o){this.message=h,this.name=o;var O=Error(h);this.stack=O.stack},d.DOMException.prototype=Object.create(Error.prototype),d.DOMException.prototype.constructor=d.DOMException}function $(e,h){return new Promise(function(o,O){var u=new w(e,h);if(u.signal&&u.signal.aborted)return O(new d.DOMException("Aborted","AbortError"));var m=new XMLHttpRequest;function L(){m.abort()}m.onload=function(){var b={status:m.status,statusText:m.statusText,headers:Gt(m.getAllResponseHeaders()||"")};b.url="responseURL"in m?m.responseURL:b.headers.get("X-Request-URL");var Z="response"in m?m.response:m.responseText;o(new S(Z,b))},m.onerror=function(){O(new TypeError("Network request failed"))},m.ontimeout=function(){O(new TypeError("Network request failed"))},m.onabort=function(){O(new d.DOMException("Aborted","AbortError"))},m.open(u.method,u.url,!0),u.credentials==="include"?m.withCredentials=!0:u.credentials==="omit"&&(m.withCredentials=!1),"responseType"in m&&f.blob&&(m.responseType="blob"),u.headers.forEach(function(b,Z){m.setRequestHeader(Z,b)}),u.signal&&(u.signal.addEventListener("abort",L),m.onreadystatechange=function(){m.readyState===4&&u.signal.removeEventListener("abort",L)}),m.send(typeof u._bodyInit=="undefined"?null:u._bodyInit)})}return $.polyfill=!0,n.fetch||(n.fetch=$,n.Headers=c,n.Request=w,n.Response=S),d.Headers=c,d.Request=w,d.Response=S,d.fetch=$,d}({})})(r),delete r.fetch.polyfill,s=r.fetch,s.default=r.fetch,s.fetch=r.fetch,s.Headers=r.Headers,s.Request=r.Request,s.Response=r.Response,t.exports=s});(function(t){t[t.NORMAL=0]="NORMAL",t[t.MULTIPLY=1]="MULTIPLY",t[t.SCREEN=2]="SCREEN",t[t.OVERLAY=3]="OVERLAY",t[t.DARKEN=4]="DARKEN",t[t.LIGHTEN=5]="LIGHTEN",t[t.COLOR_DODGE=6]="COLOR_DODGE",t[t.COLOR_BURN=7]="COLOR_BURN",t[t.HARD_LIGHT=8]="HARD_LIGHT",t[t.SOFT_LIGHT=9]="SOFT_LIGHT",t[t.DIFFERENCE=10]="DIFFERENCE",t[t.EXCLUSION=11]="EXCLUSION",t[t.HUE=12]="HUE",t[t.SATURATION=13]="SATURATION",t[t.COLOR=14]="COLOR",t[t.LUMINOSITY=15]="LUMINOSITY"})(i.BlendMode||(i.BlendMode={})),function(t){t[t.EVEN_ODD=1]="EVEN_ODD",t[t.NONZERO=2]="NONZERO"}(i.FillRuleType||(i.FillRuleType={})),function(t){t[t.NONE=0]="NONE",t[t.LINEAR=1]="LINEAR",t[t.RADIAL=2]="RADIAL",t[t.ANGULAR=4]="ANGULAR",t[t.REFLECTED=5]="REFLECTED",t[t.DIAMOND=6]="DIAMOND"}(i.GradientFillType||(i.GradientFillType={})),function(t){t[t.LINEAR=1]="LINEAR",t[t.RADIAL=2]="RADIAL"}(i.GradientStrokeType||(i.GradientStrokeType={})),function(t){t[t.PRECOMPOSITION=0]="PRECOMPOSITION",t[t.SOLID=1]="SOLID",t[t.IMAGE=2]="IMAGE",t[t.GROUP=3]="GROUP",t[t.SHAPE=4]="SHAPE",t[t.TEXT=5]="TEXT",t[t.AUDIO=6]="AUDIO",t[t.VIDEO_PLACEHOLDER=7]="VIDEO_PLACEHOLDER",t[t.IMAGE_SEQUENCE=8]="IMAGE_SEQUENCE",t[t.VIDEO=9]="VIDEO",t[t.IMAGE_PLACEHOLDER=10]="IMAGE_PLACEHOLDER",t[t.GUIDE=11]="GUIDE",t[t.ADJUSTMENT=12]="ADJUSTMENT",t[t.CAMERA=13]="CAMERA",t[t.LIGHT=14]="LIGHT"}(i.LayerType||(i.LayerType={})),function(t){t[t.BUTT=1]="BUTT",t[t.ROUND=2]="ROUND",t[t.PROJECTING=3]="PROJECTING"}(i.LineCapType||(i.LineCapType={})),function(t){t[t.MITER=1]="MITER",t[t.ROUND=2]="ROUND",t[t.BEVEL=3]="BEVEL"}(i.LineJoinType||(i.LineJoinType={})),function(t){t.None="n",t.Add="a",t.Subtract="s",t.Intersect="i",t.Lighten="l",t.Darken="d",t.Difference="f"}(i.MaskMode||(i.MaskMode={})),function(t){t.ANCHOR="a",t.OPACITY="o",t.POSITION="p",t.ROTATION="r",t.ROTATION_X="rx",t.ROTATION_Y="ry",t.ROTATION_Z="rz",t.SCALE="s",t.SKEW_AXIS="sa",t.SKEW="sk",t.SHAPE="sh",t.EXPANSION="x",t.FEATHER="f",t.SIZE="sz",t.ROUNDNESS="rd",t.MITER_LIMIT="ml",t.STROKE_WIDTH="sw",t.NUMBER="nu",t.COLOR="cl",t.ORIENTATION="or",t.GRADIENT="gr"}(i.PropertyType||(i.PropertyType={})),function(t){t.ELLIPSE="el",t.FILL="fl",t.GRADIENT_FILL="gf",t.GRADIENT_STROKE="gs",t.GROUP="gr",t.MERGE="mm",t.OFFSET_PATH="op",t.PATH="sh",t.RECTANGLE="rc",t.REPEATER="rp",t.ROUNDED_CORNERS="rd",t.STAR="sr",t.STROKE="st",t.TRIM="tm",t.TWIST="tw"}(i.ShapeType||(i.ShapeType={})),function(t){t[t.SIMULTANEOUSLY=1]="SIMULTANEOUSLY",t[t.INDIVIDUALLY=2]="INDIVIDUALLY"}(i.TrimMode||(i.TrimMode={})),function(t){t[t.ABOVE=1]="ABOVE",t[t.BELOW=2]="BELOW"}(i.RepeaterComposite||(i.RepeaterComposite={})),function(t){t[t.STAR=1]="STAR",t[t.POLYGON=2]="POLYGON"}(i.StarType||(i.StarType={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ALPHA=1]="ALPHA",t[t.INVERTED_ALPHA=2]="INVERTED_ALPHA",t[t.LUMA=3]="LUMA",t[t.INVERTED_LUMA=4]="INVERTED_LUMA"}(i.MatteMode||(i.MatteMode={}));class Ot{constructor(){this.list=[]}fromJSON(t){return this.list=t.list,this}toJSON(){return{list:this.list}}}class p{constructor(t=0,s=0){this.frame=0,this.value=0,this.frameInTangent=[0,0],this.frameOutTangent=[1,1],this.hold=!1,this.frame=t,this.value=s}fromJSON(t,s=void 0){this.frame=t.t,s===void 0?this.value=t.s:this.value=s.fromJSON(t.s);const r="i"in t&&"o"in t,n="ti"in t&&"to"in t;return this.frameInTangent=r?[t.i.x,t.i.y]:void 0,this.frameOutTangent=r?[t.o.x,t.o.y]:void 0,n&&("x"in t.ti&&"y"in t.ti?this.valueInTangent=[t.ti.x,t.ti.y]:this.valueInTangent=t.ti,"x"in t.to&&"y"in t.to?this.valueOutTangent=[t.to.x,t.to.y]:this.valueOutTangent=t.to),this.hold="h"in t&&t.h,this}toJSON(){const t={t:this.frame,s:this.value};return this.hold?t.h=1:this.frameInTangent&&this.frameOutTangent&&(t.i={x:this.frameInTangent[0],y:this.frameInTangent[1]},t.o={x:this.frameOutTangent[0],y:this.frameOutTangent[1]}),this.valueInTangent&&this.valueOutTangent&&(t.ti=this.valueInTangent,t.to=this.valueOutTangent),t}}const pt=new Map;function R(){return pt}class J{toJSON(){return this.toRgbArray()}static fromJSON(t){return t.length>3?D.fromJSON(t):t.length==3?A.fromJSON(t):new A(0,0,0)}}class A extends J{constructor(t,s,r){super();this.r=t,this.g=s,this.b=r}toRgbArray(){return[this.r,this.g,this.b]}static fromJSON(t){return new A(t[0],t[1],t[2])}}class D extends A{constructor(t,s,r,n=1){super(t,s,r);this.a=n}toRgbArray(){return[this.r,this.g,this.b,this.a]}static fromJSON(t){return new D(t[0],t[1],t[2],t[3])}}class a{constructor(t,s,r=[]){this.UID=0,this.isAnimated=!1,this.values=[],this._parent=t,this.type=s,this.values=r,this.isAnimated=r.length>1,R().set(this,t)}getParent(){return this._parent}fromJSON(t){this.expression="x"in t?t.x:void 0,this.index=t.ix,this.isAnimated=t.a===1;let s;return this.type==i.PropertyType.COLOR&&(s=J),this.values=this.isAnimated?t.k.map(r=>new p().fromJSON(r,s)):[new p().fromJSON({t:0,s:t.k},s)],this.type===i.PropertyType.COLOR&&(this.maxColors="p"in t?t.p:void 0),this}toJSON(){let t;const s=this.isAnimated!==!1||this.values.length>1;return s?t=this.values:t=this.values.length?this.values[0].value:0,{x:this.expression,ix:this.index,a:s?1:0,k:t,p:this.maxColors}}}class C{constructor(){this.anchor=new a(this,i.PropertyType.ANCHOR,[new p(0,[0,0])]),this.opacity=new a(this,i.PropertyType.OPACITY,[new p(0,100)]),this.position=new a(this,i.PropertyType.POSITION,[new p(0,[0,0])]),this.rotation=new a(this,i.PropertyType.ROTATION,[new p(0,0)]),this.scale=new a(this,i.PropertyType.SCALE,[new p(0,[100,100])]),this.skew=new a(this,i.PropertyType.SKEW),this.skewAxis=new a(this,i.PropertyType.SKEW_AXIS)}fromJSON(t){return this.rotation="r"in t?new a(this,i.PropertyType.ROTATION).fromJSON(t.r):void 0,"o"in t&&this.opacity.fromJSON(t.o),"p"in t&&this.position.fromJSON(t.p),"a"in t&&this.anchor.fromJSON(t.a),"s"in t&&this.scale.fromJSON(t.s),this.skew="sk"in t?new a(this,i.PropertyType.SKEW).fromJSON(t.sk):void 0,this.skewAxis="sa"in t?new a(this,i.PropertyType.SKEW_AXIS).fromJSON(t.sa):void 0,"or"in t&&(this.orientation=new a(this,i.PropertyType.ORIENTATION).fromJSON(t.or)),"rx"in t&&(this.rotationX=new a(this,i.PropertyType.ROTATION_X).fromJSON(t.rx)),"ry"in t&&(this.rotationY=new a(this,i.PropertyType.ROTATION_Y).fromJSON(t.ry)),"rz"in t&&(this.rotationZ=new a(this,i.PropertyType.ROTATION_Z).fromJSON(t.rz)),this}toJSON(){return{a:this.anchor,o:this.opacity,p:this.position,r:this.rotation,s:this.scale,sk:this.skew,sa:this.skewAxis,rx:this.rotationX,ry:this.rotationY,rz:this.rotationZ,or:this.orientation}}}class E{constructor(t){this.autoOrient=!1,this.blendMode=i.BlendMode.NORMAL,this.classNames=[],this.height=0,this.id="",this.inPoint=0,this.is3D=!1,this.name="",this.outPoint=0,this.startTime=0,this.timeStretch=1,this.width=0,this.transform=new C,this.parent=t}get colors(){const t=new Set,s=R();return[...s.keys()].filter(r=>s.get(r)===this&&r.type===i.PropertyType.COLOR).forEach(r=>{r.values.forEach(n=>{t.add(JSON.stringify(n.value))})}),Array.from(t).map(r=>JSON.parse(r))}get totalFrames(){return this.outPoint-this.inPoint}}var Nt=Object.assign;class j extends E{constructor(){super(...arguments);this.type=i.LayerType.GROUP}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this}toJSON(){var t;return{ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:Nt({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sr:this.timeStretch,st:this.startTime,ty:this.type,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0}}}var St=Object.assign;class tt extends E{constructor(){super(...arguments);this.type=i.LayerType.IMAGE}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this.refId=t.refId,this}toJSON(){var t;return{ty:this.type,ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:St({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sr:this.timeStretch,st:this.startTime,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0,refId:this.refId}}}var Tt=Object.assign;class it extends E{constructor(){super(...arguments);this.type=i.LayerType.PRECOMPOSITION}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this.refId=t.refId,this}toJSON(){var t;return{ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:Tt({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,refId:this.refId,sr:this.timeStretch,st:this.startTime,ty:this.type,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0}}}class et{constructor(t=0,s=[]){this.offset=t,this.color=s}get hasAlpha(){return this.color.length>3}get red(){return this.color[0]}get green(){return this.color[1]}get blue(){return this.color[2]}get alpha(){return this.color[3]}}class gt extends a{constructor(){super(...arguments);this.colorCount=0}keyframeValue(t){return t>=this.values.length?[]:this.values[t].value}keyframeHasAlpha(t){return this.keyframeValue(t).length==this.colorCount*6}keframeStops(t){const s=this.keyframeValue(t),r=[],n=this.keyframeHasAlpha(t);for(let l=0;l<this.colorCount;l++){const d=s.slice(l,3);n&&d.push(s[this.colorCount*4+l*2]),r.push(new et(s[l*4],d))}return r}setKeyframeStops(t,s){if(t>=this.values.length)return;s.length>this.colorCount&&(this.colorCount=s.length),this.values[t].value=this.stopsToArray(s)}addKeyframe(t,s){const r=new p(t,this.stopsToArray(s));return s.length>this.colorCount&&(this.colorCount=s.length),this.values.push(r),r}stopsToArray(t){let s=!1;const r=[];for(const n of t)r.push(n.offset),r.push(n.red),r.push(n.green),r.push(n.blue),n.hasAlpha&&(s=!0);if(s)for(const n of t)r.push(n.offset),r.push(n.alpha!==void 0?n.alpha:1);return r}}class M{constructor(){this.gradientColors=new gt(this,i.PropertyType.GRADIENT)}get colorCount(){return this.gradientColors.colorCount}set colorCount(t){this.gradientColors.colorCount=t}toJSON(){return{p:this.colorCount,k:this.gradientColors}}fromJSON(t){return this.gradientColors.fromJSON(t.k),this.colorCount=t.p,this}}class y{constructor(t){this.isHidden=!1,this.parent=t}}class _ extends y{constructor(){super(...arguments);this.type=i.ShapeType.ELLIPSE,this.position=new a(this,i.PropertyType.POSITION),this.size=new a(this,i.PropertyType.SIZE),this.direction=1}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.position.fromJSON(t.p),this.size.fromJSON(t.s),this.direction=t.d,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,p:this.position,s:this.size,d:this.direction}}}class U extends y{constructor(){super(...arguments);this.type=i.ShapeType.FILL,this.blendMode=i.BlendMode.NORMAL,this.color=new a(this,i.PropertyType.COLOR),this.fillRule=i.FillRuleType.EVEN_ODD,this.opacity=new a(this,i.PropertyType.OPACITY,[new p(0,100)])}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm,this.color.fromJSON(t.c),this.fillRule=t.r in i.FillRuleType?t.r:i.FillRuleType.EVEN_ODD,this.opacity.fromJSON(t.o),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,c:this.color,r:this.fillRule,o:this.opacity}}}class H extends y{constructor(){super(...arguments);this.type=i.ShapeType.GRADIENT_FILL,this.blendMode=i.BlendMode.NORMAL,this.endPoint=new a(this,i.PropertyType.POSITION),this.gradientColors=new M,this.gradientType=i.GradientFillType.LINEAR,this.highlightAngle=new a(this,i.PropertyType.NUMBER),this.highlightLength=new a(this,i.PropertyType.NUMBER),this.opacity=new a(this,i.PropertyType.OPACITY),this.startPoint=new a(this,i.PropertyType.POSITION),this.fillRule=i.FillRuleType.EVEN_ODD}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm,this.endPoint.fromJSON(t.e),this.gradientColors.fromJSON(t.g),this.gradientType=t.t,this.opacity.fromJSON(t.o),this.startPoint.fromJSON(t.s),this.fillRule=t.r,this.gradientType===i.GradientFillType.RADIAL&&(this.highlightAngle.fromJSON(t.a),this.highlightLength.fromJSON(t.h)),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,e:this.endPoint,g:this.gradientColors,t:this.gradientType,a:this.highlightAngle,h:this.highlightLength,o:this.opacity,r:this.fillRule,s:this.startPoint}}}class k extends y{constructor(){super(...arguments);this.type=i.ShapeType.MERGE,this.mergeMode=1}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.mergeMode=t.mm,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,mm:this.mergeMode}}}class G extends y{constructor(){super(...arguments);this.type=i.ShapeType.PATH,this.vertices=new a(this,i.PropertyType.SHAPE)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.itemIndex=t.ind,this.shapeIndex=t.ix,this.direction=t.d,this.vertices=t.ks,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,ind:this.itemIndex,ix:this.shapeIndex,d:this.direction,ks:this.vertices}}}class B extends y{constructor(){super(...arguments);this.type=i.ShapeType.RECTANGLE,this.position=new a(this,i.PropertyType.POSITION),this.roundness=new a(this,i.PropertyType.ROUNDNESS),this.size=new a(this,i.PropertyType.SIZE)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.direction=t.d,this.position.fromJSON(t.p),this.roundness.fromJSON(t.r),this.size.fromJSON(t.s),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,d:this.direction,p:this.position,r:this.roundness,s:this.size}}}var F=Object.assign;class V extends y{constructor(){super(...arguments);this.type=i.ShapeType.STAR,this.position=new a(this,i.PropertyType.POSITION),this.innerRadius=new a(this,i.PropertyType.NUMBER),this.innerRoundness=new a(this,i.PropertyType.NUMBER),this.outerRadius=new a(this,i.PropertyType.NUMBER),this.outerRoundness=new a(this,i.PropertyType.NUMBER),this.rotation=new a(this,i.PropertyType.ROTATION),this.points=new a(this,i.PropertyType.NUMBER),this.starType=i.StarType.STAR}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.position.fromJSON(t.p),t.sy===1&&(this.innerRadius.fromJSON(t.ir),this.innerRoundness.fromJSON(t.is)),this.outerRadius.fromJSON(t.or),this.outerRoundness.fromJSON(t.os),this.rotation.fromJSON(t.r),this.points.fromJSON(t.pt),this.starType=t.sy,this.direction=t.d,this}toJSON(){return F(F(F({ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,p:this.position},this.starType===1&&{ir:this.innerRadius}),this.starType===1&&{is:this.innerRoundness}),{or:this.outerRadius,os:this.outerRoundness,r:this.rotation,pt:this.points,sy:this.starType,d:this.direction})}}class Y extends y{constructor(){super(...arguments);this.type=i.ShapeType.STROKE,this.blendMode=i.BlendMode.NORMAL,this.color=new a(this,i.PropertyType.COLOR),this.lineCapType=i.LineCapType.ROUND,this.lineJoinType=i.LineJoinType.ROUND,this.opacity=new a(this,i.PropertyType.OPACITY,[new p(0,100)]),this.width=new a(this,i.PropertyType.STROKE_WIDTH)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm in i.BlendMode?t.bm:i.BlendMode.NORMAL,this.color.fromJSON(t.c),this.lineCapType=t.lc in i.LineCapType?t.lc:i.LineCapType.ROUND,this.lineJoinType=t.lj in i.LineJoinType?t.lj:i.LineJoinType.ROUND,this.miterLimit=t.ml,this.opacity.fromJSON(t.o),this.width.fromJSON(t.w),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,c:this.color,lc:this.lineCapType,lj:this.lineJoinType,ml:this.miterLimit,o:this.opacity,w:this.width}}}class K extends y{constructor(){super(...arguments);this.type=i.ShapeType.TRIM,this.blendMode=i.BlendMode.NORMAL,this.trimEnd=new a(this,i.PropertyType.NUMBER),this.trimOffset=new a(this,i.PropertyType.NUMBER),this.trimStart=new a(this,i.PropertyType.NUMBER),this.trimMultipleShapes=i.TrimMode.SIMULTANEOUSLY}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm in i.BlendMode?t.bm:i.BlendMode.NORMAL,this.trimEnd.fromJSON(t.e),this.trimOffset.fromJSON(t.o),this.trimStart.fromJSON(t.s),this.trimMultipleShapes=t.m in i.TrimMode?t.m:i.TrimMode.INDIVIDUALLY,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,e:this.trimEnd,o:this.trimOffset,s:this.trimStart,m:this.trimMultipleShapes}}}var Et=Object.assign;class z extends y{constructor(){super(...arguments);this.type=i.ShapeType.GROUP,this.blendMode=i.BlendMode.NORMAL,this.isHidden=!1,this.numProperties=0,this.transform=new C,this.shapes=[]}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm,this.contentPropertyIndex=t.cix,this.propertyIndex=t.ix,this.numProperties=t.np,this.shapes=t.it.map(s=>{try{if(s.ty!=="tr"){const r=this.createShape(s.ty);return r.fromJSON(s)}this.transform.fromJSON(s)}catch(r){}return!1}).filter(Boolean),this}createShape(t){if(t===i.ShapeType.PATH)return new G(this);if(t===i.ShapeType.GROUP)return new z(this);if(t===i.ShapeType.FILL)return new U(this);if(t===i.ShapeType.RECTANGLE)return new B(this);if(t===i.ShapeType.ELLIPSE)return new _(this);if(t===i.ShapeType.STROKE)return new Y(this);if(t===i.ShapeType.GRADIENT_FILL)return new H(this);if(t===i.ShapeType.TRIM)return new K(this);if(t===i.ShapeType.MERGE)return new k(this);if(t===i.ShapeType.STAR)return new V(this);throw new Error(`Invalid or unknown shape type: ${t}`)}addShape(t){return t instanceof y||(t=this.createShape(t)),this.shapes.push(t),t}toJSON(){const t=JSON.parse(JSON.stringify(this.shapes));return t.push(Et({ty:"tr",nm:"Transform"},this.transform.toJSON())),{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,cix:this.contentPropertyIndex,it:t,ix:this.propertyIndex,np:this.numProperties}}}class wt extends y{constructor(){super(...arguments);this.type=i.ShapeType.GRADIENT_STROKE,this.blendMode=i.BlendMode.NORMAL,this.endPoint=new a(this,i.PropertyType.POSITION),this.gradientColors=new M,this.gradientType=i.GradientFillType.LINEAR,this.highlightAngle=new a(this,i.PropertyType.NUMBER),this.highlightLength=new a(this,i.PropertyType.NUMBER),this.opacity=new a(this,i.PropertyType.OPACITY),this.startPoint=new a(this,i.PropertyType.POSITION),this.lineCapType=i.LineCapType.ROUND,this.lineJoinType=i.LineJoinType.ROUND,this.width=new a(this,i.PropertyType.STROKE_WIDTH)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.blendMode=t.bm,this.opacity.fromJSON(t.o),this.endPoint.fromJSON(t.e),this.gradientColors.fromJSON(t.g),this.gradientType=t.t,this.startPoint.fromJSON(t.s),this.gradientType===i.GradientFillType.RADIAL&&(this.highlightAngle.fromJSON(t.a),this.highlightLength.fromJSON(t.h)),this.lineCapType=t.lc in i.LineCapType?t.lc:i.LineCapType.ROUND,this.lineJoinType=t.lj in i.LineJoinType?t.lj:i.LineJoinType.ROUND,this.miterLimit=t.ml,this.width.fromJSON(t.w),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,bm:this.blendMode,o:this.opacity,e:this.endPoint,g:this.gradientColors,t:this.gradientType,a:this.highlightAngle,h:this.highlightLength,s:this.startPoint,lc:this.lineCapType,lj:this.lineJoinType,ml:this.miterLimit,w:this.width}}}class Rt extends y{constructor(){super(...arguments);this.type=i.ShapeType.REPEATER,this.anchor=new a(this,i.PropertyType.ANCHOR),this.startOpacity=new a(this,i.PropertyType.OPACITY),this.endOpacity=new a(this,i.PropertyType.OPACITY),this.position=new a(this,i.PropertyType.POSITION),this.rotation=new a(this,i.PropertyType.ROTATION),this.scale=new a(this,i.PropertyType.SCALE),this.shapes=[],this.skew=new a(this,i.PropertyType.SKEW),this.skewAxis=new a(this,i.PropertyType.SKEW_AXIS),this.copies=new a(this,i.PropertyType.NUMBER),this.offset=new a(this,i.PropertyType.NUMBER),this.composition=i.RepeaterComposite.ABOVE}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.copies.fromJSON(t.c),this.composition=t.m,this.offset.fromJSON(t.o),this.anchor.fromJSON(t.tr.a),this.startOpacity.fromJSON(t.tr.so),this.endOpacity.fromJSON(t.tr.eo),this.position.fromJSON(t.tr.p),this.rotation.fromJSON(t.tr.r),this.scale.fromJSON(t.tr.s),t.tr.sk&&this.skew.fromJSON(t.tr.sk),t.tr.sa&&this.skewAxis.fromJSON(t.tr.sa),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,m:this.composition,c:this.copies,o:this.offset,tr:{a:this.anchor,so:this.startOpacity,eo:this.endOpacity,p:this.position,r:this.rotation,s:this.scale,sk:this.skew,sa:this.skewAxis}}}}class At extends y{constructor(){super(...arguments);this.type=i.ShapeType.ROUNDED_CORNERS,this.roundness=new a(this,i.PropertyType.NUMBER)}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this.roundness.fromJSON(t.r),this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name,r:this.roundness}}}var It=Object.assign;class v extends E{constructor(){super(...arguments);this.type=i.LayerType.SHAPE,this.shapes=[]}createShape(t){if(t===i.ShapeType.PATH)return new G(this);if(t===i.ShapeType.GROUP)return new z(this);if(t===i.ShapeType.FILL)return new U(this);if(t===i.ShapeType.RECTANGLE)return new B(this);if(t===i.ShapeType.ELLIPSE)return new _(this);if(t===i.ShapeType.STROKE)return new Y(this);if(t===i.ShapeType.GRADIENT_FILL)return new H(this);if(t===i.ShapeType.TRIM)return new K(this);if(t===i.ShapeType.MERGE)return new k(this);if(t===i.ShapeType.STAR)return new V(this);throw new Error(`Invalid or unknown shape type: ${t}`)}addShape(t){return t instanceof y||(t=this.createShape(t)),this.shapes.push(t),t}createShapeFromJSON(t){try{const s=this.createShape(t.ty);return s.fromJSON(t)}catch(s){throw new Error(`Unable to create shape from JSON: ${t.ty}`)}}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,this.classNames="cl"in t?t.cl.split(" "):[],this.transform.fromJSON(t.ks),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.shapes=t.shapes.map(s=>this.createShapeFromJSON(s)).filter(Boolean),this}toJSON(){var t;return{ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:It({},this.transform.toJSON()),shapes:this.shapes.map(s=>s.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sr:this.timeStretch,st:this.startTime,ty:this.type,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0}}}var Pt=Object.assign;class st extends E{constructor(){super(...arguments);this.type=i.LayerType.SOLID,this.solidColor="#000000",this.solidHeight=1,this.solidWidth=1}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this.solidColor=t.sc,this.solidHeight=t.sh,this.solidWidth=t.sw,this}toJSON(){var t;return{ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:Pt({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sc:this.solidColor,sh:this.solidHeight,sw:this.solidWidth,sr:this.timeStretch,st:this.startTime,ty:this.type,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0}}}var bt=Object.assign;class rt extends E{constructor(){super(...arguments);this.type=i.LayerType.TEXT}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,this.effects=t.ef,this.height=t.h,this.id=t.ln,this.index=t.ind,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.parent=t.parent,this.startTime=t.st,this.timeStretch=t.sr,this.width=t.w,"cl"in t&&(this.classNames=t.cl.split(" ")),"tt"in t&&(this.matteMode=t.tt),"td"in t&&(this.matteTarget=t.td),"hd"in t&&(this.isHidden=t.hd),"mn"in t&&(this.matchName=t.mn),this.transform.fromJSON(t.ks),this.textData=t.t,this}toJSON(){var t;return{ty:this.type,ao:this.autoOrient?1:0,bm:this.blendMode,cl:this.classNames.length?this.classNames.join(" "):void 0,ddd:this.is3D?1:0,ef:this.effects,h:this.height,ind:this.index,ip:this.inPoint,ks:bt({},this.transform.toJSON()),ln:this.id,nm:this.name,mn:this.matchName,op:this.outPoint,parent:(t=this.parent)==null?void 0:t.index,sr:this.timeStretch,st:this.startTime,w:this.width,tt:this.matteMode,td:this.matteTarget,hd:this.isHidden!==void 0?Number(this.isHidden):void 0,t:this.textData}}}class ht{constructor(){this.comment="",this.duration=0,this.time=0}fromJSON(t){return this.comment=t.cm,this.duration=t.dr,this.time=t.tm,this}toJSON(){return{cm:this.comment,dr:this.duration,tm:this.time}}}function nt(t){let s=(+t[0]).toString(16),r=(+t[1]).toString(16),n=(+t[2]).toString(16),l=Math.round(+t[3]*255).toString(16);return s.length==1&&(s="0"+s),r.length==1&&(r="0"+r),n.length==1&&(n="0"+n),l.length==1&&(l="0"+l),"#"+s+r+n+l}function Jt(t,s){const r=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),l=parseInt(t.slice(5,7),16);return s?[r/255,n/255,l/255,s]:[r/255,n/255,l/255]}class at{constructor(t){this.keywords=[],this.generator="@lottiefiles/lottie-js 0.3.5",this.parent=t}fromJSON(t){return this.author=t.a,this.keywords="k"in t?t.k.split(",").map(s=>s.trim()):[t.k],this.generator=t.g,this.description=t.d,this.themeColor=t.tc,this}toJSON(){return{a:this.author,k:this.keywords.length?this.keywords:void 0,g:this.generator,d:this.description,tc:this.themeColor}}}var vt=Object.assign,Lt=(t,s,r)=>new Promise((n,l)=>{var d=T=>{try{N(r.next(T))}catch(I){l(I)}},f=T=>{try{N(r.throw(T))}catch(I){l(I)}},N=T=>T.done?n(T.value):Promise.resolve(T.value).then(d,f);N((r=r.apply(t,s)).next())});class X{constructor(){this.assets=[],this.frameRate=60,this.height=0,this.inPoint=0,this.is3D=!1,this.layers=[],this.markers=[],this.meta=new at(this),this.name="",this.outPoint=0,this.version="",this.width=0,this.fonts=new Ot}static fromURL(t){return Lt(this,null,function*(){if(typeof t!="string")throw new Error("The url value must be a string");let s;try{const n=new URL(t),l=yield yt(n.toString());s=yield l.json()}catch(n){throw new Error("An error occurred while trying to load the Lottie file from URL")}const r=new X;return r.fromJSON(s)})}static isLottie(t){const s=["v","ip","op","layers","fr","w","h"];return s.every(r=>Object.prototype.hasOwnProperty.call(t,r))}get colors(){const t=new Set;return[...R().keys()].filter(s=>s.type===i.PropertyType.COLOR).forEach(s=>{s.values.forEach(r=>{t.add(JSON.stringify(r.value))})}),Array.from(t).map(s=>J.fromJSON(JSON.parse(s)))}get colorsVerbose(){const t={};return[...R().keys()].filter(s=>s.type===i.PropertyType.COLOR).forEach((s,r)=>{const n=s.getParent(),l=this.parentPath(n),d=l.slice();s.values.forEach(f=>{d.unshift("Frame "+f.frame),d.unshift(r.toString());const N=f.value;t[d.join(".")]=nt([Math.round(N[0]*255),Math.round(N[1]*255),Math.round(N[2]*255),N[3]])})}),t}get textLayers(){const t={},s=this.getLayersByType(i.LayerType.TEXT);return s.forEach((r,n)=>{t[n+"."+r.name]=r.textData.d.k[0].s.t}),t}parentPath(t,s=[]){return t.parent===void 0?(s.push(t.name),s):(s.push(t.name),this.parentPath(t.parent,s))}get duration(){return this.totalFrames/this.frameRate}get fileSize(){return new TextEncoder().encode(JSON.stringify(this)).length}get totalFrames(){return this.outPoint-this.inPoint}createAsset(t){if(t===i.AssetType.PRECOMPOSITION)return new x(this);if(t===i.AssetType.IMAGE)return new Q(this);throw new Error(`Invalid or unknown asset type ${t}`)}createAssetFromJSON(t){try{const s=this.createAsset("layers"in t?i.AssetType.PRECOMPOSITION:i.AssetType.IMAGE);return s.fromJSON(t)}catch(s){throw new Error("Unable to create asset from JSON")}}createLayer(t){if(t===i.LayerType.PRECOMPOSITION)return new it(this);if(t===i.LayerType.SHAPE)return new v(this);if(t===i.LayerType.GROUP)return new j(this);if(t===i.LayerType.SOLID)return new st(this);if(t===i.LayerType.IMAGE)return new tt(this);if(t===i.LayerType.TEXT)return new rt(this);throw new Error(`Invalid or unknown layer type: ${t}`)}createLayerFromJSON(t){try{const s=this.createLayer(t.ty);return s.fromJSON(t)}catch(s){throw console.log(s),new Error(`Unable to create layer type from JSON: ${t.ty}`)}}createLayersFromJSONArray(t){const s=new Map,r=[],n=[];return t.forEach(l=>{const d=this.createLayerFromJSON(l);d&&(l.parent!==void 0&&r.push([d,l.parent]),d.index!==void 0&&s.set(d.index,d),n.push(d))}),r.forEach(([l,d])=>{l.parent=s.get(d)}),n}createMarker(){return new ht}createMarkerFromJSON(t){try{const s=this.createMarker();return s.fromJSON(t)}catch(s){throw console.log(s),new Error("Unable to create marker from JSON")}}fromJSON(t){if(X.isLottie(t)===!1)throw new Error("The given object is not a valid Lottie JSON structure");return this.frameRate=t.fr,this.height=t.h,this.inPoint=t.ip,this.is3D=t.ddd,this.name=t.nm,this.outPoint=t.op,this.version=t.v,this.width=t.w,this.assets=t.assets.map(s=>this.createAssetFromJSON(s)).filter(Boolean),this.layers=this.createLayersFromJSONArray(t.layers),this.markers=t.markers.map(s=>this.createMarkerFromJSON(s)).filter(Boolean),"meta"in t&&this.meta.fromJSON(t.meta),"fonts"in t&&this.fonts.fromJSON(t.fonts),this}getLayerById(t){if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.find(s=>s.id===t)}getShapeById(t){let s=null;if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.forEach(r=>{r instanceof v&&r.shapes.forEach(n=>{if(n.id===t){s=n;return}})}),s}getShapesByClassName(t){const s=[];if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.forEach(r=>{r instanceof v&&r.shapes.forEach(n=>{var l;((l=n.classNames)==null?void 0:l.includes(t))&&s.push(n)})}),s}getLayersByClassName(t){if(typeof t!="string")throw new Error("Class name value must be a string");return this.layers.filter(s=>s.classNames.includes(t))}getLayersByType(t){if(t in i.LayerType===!1)throw new Error("Type value must be a valid LayerType value");return this.layers.filter(s=>s.type===t)}toJSON(t){return t?void 0:vt({assets:this.assets,ddd:this.is3D?1:0,fr:this.frameRate,h:this.height,ip:this.inPoint,layers:this.layers.map(s=>s.toJSON()),markers:this.markers.map(s=>s.toJSON()),meta:this.meta,nm:this.name,op:this.outPoint,v:this.version||"5.6.0",w:this.width},this.fonts.list.length>0&&{fonts:this.fonts.toJSON()})}}class Dt{constructor(){this.isInverted=!1,this.name="",this.mode=i.MaskMode.Add}fromJSON(t){return this.isInverted=t.inv,this.mode=t.mode,this.name=t.nm,this.points=t.pt,this.opacity=t.o,this}toJSON(){return{inv:this.isInverted,mode:this.mode,nm:this.name,o:this.opacity,pt:this.points}}}i.Animation=X,i.Asset=g,i.Color=J,i.ColorRgb=A,i.ColorRgba=D,i.EllipseShape=_,i.FillShape=U,i.Gradient=M,i.GradientFillShape=H,i.GradientStop=et,i.GradientStrokeShape=wt,i.GroupLayer=j,i.GroupShape=z,i.ImageAsset=Q,i.ImageLayer=tt,i.KeyFrame=p,i.Layer=E,i.Marker=ht,i.Mask=Dt,i.MergeShape=k,i.Meta=at,i.PathShape=G,i.PrecompositionAsset=x,i.PrecompositionLayer=it,i.Property=a,i.RectangleShape=B,i.RepeaterShape=Rt,i.RoundedCornersShape=At,i.Shape=y,i.ShapeLayer=v,i.SolidLayer=st,i.StarShape=V,i.StrokeShape=Y,i.TextLayer=rt,i.Transform=C,i.TrimShape=K,i.hexToRgba=Jt,i.rgbaToHex=nt,i.useRegistry=R,Object.defineProperty(i,"__esModule",{value:!0})});
//# sourceMappingURL=index.umd.js.map
{
"name": "@lottiefiles/lottie-js",
"version": "0.3.3",
"version": "0.3.5",
"description": "Lottie JSON model for Javascript/Typescript",

@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc