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.9 to 0.4.0

190

dist/index.d.ts

@@ -102,3 +102,5 @@ declare abstract class Asset {

declare enum PropertyType {
AMOUNT = "am",
ANCHOR = "a",
ANGLE = "an",
OPACITY = "o",

@@ -125,3 +127,20 @@ POSITION = "p",

GRADIENT = "gr",
EFFECT_VALUE = "v"
EFFECT_VALUE = "v",
TEXT_DATA = "d",
TEXT_ALIGNMENT = "ta",
MAX_EASE = "xe",
MIN_EASE = "ne",
MAX_AMOUNT = "ma",
RANGE_UNITS = "rn",
OFFSET = "of",
EXPRESSION_SELECTOR = "sm",
START = "st",
END = "e",
SATURATION = "fs",
HUE = "fh",
BRIGHTNESS = "fb",
TEXT_TRACKING = "t",
CENTER = "cn",
RADIUS = "ra",
DISTANCE = "ds"
}

@@ -144,3 +163,5 @@

TRIM = "tm",
TWIST = "tw"
TWIST = "tw",
PUCKER_BLOAT = "pb",
ZIG_ZAG = "zz"
}

@@ -202,2 +223,41 @@

declare enum TextCaps {
REGULAR = 0,
ALL_CAPS = 1,
SMALL_CAPS = 2
}
declare enum TextGrouping {
CHARACTERS = 1,
WORD = 2,
LINE = 3,
ALL = 4
}
declare enum TextJustify {
LEFT = 0,
RIGHT = 1,
CENTER = 2,
JUSTIFY_LAST_LINE_LEFT = 3,
JUSTIFY_LAST_LINE_RIGHT = 4,
JUSTIFY_LAST_LINE_CENTER = 5,
JUSTIFY_LAST_LINE_FULL = 6
}
declare enum TextBased {
CHARACTERS = 1,
CHARACTER_EXCLUDING_SPACES = 2,
WORDS = 3,
LINES = 4
}
declare enum TextShape {
SQUARE = 1,
RAMP_UP = 2,
RAMP_DOWN = 3,
TRIANGLE = 4,
ROUND = 5,
SMOOTH = 6
}
interface Value {

@@ -209,3 +269,6 @@ toJSON(): any;

protected abstract toRgbArray(): number[];
protected abstract toRgbArrayWebsafe(): number[];
abstract websafeColors(): void;
toJSON(): number[];
toJSONWebsafe(): number[];
static fromJSON(json: number[]): Color;

@@ -218,3 +281,5 @@ }

constructor(r: number, g: number, b: number);
websafeColors(): void;
protected toRgbArray(): number[];
protected toRgbArrayWebsafe(): number[];
static fromJSON(json: number[]): ColorRgb;

@@ -225,6 +290,24 @@ }

constructor(r: number, g: number, b: number, a?: number);
websafeColors(): void;
protected toRgbArray(): number[];
protected toRgbArrayWebsafe(): number[];
static fromJSON(json: number[]): ColorRgba;
}
declare class TextDocument implements Value {
fontFamily: string;
fontColor: Color;
fontSize: number;
text: string;
lineHeight?: number;
boxSize?: [number, number];
justify?: TextJustify;
textCaps?: TextCaps;
textTracking?: number;
strokeColor?: Color;
strokeWidth?: number;
static fromJSON(json: Record<string, any>): TextDocument;
toJSON(): any;
}
declare class KeyFrame {

@@ -305,3 +388,3 @@ frame: number;

index: number;
value: Property;
value?: Property | number;
type: EffectValueType;

@@ -560,2 +643,35 @@ constructor(type: EffectValueType);

declare class OffsetPathShape extends Shape {
readonly type = ShapeType.OFFSET_PATH;
amount: Property;
lineJoin: LineJoinType;
miterLimit: Property;
fromJSON(json: Record<string, any>): OffsetPathShape;
toJSON(): Record<string, any>;
}
declare class PuckerBloatShape extends Shape {
readonly type = ShapeType.PUCKER_BLOAT;
amount: Property;
fromJSON(json: Record<string, any>): PuckerBloatShape;
toJSON(): Record<string, any>;
}
declare class TwistShape extends Shape {
readonly type = ShapeType.TWIST;
angle: Property;
center: Property;
fromJSON(json: Record<string, any>): TwistShape;
toJSON(): Record<string, any>;
}
declare class ZigZagShape extends Shape {
readonly type = ShapeType.ZIG_ZAG;
radius: Property;
distance: Property;
numberOfRidges: Property;
fromJSON(json: Record<string, any>): ZigZagShape;
toJSON(): Record<string, any>;
}
declare class ShapeLayer extends Layer {

@@ -580,5 +696,68 @@ readonly type = LayerType.SHAPE;

declare class TextSelector {
startTime: number;
randomize: boolean;
textShape: TextShape;
basedOn: TextBased;
maxEase: Property;
minEase: Property;
maxAmount: Property;
rangeUnits?: number;
offset?: Property;
expressionSelector?: Property;
start?: Property;
end?: Property;
fromJSON(json: Record<string, any>): TextSelector;
toJSON(): Record<string, any>;
}
declare class TextTransform {
anchor?: Property;
opacity?: Property;
position?: Property;
rotation?: Property;
scale?: Property;
skew?: Property;
skewAxis?: Property;
rotationX?: Property;
rotationY?: Property;
strokeWidth?: Property;
strokeColor?: Property;
fillColor?: Property;
fillSaturation?: Property;
fillHue?: Property;
fillBrightness?: Property;
tracking?: Property;
fromJSON(json: Record<string, any>): this;
toJSON(): Record<string, any>;
}
declare class TextAnimator {
name: string;
transform: TextTransform;
selector: TextSelector;
fromJSON(json: Record<string, any>): TextAnimator;
toJSON(): Record<string, any>;
}
declare class TextOptions {
alignment: Property;
grouping: TextGrouping;
fromJSON(json: Record<string, any>): TextOptions;
toJSON(): Record<string, any>;
}
declare class TextData {
textDocument: Property;
textOptions: TextOptions;
maskedPath: any;
textAnimators: TextAnimator[];
fromJSON(json: Record<string, any>): TextData;
createTextAnimator(json: Record<string, any>): TextAnimator;
toJSON(): Record<string, any>;
}
declare class TextLayer extends Layer {
readonly type = LayerType.TEXT;
textData?: any;
textData?: TextData;
fromJSON(json: Record<string, any>): TextLayer;

@@ -693,3 +872,4 @@ toJSON(): Record<string, any>;

declare function hexToRgba(hex: string, alpha: number | null): number[];
declare function websafeColors(colors: Color[]): Color[];
export { Animation, Asset, AssetType, BlendMode, Color, ColorRgb, ColorRgba, EffectType, EffectValueType, EllipseShape, FillRuleType, FillShape, Gradient, GradientFillShape, GradientFillType, GradientStop, GradientStrokeShape, GradientStrokeType, GroupLayer, GroupShape, ImageAsset, ImageLayer, KeyFrame, Layer, LayerType, LineCapType, LineJoinType, Marker, Mask, MaskMode, MatteMode, MergeShape, Meta, PathShape, PrecompositionAsset, PrecompositionLayer, Property, PropertyType, RectangleShape, RepeaterComposite, RepeaterShape, RoundedCornersShape, Shape, ShapeLayer, ShapeType, SolidLayer, StarShape, StarType, StrokeShape, TextLayer, Transform, TrimMode, TrimShape, Value, hexToRgba, rgbaToHex, useRegistry };
export { Animation, Asset, AssetType, BlendMode, Character, Color, ColorRgb, ColorRgba, Effect, EffectType, EffectValue, EffectValueType, EllipseShape, FillRuleType, FillShape, Font, FontList, Gradient, GradientFillShape, GradientFillType, GradientStop, GradientStrokeShape, GradientStrokeType, GroupLayer, GroupShape, ImageAsset, ImageLayer, KeyFrame, Layer, LayerType, LineCapType, LineJoinType, Marker, Mask, MaskMode, MatteMode, MergeShape, Meta, OffsetPathShape, PathShape, PrecompositionAsset, PrecompositionLayer, Property, PropertyType, PuckerBloatShape, RectangleShape, RepeaterComposite, RepeaterShape, RoundedCornersShape, Shape, ShapeLayer, ShapeType, SolidLayer, StarShape, StarType, StrokeShape, TextAnimator, TextBased, TextCaps, TextData, TextDocument, TextGrouping, TextJustify, TextLayer, TextOptions, TextSelector, TextShape, TextTransform, Transform, TrimMode, TrimShape, TwistShape, Value, ZigZagShape, hexToRgba, rgbaToHex, useRegistry, websafeColors };

6

dist/index.umd.js
/*!
* @lottiefiles/lottie-js - v0.3.9
* Compiled Wed, 30 Mar 2022 08:38:45 UTC
* @lottiefiles/lottie-js - v0.4.0
* Compiled Wed, 13 Apr 2022 12:08:26 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 V 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,id: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 K 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 pt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Tt(t,e,s){return s={path:e,exports:{},require:function(n,u){return gt(n,u??s.path)}},t(s,s.exports),s.exports}function gt(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Et=Tt(function(t,e){var s=function(n){function u(){this.fetch=!1,this.DOMException=n.DOMException}return u.prototype=n,new u}(typeof self!="undefined"?self:pt);(function(n){var u=function(l){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(r){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function N(r){return r&&DataView.prototype.isPrototypeOf(r)}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(r){return r&&T.indexOf(Object.prototype.toString.call(r))>-1};function P(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(r))throw new TypeError("Invalid character in header field name");return r.toLowerCase()}function dt(r){return typeof r!="string"&&(r=String(r)),r}function G(r){var h={next:function(){var o=r.shift();return{done:o===void 0,value:o}}};return f.iterable&&(h[Symbol.iterator]=function(){return h}),h}function m(r){this.map={},r instanceof m?r.forEach(function(h,o){this.append(o,h)},this):Array.isArray(r)?r.forEach(function(h){this.append(h[0],h[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(h){this.append(h,r[h])},this)}m.prototype.append=function(r,h){r=P(r),h=dt(h);var o=this.map[r];this.map[r]=o?o+", "+h:h},m.prototype.delete=function(r){delete this.map[P(r)]},m.prototype.get=function(r){return r=P(r),this.has(r)?this.map[r]:null},m.prototype.has=function(r){return this.map.hasOwnProperty(P(r))},m.prototype.set=function(r,h){this.map[P(r)]=dt(h)},m.prototype.forEach=function(r,h){for(var o in this.map)this.map.hasOwnProperty(o)&&r.call(h,this.map[o],o,this)},m.prototype.keys=function(){var r=[];return this.forEach(function(h,o){r.push(o)}),G(r)},m.prototype.values=function(){var r=[];return this.forEach(function(h){r.push(h)}),G(r)},m.prototype.entries=function(){var r=[];return this.forEach(function(h,o){r.push([o,h])}),G(r)},f.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function B(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function St(r){return new Promise(function(h,o){r.onload=function(){h(r.result)},r.onerror=function(){o(r.error)}})}function Ct(r){var h=new FileReader,o=St(h);return h.readAsArrayBuffer(r),o}function _t(r){var h=new FileReader,o=St(h);return h.readAsText(r),o}function Ut(r){for(var h=new Uint8Array(r),o=new Array(h.length),S=0;S<h.length;S++)o[S]=String.fromCharCode(h[S]);return o.join("")}function Nt(r){if(r.slice)return r.slice(0);var h=new Uint8Array(r.byteLength);return h.set(new Uint8Array(r)),h.buffer}function yt(){return this.bodyUsed=!1,this._initBody=function(r){this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:f.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:f.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():f.arrayBuffer&&f.blob&&N(r)?(this._bodyArrayBuffer=Nt(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||I(r))?this._bodyArrayBuffer=Nt(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="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(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var r=B(this);if(r)return r;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?B(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Ct)}),this.text=function(){var r=B(this);if(r)return r;if(this._bodyBlob)return _t(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ut(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(Ft)}),this.json=function(){return this.text().then(JSON.parse)},this}var Mt=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function kt(r){var h=r.toUpperCase();return Mt.indexOf(h)>-1?h:r}function R(r,h){h=h||{};var o=h.body;if(r instanceof R){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,h.headers||(this.headers=new m(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!o&&r._bodyInit!=null&&(o=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new m(h.headers)),this.method=kt(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)}R.prototype.clone=function(){return new R(this,{body:this._bodyInit})};function Ft(r){var h=new FormData;return r.trim().split("&").forEach(function(o){if(o){var S=o.split("="),O=S.shift().replace(/\+/g," "),c=S.join("=").replace(/\+/g," ");h.append(decodeURIComponent(O),decodeURIComponent(c))}}),h}function Ht(r){var h=new m,o=r.replace(/\r?\n[\t ]+/g," ");return o.split(/\r?\n/).forEach(function(S){var O=S.split(":"),c=O.shift().trim();if(c){var D=O.join(":").trim();h.append(c,D)}}),h}yt.call(R.prototype);function p(r,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 m(h.headers),this.url=h.url||"",this._initBody(r)}yt.call(p.prototype),p.prototype.clone=function(){return new p(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},p.error=function(){var r=new p(null,{status:0,statusText:""});return r.type="error",r};var Gt=[301,302,303,307,308];p.redirect=function(r,h){if(Gt.indexOf(h)===-1)throw new RangeError("Invalid status code");return new p(null,{status:h,headers:{location:r}})},l.DOMException=n.DOMException;try{new l.DOMException}catch(r){l.DOMException=function(h,o){this.message=h,this.name=o;var S=Error(h);this.stack=S.stack},l.DOMException.prototype=Object.create(Error.prototype),l.DOMException.prototype.constructor=l.DOMException}function W(r,h){return new Promise(function(o,S){var O=new R(r,h);if(O.signal&&O.signal.aborted)return S(new l.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function D(){c.abort()}c.onload=function(){var J={status:c.status,statusText:c.statusText,headers:Ht(c.getAllResponseHeaders()||"")};J.url="responseURL"in c?c.responseURL:J.headers.get("X-Request-URL");var Y="response"in c?c.response:c.responseText;o(new p(Y,J))},c.onerror=function(){S(new TypeError("Network request failed"))},c.ontimeout=function(){S(new TypeError("Network request failed"))},c.onabort=function(){S(new l.DOMException("Aborted","AbortError"))},c.open(O.method,O.url,!0),O.credentials==="include"?c.withCredentials=!0:O.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&f.blob&&(c.responseType="blob"),O.headers.forEach(function(J,Y){c.setRequestHeader(Y,J)}),O.signal&&(O.signal.addEventListener("abort",D),c.onreadystatechange=function(){c.readyState===4&&O.signal.removeEventListener("abort",D)}),c.send(typeof O._bodyInit=="undefined"?null:O._bodyInit)})}return W.polyfill=!0,n.fetch||(n.fetch=W,n.Headers=m,n.Request=R,n.Response=p),l.Headers=m,l.Request=R,l.Response=p,l.fetch=W,l}({})})(s),delete s.fetch.polyfill,e=s.fetch,e.default=s.fetch,e.fetch=s.fetch,e.Headers=s.Headers,e.Request=s.Request,e.Response=s.Response,t.exports=e});(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.POINTS="pt",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",t.EFFECT_VALUE="v"}(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={})),function(t){t[t.NONE=0]="NONE",t[t.CUSTOM=5]="CUSTOM",t[t.PAINT_OVER_TRANSPARENT=7]="PAINT_OVER_TRANSPARENT",t[t.TINT=20]="TINT",t[t.FILL=21]="FILL",t[t.STROKE=22]="STROKE",t[t.TRITONE=23]="TRITONE",t[t.PRO_LEVELS=24]="PRO_LEVELS",t[t.DROP_SHADOW=25]="DROP_SHADOW",t[t.RADIAL_WIPE=26]="RADIAL_WIPE",t[t.DISPLACEMENT_MAP=27]="DISPLACEMENT_MAP",t[t.MATTE3=28]="MATTE3",t[t.GAUSSIAN_BLUR=29]="GAUSSIAN_BLUR",t[t.MESH_WRAP=31]="MESH_WRAP",t[t.WAVY=32]="WAVY",t[t.SPHERIZE=33]="SPHERIZE",t[t.PUPPET=34]="PUPPET"}(i.EffectType||(i.EffectType={})),function(t){t[t.SLIDER=0]="SLIDER",t[t.ANGLE=1]="ANGLE",t[t.COLOR=2]="COLOR",t[t.POINT=3]="POINT",t[t.CHECKBOX=4]="CHECKBOX",t[t.IGNORED=6]="IGNORED",t[t.DROPDOWN=7]="DROPDOWN",t[t.LAYER=10]="LAYER"}(i.EffectValueType||(i.EffectValueType={}));class y{constructor(t=0,e=0){this.frame=0,this.value=0,this.frameInTangent=[0,0],this.frameOutTangent=[1,1],this.hold=!1,this.frame=t,this.value=e}fromJSON(t,e=void 0){this.frame=t.t,e===void 0?this.value=t.s:this.value=e.fromJSON(t.s);const s="i"in t&&"o"in t,n="ti"in t&&"to"in t;return this.frameInTangent=s?[t.i.x,t.i.y]:void 0,this.frameOutTangent=s?[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 Rt=new Map;function A(){return Rt}class L{toJSON(){return this.toRgbArray()}static fromJSON(t){return t.length>3?C.fromJSON(t):t.length==3?w.fromJSON(t):new w(0,0,0)}}class w extends L{constructor(t,e,s){super();this.r=t,this.g=e,this.b=s}toRgbArray(){return[this.r,this.g,this.b]}static fromJSON(t){return new w(t[0],t[1],t[2])}}class C extends w{constructor(t,e,s,n=1){super(t,e,s);this.a=n}toRgbArray(){return[this.r,this.g,this.b,this.a]}static fromJSON(t){return new C(t[0],t[1],t[2],t[3])}}class a{constructor(t,e,s=[]){this.UID=0,this.isAnimated=!1,this.values=[],this._parent=t,this.type=e,this.values=s,this.isAnimated=s.length>1,A().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 e;return this.type==i.PropertyType.COLOR&&(e=L),this.values=this.isAnimated?t.k.map(s=>new y().fromJSON(s,e)):[new y().fromJSON({t:0,s:t.k},e)],this.type===i.PropertyType.COLOR&&(this.maxColors="p"in t?t.p:void 0),this}toJSON(){let t;const e=this.isAnimated!==!1||this.values.length>1;return e?t=this.values:t=this.values.length?this.values[0].value:0,{x:this.expression,ix:this.index,a:e?1:0,k:t,p:this.maxColors}}}class z{constructor(t=0,e=[]){this.offset=t,this.color=e}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 At 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 e=this.keyframeValue(t),s=[],n=this.keyframeHasAlpha(t);for(let u=0;u<this.colorCount;u++){const l=e.slice(u,3);n&&l.push(e[this.colorCount*4+u*2]),s.push(new z(e[u*4],l))}return s}setKeyframeStops(t,e){if(t>=this.values.length)return;e.length>this.colorCount&&(this.colorCount=e.length),this.values[t].value=this.stopsToArray(e)}addKeyframe(t,e){const s=new y(t,this.stopsToArray(e));return e.length>this.colorCount&&(this.colorCount=e.length),this.values.push(s),s}stopsToArray(t){let e=!1;const s=[];for(const n of t)s.push(n.offset),s.push(n.red),s.push(n.green),s.push(n.blue),n.hasAlpha&&(e=!0);if(e)for(const n of t)s.push(n.offset),s.push(n.alpha!==void 0?n.alpha:1);return s}}class _{constructor(){this.gradientColors=new At(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 U{constructor(){this.anchor=new a(this,i.PropertyType.ANCHOR,[new y(0,[0,0])]),this.opacity=new a(this,i.PropertyType.OPACITY,[new y(0,100)]),this.position=new a(this,i.PropertyType.POSITION,[new y(0,[0,0])]),this.rotation=new a(this,i.PropertyType.ROTATION,[new y(0,0)]),this.scale=new a(this,i.PropertyType.SCALE,[new y(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 d{constructor(t){this.isHidden=!1,this.parent=t}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name}}}class X extends d{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 super.fromJSON(t),this.position.fromJSON(t.p),this.size.fromJSON(t.s),this.direction=t.d,this}toJSON(){const t=super.toJSON();return Object.assign(t,{p:this.position,s:this.size,d:this.direction})}}class q extends d{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 y(0,100)])}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{bm:this.blendMode,c:this.color,r:this.fillRule,o:this.opacity})}}class Z extends d{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 _,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 super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{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})}}var wt=Object.assign;class M extends d{constructor(){super(...arguments);this.type=i.ShapeType.GROUP,this.blendMode=i.BlendMode.NORMAL,this.isHidden=!1,this.numProperties=0,this.transform=new U,this.shapes=[]}fromJSON(t){return super.fromJSON(t),this.blendMode=t.bm,this.contentPropertyIndex=t.cix,this.propertyIndex=t.ix,this.numProperties=t.np,this.shapes=t.it.map(e=>{try{if(e.ty!=="tr"){const s=this.createShape(e.ty);return s.fromJSON(e)}else this.transform.fromJSON(e)}catch(s){}return!1}).filter(Boolean),this}createShape(t){return F(t,this)}addShape(t){return t instanceof d||(t=this.createShape(t)),this.shapes.push(t),t}toJSON(){const t=super.toJSON(),e=JSON.parse(JSON.stringify(this.shapes));return e.push(wt({ty:"tr",nm:"Transform"},this.transform.toJSON())),Object.assign(t,{bm:this.blendMode,cix:this.contentPropertyIndex,it:e,ix:this.propertyIndex,np:this.numProperties})}}class $ extends d{constructor(){super(...arguments);this.type=i.ShapeType.PATH,this.vertices=new a(this,i.PropertyType.SHAPE)}fromJSON(t){return super.fromJSON(t),this.itemIndex=t.ind,this.shapeIndex=t.ix,this.direction=t.d,this.vertices.fromJSON(t.ks),this}toJSON(){const t=super.toJSON();return Object.assign(t,{ind:this.itemIndex,ix:this.shapeIndex,d:this.direction,ks:this.vertices})}}class Q extends d{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 super.fromJSON(t),this.direction=t.d,this.position.fromJSON(t.p),this.roundness.fromJSON(t.r),this.size.fromJSON(t.s),this}toJSON(){const t=super.toJSON();return Object.assign(t,{d:this.direction,p:this.position,r:this.roundness,s:this.size})}}class x extends d{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 y(0,100)]),this.width=new a(this,i.PropertyType.STROKE_WIDTH)}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{bm:this.blendMode,c:this.color,lc:this.lineCapType,lj:this.lineJoinType,ml:this.miterLimit,o:this.opacity,w:this.width})}}class j extends d{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 super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{bm:this.blendMode,e:this.trimEnd,o:this.trimOffset,s:this.trimStart,m:this.trimMultipleShapes})}}class tt extends d{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 _,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 super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{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 it extends d{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 super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{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}})}}var k=Object.assign;class et extends d{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 super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,k(k(k({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 rt extends d{constructor(){super(...arguments);this.type=i.ShapeType.ROUNDED_CORNERS,this.roundness=new a(this,i.PropertyType.NUMBER)}fromJSON(t){return super.fromJSON(t),this.roundness.fromJSON(t.r),this}toJSON(){const t=super.toJSON();return Object.assign(t,{r:this.roundness})}}class st extends d{constructor(){super(...arguments);this.type=i.ShapeType.MERGE,this.mergeMode=1}fromJSON(t){return super.fromJSON(t),this.mergeMode=t.mm,this}toJSON(){const t=super.toJSON();return Object.assign(t,{mm:this.mergeMode})}}const F=(t,e)=>{if(t===i.ShapeType.PATH)return new $(e);if(t===i.ShapeType.GROUP)return new M(e);if(t===i.ShapeType.FILL)return new q(e);if(t===i.ShapeType.RECTANGLE)return new Q(e);if(t===i.ShapeType.ELLIPSE)return new X(e);if(t===i.ShapeType.STROKE)return new x(e);if(t===i.ShapeType.GRADIENT_FILL)return new Z(e);if(t===i.ShapeType.GRADIENT_STROKE)return new tt(e);if(t===i.ShapeType.TRIM)return new j(e);if(t===i.ShapeType.MERGE)return new st(e);if(t===i.ShapeType.STAR)return new et(e);if(t===i.ShapeType.ROUNDED_CORNERS)return new rt(e);if(t===i.ShapeType.REPEATER)return new it(e);throw new Error(`Invalid or unknown shape type: ${t}`)};class It{constructor(){this.character="",this.fontSize=0,this.fontStyle="",this.fontWeight=0,this.data=[],this.fontFamily=""}createShape(t){return F(t,this)}createShapeFromJSON(t){try{const e=this.createShape(t.ty);return e.fromJSON(t)}catch(e){throw new Error(`Unable to create shape from JSON: ${t.ty}`)}}fromJSON(t){return this.character=t.ch,this.fontSize=t.size,this.fontStyle=t.style,this.fontWeight=t.w,this.fontFamily=t.fFamily,"data"in t&&t.data.shapes&&(this.data=t.data.shapes.map(e=>this.createShapeFromJSON(e))),this}toJSON(){const t=this.data.map(e=>e.toJSON());return{ch:this.character,size:this.fontSize,style:this.fontStyle,w:this.fontWeight,data:{shapes:t.length?t:void 0},fFamily:this.fontFamily}}}var b=Object.assign;class Pt{constructor(){this.fName="",this.fFamily="",this.fStyle="",this.ascent=0,this.fPath="",this.fWeight="",this.origin=-1,this.fClass=""}fromJSON(t){return this.fName=t.fName,this.fFamily=t.fFamily,this.fStyle=t.fStyle,this.ascent=t.ascent,this.fPath=t.fPath,this.fWeight=t.fWeight,this.origin=t.origin,this.fClass=t.fClass,this}toJSON(){return b(b(b(b({fName:this.fName,fFamily:this.fFamily,fStyle:this.fStyle,ascent:this.ascent},!(this.fPath==="")&&{fPath:this.fPath}),!(this.fWeight==="")&&{fWeight:this.fWeight}),!(this.origin>=0)&&{origin:this.origin}),!(this.fClass==="")&&{fClass:this.fClass})}}class Jt{constructor(){this.list=[]}fromJSON(t){return this.list=t.list.map(e=>new Pt().fromJSON(e)),this}toJSON(){return{list:this.list}}}class Lt{constructor(t){this.name="",this.index=0,this.value=new a(this,i.PropertyType.EFFECT_VALUE),this.type=t}fromJSON(t){return this.name=t.nm,this.matchName=t.mn,this.index=t.ix,this.value.fromJSON(t.v),this}toJSON(){return{ty:this.type,nm:this.name,mn:this.matchName,ix:this.index,v:this.value}}}class bt{constructor(t=i.EffectType.NONE){this.name="",this.index=0,this.enabled=!0,this.values=[],this.type=t}fromJSON(t){var e;return this.type=t.ty,this.name=t.nm,this.matchName=t.mn,this.numberOfProperties=t.np,this.index=t.ix,this.enabled=(e=t.en)!=null?e:!0,this.values=t.ef.map(s=>new Lt(s.ty).fromJSON(s)),this}toJSON(){const t=this.values.map(e=>e.toJSON());return{ty:this.type,nm:this.name,np:this.numberOfProperties,mn:this.matchName,ix:this.index,ef:t,en:this.enabled?1:this.enabled}}}class ht{constructor(){this.isInverted=!1,this.name="",this.opacity=new a(this,i.PropertyType.OPACITY),this.points=new a(this,i.PropertyType.POINTS),this.mode=i.MaskMode.Add,this.expansion=new a(this,i.PropertyType.EXPANSION)}fromJSON(t){return this.isInverted=Boolean(t.inv),this.mode=t.mode,this.name=t.nm,this.points.fromJSON(t.pt),this.opacity.fromJSON(t.o),this.expansion.fromJSON(t.x),this}toJSON(){return{inv:this.isInverted,mode:this.mode,nm:this.name,o:this.opacity,pt:this.points,x:this.expansion}}}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.masks=[],this.effects=[],this.transform=new U,this.parent=t}get colors(){const t=new Set,e=A();return[...e.keys()].filter(s=>e.get(s)===this&&s.type===i.PropertyType.COLOR).forEach(s=>{s.values.forEach(n=>{t.add(JSON.stringify(n.value))})}),Array.from(t).map(s=>JSON.parse(s))}get hasMask(){return this.masks.length>0}get totalFrames(){return this.outPoint-this.inPoint}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,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),"masksProperties"in t&&(this.masks=t.masksProperties.map(e=>new ht().fromJSON(e))),"ef"in t&&(this.effects=t.ef.map(e=>new bt().fromJSON(e))),this}toJSON(){var t;const e=this.hasMask?this.masks.map(n=>n.toJSON()):void 0,s=this.effects.length?this.effects.map(n=>n.toJSON()):void 0;return{ddd:this.is3D?1:0,ind:this.index,ty:this.type,nm:this.name,mn:this.matchName,tt:this.matteMode,td:this.matteTarget,cl:this.classNames.length?this.classNames.join(" "):void 0,ln:this.id,parent:(t=this.parent)==null?void 0:t.index,hd:this.isHidden!==void 0?Number(this.isHidden):void 0,sr:this.timeStretch,ks:this.transform.toJSON(),ao:this.autoOrient?1:0,hasMask:this.hasMask||void 0,masksProperties:e,ef:s,w:this.width,h:this.height,ip:this.inPoint,op:this.outPoint,st:this.startTime,bm:this.blendMode}}}class nt extends E{constructor(){super(...arguments);this.type=i.LayerType.GROUP}fromJSON(t){return super.fromJSON(t),this}}class at extends E{constructor(){super(...arguments);this.type=i.LayerType.IMAGE}fromJSON(t){return super.fromJSON(t),this.refId=t.refId,this}toJSON(){const t=super.toJSON();return Object.assign(t,{refId:this.refId})}}class ot extends E{constructor(){super(...arguments);this.type=i.LayerType.PRECOMPOSITION}fromJSON(t){return super.fromJSON(t),this.refId=t.refId,this}toJSON(){const t=super.toJSON();return Object.assign(t,{refId:this.refId})}}class v extends E{constructor(){super(...arguments);this.type=i.LayerType.SHAPE,this.shapes=[]}createShape(t){return F(t,this)}addShape(t){return t instanceof d||(t=this.createShape(t)),this.shapes.push(t),t}createShapeFromJSON(t){try{const e=this.createShape(t.ty);return e.fromJSON(t)}catch(e){throw new Error(`Unable to create shape from JSON: ${t.ty}`)}}fromJSON(t){return super.fromJSON(t),this.shapes=t.shapes.map(e=>this.createShapeFromJSON(e)).filter(Boolean),this}toJSON(){const t=super.toJSON();return Object.assign(t,{shapes:this.shapes.map(e=>e.toJSON())})}}class ut extends E{constructor(){super(...arguments);this.type=i.LayerType.SOLID,this.solidColor="#000000",this.solidHeight=1,this.solidWidth=1}fromJSON(t){return super.fromJSON(t),this.solidColor=t.sc,this.solidHeight=t.sh,this.solidWidth=t.sw,this}toJSON(){const t=super.toJSON();return Object.assign(t,{sc:this.solidColor,sh:this.solidHeight,sw:this.solidWidth})}}class lt extends E{constructor(){super(...arguments);this.type=i.LayerType.TEXT}fromJSON(t){return super.fromJSON(t),this.textData=t.t,this}toJSON(){const t=super.toJSON();return Object.assign(t,{t:this.textData})}}class ct{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 ft(t){let e=(+t[0]).toString(16),s=(+t[1]).toString(16),n=(+t[2]).toString(16),u=Math.round(+t[3]*255).toString(16);return e.length==1&&(e="0"+e),s.length==1&&(s="0"+s),n.length==1&&(n="0"+n),u.length==1&&(u="0"+u),"#"+e+s+n+u}function vt(t,e){const s=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),u=parseInt(t.slice(5,7),16);return e?[s/255,n/255,u/255,e]:[s/255,n/255,u/255]}class mt{constructor(t){this.keywords=[],this.generator="@lottiefiles/lottie-js 0.3.9",this.parent=t}fromJSON(t){return this.author=t.a,this.keywords="k"in t?t.k.split(",").map(e=>e.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 Ot=Object.assign,Dt=(t,e,s)=>new Promise((n,u)=>{var l=T=>{try{N(s.next(T))}catch(I){u(I)}},f=T=>{try{N(s.throw(T))}catch(I){u(I)}},N=T=>T.done?n(T.value):Promise.resolve(T.value).then(l,f);N((s=s.apply(t,e)).next())});class H{constructor(){this.assets=[],this.frameRate=60,this.height=0,this.inPoint=0,this.is3D=!1,this.layers=[],this.markers=[],this.meta=new mt(this),this.name="",this.outPoint=0,this.version="",this.width=0,this.fonts=new Jt,this.characters=[]}static fromURL(t){return Dt(this,null,function*(){if(typeof t!="string")throw new Error("The url value must be a string");let e;try{const n=new URL(t),u=yield Et(n.toString());e=yield u.json()}catch(n){throw new Error("An error occurred while trying to load the Lottie file from URL")}const s=new H;return s.fromJSON(e)})}static isLottie(t){const e=["v","ip","op","layers","fr","w","h"];return e.every(s=>Object.prototype.hasOwnProperty.call(t,s))}get colors(){const t=new Set;return[...A().keys()].filter(e=>e.type===i.PropertyType.COLOR).forEach(e=>{e.values.forEach(s=>{t.add(JSON.stringify(s.value))})}),Array.from(t).map(e=>L.fromJSON(JSON.parse(e)))}get colorsVerbose(){const t={};return[...A().keys()].filter(e=>e.type===i.PropertyType.COLOR).forEach((e,s)=>{const n=e.getParent(),u=this.parentPath(n),l=u.slice();e.values.forEach(f=>{l.unshift("Frame "+f.frame),l.unshift(s.toString());const N=f.value;t[l.join(".")]=ft([Math.round(N[0]*255),Math.round(N[1]*255),Math.round(N[2]*255),N[3]])})}),t}get textLayers(){const t={},e=this.getLayersByType(i.LayerType.TEXT);return e.forEach((s,n)=>{t[n+"."+s.name]=s.textData.d.k[0].s.t}),t}parentPath(t,e=[]){return t.parent===void 0?(e.push(t.name),e):(e.push(t.name),this.parentPath(t.parent,e))}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 K(this);if(t===i.AssetType.IMAGE)return new V(this);throw new Error(`Invalid or unknown asset type ${t}`)}createAssetFromJSON(t){try{const e=this.createAsset("layers"in t?i.AssetType.PRECOMPOSITION:i.AssetType.IMAGE);return e.fromJSON(t)}catch(e){throw new Error("Unable to create asset from JSON")}}createLayer(t){if(t===i.LayerType.PRECOMPOSITION)return new ot(this);if(t===i.LayerType.SHAPE)return new v(this);if(t===i.LayerType.GROUP)return new nt(this);if(t===i.LayerType.SOLID)return new ut(this);if(t===i.LayerType.IMAGE)return new at(this);if(t===i.LayerType.TEXT)return new lt(this);throw new Error(`Invalid or unknown layer type: ${t}`)}createLayerFromJSON(t){try{const e=this.createLayer(t.ty);return e.fromJSON(t)}catch(e){throw console.log(e),new Error(`Unable to create layer type from JSON: ${t.ty}`)}}createLayersFromJSONArray(t){const e=new Map,s=[],n=[];return t.forEach(u=>{const l=this.createLayerFromJSON(u);l&&(u.parent!==void 0&&s.push([l,u.parent]),l.index!==void 0&&e.set(l.index,l),n.push(l))}),s.forEach(([u,l])=>{u.parent=e.get(l)}),n}createMarker(){return new ct}createMarkerFromJSON(t){try{const e=this.createMarker();return e.fromJSON(t)}catch(e){throw console.log(e),new Error("Unable to create marker from JSON")}}fromJSON(t){if(H.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(e=>this.createAssetFromJSON(e)).filter(Boolean),this.layers=this.createLayersFromJSONArray(t.layers),this.markers=t.markers.map(e=>this.createMarkerFromJSON(e)).filter(Boolean),"meta"in t&&this.meta.fromJSON(t.meta),"fonts"in t&&this.fonts.fromJSON(t.fonts),"chars"in t&&(this.characters=t.chars.map(e=>new It().fromJSON(e))),this}getLayerById(t){if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.find(e=>e.id===t)}getShapeById(t){let e=null;if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.forEach(s=>{s instanceof v&&s.shapes.forEach(n=>{if(n.id===t){e=n;return}})}),e}getShapesByClassName(t){const e=[];if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.forEach(s=>{s instanceof v&&s.shapes.forEach(n=>{var u;if(((u=n.classNames)==null?void 0:u.includes(t))&&e.push(n),n instanceof M){const l=n.shapes;l.forEach(f=>{var N;((N=f.classNames)==null?void 0:N.includes(t))&&e.push(n)})}})}),e}getLayersByClassName(t){if(typeof t!="string")throw new Error("Class name value must be a string");return this.layers.filter(e=>e.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(e=>e.type===t)}toJSON(t){if(t)return;const e=this.characters.map(s=>s.toJSON());return Ot(Ot({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()}),{chars:e.length>0?e:void 0})}}i.Animation=H,i.Asset=g,i.Color=L,i.ColorRgb=w,i.ColorRgba=C,i.EllipseShape=X,i.FillShape=q,i.Gradient=_,i.GradientFillShape=Z,i.GradientStop=z,i.GradientStrokeShape=tt,i.GroupLayer=nt,i.GroupShape=M,i.ImageAsset=V,i.ImageLayer=at,i.KeyFrame=y,i.Layer=E,i.Marker=ct,i.Mask=ht,i.MergeShape=st,i.Meta=mt,i.PathShape=$,i.PrecompositionAsset=K,i.PrecompositionLayer=ot,i.Property=a,i.RectangleShape=Q,i.RepeaterShape=it,i.RoundedCornersShape=rt,i.Shape=d,i.ShapeLayer=v,i.SolidLayer=ut,i.StarShape=et,i.StrokeShape=x,i.TextLayer=lt,i.Transform=U,i.TrimShape=j,i.hexToRgba=vt,i.rgbaToHex=ft,i.useRegistry=A,Object.defineProperty(i,"__esModule",{value:!0})});
*/(function(i,A){typeof exports=="object"&&typeof module!="undefined"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(i=typeof globalThis!="undefined"?globalThis:i||self,A(i.Lottie={}))})(this,function(i){"use strict";class A{constructor(t){this.parent=t}}class K extends A{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,id: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 V extends A{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 vt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ut(t,e,h){return h={path:e,exports:{},require:function(a,o){return Mt(a,o??h.path)}},t(h,h.exports),h.exports}function Mt(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var kt=Ut(function(t,e){var h=function(a){function o(){this.fetch=!1,this.DOMException=a.DOMException}return o.prototype=a,new o}(typeof self!="undefined"?self:vt);(function(a){var o=function(f){var c={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(r){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function d(r){return r&&DataView.prototype.isPrototypeOf(r)}if(c.arrayBuffer)var E=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],P=ArrayBuffer.isView||function(r){return r&&E.indexOf(Object.prototype.toString.call(r))>-1};function L(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(r))throw new TypeError("Invalid character in header field name");return r.toLowerCase()}function bt(r){return typeof r!="string"&&(r=String(r)),r}function W(r){var n={next:function(){var u=r.shift();return{done:u===void 0,value:u}}};return c.iterable&&(n[Symbol.iterator]=function(){return n}),n}function O(r){this.map={},r instanceof O?r.forEach(function(n,u){this.append(u,n)},this):Array.isArray(r)?r.forEach(function(n){this.append(n[0],n[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(n){this.append(n,r[n])},this)}O.prototype.append=function(r,n){r=L(r),n=bt(n);var u=this.map[r];this.map[r]=u?u+", "+n:n},O.prototype.delete=function(r){delete this.map[L(r)]},O.prototype.get=function(r){return r=L(r),this.has(r)?this.map[r]:null},O.prototype.has=function(r){return this.map.hasOwnProperty(L(r))},O.prototype.set=function(r,n){this.map[L(r)]=bt(n)},O.prototype.forEach=function(r,n){for(var u in this.map)this.map.hasOwnProperty(u)&&r.call(n,this.map[u],u,this)},O.prototype.keys=function(){var r=[];return this.forEach(function(n,u){r.push(u)}),W(r)},O.prototype.values=function(){var r=[];return this.forEach(function(n){r.push(n)}),W(r)},O.prototype.entries=function(){var r=[];return this.forEach(function(n,u){r.push([u,n])}),W(r)},c.iterable&&(O.prototype[Symbol.iterator]=O.prototype.entries);function X(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function Ct(r){return new Promise(function(n,u){r.onload=function(){n(r.result)},r.onerror=function(){u(r.error)}})}function Yt(r){var n=new FileReader,u=Ct(n);return n.readAsArrayBuffer(r),u}function zt(r){var n=new FileReader,u=Ct(n);return n.readAsText(r),u}function Kt(r){for(var n=new Uint8Array(r),u=new Array(n.length),N=0;N<n.length;N++)u[N]=String.fromCharCode(n[N]);return u.join("")}function _t(r){if(r.slice)return r.slice(0);var n=new Uint8Array(r.byteLength);return n.set(new Uint8Array(r)),n.buffer}function Dt(){return this.bodyUsed=!1,this._initBody=function(r){this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:c.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:c.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():c.arrayBuffer&&c.blob&&d(r)?(this._bodyArrayBuffer=_t(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||P(r))?this._bodyArrayBuffer=_t(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var r=X(this);if(r)return r;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?X(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Yt)}),this.text=function(){var r=X(this);if(r)return r;if(this._bodyBlob)return zt(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Kt(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(qt)}),this.json=function(){return this.text().then(JSON.parse)},this}var Vt=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Zt(r){var n=r.toUpperCase();return Vt.indexOf(n)>-1?n:r}function R(r,n){n=n||{};var u=n.body;if(r instanceof R){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,n.headers||(this.headers=new O(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!u&&r._bodyInit!=null&&(u=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new O(n.headers)),this.method=Zt(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&u)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(u)}R.prototype.clone=function(){return new R(this,{body:this._bodyInit})};function qt(r){var n=new FormData;return r.trim().split("&").forEach(function(u){if(u){var N=u.split("="),S=N.shift().replace(/\+/g," "),l=N.join("=").replace(/\+/g," ");n.append(decodeURIComponent(S),decodeURIComponent(l))}}),n}function $t(r){var n=new O,u=r.replace(/\r?\n[\t ]+/g," ");return u.split(/\r?\n/).forEach(function(N){var S=N.split(":"),l=S.shift().trim();if(l){var D=S.join(":").trim();n.append(l,D)}}),n}Dt.call(R.prototype);function T(r,n){n||(n={}),this.type="default",this.status=n.status===void 0?200:n.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in n?n.statusText:"OK",this.headers=new O(n.headers),this.url=n.url||"",this._initBody(r)}Dt.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new O(this.headers),url:this.url})},T.error=function(){var r=new T(null,{status:0,statusText:""});return r.type="error",r};var Qt=[301,302,303,307,308];T.redirect=function(r,n){if(Qt.indexOf(n)===-1)throw new RangeError("Invalid status code");return new T(null,{status:n,headers:{location:r}})},f.DOMException=a.DOMException;try{new f.DOMException}catch(r){f.DOMException=function(n,u){this.message=n,this.name=u;var N=Error(n);this.stack=N.stack},f.DOMException.prototype=Object.create(Error.prototype),f.DOMException.prototype.constructor=f.DOMException}function Y(r,n){return new Promise(function(u,N){var S=new R(r,n);if(S.signal&&S.signal.aborted)return N(new f.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function D(){l.abort()}l.onload=function(){var b={status:l.status,statusText:l.statusText,headers:$t(l.getAllResponseHeaders()||"")};b.url="responseURL"in l?l.responseURL:b.headers.get("X-Request-URL");var z="response"in l?l.response:l.responseText;u(new T(z,b))},l.onerror=function(){N(new TypeError("Network request failed"))},l.ontimeout=function(){N(new TypeError("Network request failed"))},l.onabort=function(){N(new f.DOMException("Aborted","AbortError"))},l.open(S.method,S.url,!0),S.credentials==="include"?l.withCredentials=!0:S.credentials==="omit"&&(l.withCredentials=!1),"responseType"in l&&c.blob&&(l.responseType="blob"),S.headers.forEach(function(b,z){l.setRequestHeader(z,b)}),S.signal&&(S.signal.addEventListener("abort",D),l.onreadystatechange=function(){l.readyState===4&&S.signal.removeEventListener("abort",D)}),l.send(typeof S._bodyInit=="undefined"?null:S._bodyInit)})}return Y.polyfill=!0,a.fetch||(a.fetch=Y,a.Headers=O,a.Request=R,a.Response=T),f.Headers=O,f.Request=R,f.Response=T,f.fetch=Y,f}({})})(h),delete h.fetch.polyfill,e=h.fetch,e.default=h.fetch,e.fetch=h.fetch,e.Headers=h.Headers,e.Request=h.Request,e.Response=h.Response,t.exports=e});(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.AMOUNT="am",t.ANCHOR="a",t.ANGLE="an",t.OPACITY="o",t.POSITION="p",t.POINTS="pt",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",t.EFFECT_VALUE="v",t.TEXT_DATA="d",t.TEXT_ALIGNMENT="ta",t.MAX_EASE="xe",t.MIN_EASE="ne",t.MAX_AMOUNT="ma",t.RANGE_UNITS="rn",t.OFFSET="of",t.EXPRESSION_SELECTOR="sm",t.START="st",t.END="e",t.SATURATION="fs",t.HUE="fh",t.BRIGHTNESS="fb",t.TEXT_TRACKING="t",t.CENTER="cn",t.RADIUS="ra",t.DISTANCE="ds"}(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",t.PUCKER_BLOAT="pb",t.ZIG_ZAG="zz"}(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={})),function(t){t[t.NONE=0]="NONE",t[t.CUSTOM=5]="CUSTOM",t[t.PAINT_OVER_TRANSPARENT=7]="PAINT_OVER_TRANSPARENT",t[t.TINT=20]="TINT",t[t.FILL=21]="FILL",t[t.STROKE=22]="STROKE",t[t.TRITONE=23]="TRITONE",t[t.PRO_LEVELS=24]="PRO_LEVELS",t[t.DROP_SHADOW=25]="DROP_SHADOW",t[t.RADIAL_WIPE=26]="RADIAL_WIPE",t[t.DISPLACEMENT_MAP=27]="DISPLACEMENT_MAP",t[t.MATTE3=28]="MATTE3",t[t.GAUSSIAN_BLUR=29]="GAUSSIAN_BLUR",t[t.MESH_WRAP=31]="MESH_WRAP",t[t.WAVY=32]="WAVY",t[t.SPHERIZE=33]="SPHERIZE",t[t.PUPPET=34]="PUPPET"}(i.EffectType||(i.EffectType={})),function(t){t[t.SLIDER=0]="SLIDER",t[t.ANGLE=1]="ANGLE",t[t.COLOR=2]="COLOR",t[t.POINT=3]="POINT",t[t.CHECKBOX=4]="CHECKBOX",t[t.IGNORED=6]="IGNORED",t[t.DROPDOWN=7]="DROPDOWN",t[t.LAYER=10]="LAYER"}(i.EffectValueType||(i.EffectValueType={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.ALL_CAPS=1]="ALL_CAPS",t[t.SMALL_CAPS=2]="SMALL_CAPS"}(i.TextCaps||(i.TextCaps={})),function(t){t[t.CHARACTERS=1]="CHARACTERS",t[t.WORD=2]="WORD",t[t.LINE=3]="LINE",t[t.ALL=4]="ALL"}(i.TextGrouping||(i.TextGrouping={})),function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.CENTER=2]="CENTER",t[t.JUSTIFY_LAST_LINE_LEFT=3]="JUSTIFY_LAST_LINE_LEFT",t[t.JUSTIFY_LAST_LINE_RIGHT=4]="JUSTIFY_LAST_LINE_RIGHT",t[t.JUSTIFY_LAST_LINE_CENTER=5]="JUSTIFY_LAST_LINE_CENTER",t[t.JUSTIFY_LAST_LINE_FULL=6]="JUSTIFY_LAST_LINE_FULL"}(i.TextJustify||(i.TextJustify={})),function(t){t[t.CHARACTERS=1]="CHARACTERS",t[t.CHARACTER_EXCLUDING_SPACES=2]="CHARACTER_EXCLUDING_SPACES",t[t.WORDS=3]="WORDS",t[t.LINES=4]="LINES"}(i.TextBased||(i.TextBased={})),function(t){t[t.SQUARE=1]="SQUARE",t[t.RAMP_UP=2]="RAMP_UP",t[t.RAMP_DOWN=3]="RAMP_DOWN",t[t.TRIANGLE=4]="TRIANGLE",t[t.ROUND=5]="ROUND",t[t.SMOOTH=6]="SMOOTH"}(i.TextShape||(i.TextShape={}));class y{constructor(t=0,e=0){this.frame=0,this.value=0,this.frameInTangent=[0,0],this.frameOutTangent=[1,1],this.hold=!1,this.frame=t,this.value=e}fromJSON(t,e=void 0){this.frame=t.t,e===void 0?this.value=t.s:this.value=e.fromJSON(t.s);const h="i"in t&&"o"in t,a="ti"in t&&"to"in t;return this.frameInTangent=h?[t.i.x,t.i.y]:void 0,this.frameOutTangent=h?[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 Ft=new Map;function J(){return Ft}class g{toJSON(){return this.toRgbArray()}toJSONWebsafe(){return this.toRgbArrayWebsafe()}static fromJSON(t){return t.length>3?v.fromJSON(t):t.length==3?w.fromJSON(t):new w(0,0,0)}}class w extends g{constructor(t,e,h){super();this.r=t,this.g=e,this.b=h}websafeColors(){this.r=Math.round(this.r*255),this.g=Math.round(this.g*255),this.b=Math.round(this.b*255)}toRgbArray(){return[this.r,this.g,this.b]}toRgbArrayWebsafe(){return[this.r*255,this.g*255,this.b*255]}static fromJSON(t){return new w(t[0],t[1],t[2])}}class v extends w{constructor(t,e,h,a=1){super(t,e,h);this.a=a}websafeColors(){this.r=Math.round(this.r*255),this.g=Math.round(this.g*255),this.b=Math.round(this.b*255)}toRgbArray(){return[this.r,this.g,this.b,this.a]}toRgbArrayWebsafe(){return[this.r*255,this.g*255,this.b*255,this.a]}static fromJSON(t){return new v(t[0],t[1],t[2],t[3])}}class U{constructor(){this.fontFamily="",this.fontColor=new w(0,0,0),this.fontSize=0,this.text=""}static fromJSON(t){const e=new U;return e.fontFamily=t.f,e.fontColor=g.fromJSON(t.fc),e.fontSize=t.s,e.lineHeight=t.lh,e.boxSize=t.sz,e.text=t.t,e.justify=t.j,e.textCaps=t.ca,e.textTracking=t.tr,e.strokeWidth=t.sw,"sc"in t&&(e.strokeColor=g.fromJSON(t.sc)),e}toJSON(){return{f:this.fontFamily,fc:this.fontColor,s:this.fontSize,lh:this.lineHeight,sz:this.boxSize,t:this.text,j:this.justify,ca:this.textCaps,tr:this.textTracking,sc:this.strokeColor,sw:this.strokeWidth}}}class s{constructor(t,e,h=[]){this.UID=0,this.isAnimated=!1,this.values=[],this._parent=t,this.type=e,this.values=h,this.isAnimated=h.length>1,J().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 e;return this.type==i.PropertyType.COLOR?e=g:this.type==i.PropertyType.TEXT_DATA&&(e=U),this.values=this.isAnimated||this.type==i.PropertyType.TEXT_DATA?t.k.map(h=>new y().fromJSON(h,e)):[new y().fromJSON({t:0,s:t.k},e)],this.type===i.PropertyType.COLOR&&(this.maxColors="p"in t?t.p:void 0),this}toJSON(){let t;const e=this.isAnimated||this.values.length>1||this.type===i.PropertyType.TEXT_DATA;return e?t=this.values:t=this.values.length?this.values[0].value:0,{x:this.expression,ix:this.index,a:e?1:0,k:t,p:this.maxColors}}}class Z{constructor(t=0,e=[]){this.offset=t,this.color=e}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 Ht extends s{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 e=this.keyframeValue(t),h=[],a=this.keyframeHasAlpha(t);for(let o=0;o<this.colorCount;o++){const f=e.slice(o,3);a&&f.push(e[this.colorCount*4+o*2]),h.push(new Z(e[o*4],f))}return h}setKeyframeStops(t,e){if(t>=this.values.length)return;e.length>this.colorCount&&(this.colorCount=e.length),this.values[t].value=this.stopsToArray(e)}addKeyframe(t,e){const h=new y(t,this.stopsToArray(e));return e.length>this.colorCount&&(this.colorCount=e.length),this.values.push(h),h}stopsToArray(t){let e=!1;const h=[];for(const a of t)h.push(a.offset),h.push(a.red),h.push(a.green),h.push(a.blue),a.hasAlpha&&(e=!0);if(e)for(const a of t)h.push(a.offset),h.push(a.alpha!==void 0?a.alpha:1);return h}}class M{constructor(){this.gradientColors=new Ht(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 k{constructor(){this.anchor=new s(this,i.PropertyType.ANCHOR,[new y(0,[0,0])]),this.opacity=new s(this,i.PropertyType.OPACITY,[new y(0,100)]),this.position=new s(this,i.PropertyType.POSITION,[new y(0,[0,0])]),this.rotation=new s(this,i.PropertyType.ROTATION,[new y(0,0)]),this.scale=new s(this,i.PropertyType.SCALE,[new y(0,[100,100])]),this.skew=new s(this,i.PropertyType.SKEW),this.skewAxis=new s(this,i.PropertyType.SKEW_AXIS)}fromJSON(t){return this.rotation="r"in t?new s(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 s(this,i.PropertyType.SKEW).fromJSON(t.sk):void 0,this.skewAxis="sa"in t?new s(this,i.PropertyType.SKEW_AXIS).fromJSON(t.sa):void 0,"or"in t&&(this.orientation=new s(this,i.PropertyType.ORIENTATION).fromJSON(t.or)),"rx"in t&&(this.rotationX=new s(this,i.PropertyType.ROTATION_X).fromJSON(t.rx)),"ry"in t&&(this.rotationY=new s(this,i.PropertyType.ROTATION_Y).fromJSON(t.ry)),"rz"in t&&(this.rotationZ=new s(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 m{constructor(t){this.isHidden=!1,this.parent=t}fromJSON(t){return this.classNames=t.cl,this.id=t.ln,this.isHidden=t.hd,this.matchName=t.mn,this.name=t.nm,this}toJSON(){return{ty:this.type,cl:this.classNames,hd:this.isHidden,ln:this.id,mn:this.matchName,nm:this.name}}}class q extends m{constructor(){super(...arguments);this.type=i.ShapeType.ELLIPSE,this.position=new s(this,i.PropertyType.POSITION),this.size=new s(this,i.PropertyType.SIZE),this.direction=1}fromJSON(t){return super.fromJSON(t),this.position.fromJSON(t.p),this.size.fromJSON(t.s),this.direction=t.d,this}toJSON(){const t=super.toJSON();return Object.assign(t,{p:this.position,s:this.size,d:this.direction})}}class $ extends m{constructor(){super(...arguments);this.type=i.ShapeType.FILL,this.blendMode=i.BlendMode.NORMAL,this.color=new s(this,i.PropertyType.COLOR),this.fillRule=i.FillRuleType.EVEN_ODD,this.opacity=new s(this,i.PropertyType.OPACITY,[new y(0,100)])}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{bm:this.blendMode,c:this.color,r:this.fillRule,o:this.opacity})}}class Q extends m{constructor(){super(...arguments);this.type=i.ShapeType.GRADIENT_FILL,this.blendMode=i.BlendMode.NORMAL,this.endPoint=new s(this,i.PropertyType.POSITION),this.gradientColors=new M,this.gradientType=i.GradientFillType.LINEAR,this.highlightAngle=new s(this,i.PropertyType.NUMBER),this.highlightLength=new s(this,i.PropertyType.NUMBER),this.opacity=new s(this,i.PropertyType.OPACITY),this.startPoint=new s(this,i.PropertyType.POSITION),this.fillRule=i.FillRuleType.EVEN_ODD}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{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})}}var Gt=Object.assign;class F extends m{constructor(){super(...arguments);this.type=i.ShapeType.GROUP,this.blendMode=i.BlendMode.NORMAL,this.isHidden=!1,this.numProperties=0,this.transform=new k,this.shapes=[]}fromJSON(t){return super.fromJSON(t),this.blendMode=t.bm,this.contentPropertyIndex=t.cix,this.propertyIndex=t.ix,this.numProperties=t.np,this.shapes=t.it.map(e=>{try{if(e.ty!=="tr"){const h=this.createShape(e.ty);return h.fromJSON(e)}else this.transform.fromJSON(e)}catch(h){}return!1}).filter(Boolean),this}createShape(t){return G(t,this)}addShape(t){return t instanceof m||(t=this.createShape(t)),this.shapes.push(t),t}toJSON(){const t=super.toJSON(),e=JSON.parse(JSON.stringify(this.shapes));return e.push(Gt({ty:"tr",nm:"Transform"},this.transform.toJSON())),Object.assign(t,{bm:this.blendMode,cix:this.contentPropertyIndex,it:e,ix:this.propertyIndex,np:this.numProperties})}}class x extends m{constructor(){super(...arguments);this.type=i.ShapeType.PATH,this.vertices=new s(this,i.PropertyType.SHAPE)}fromJSON(t){return super.fromJSON(t),this.itemIndex=t.ind,this.shapeIndex=t.ix,this.direction=t.d,this.vertices.fromJSON(t.ks),this}toJSON(){const t=super.toJSON();return Object.assign(t,{ind:this.itemIndex,ix:this.shapeIndex,d:this.direction,ks:this.vertices})}}class j extends m{constructor(){super(...arguments);this.type=i.ShapeType.RECTANGLE,this.position=new s(this,i.PropertyType.POSITION),this.roundness=new s(this,i.PropertyType.ROUNDNESS),this.size=new s(this,i.PropertyType.SIZE)}fromJSON(t){return super.fromJSON(t),this.direction=t.d,this.position.fromJSON(t.p),this.roundness.fromJSON(t.r),this.size.fromJSON(t.s),this}toJSON(){const t=super.toJSON();return Object.assign(t,{d:this.direction,p:this.position,r:this.roundness,s:this.size})}}class tt extends m{constructor(){super(...arguments);this.type=i.ShapeType.STROKE,this.blendMode=i.BlendMode.NORMAL,this.color=new s(this,i.PropertyType.COLOR),this.lineCapType=i.LineCapType.ROUND,this.lineJoinType=i.LineJoinType.ROUND,this.opacity=new s(this,i.PropertyType.OPACITY,[new y(0,100)]),this.width=new s(this,i.PropertyType.STROKE_WIDTH)}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{bm:this.blendMode,c:this.color,lc:this.lineCapType,lj:this.lineJoinType,ml:this.miterLimit,o:this.opacity,w:this.width})}}class it extends m{constructor(){super(...arguments);this.type=i.ShapeType.TRIM,this.blendMode=i.BlendMode.NORMAL,this.trimEnd=new s(this,i.PropertyType.NUMBER),this.trimOffset=new s(this,i.PropertyType.NUMBER),this.trimStart=new s(this,i.PropertyType.NUMBER),this.trimMultipleShapes=i.TrimMode.SIMULTANEOUSLY}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{bm:this.blendMode,e:this.trimEnd,o:this.trimOffset,s:this.trimStart,m:this.trimMultipleShapes})}}class et extends m{constructor(){super(...arguments);this.type=i.ShapeType.GRADIENT_STROKE,this.blendMode=i.BlendMode.NORMAL,this.endPoint=new s(this,i.PropertyType.POSITION),this.gradientColors=new M,this.gradientType=i.GradientFillType.LINEAR,this.highlightAngle=new s(this,i.PropertyType.NUMBER),this.highlightLength=new s(this,i.PropertyType.NUMBER),this.opacity=new s(this,i.PropertyType.OPACITY),this.startPoint=new s(this,i.PropertyType.POSITION),this.lineCapType=i.LineCapType.ROUND,this.lineJoinType=i.LineJoinType.ROUND,this.width=new s(this,i.PropertyType.STROKE_WIDTH)}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{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 m{constructor(){super(...arguments);this.type=i.ShapeType.REPEATER,this.anchor=new s(this,i.PropertyType.ANCHOR),this.startOpacity=new s(this,i.PropertyType.OPACITY),this.endOpacity=new s(this,i.PropertyType.OPACITY),this.position=new s(this,i.PropertyType.POSITION),this.rotation=new s(this,i.PropertyType.ROTATION),this.scale=new s(this,i.PropertyType.SCALE),this.shapes=[],this.skew=new s(this,i.PropertyType.SKEW),this.skewAxis=new s(this,i.PropertyType.SKEW_AXIS),this.copies=new s(this,i.PropertyType.NUMBER),this.offset=new s(this,i.PropertyType.NUMBER),this.composition=i.RepeaterComposite.ABOVE}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,{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}})}}var H=Object.assign;class st extends m{constructor(){super(...arguments);this.type=i.ShapeType.STAR,this.position=new s(this,i.PropertyType.POSITION),this.innerRadius=new s(this,i.PropertyType.NUMBER),this.innerRoundness=new s(this,i.PropertyType.NUMBER),this.outerRadius=new s(this,i.PropertyType.NUMBER),this.outerRoundness=new s(this,i.PropertyType.NUMBER),this.rotation=new s(this,i.PropertyType.ROTATION),this.points=new s(this,i.PropertyType.NUMBER),this.starType=i.StarType.STAR}fromJSON(t){return super.fromJSON(t),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(){const t=super.toJSON();return Object.assign(t,H(H(H({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 ht extends m{constructor(){super(...arguments);this.type=i.ShapeType.ROUNDED_CORNERS,this.roundness=new s(this,i.PropertyType.NUMBER)}fromJSON(t){return super.fromJSON(t),this.roundness.fromJSON(t.r),this}toJSON(){const t=super.toJSON();return Object.assign(t,{r:this.roundness})}}class nt extends m{constructor(){super(...arguments);this.type=i.ShapeType.MERGE,this.mergeMode=1}fromJSON(t){return super.fromJSON(t),this.mergeMode=t.mm,this}toJSON(){const t=super.toJSON();return Object.assign(t,{mm:this.mergeMode})}}class at extends m{constructor(){super(...arguments);this.type=i.ShapeType.OFFSET_PATH,this.amount=new s(this,i.PropertyType.AMOUNT),this.lineJoin=i.LineJoinType.MITER,this.miterLimit=new s(this,i.PropertyType.MITER_LIMIT)}fromJSON(t){return super.fromJSON(t),this.miterLimit.fromJSON(t.ml),this.amount.fromJSON(t.a),this.lineJoin=t.lj,this}toJSON(){const t=super.toJSON();return Object.assign(t,{ml:this.miterLimit,a:this.amount,lj:this.lineJoin})}}class ot extends m{constructor(){super(...arguments);this.type=i.ShapeType.PUCKER_BLOAT,this.amount=new s(this,i.PropertyType.AMOUNT)}fromJSON(t){return super.fromJSON(t),this.amount.fromJSON(t.a),this}toJSON(){const t=super.toJSON();return Object.assign(t,{a:this.amount})}}class ut extends m{constructor(){super(...arguments);this.type=i.ShapeType.TWIST,this.angle=new s(this,i.PropertyType.ANGLE),this.center=new s(this,i.PropertyType.CENTER)}fromJSON(t){return super.fromJSON(t),this.center.fromJSON(t.c),this.angle.fromJSON(t.a),this}toJSON(){const t=super.toJSON();return Object.assign(t,{c:this.center,a:this.angle})}}class ft extends m{constructor(){super(...arguments);this.type=i.ShapeType.ZIG_ZAG,this.radius=new s(this,i.PropertyType.RADIUS),this.distance=new s(this,i.PropertyType.DISTANCE),this.numberOfRidges=new s(this,i.PropertyType.POINTS)}fromJSON(t){return super.fromJSON(t),this.radius.fromJSON(t.r),this.distance.fromJSON(t.s),this.numberOfRidges.fromJSON(t.pt),this}toJSON(){const t=super.toJSON();return Object.assign(t,{r:this.radius,s:this.distance,pt:this.numberOfRidges})}}const G=(t,e)=>{if(t===i.ShapeType.PATH)return new x(e);if(t===i.ShapeType.GROUP)return new F(e);if(t===i.ShapeType.FILL)return new $(e);if(t===i.ShapeType.RECTANGLE)return new j(e);if(t===i.ShapeType.ELLIPSE)return new q(e);if(t===i.ShapeType.STROKE)return new tt(e);if(t===i.ShapeType.GRADIENT_FILL)return new Q(e);if(t===i.ShapeType.GRADIENT_STROKE)return new et(e);if(t===i.ShapeType.TRIM)return new it(e);if(t===i.ShapeType.MERGE)return new nt(e);if(t===i.ShapeType.STAR)return new st(e);if(t===i.ShapeType.ROUNDED_CORNERS)return new ht(e);if(t===i.ShapeType.REPEATER)return new rt(e);if(t===i.ShapeType.PUCKER_BLOAT)return new ot(e);if(t===i.ShapeType.OFFSET_PATH)return new at(e);if(t===i.ShapeType.TWIST)return new ut(e);if(t===i.ShapeType.ZIG_ZAG)return new ft(e);throw new Error(`Invalid or unknown shape type: ${t}`)};class lt{constructor(){this.character="",this.fontSize=0,this.fontStyle="",this.fontWeight=0,this.data=[],this.fontFamily=""}createShape(t){return G(t,this)}createShapeFromJSON(t){try{const e=this.createShape(t.ty);return e.fromJSON(t)}catch(e){throw new Error(`Unable to create shape from JSON: ${t.ty}`)}}fromJSON(t){return this.character=t.ch,this.fontSize=t.size,this.fontStyle=t.style,this.fontWeight=t.w,this.fontFamily=t.fFamily,"data"in t&&t.data.shapes&&(this.data=t.data.shapes.map(e=>this.createShapeFromJSON(e))),this}toJSON(){const t=this.data.map(e=>e.toJSON());return{ch:this.character,size:this.fontSize,style:this.fontStyle,w:this.fontWeight,data:{shapes:t.length?t:void 0},fFamily:this.fontFamily}}}var C=Object.assign;class ct{constructor(){this.fName="",this.fFamily="",this.fStyle="",this.ascent=0,this.fPath="",this.fWeight="",this.origin=-1,this.fClass=""}fromJSON(t){return this.fName=t.fName,this.fFamily=t.fFamily,this.fStyle=t.fStyle,this.ascent=t.ascent,this.fPath=t.fPath,this.fWeight=t.fWeight,this.origin=t.origin,this.fClass=t.fClass,this}toJSON(){return C(C(C(C({fName:this.fName,fFamily:this.fFamily,fStyle:this.fStyle,ascent:this.ascent},!(this.fPath==="")&&{fPath:this.fPath}),!(this.fWeight==="")&&{fWeight:this.fWeight}),!(this.origin>=0)&&{origin:this.origin}),!(this.fClass==="")&&{fClass:this.fClass})}}class mt{constructor(){this.list=[]}fromJSON(t){return this.list=t.list.map(e=>new ct().fromJSON(e)),this}toJSON(){return{list:this.list}}}class Ot{constructor(t){this.name="",this.index=0,this.type=t}fromJSON(t){return this.name=t.nm,this.matchName=t.mn,this.index=t.ix,typeof t.v=="object"?this.value=new s(this,i.PropertyType.EFFECT_VALUE).fromJSON(t.v):typeof t.v=="number"&&(this.value=t.v),this}toJSON(){return{ty:this.type,nm:this.name,mn:this.matchName,ix:this.index,v:this.value}}}class St{constructor(t=i.EffectType.NONE){this.name="",this.index=0,this.enabled=!0,this.values=[],this.type=t}fromJSON(t){var e;return this.type=t.ty,this.name=t.nm,this.matchName=t.mn,this.numberOfProperties=t.np,this.index=t.ix,this.enabled=(e=t.en)!=null?e:!0,this.values=t.ef.map(h=>new Ot(h.ty).fromJSON(h)),this}toJSON(){const t=this.values.map(e=>e.toJSON());return{ty:this.type,nm:this.name,np:this.numberOfProperties,mn:this.matchName,ix:this.index,ef:t,en:this.enabled?1:this.enabled}}}class Nt{constructor(){this.isInverted=!1,this.name="",this.opacity=new s(this,i.PropertyType.OPACITY),this.points=new s(this,i.PropertyType.POINTS),this.mode=i.MaskMode.Add,this.expansion=new s(this,i.PropertyType.EXPANSION)}fromJSON(t){return this.isInverted=Boolean(t.inv),this.mode=t.mode,this.name=t.nm,this.points.fromJSON(t.pt),this.opacity.fromJSON(t.o),this.expansion.fromJSON(t.x),this}toJSON(){return{inv:this.isInverted,mode:this.mode,nm:this.name,o:this.opacity,pt:this.points,x:this.expansion}}}class p{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.masks=[],this.effects=[],this.transform=new k,this.parent=t}get colors(){const t=new Set,e=J();return[...e.keys()].filter(h=>e.get(h)===this&&h.type===i.PropertyType.COLOR).forEach(h=>{h.values.forEach(a=>{t.add(JSON.stringify(a.value))})}),Array.from(t).map(h=>JSON.parse(h))}get hasMask(){return this.masks.length>0}get totalFrames(){return this.outPoint-this.inPoint}fromJSON(t){return this.autoOrient=t.ao===1,this.blendMode=t.bm,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),"masksProperties"in t&&(this.masks=t.masksProperties.map(e=>new Nt().fromJSON(e))),"ef"in t&&(this.effects=t.ef.map(e=>new St().fromJSON(e))),this}toJSON(){var t;const e=this.hasMask?this.masks.map(a=>a.toJSON()):void 0,h=this.effects.length?this.effects.map(a=>a.toJSON()):void 0;return{ddd:this.is3D?1:0,ind:this.index,ty:this.type,nm:this.name,mn:this.matchName,tt:this.matteMode,td:this.matteTarget,cl:this.classNames.length?this.classNames.join(" "):void 0,ln:this.id,parent:(t=this.parent)==null?void 0:t.index,hd:this.isHidden!==void 0?Number(this.isHidden):void 0,sr:this.timeStretch,ks:this.transform.toJSON(),ao:this.autoOrient?1:0,hasMask:this.hasMask||void 0,masksProperties:e,ef:h,w:this.width,h:this.height,ip:this.inPoint,op:this.outPoint,st:this.startTime,bm:this.blendMode}}}class dt extends p{constructor(){super(...arguments);this.type=i.LayerType.GROUP}fromJSON(t){return super.fromJSON(t),this}}class yt extends p{constructor(){super(...arguments);this.type=i.LayerType.IMAGE}fromJSON(t){return super.fromJSON(t),this.refId=t.refId,this}toJSON(){const t=super.toJSON();return Object.assign(t,{refId:this.refId})}}class Tt extends p{constructor(){super(...arguments);this.type=i.LayerType.PRECOMPOSITION}fromJSON(t){return super.fromJSON(t),this.refId=t.refId,this}toJSON(){const t=super.toJSON();return Object.assign(t,{refId:this.refId})}}class _ extends p{constructor(){super(...arguments);this.type=i.LayerType.SHAPE,this.shapes=[]}createShape(t){return G(t,this)}addShape(t){return t instanceof m||(t=this.createShape(t)),this.shapes.push(t),t}createShapeFromJSON(t){try{const e=this.createShape(t.ty);return e.fromJSON(t)}catch(e){throw new Error(`Unable to create shape from JSON: ${t.ty}`)}}fromJSON(t){return super.fromJSON(t),this.shapes=t.shapes.map(e=>this.createShapeFromJSON(e)).filter(Boolean),this}toJSON(){const t=super.toJSON();return Object.assign(t,{shapes:this.shapes.map(e=>e.toJSON())})}}class Et extends p{constructor(){super(...arguments);this.type=i.LayerType.SOLID,this.solidColor="#000000",this.solidHeight=1,this.solidWidth=1}fromJSON(t){return super.fromJSON(t),this.solidColor=t.sc,this.solidHeight=t.sh,this.solidWidth=t.sw,this}toJSON(){const t=super.toJSON();return Object.assign(t,{sc:this.solidColor,sh:this.solidHeight,sw:this.solidWidth})}}class At{constructor(){this.startTime=0,this.randomize=!1,this.textShape=i.TextShape.SQUARE,this.basedOn=i.TextBased.CHARACTERS,this.maxEase=new s(this,i.PropertyType.MAX_EASE),this.minEase=new s(this,i.PropertyType.MIN_EASE),this.maxAmount=new s(this,i.PropertyType.MAX_AMOUNT)}fromJSON(t){return this.startTime=t.t,this.randomize=t.r===1,this.rangeUnits=t.rn,this.textShape=t.sh,this.basedOn=t.b,"a"in t&&this.maxAmount.fromJSON(t.a),"e"in t&&(this.end=new s(this,i.PropertyType.END).fromJSON(t.e)),"xe"in t&&(this.maxEase=new s(this,i.PropertyType.MAX_EASE).fromJSON(t.xe)),"ne"in t&&(this.minEase=new s(this,i.PropertyType.MIN_EASE).fromJSON(t.ne)),"o"in t&&(this.offset=new s(this,i.PropertyType.OFFSET).fromJSON(t.o)),"sm"in t&&(this.expressionSelector=new s(this,i.PropertyType.EXPRESSION_SELECTOR).fromJSON(t.sm)),"s"in t&&(this.start=new s(this,i.PropertyType.START).fromJSON(t.s)),this}toJSON(){return{t:this.startTime,xe:this.maxEase,ne:this.minEase,a:this.maxAmount,b:this.basedOn,rn:this.rangeUnits,sh:this.textShape,o:this.offset,r:this.randomize?1:0,sm:this.expressionSelector,s:this.start,e:this.end}}}class pt{fromJSON(t){return"a"in t&&(this.anchor=new s(this,i.PropertyType.ANCHOR).fromJSON(t.a)),"p"in t&&(this.position=new s(this,i.PropertyType.POSITION).fromJSON(t.p)),"s"in t&&(this.scale=new s(this,i.PropertyType.SCALE).fromJSON(t.s)),"r"in t&&(this.rotation=new s(this,i.PropertyType.ROTATION).fromJSON(t.r)),"sk"in t&&(this.skew=new s(this,i.PropertyType.SKEW).fromJSON(t.sk)),"sa"in t&&(this.skewAxis=new s(this,i.PropertyType.SKEW_AXIS).fromJSON(t.sa)),"o"in t&&(this.opacity=new s(this,i.PropertyType.OPACITY).fromJSON(t.o)),"rx"in t&&(this.rotationX=new s(this,i.PropertyType.ROTATION_X).fromJSON(t.rx)),"ry"in t&&(this.rotationY=new s(this,i.PropertyType.ROTATION_Y).fromJSON(t.ry)),"sw"in t&&(this.strokeWidth=new s(this,i.PropertyType.STROKE_WIDTH).fromJSON(t.sw)),"sc"in t&&(this.strokeColor=new s(this,i.PropertyType.COLOR).fromJSON(t.sc)),"fc"in t&&(this.fillColor=new s(this,i.PropertyType.COLOR).fromJSON(t.fc)),"fs"in t&&(this.fillSaturation=new s(this,i.PropertyType.SATURATION).fromJSON(t.fs)),"fh"in t&&(this.fillHue=new s(this,i.PropertyType.HUE).fromJSON(t.fh)),"fb"in t&&(this.fillBrightness=new s(this,i.PropertyType.BRIGHTNESS).fromJSON(t.fb)),"t"in t&&(this.tracking=new s(this,i.PropertyType.TEXT_TRACKING).fromJSON(t.t)),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,sw:this.strokeWidth,sc:this.strokeColor,fc:this.fillColor,fs:this.fillSaturation,fh:this.fillHue,fb:this.fillBrightness,t:this.tracking}}}class Rt{constructor(){this.name="",this.transform=new pt,this.selector=new At}fromJSON(t){return this.transform.fromJSON(t.a),this.selector.fromJSON(t.s),this.name=t.nm,this}toJSON(){return{nm:this.name,s:this.selector,a:this.transform}}}class gt{constructor(){this.alignment=new s(this,i.PropertyType.TEXT_ALIGNMENT),this.grouping=i.TextGrouping.CHARACTERS}fromJSON(t){return this.alignment.fromJSON(t.a),this.grouping=t.g,this}toJSON(){return{a:this.alignment,g:this.grouping}}}class wt{constructor(){this.textDocument=new s(this,i.PropertyType.TEXT_DATA),this.textOptions=new gt,this.textAnimators=[]}fromJSON(t){return this.textDocument.fromJSON(t.d),this.textOptions.fromJSON(t.m),this.maskedPath=t.p,"a"in t&&Array.isArray(t.a)&&(this.textAnimators=t.a.map(e=>this.createTextAnimator(e))),this}createTextAnimator(t){return new Rt().fromJSON(t)}toJSON(){return{a:this.textAnimators.map(t=>t.toJSON()),d:this.textDocument,m:this.textOptions,p:this.maskedPath}}}class It extends p{constructor(){super(...arguments);this.type=i.LayerType.TEXT}fromJSON(t){return super.fromJSON(t),"t"in t&&(this.textData=new wt,this.textData.fromJSON(t.t)),this}toJSON(){const t=super.toJSON();return Object.assign(t,{t:this.textData})}}class Jt{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 Pt(t){let e=(+t[0]).toString(16),h=(+t[1]).toString(16),a=(+t[2]).toString(16),o=Math.round(+t[3]*255).toString(16);return e.length==1&&(e="0"+e),h.length==1&&(h="0"+h),a.length==1&&(a="0"+a),o.length==1&&(o="0"+o),"#"+e+h+a+o}function Bt(t,e){const h=parseInt(t.slice(1,3),16),a=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return e?[h/255,a/255,o/255,e]:[h/255,a/255,o/255]}function Wt(t){return t.forEach(e=>{e.websafeColors()}),t}class Lt{constructor(t){this.keywords=[],this.generator="@lottiefiles/lottie-js 0.4.0",this.parent=t}fromJSON(t){return this.author=t.a,this.keywords="k"in t?t.k.split(",").map(e=>e.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 I=Object.assign,Xt=(t,e,h)=>new Promise((a,o)=>{var f=E=>{try{d(h.next(E))}catch(P){o(P)}},c=E=>{try{d(h.throw(E))}catch(P){o(P)}},d=E=>E.done?a(E.value):Promise.resolve(E.value).then(f,c);d((h=h.apply(t,e)).next())});class B{constructor(){this.assets=[],this.frameRate=60,this.height=0,this.inPoint=0,this.is3D=!1,this.layers=[],this.markers=[],this.meta=new Lt(this),this.name="",this.outPoint=0,this.version="",this.width=0,this.fonts=new mt,this.characters=[]}static fromURL(t){return Xt(this,null,function*(){if(typeof t!="string")throw new Error("The url value must be a string");let e;try{const a=new URL(t),o=yield kt(a.toString());e=yield o.json()}catch(a){throw new Error("An error occurred while trying to load the Lottie file from URL")}const h=new B;return h.fromJSON(e)})}static isLottie(t){const e=["v","ip","op","layers","fr","w","h"];return e.every(h=>Object.prototype.hasOwnProperty.call(t,h))}get colors(){const t=new Set;return[...J().keys()].filter(e=>e.type===i.PropertyType.COLOR).forEach(e=>{e.values.forEach(h=>{t.add(JSON.stringify(h.value))})}),Array.from(t).map(e=>g.fromJSON(JSON.parse(e)))}get colorsVerbose(){const t={};return[...J().keys()].filter(e=>e.type===i.PropertyType.COLOR).forEach((e,h)=>{const a=e.getParent(),o=this.parentPath(a),f=o.slice();e.values.forEach(c=>{f.unshift("Frame "+c.frame),f.unshift(h.toString());const d=c.value;t[f.join(".")]=Pt([Math.round(d[0]*255),Math.round(d[1]*255),Math.round(d[2]*255),d[3]])})}),t}get textLayers(){const t={},e=this.getLayersByType(i.LayerType.TEXT);return e.forEach((h,a)=>{var o;const f=(o=h.textData)==null?void 0:o.textDocument.values[0];let c="";f!==void 0&&(c=f.value.text),t[a+"."+h.name]=c}),t}parentPath(t,e=[]){return t.parent===void 0?(e.push(t.name),e):(e.push(t.name),this.parentPath(t.parent,e))}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 V(this);if(t===i.AssetType.IMAGE)return new K(this);throw new Error(`Invalid or unknown asset type ${t}`)}createAssetFromJSON(t){try{const e=this.createAsset("layers"in t?i.AssetType.PRECOMPOSITION:i.AssetType.IMAGE);return e.fromJSON(t)}catch(e){throw new Error("Unable to create asset from JSON")}}createLayer(t){if(t===i.LayerType.PRECOMPOSITION)return new Tt(this);if(t===i.LayerType.SHAPE)return new _(this);if(t===i.LayerType.GROUP)return new dt(this);if(t===i.LayerType.SOLID)return new Et(this);if(t===i.LayerType.IMAGE)return new yt(this);if(t===i.LayerType.TEXT)return new It(this);throw new Error(`Invalid or unknown layer type: ${t}`)}createLayerFromJSON(t){try{const e=this.createLayer(t.ty);return e.fromJSON(t)}catch(e){throw console.log(e),new Error(`Unable to create layer type from JSON: ${t.ty}`)}}createLayersFromJSONArray(t){const e=new Map,h=[],a=[];return t.forEach(o=>{const f=this.createLayerFromJSON(o);f&&(o.parent!==void 0&&h.push([f,o.parent]),f.index!==void 0&&e.set(f.index,f),a.push(f))}),h.forEach(([o,f])=>{o.parent=e.get(f)}),a}createMarker(){return new Jt}createMarkerFromJSON(t){try{const e=this.createMarker();return e.fromJSON(t)}catch(e){throw console.log(e),new Error("Unable to create marker from JSON")}}fromJSON(t){if(B.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,"assets"in t&&(this.assets=t.assets.map(e=>this.createAssetFromJSON(e)).filter(Boolean)),this.layers=this.createLayersFromJSONArray(t.layers),"markers"in t&&(this.markers=t.markers.map(e=>this.createMarkerFromJSON(e)).filter(Boolean)),"meta"in t&&this.meta.fromJSON(t.meta),"fonts"in t&&this.fonts.fromJSON(t.fonts),"chars"in t&&(this.characters=t.chars.map(e=>new lt().fromJSON(e))),this}getLayerById(t){if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.find(e=>e.id===t)}getShapeById(t){let e=null;if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.forEach(h=>{h instanceof _&&h.shapes.forEach(a=>{if(a.id===t){e=a;return}})}),e}getShapesByClassName(t){const e=[];if(typeof t!="string")throw new Error("ID value must be a string");return this.layers.forEach(h=>{h instanceof _&&h.shapes.forEach(a=>{var o;if(((o=a.classNames)==null?void 0:o.includes(t))&&e.push(a),a instanceof F){const f=a.shapes;f.forEach(c=>{var d;((d=c.classNames)==null?void 0:d.includes(t))&&e.push(a)})}})}),e}getLayersByClassName(t){if(typeof t!="string")throw new Error("Class name value must be a string");return this.layers.filter(e=>e.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(e=>e.type===t)}toJSON(t){if(t)return;const e=this.characters.map(h=>h.toJSON());return I(I(I(I(I(I({},this.assets.length>0&&{assets:this.assets}),{ddd:this.is3D?1:0,fr:this.frameRate,h:this.height,ip:this.inPoint,layers:this.layers.map(h=>h.toJSON())}),this.assets.length>0&&{markers:this.markers.map(h=>h.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()}),{chars:e.length>0?e:void 0})}}i.Animation=B,i.Asset=A,i.Character=lt,i.Color=g,i.ColorRgb=w,i.ColorRgba=v,i.Effect=St,i.EffectValue=Ot,i.EllipseShape=q,i.FillShape=$,i.Font=ct,i.FontList=mt,i.Gradient=M,i.GradientFillShape=Q,i.GradientStop=Z,i.GradientStrokeShape=et,i.GroupLayer=dt,i.GroupShape=F,i.ImageAsset=K,i.ImageLayer=yt,i.KeyFrame=y,i.Layer=p,i.Marker=Jt,i.Mask=Nt,i.MergeShape=nt,i.Meta=Lt,i.OffsetPathShape=at,i.PathShape=x,i.PrecompositionAsset=V,i.PrecompositionLayer=Tt,i.Property=s,i.PuckerBloatShape=ot,i.RectangleShape=j,i.RepeaterShape=rt,i.RoundedCornersShape=ht,i.Shape=m,i.ShapeLayer=_,i.SolidLayer=Et,i.StarShape=st,i.StrokeShape=tt,i.TextAnimator=Rt,i.TextData=wt,i.TextDocument=U,i.TextLayer=It,i.TextOptions=gt,i.TextSelector=At,i.TextTransform=pt,i.Transform=k,i.TrimShape=it,i.TwistShape=ut,i.ZigZagShape=ft,i.hexToRgba=Bt,i.rgbaToHex=Pt,i.useRegistry=J,i.websafeColors=Wt,Object.defineProperty(i,"__esModule",{value:!0})});
//# sourceMappingURL=index.umd.js.map
{
"name": "@lottiefiles/lottie-js",
"version": "0.3.9",
"version": "0.4.0",
"description": "Lottie JSON model for Javascript/Typescript",

@@ -31,2 +31,3 @@ "main": "dist/index.cjs.js",

"release": "yarn build && yarn changeset version && yarn changeset publish",
"version": "yarn changeset version",
"test": "jest",

@@ -33,0 +34,0 @@ "test:dev": "jest --watch --coverage"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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