@pixodesk/svg-animator-web 1.0.26 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,s=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&a(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&a(t,n,e[n]);return t},l=(t,r)=>e(t,n(r)),u=Object.defineProperty,c=Object.defineProperties,f=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=Math.pow,v=(t,e,n)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,g=(t,e)=>{for(var n in e||(e={}))h.call(e,n)&&v(t,n,e[n]);if(d)for(var n of d(e))p.call(e,n)&&v(t,n,e[n]);return t},y=(t,e)=>c(t,f(e));function b(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var k=class{_canSanitize(t){return this.isValid(t)}optional(){return new A(this)}},A=class extends k{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,e,n){return null==t||this.inner.isValid(t,e,n)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},w=class extends k{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,n){return"string"==typeof t||(null==e||e.errors.push(b(null!=n?n:[])+": expected string, got "+typeof t),!1)}},x=class extends k{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,n){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(b(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},j=class extends k{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,n){return"boolean"==typeof t||(null==e||e.errors.push(b(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},O=class extends k{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,n){return t===this.value||(null==e||e.errors.push(b(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},S=class extends k{constructor(t,e){super(),this.values=t,this._default=null!=e?e:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,e,n){return!!this.values.includes(t)||(null==e||e.errors.push(b(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},P=class extends k{constructor(t,e){super(),this.schemas=t,this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;const o=e&&{errors:[],warnings:[],strict:e.strict};return!!this.schemas.some(e=>e.isValid(t,o,n?[...n]:void 0))||(null==e||e.errors.push(b(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},M=class extends k{constructor(t,e,n){super(),this._key=t,this._schemas=e,this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];e&&this._map.set(e._default,n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null!=e?this._map.get(e):void 0}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(b(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},_=class extends k{constructor(t){super(),this._shape=t;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n={};for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(b(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),e.errors.push(b(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},z=class extends k{constructor(t,e){super(),this._shape=t,this._openSchema=e;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=g({},e);for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(n[t]=this._openSchema.sanitize(e[t]));return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(b(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(this._openSchema)for(const t of Object.keys(r))t in this._shape||(o.push(t),this._openSchema.isValid(r[t],e,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},I=class extends k{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const n of t)this.item._canSanitize(n)&&e.push(this.item.sanitize(n));return e}isValid(t,e,n){if(!Array.isArray(t))return null==e||e.errors.push(b(null!=n?n:[])+": expected array, got "+typeof t),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<t.length;n++)r.push("["+n+"]"),this.item.isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},N=class extends k{constructor(t){super(),this.value=t,this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(b(null!=n?n:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(const[n,i]of Object.entries(t))r.push(n),this.value.isValid(i,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},C=class extends k{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},E=class extends k{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(b(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},T=class extends k{constructor(t,e){super(),this.fn=t,this._default=e,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,e,n){return this.schema.isValid(t,e,n)}_canSanitize(t){return this.schema._canSanitize(t)}},F=class extends k{constructor(t){super(),this.schemas=t,this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(b(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function L(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function D(t){var e;const n=t;return"_shape"in n?{kind:"shape",shape:n._shape}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.fn()}:{kind:"leaf"}}var U={string:(t="")=>new w(t),number:(t=0)=>new x(t),boolean:(t=!1)=>new j(t),literal:t=>new O(t),enum:(t,e)=>new S(t,e),union:(t,e)=>new P(t,e),discriminatedUnion:(t,e)=>new M(t,e),object:t=>new _(t),openObject:(t,e)=>new z(t,e),extendedObject:(t,e)=>new _(g(g({},t._shape),e)),array:t=>new I(t),record:t=>new N(t),any:()=>new C,defined:()=>new E,tuple:t=>new F(t),lazy:(t,e)=>new T(t,e)},V="data-px-animation-src",B="_px_animator",R={auto:"auto",waapi:"waapi",frames:"frames"},W={waapi:R.waapi,frames:R.frames},q="before",G="userSpaceOnUse",K="objectBoundingBox",Z="combined",Q="text",X="textContent",J=new Set(["type","children","animator","meta","animate","effects",Q,X]),Y=["translate","rotate","scale","origin"],H={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},$={pad:"pad",reflect:"reflect",repeat:"repeat"},tt={linear:"linear",radial:"radial"};function et(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function nt(t){var e;return(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator)}function rt(t){var e;if(t)return null==(e=nt(t))?void 0:e.definitions}function ot(t){var e;if(!t)return;const n=null==(e=nt(t))?void 0:e.animateById;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function it(t){return null==t?void 0:t.children}var at=U.union([U.string(),U.tuple([U.number(),U.number(),U.number(),U.number()])]),st=U.union([U.string(),U.number(),U.array(U.number()),U.lazy(()=>ft,{}),U.object({path:U.string()}),U.lazy(()=>U.object({paths:U.array(qt)}),{paths:[]}),U.lazy(()=>U.array(Nt),[])]),lt=U.object({time:U.number().optional(),t:U.number().optional(),value:st.optional(),v:st.optional(),easing:at.optional(),e:at.optional(),tangentOut:U.tuple([U.number(),U.number()]).optional(),to:U.tuple([U.number(),U.number()]).optional(),tangentIn:U.tuple([U.number(),U.number()]).optional(),ti:U.tuple([U.number(),U.number()]).optional(),selected:U.boolean().optional()}),ut=U.object({segmentCount:U.number().optional(),extend:U.enum([q,"after"]).optional(),alternate:U.boolean().optional()}),ct=U.object({value:st.optional(),keyframes:U.array(lt).optional(),kfs:U.array(lt).optional(),loop:U.union([ut,U.boolean()]).optional(),autoOrient:U.boolean().optional()}),ft=U.object({translate:U.tuple([U.number(),U.number()]).optional(),rotate:U.number().optional(),skew:U.number().optional(),scale:U.tuple([U.number(),U.number()]).optional(),origin:U.tuple([U.number(),U.number()]).optional()}),dt=U.union([U.string(),ft,U.object({value:ft}),ct]),ht=U.record(ct),pt=U.union([U.string(),U.array(U.union([U.string(),ht])),ht]),mt=U.object({startOn:U.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:U.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:U.number().optional()}),vt=U.object({width:U.number(),d:U.string()}),gt=U.object({fFamily:U.string(),style:U.string(),ascent:U.number(),unitsPerEm:U.number(),glyphs:U.record(vt)}),yt=U.object({easings:U.record(U.tuple([U.number(),U.number(),U.number(),U.number()])).optional(),animations:U.record(ht).optional(),styles:U.record(U.any()).optional(),glyphs:U.record(gt).optional()}),bt=U.object({mode:U.enum([R.auto,R.waapi,R.frames]).optional(),duration:U.number().optional(),delay:U.number().optional(),iterations:U.union([U.number(),U.literal("infinite")]).optional(),fill:U.enum(["forwards","backwards","both","none"]).optional(),direction:U.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:U.number().optional(),trigger:mt.optional(),resetOnFinish:U.boolean().optional(),definitions:yt.optional(),animateById:U.record(pt).optional(),timelineSource:U.string().optional(),debugInstName:U.string().optional()}),kt=U.object({id:U.string(),animate:pt}),At=U.union([U.string(),U.number(),U.array(U.number()),U.object({value:U.defined()}),ft]),wt=U.union([U.number(),U.object({value:U.number()}),ct]),xt=U.union([U.tuple([U.number(),U.number()]),U.object({value:U.tuple([U.number(),U.number()])}),ct]),jt=U.union([U.string(),U.object({value:U.string()}),ct]),Ot=U.object({translate:xt.optional(),rotate:wt.optional(),scale:xt.optional(),skew:wt.optional(),origin:xt.optional()}),St=U.object({copies:U.number().optional(),translate:xt.optional(),rotate:wt.optional(),skew:wt.optional(),scale:xt.optional(),origin:xt.optional()}),Pt=U.object({sourceId:U.string().optional(),maskType:U.enum(["luminance","alpha"]).optional(),maskUnits:U.enum([G,K]).optional(),maskContentUnits:U.enum([G,K]).optional(),x:U.number().optional(),y:U.number().optional(),width:U.number().optional(),height:U.number().optional()}),Mt=U.object({d:jt.optional(),animate:ct.optional()}),_t=U.object({offset:wt.optional(),range:xt.optional(),subPaths:U.enum(["separate",Z]).optional()}),zt=U.object({sourceId:U.string().optional(),start:U.number().optional(),stretch:U.number().optional(),timeCrop:U.tuple([U.number(),U.number()]).optional()}),It=U.object({type:U.enum(["content"]).optional(),sourceId:U.string().optional(),retime:zt.optional()}),Nt=U.object({offset:U.number(),color:U.string()}),Ct=U.union([U.array(Nt),U.object({value:U.array(Nt)}),ct]),Et=U.object({type:U.enum([tt.linear,tt.radial]),p1:xt.optional(),p2:xt.optional(),c:xt.optional(),r:wt.optional(),fp:xt.optional(),stops:Ct.optional(),gradientUnits:U.enum([H.userSpaceOnUse,H.objectBoundingBox]).optional(),spreadMethod:U.enum([$.pad,$.reflect,$.repeat]).optional(),gradientTransform:U.string().optional()}),Tt=Et,Ft=U.object({path:U.string(),pathOverflow:U.enum(["clip","extend"]).optional(),lengthAdjust:U.enum(["spacing","spacingAndGlyphs"]).optional(),method:U.enum(["align","stretch"]).optional(),spacing:U.enum(["auto","exact"]).optional(),startOffset:wt.optional(),textLength:wt.optional()}),Lt=U.object({useGlyphs:U.boolean().optional()}),Dt=U.object({transformBy:Ot.optional(),repeater:St.optional(),maskedBy:Pt.optional(),clipPath:Mt.optional(),trimPath:_t.optional(),clone:It.optional(),fillGradient:Et.optional(),strokeGradient:Tt.optional(),textPath:Ft.optional(),text:Lt.optional()});function Ut(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!Dt.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}var Vt=U.openObject({type:U.string(),id:U.string().optional(),meta:U.any().optional(),effects:Dt.optional(),animate:pt.optional(),style:U.union([U.string(),U.record(U.union([U.string(),U.number()]))]).optional()},At),Bt=U.openObject(y(g({},Vt._shape),{children:U.lazy(()=>U.array(Bt),[]).optional()}),At),Rt=U.object({width:U.union([U.number(),U.string()]).optional(),height:U.union([U.number(),U.string()]).optional(),viewBox:U.string().optional(),animator:bt.optional()}),Wt=U.openObject(y(g(g({},Vt._shape),Rt._shape),{type:U.literal("svg"),children:U.array(Bt).optional()}),At),qt=U.object({v:U.array(U.array(U.number())),i:U.array(U.array(U.number())).optional(),o:U.array(U.array(U.number())).optional(),c:U.boolean().optional()});function Gt(t){const e=Wt.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Kt(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,u=t.c;if(!a.length)return"";const c=[],f=a.length;c.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];e||i[0]!==o[0]||i[1]!==o[1]||u[0]!==f[0]||u[1]!==f[1]?c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1]):c.push("L"+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],u=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function Zt(t,e,n){return t+(e-t)*n}function Qt(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Zt(t[i]||0,e[i]||0,n);return r}function Xt(t,e,n){return[Zt(t[0]||0,e[0]||0,n),Zt(t[1]||0,e[1]||0,n),Zt(t[2]||0,e[2]||0,n),Zt(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Jt(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Yt(t[i],e[i],n));return o}function Yt(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],v=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(Qt(f,h,d));const g=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(a=null==(i=e.i)?void 0:i[n])?a:h;m.push(Qt(g,y,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;v.push(Qt(b,k,d))}return{v:p,i:m.length?m:void 0,o:v.length?v:void 0,c:null!=(f=t.c)?f:e.c}}function Ht(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function $t(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=Ht(e,r,t),((s*n+a)*n+i)*n;var n}}function te(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function ee(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=Ht(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=te(t,e,o),a=te(e,n,o),s=te(n,r,o),l=te(i,a,o),u=te(a,s,o),c=te(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,v=1-d;return m>1e-9&&Math.abs(v)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/v,(c[2][0]-f)/m,(c[2][1]-d)/v]),{left:h,right:p}}function ne(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function re(t){const e=Math.round(255*t[0]),n=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+e+","+n+","+r+","+t[3]+")":"rgb("+e+","+n+","+r+")"}function oe(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var ie=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),ae=new Set(["translate","rotate","scale","skew"]),se=new Set(["offset-distance","offsetDistance"]);function le(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),a&&o.push("translate("+-a[0]+c+","+-a[1]+c+")"),o.join("")}var ue=new Set(["offset-distance","offsetDistance"]);function ce(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function fe(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var de=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function he(t){return de.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function pe(t,e,n){return Math.max(e,Math.min(t,n))}function me(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var ve=1e-4;function ge(t,e,n,r,o){const i=ye(t,e,n,r,o);return 0===i[0]&&0===i[1]?ye(t,e,n,r,o<.5?o+ve:o-ve):i}function ye(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function be(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=me(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=me(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}function ke(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}var Ae=0;function we(){return"_px_"+Date.now().toString(36)+(++Ae).toString(36)+Math.random().toString(36).substring(2,6)}function xe(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>xe(t));const e=t,n={};for(const t of Object.keys(e))n[t]=xe(e[t]);return n}function je(t){var e,n;const r=xe(t),o=new Map,i=new Set(["href","xlink:href"]),a=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["sourceId","targetId","boundElementId"]);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=we();o.set(t,n),e.id=n}else e.animate&&(e.id=we());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(r),function t(e){if(e&&"object"==typeof e)for(const[n,r]of Object.entries(e))if("children"!==n)if("string"==typeof r)if(i.has(n)&&r.startsWith("#")){const t=r.slice(1),i=o.get(t);i&&(e[n]="#"+i)}else if(a.has(n))e[n]=Oe(r,o);else if(s.has(n)){const t=r.startsWith("#"),i=o.get(t?r.slice(1):r);i&&(e[n]=t?"#"+i:i)}else r.includes("url(#")&&(e[n]=Oe(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=Oe(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const l=null==(e=r.animator)?void 0:e.animateById;if(l&&"object"==typeof l){const t={};for(const[e,r]of Object.entries(l))t[null!=(n=o.get(e))?n:e]=r;r.animator=y(g({},r.animator),{animateById:t})}return r}function Oe(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var Se=new Set(["script","foreignobject"]),Pe=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Me=new Set(["href","xlink:href","src"]),_e=new Set(["mixBlendMode","isolation"]),ze=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Ie=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Ne=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Ce=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Ee(t,e){const n=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(n)){if("fill"===n||"stroke"===n||"stopcolor"===n){const t=String(e);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+n+'" blocked: url() must be internal url(#id), got:',e):e}if(Pe.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)||Me.has(n)&&(ze.test(t)||Ie.test(t)||function(t){const e=Ne.exec(t);return!!e&&Ce.some(t=>e[1].startsWith(t))}(t))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or data:image/… URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function Te(t){const e={};for(const n of Object.keys(t)){const r=ce(n);if(J.has(r))continue;if("style"===r)continue;let o=t[n];if(ie.has(r)&&Array.isArray(o))e[r]=re(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes||o.kfs)ae.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e.transform=r+"("+o+")"):Array.isArray(o)?e[r]=o.join(","):null!=o&&(e[r]=String(o));else{const t=o.value&&"object"==typeof o.value?o.value:o;e.transform=le(t,{withUnits:!1})}}return e}function Fe(t){var e;const n=null!=(e=t.value)?e:t.v;if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const r=n.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function Le(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function De(t){var e;return null!=(e=t.easing)?e:t.e}function Ue(t){var e,n,r;const o=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(o))return!1;if(t.autoOrient)return!0;for(const t of o)if((null!=(n=t.tangentIn)?n:t.ti)||(null!=(r=t.tangentOut)?r:t.to))return!0;return!1}var Ve=new WeakMap;function Be(t,e,n,r){var o,i;let a=Ve.get(t);const s=null==a?void 0:a.get(e);if(s)return s;const l=null!=(o=t.tangentOut)?o:t.to,u=null!=(i=e.tangentIn)?i:e.ti,c=[n[0]+(l?l[0]:0),n[1]+(l?l[1]:0)],f=[r[0]+(u?u[0]:0),r[1]+(u?u[1]:0)],d=be(n,c,f,r),h={P0:n,P1:c,P2:f,P3:r,lut:d,totalArc:d.ds[d.ds.length-1]};return a||(a=new WeakMap,Ve.set(t,a)),a.set(e,h),h}function Re(t,e,n,r,o,i){const a=Be(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=e*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(n<=0)return r[0];if(n>=o[i])return r[i];let a=1,s=i;for(;a<s;){const t=a+s>>>1;o[t]<n?a=t+1:s=t}const l=o[s-1],u=o[s]-l,c=u>0?(n-l)/u:0;return r[s-1]+c*(r[s]-r[s-1])}(a.lut,o),l=me(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=ge(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function We(t,e){var n,r,o,i;if(!Ue(t))return t;const a=null!=(n=t.keyframes)?n:t.kfs;if(!Array.isArray(a)||a.length<2)return t;const s=!!t.autoOrient,l=null!=(r=null==e?void 0:e.flatnessTolerance)?r:.5,u=null!=(o=null==e?void 0:e.rotationTolerance)?o:5,c=null!=(i=null==e?void 0:e.maxSamplesPerSegment)?i:32,f=[],d=Fe(a[0]);if(!d)return t;const h=s?function(t,e){const n=Fe(t),r=Fe(e);if(!n||!r)return 0;const o=Be(t,e,n,r),i=ge(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(a[0],a[1]):void 0;f.push(Ge(Le(a[0]),Qe(Ke(a[0]),Ke(a[0]),0,d,h,s)));for(let t=0;t<a.length-1;t++){const e=a[t],n=a[t+1],r=Fe(e),o=Fe(n);r&&o?(s&&t>0&&Je(f,e,n,r,o,u),He(f,e,n,r,o,s,l,u,c)):f.push(Ge(Le(n),Qe(Ke(n),Ke(n),1,null!=o?o:[0,0],void 0,s)))}const p=De(a[a.length-1]);p&&(f[f.length-1].e=p),s&&qe(f);const m={kfs:f};return void 0!==t.loop&&(m.loop=t.loop),m}function qe(t){var e;let n;for(const r of t){const t=null!=(e=r.v)?e:r.value;if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let o=t.rotate;for(;o-n>180;)o-=360;for(;o-n<-180;)o+=360;t.rotate=o,n=o}}function Ge(t,e){return{t:t,v:e}}function Ke(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Ze(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function Qe(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=Ze(o,s,n))}return void 0!==o&&(a.rotate=o+Xe(t,e,n)),a}function Xe(t,e,n){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==e?void 0:e.rotate)?e.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=Ze(r,o,n);return"number"==typeof i?i:0}function Je(t,e,n,r,o,i){var a;const s=t[t.length-1],l=null!=(a=s.v)?a:s.value,u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=Ke(e),f=u-Xe(c,c,0),d=Be(e,n,r,o),h=ge(d.P0,d.P1,d.P2,d.P3,0),p=180*Math.atan2(h[1],h[0])/Math.PI,m=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(p,f);if(Math.abs(m)<=i)return;const v=Le(e),g=Math.min(v+Ye,(v+Le(n))/2),y=Qe(Ke(e),Ke(e),0,r,p,!0);t.push(Ge(g,y))}var Ye=.05;function He(t,e,n,r,o,i,a,s,l){const u=Be(e,n,r,o),c=Le(e),f=Le(n),d=De(e),h=(p=d)?$t([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Ke(e),v=Ke(n),g=function(t,e,n,r,o){const i=[];$e(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),$e(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)tn(a[o],a[o+1],s,t,e,n,r,l);return s}(u,i,a,s,l),y=[];for(const t of g){const e=ke(u.lut,t),n=pe(u.totalArc>0?e/u.totalArc:t,0,1),r={u:pe(h(n),0,1),p:n,pos:me(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=ge(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}y.push(r)}let b=d,k=0;const A=t.length-1;for(let e=0;e<y.length;e++){const n=y[e],r=k<1?pe((n.u-k)/(1-k),0,1):1,{left:o,right:a}=ee(b,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=Qe(m,v,n.p,n.pos,n.rotateDeg,i);t.push(Ge(l,u)),b=a,k=n.u}}function $e(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),u=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function tn(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=me(r.P0,r.P1,r.P2,r.P3,t),c=me(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=me(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=me(r.P0,r.P1,r.P2,r.P3,l),p=me(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(en(d,u,c),en(h,u,c),en(p,u,c));let v=!0;if(o){const n=ge(r.P0,r.P1,r.P2,r.P3,t),o=ge(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(v=!1)}m<=i&&v||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,tn(t,l,n,r,o,i,a,s),tn(l,e,n,r,o,i,a,s))}function en(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function nn(t,e){const n=rn(t,e);return null!=n?n:t}function rn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=rn(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,n=t.transform;if(n&&"object"==typeof n&&Ue(n)){const o=We(n,e);o!==n&&(r=y(g({},t),{transform:o}))}}if(!n&&!r)return null;const i=g({},t);return n&&(i.children=n),r&&(i.animate=r),i}function on(t,e){if(t===e)return!0;if(typeof t!=typeof e||null===t||null===e||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(e))return!1;const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(n=>on(t[n],e[n]))}function an(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function sn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function ln(t){return"string"==typeof t&&void 0!==sn(t)}function un(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=sn(t.path);return e?{paths:an(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&ln(e[0])){const t=[];for(const n of e){const e=sn(n);e&&t.push(...an(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&ln(t[0])){const e=[];for(const n of t){const t=sn(n);t&&e.push(...an(t))}return{paths:e}}return{paths:t}}return ln(t)?{paths:an(sn(t))}:t}function cn(t,e){var n;if(t)return Array.isArray(t)?t:(null==(n=null==e?void 0:e.easings)?void 0:n[t])?e.easings[t]:void console.warn("Unknown easing name: "+t)}function fn(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function dn(t,e,n,r){var o,i;return"d"===t?{paths:Jt(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}:ie.has(t)?Xt(e||[0,0,0,1],n||[0,0,0,1],r):"transform"!==t||"object"!=typeof e||null===e||Array.isArray(e)||"object"!=typeof n||null===n||Array.isArray(n)?"rotate"===t&&"number"==typeof e&&"number"==typeof n?Zt(e,n,r):ae.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Qt(e||[],n||[],r):Zt(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=Zt(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=Qt(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function hn(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=pe(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.extend===q?e.slice(0,c+1):e.slice(u-c);const d=null!=(i=e[0].t)?i:0,h=null!=(a=e[e.length-1].t)?a:0;let p,m;n.extend===q?(p=0,m=d):(p=h,m=r);const v=m-p;if(v<=0)return e;const b=null!=(s=f[0].t)?s:0,k=(null!=(l=f[f.length-1].t)?l:0)-b;if(k<=0)return e;const A=f.map(t=>{var e,n;return{relT:(t.t-b)/k,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),w=Math.floor(v/k),x=v-w*k,j=x/k,O=[],S=n.extend!==q,P=e[e.length-1];let M,_=!1;function z(e,n,r){var o;let i;if(n){i=[];for(let t=A.length-1;t>=0;t--)i.push({relT:1-A[t].relT,v:A[t].v,e:t>0?ne(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else i=A;const a=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>a+1e-9){const o=i[n-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?$t(o.e)(l):l,c=dn(t,o.v,r.v,u),{left:f}=ee(o.e,l);return O.length>0&&o.relT<=a&&(O[O.length-1].e=f),void O.push({t:e+a*k,v:c,e:void 0})}const s=O.length>0?O[O.length-1]:P,l=S&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*k))<1e-9;if(l){if(on(s.v,r.v)){O.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(M=r.e,_=!0);continue}O.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:e+r.relT*k+(l?1:0),v:r.v,e:n<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),O.push(u)}}if(n.extend===q){j>1e-9&&function(e,n,r){let o;if(n){o=[];for(let t=A.length-1;t>=0;t--)o.push({relT:1-A[t].relT,v:A[t].v,e:t>0?ne(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else o=A;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?$t(a.e)(o):o,l=dn(t,a.v,r.v,s),{right:u}=ee(a.e,o);O.push({t:e,v:l,e:u})}const s={t:e+(r.relT-i)*k,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),O.push(s)}}(p,!!n.alternate&&w%2==0,j);for(let t=0;t<w;t++){const e=w-1-t,r=!!n.alternate&&e%2==0;z(p+x+t*k,r)}}else{for(let t=0;t<w;t++){const e=!!n.alternate&&t%2==0;z(p+t*k,e)}if(j>1e-9){const t=!!n.alternate&&w%2==0;z(p+w*k,t,j)}}return n.extend===q?[...O,...e]:_&&e.length>0?[...e.slice(0,-1),y(g({},e[e.length-1]),{e:M}),...O]:[...e,...O]}function pn(t,e,n,r){var o,i,a,s,l,u,c;const f=e.keyframes||e.kfs||[],d=[];for(const e of f){const n=null!=(i=null!=(o=e.time)?o:e.t)?i:0;let f=null!=(a=e.value)?a:e.v;const h=null!=(s=e.easing)?s:e.e;"d"===t&&(f=un(f));const p=fe(t)?he(t):t;ie.has(p)&&(f=null!=(l=oe(f))?l:f);const m={t:n,v:f,e:cn(h,r)},v=null!=(u=e.tangentIn)?u:e.ti,g=null!=(c=e.tangentOut)?c:e.to;v&&(m.tangentIn=v),g&&(m.tangentOut=g),d.push(m)}d.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const h=e.loop,p=!0===h?{}:h||void 0;return p&&d.length>=2?hn(t,d,p,n):d}function mn(t,e,n){var r;const o=e.loop;if(null==o||!1===o)return e;const i=!0===o?{}:o,a=null!=(r=e.keyframes)?r:e.kfs;if(!Array.isArray(a)||a.length<2)return e;const s=fe(t)?he(t):t,l=ie.has(s),u=a.map(e=>{var n,r,o,i,a,s,u,c;const f=null!=(n=e.t)?n:e.time;let d=null!=(r=e.v)?r:e.value;"d"===t&&(d=un(d)),l&&(d=null!=(o=oe(d))?o:d);const h={t:f,v:d,e:null!=(i=e.e)?i:e.easing};return(null!=(a=e.tangentIn)?a:e.ti)&&(h.tangentIn=null!=(s=e.tangentIn)?s:e.ti),(null!=(u=e.tangentOut)?u:e.to)&&(h.tangentOut=null!=(c=e.tangentOut)?c:e.to),h}),c={kfs:hn(t,u,i,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function vn(t,e){const n=gn(t,e);return null!=n?n:t}function gn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=gn(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const n of Object.keys(t)){const o=t[n],i=mn(n,o,e);i!==o&&(r||(r=g({},t)),r[n]=i)}}if(!n&&!r)return null;const i=g({},t);return n&&(i.children=n),r&&(i.animate=r),i}var yn=0;function bn(t,e=W.waapi){const n=nt(t)||{},r=rt(t),o=n.duration||1e3,i=[],a=(t,n)=>{if(!n)return null;const i=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=fn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=fn(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===i.length)return null;const a=function(t,e,n,r=W.waapi){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=pn(i,a,e,n);if(s.length>0){const t={kfs:s};void 0!==a.autoOrient&&(t.autoOrient=a.autoOrient),void 0!==a.loop&&(t.loop=a.loop),o[i]=r===W.waapi&&"transform"===i?We(t):t}}return o}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(i),o,r,e);return 0===Object.keys(a).length?null:{id:t,animate:a}},s=ot(t);if(s)for(const t of s){const e=a(t.id,t.animate);e&&i.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++yn;t.id=n;const r=a(n,e);r&&i.push(r)}if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e]);return i}function kn(t,e,n){var r,o,i,a,s,l,u;const c=e.kfs||e.keyframes||[];if(0===c.length)return null;const{prevKf:f,nextKf:d}=function(t,e){var n,r;const o=t.length-1;let i=t[0],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){i=t[s],a=t[s+1];break}e>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(c,n);let h=f===d?0:(p=n,m=null!=(r=f.t)?r:0,(v=null!=(o=d.t)?o:0)===m?0:0+(p-m)/(v-m)*1);var p,m,v;h=pe(h,0,1);const g=null!=(i=f.e)?i:f.easing;if(g&&Array.isArray(g))try{h=$t(g)(h)}catch(t){}let y=fe(t)?he(t):t,b=null;const k=null!=(a=null==f?void 0:f.v)?a:null==f?void 0:f.value,A=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===y)b=Jt(null!=(l=null==k?void 0:k.paths)?l:Array.isArray(k)?k:[],null!=(u=null==A?void 0:A.paths)?u:Array.isArray(A)?A:[],h).map(t=>Kt(t)).join("");else if(ie.has(y))b=re(Xt(k||[0,0,0,1],A||[0,0,0,1],h)),y=t;else if("stroke-dasharray"===y)b=Qt(k||[],A||[],h).join(" "),y=t;else if("transform"!==y||null===k||"object"!=typeof k||Array.isArray(k))"translate"===y?(b="translate("+Qt(k||[0,0],A||[0,0],h).join(",")+")",y="transform"):"rotate"===y?(b="rotate("+Zt(+(k||0),+(A||0),h)+")",y="transform"):"scale"===y?(b="scale("+Qt(k||[1,1],A||[1,1],h).join(",")+")",y="transform"):b=Zt(+(k||0),+(A||0),h);else{const t=new Set([...k?Object.keys(k):[],...A?Object.keys(A):[]]),n={};for(const e of t){const t=null==k?void 0:k[e],r=null==A?void 0:A[e];if("rotate"===e||"skew"===e)n[e]=Zt(+(null!=t?t:0),+(null!=r?r:0),h);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=Qt(t||o,r||o,h);n[e]=i}}if(Ue(e)){const t=k.translate,r=A.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Re(f,d,[+t[0],+t[1]],[+r[0],+r[1]],h,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}b=le(n,{withUnits:!1}),y="transform"}return se.has(y)&&"number"==typeof b&&(b=100*b+"%"),{k:y,v:null===b?"":""+b}}function An(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=kn(r,o,e);t&&(n[t.k]=t.v)}return n}function wn(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(wn);const e={};for(const n of Object.keys(t))e[n]=wn(t[n]);return e}function xn(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=e();n.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t}),i=t=>{var e;if("string"==typeof t.href&&t.href.startsWith("#")){const e=n.get(t.href.slice(1));e&&(t.href="#"+e)}for(const e of Object.keys(t)){if("children"===e||"effects"===e||"meta"===e||"animate"===e||"href"===e||"id"===e)continue;const n=t[e];"string"==typeof n&&-1!==n.indexOf("url(#")&&(t[e]=o(n))}null==(e=t.children)||e.forEach(i)};return i(t),n}function jn(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function On(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=Pn(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=Mn(t.viewBox);if(e)return[e[2],e[3]];const n=Sn(t.width),r=Sn(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=_n(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return y(g({},s),{children:u})}function Sn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Pn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Mn(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}function _n(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Pn(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return function(t,e,n,r,o,i,a){var s,l,u,c;const f=wn(e);xn(f,o);const d="symbol"===f.type?Mn(f.viewBox):void 0,h=null!=(l=null!=(s=Sn(t.width))?s:null==d?void 0:d[2])?l:a[0],p=null!=(c=null!=(u=Sn(t.height))?u:null==d?void 0:d[3])?c:a[1],m="symbol"===f.type?function(t,e,n,r,o){const i=Mn(t.viewBox),a=y(g({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,h=(o-c*f)/2,p=[];0===d&&0===h||p.push("translate("+d+","+h+")"),1!==f&&p.push("scale("+f+")"),0===s&&0===l||p.push("translate("+-s+","+-l+")"),p.length&&(a.transform=p.join(""));const m=e();return n.push({type:"clipPath",id:m,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+m+")",a}(f,o,i,h,p):f,v=_n(m,n,r,o,i,a),b=y(g({},t),{type:"g",children:[v]});return delete b.href,delete b.width,delete b.height,function(t){var e;const n=jn(t.x),r=jn(t.y);if(delete t.x,delete t.y,!n&&!r)return t;const o="translate("+n+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const n={type:"g",transform:o,children:null!=(e=t.children)?e:[]};t.children=[n]}else t.transform=o;return t}(b)}(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=_n(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?y(g({},t),{children:s}):t}function zn(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:"skew"===t?r.skew=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function In(t){var e,n,r;if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const o=t,i=null!=(e=o.keyframes)?e:o.kfs;if(i){const t={kind:"animated",keyframes:i.map(Cn),autoOrient:o.autoOrient,loop:o.loop},e=null!=(n=o.value)?n:o.v;return void 0!==e&&"animated"===t.kind&&(t.base=e),t}const a=null!=(r=o.value)?r:o.v;if(void 0!==a)return{kind:"static",value:a}}return{kind:"static",value:t}}function Nn(t,e,n,r){var o,i,a,s;const l=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=l(n.value));const u=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,c=g({},u||{}),f={keyframes:n.keyframes};void 0!==n.loop&&(f.loop=n.loop),void 0!==n.autoOrient&&(f.autoOrient=n.autoOrient),c[e]=f,t.animate=c;const d=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==d&&(t[e]=l(d))}function Cn(t){if(!t||"object"!=typeof t)return t;const e=t;if(void 0===e.t&&void 0===e.v&&void 0===e.e&&void 0===e.to&&void 0===e.ti)return t;const n=g({},e);return void 0===n.time&&void 0!==e.t&&(n.time=e.t),void 0===n.value&&void 0!==e.v&&(n.value=e.v),void 0===n.easing&&void 0!==e.e&&(n.easing=e.e),void 0===n.tangentOut&&void 0!==e.to&&(n.tangentOut=e.to),void 0===n.tangentIn&&void 0!==e.ti&&(n.tangentIn=e.ti),n}function En(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function Tn(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=Ln(r,e.origin,!0),r=Fn(r,"scale",e.scale),r=Fn(r,"skew",e.skew),r=Fn(r,"rotate",e.rotate),r=Ln(r,e.origin,!1),function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?(r=Ln(r,e.origin,!0),r=Fn(r,"translate",e.translate),r=Ln(r,e.origin,!1)):r=Fn(r,"translate",e.translate),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function Fn(t,e,n,r){if(void 0===n)return t;const o=In(n);if("static"===o.kind)return{type:"g",transform:{value:zn(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>En(t,zn(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Ln(t,e,n){if(void 0===e)return t;const r=In(e),o=t=>n?[-t[0],-t[1]]:t;if("absent"===r.kind)return t;if("static"===r.kind)return 0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]};if("animated"===r.kind){const e={keyframes:r.keyframes.map(t=>En(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function Dn(t,e){return"_lw_"+e+"_"+t.nextId++}function Un(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Vn(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Vn(t,e))}var Bn=wn;function Rn(t,e,n){var r,o,i;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.type)){const r=Un(t.effects.clone.sourceId);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>Rn(t,e,n))}function Wn(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function qn(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function Gn(t,e,n,r){if(!e)return t;const o=Dn(n,"grad"),i=function(t,e){const n={type:t.type===tt.radial?"radialGradient":"linearGradient",id:e};return t.type===tt.linear?(Kn(n,"x1","y1",t.p1),Kn(n,"x2","y2",t.p2)):(Kn(n,"cx","cy",t.c),function(t,e,n){const r=In(n);"absent"!==r.kind&&Nn(t,"r",r,{asString:!0})}(n,0,t.r),Kn(n,"fx","fy",t.fp)),t.gradientUnits&&(n.gradientUnits=t.gradientUnits),t.spreadMethod&&(n.spreadMethod=t.spreadMethod),t.gradientTransform&&(n.gradientTransform=t.gradientTransform),n.children=function(t){var e,n,r,o;if(!t)return[];const i=In(t);if("absent"===i.kind)return[];if("static"===i.kind)return Array.isArray(i.value)?i.value.map(Zn):[];const a=i.keyframes;if(!a.length)return[];const s=i.loop;let l=0;for(const t of a){const n=null!=(e=t.value)?e:t.v;Array.isArray(n)&&n.length>l&&(l=n.length)}if(!l)return[];const u=null!=(n=a[0].value)?n:a[0].v,c=[];for(let t=0;t<l;t++){const e=null!=(o=null!=(r=null==u?void 0:u[t])?r:Qn(a,0,t))?o:{offset:t/Math.max(1,l-1),color:"#000000"};c.push({offset:e.offset,color:e.color})}return c.map((t,e)=>function(t,e,n,r,o){var i,a,s,l,u;const c=[],f=[];let d=!1;for(const r of e){const o=null!=(a=null!=(i=r.time)?i:r.t)?a:0,h=null!=(s=r.value)?s:r.v,p=null!=(l=null==h?void 0:h[n])?l:Qn(e,e.indexOf(r),n);if(!p)continue;const m=null!=(u=r.easing)?u:r.e,v={time:o,value:p.color};void 0!==m&&(v.easing=m),c.push(v);const g={time:o,value:p.offset};void 0!==m&&(g.easing=m),f.push(g),p.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:Xn(t.offset),stopColor:t.color},p={};return c.length&&(p.stopColor={keyframes:c},void 0!==o&&(p.stopColor.loop=o)),d&&f.length&&(p.offset={keyframes:f},void 0!==o&&(p.offset.loop=o)),Object.keys(p).length&&(h.animate=p),h}(t,a,e,0,s))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function Kn(t,e,n,r){var o,i,a;const s=In(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function Zn(t){return{type:"stop",offset:Xn(t.offset),stopColor:t.color}}function Qn(t,e,n){var r,o;for(let o=e;o>=0;o--){const e=null!=(r=t[o].value)?r:t[o].v;if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=null!=(o=t[r].value)?o:t[r].v;if(null==e?void 0:e[n])return e[n]}}function Xn(t){return Math.round(1e3*t)/10+"%"}function Jn(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.path?t.path:void 0}function Yn(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=In(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformBy.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=Hn(o,"translate",e.translate,void 0),o=Hn(o,"rotate",e.rotate,r),o=Hn(o,"scale",e.scale,r),o}function Hn(t,e,n,r,o){if(void 0===n)return t;const i=In("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:zn(e,$n(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=En(t,zn(e,$n(e,t.value),r));return"translate"===e?g(g({},n),tr(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function $n(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function tr(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function er(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function nr(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function rr(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=or(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function or(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function ir(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}return s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t),a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes&&!i.kfs){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}var ar="content";function sr(t,e,n){if(!e)return;const r=Un(e.sourceId);if(!r)return void(e.type===ar&&n.errors.push("clone: content ref missing sourceId"));const o=e.type===ar&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function lr(t,e){const n={};return void 0!==t.translate&&(n.translate=ur(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=ur(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=ur(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){return ur(t,t=>[Math.pow(t[0],e),Math.pow(t[1],e)],!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function ur(t,e,n=!1){const r=In(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return"number"!=typeof t&&!Array.isArray(t)||n?{value:o}:o}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?y(g({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}function cr(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function fr(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-1),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+1,value:0}],a=g({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function dr(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function hr(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function pr(t){var e;const n=null==(e=t.effects)?void 0:e.clone;n&&(delete n.retime,0===Object.keys(n).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function mr(t,e,n){const r=Un(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=vr(r,e,n,new Set);o&&(t.href="#"+o)}function vr(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=Bn(o);if(function(t,e){xn(t,()=>Dn(e,"retimed"))}(i,n),"use"===o.type?yr(i,e.start,e.stretch):gr(i,e.start,e.stretch),pr(i),"use"===o.type&&o.href){const a=Un(o.href);if(a){const s=hr(o),l=s?dr(cr(s),e):e,u=new Set(r);u.add(t);const c=vr(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=hr(t);if("use"===t.type&&s&&t.href){const i=Un(t.href);if(i){const a=dr(cr(s),e),l=new Set(r);l.add(o);const u=vr(i,a,n,l);u&&(t.href="#"+u)}pr(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function gr(t,e,n){var r;yr(t,e,n),null==(r=t.children)||r.forEach(t=>gr(t,e,n))}function yr(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}var br=/[MmLlHhVvCcSsQqTtAaZz]/;function kr(t,e,n){return{P1:[t[0]+2/3*(e[0]-t[0]),t[1]+2/3*(e[1]-t[1])],P2:[n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1])]}}function Ar(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=be(a,t,e,r,48);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];br.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",v=t.toUpperCase();if("Z"!==v){if("M"===v){const e=h()+(n?o:0),r=h()+(n?i:0);o=e,i=r,a=e,s=r,d=t;continue}if("L"===v)m(h()+(n?o:0),h()+(n?i:0));else if("H"===v)m(h()+(n?o:0),i);else if("V"===v)m(o,h()+(n?i:0));else if("C"===v){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===v){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===v){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=kr([o,i],t,e);p(r,a,e)}else if("T"===v){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=kr([o,i],t,e);p(r,a,e)}else{if("A"!==v){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=me(o.P0,o.P1,o.P2,o.P3,a),[u,c]=ge(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((n=r,(e=t)<0?0:e>n?n:e));var e,n}}}function wr(t){const e=In(t);if("static"===e.kind&&"number"==typeof e.value)return{min:e.value,max:e.value};if("animated"===e.kind&&e.keyframes.length){const t=e.keyframes.map(t=>Number(t.value)||0);return{min:Math.min(...t),max:Math.max(...t)}}return{min:0,max:0}}function xr(t){let e=0,n=16;const r=t=>{var o,i;const a=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;a&&(n=Math.max(n,a));const s=null!=(i=t.text)?i:t.textContent;if("string"==typeof s&&(e+=s.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var jr=t=>Math.round(1e3*t)/1e3;function Or(t,e){if(!e||null==t)return t;const n=In(t);if("absent"===n.kind)return t;if("static"===n.kind)return"number"==typeof t?n.value+e:{value:n.value+e};const r={keyframes:n.keyframes.map(t=>y(g({},t),{value:(Number(t.value)||0)+e}))};return void 0!==n.loop&&(r.loop=n.loop),void 0!==n.autoOrient&&(r.autoOrient=n.autoOrient),void 0!==n.base&&(r.value=n.base+e),r}function Sr(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Ar(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=wr(e.startOffset),s=wr(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),u=Math.max(0,a.max+s-o),c=l>0?l+i:0,f=u>0?u+i:0;if(f<=0&&c<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(c>0){const e=d.x-Math.cos(d.angle)*c,n=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+jr(e)+","+jr(n)+"L"+jr(d.x)+","+jr(d.y)+r}if(f>0){const t=h.x+Math.cos(h.angle)*f,e=h.y+Math.sin(h.angle)*f;p+="L"+jr(t)+","+jr(e)}return{d:p,startShift:c}}function Pr(t,e,n){null!=n&&Nn(t,e,In(n),{asString:!0})}var Mr=(t,e,n)=>{const r={type:t};for(const t in e)void 0!==e[t]&&(r[t]=e[t]);const o=Array.isArray(n)?n.filter(t=>null!=t):null!=n?[n]:[];return o.length&&(r.children=o),r};function _r(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function zr(t,e){let n="";for(let r=0;r<t.length;r++){const o=_r(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function Ir(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var Nr=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Cr(t,e,n=2){const r=[];let o;for(Nr.lastIndex=0;null!==(o=Nr.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=Ir(e,s(),s());i+=t+zr([r,o],n)}else if("C"===t){const[t,r]=Ir(e,s(),s()),[o,a]=Ir(e,s(),s()),[l,u]=Ir(e,s(),s());i+="C"+zr([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=Ir(e,s(),s()),[o,a]=Ir(e,s(),s());i+="Q"+zr([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var Er=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",Q,X,"xml:space"];function Tr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function Fr(t){return"string"==typeof t?t:void 0}function Lr(t,e){var n,r,o,i,a,s,l;return{fontFamily:null!=(n=Fr(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Tr(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=Tr(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Tr(t.wordSpacing))?l:e.wordSpacing}}function Dr(t){var e,n,r;return{fontFamily:Fr(t.fontFamily),fontSize:null!=(e=Tr(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Tr(t.letterSpacing))?n:0,wordSpacing:null!=(r=Tr(t.wordSpacing))?r:0}}function Ur(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function Vr(t,e,n,r){var o;const i=t.fontFamily?e[t.fontFamily]:n;return i||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),i}function Br(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function Rr(t,e){if(t<=0||e<=0)return"";const n=.08*t,r=.92*t,o=.92*-e,i=r-n,a=-o,s=Math.max(1,.12*Math.min(i,a)),l="M"+n+" 0L"+r+" 0L"+r+" "+o+"L"+n+" "+o+"Z";if(i<=2*s||a<=2*s)return l;const u=n+s,c=r-s,f=-s,d=o+s;return l+"M"+u+" "+f+"L"+u+" "+d+"L"+c+" "+d+"L"+c+" "+f+"Z"}function Wr(t,e){var n,r,o,i;const{glyphs:a,create:s=Mr,warnings:l}=e,u=Br(a),c={x:null!=(n=Tr(t.x))?n:0,y:null!=(r=Tr(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{var n;const r=Vr(e,a,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,s=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=Ur(e);for(let n=0;n<t.length;n++){const a=t.charAt(n),l=null==r?void 0:r.glyphs[a];if(l&&l.d)f.push({glyphD:l.d,m:[i,0,0,i,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:i}),c.x+=l.width*i;else if(/\S/.test(a)){const t=l&&l.width>0?l.width:.6*o;f.push({glyphD:Rr(t,s),m:[i,0,0,i,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:i}),c.x+=t*i}else c.x+=(l?l.width:0)*i;c.x+=e.letterSpacing+(" "===a?e.wordSpacing:0),d[h].end=c.x}},m=(t,e)=>{var n,r,o,i;const a=Lr(t,e),s=Tr(t.x),l=Tr(t.y);void 0!==s&&(c.x=s,h=d.length,d.push({start:c.x,end:c.x})),void 0!==l&&(c.y=l),c.x+=null!=(n=Tr(t.dx))?n:0,c.y+=null!=(r=Tr(t.dy))?r:0;const u=null!=(o=Fr(t[X]))?o:Fr(t[Q]);if(u&&!(null==(i=t.children)?void 0:i.length)&&p(u,a),t.children)for(const e of t.children)m(e,a)},v=Dr(t);if(t.children)for(const e of t.children)m(e,v);const g=null!=(o=Fr(t[X]))?o:Fr(t[Q]);g&&!(null==(i=t.children)?void 0:i.length)&&p(g,v);const y=Fr(t.textAnchor);if("middle"===y||"end"===y)for(const t of f){const e=d[t.line].end-d[t.line].start,n="middle"===y?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return to(t,$r(f,s,l),s)}function qr(t,e){var n,r,o,i,a,s;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:i,warnings:a,alongPath:s}=n,l=Ar(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=Br(i),c=[];let f=0;const d=(t,e)=>{var n,r,o;const s=Lr(t,e),l=null!=(n=Fr(t[X]))?n:Fr(t[Q]);if(l&&!(null==(r=t.children)?void 0:r.length)){const t=Vr(s,i,u,a),e=(null==t?void 0:t.unitsPerEm)||1e3,n=s.fontSize/e,r=(null!=(o=null==t?void 0:t.ascent)?o:.9*e)*n;for(let e=0;e<l.length;e++){const o=l.charAt(e),i=null==t?void 0:t.glyphs[o],a=(i?i.width:0)*n,u=a+s.letterSpacing+(" "===o?s.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:a,ascent:r,fontSize:s.fontSize}),f+=u}}if(t.children)for(const e of t.children)d(e,s)};d(t,Dr(t));const h=f,p=In(null==s?void 0:s.textLength),m="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,v=m>0&&h>0?m/h:1,g=In(null==s?void 0:s.startOffset),{along:y,perp:b}=Kr(t),k=y+("animated"===g.kind?Number(null==(o=g.keyframes[0])?void 0:o.value)||0:"static"===g.kind&&Number(g.value)||0),A=t=>({x:t.x-b*Math.sin(t.angle),y:t.y+b*Math.cos(t.angle),angle:t.angle});return c.map(t=>{const e=k+t.advStart*v,n=k+t.advEnd*v,r=A(l.sampleAtDistance(e)),o=A(l.sampleAtDistance(n)),i=l.sampleAtDistance(k+(t.advStart+t.glyphW/2)*v);return{x:r.x,y:r.y,width:t.advEnd-t.advStart,ascent:t.ascent,fontSize:t.fontSize,endX:o.x,endY:o.y,rotation:180*i.angle/Math.PI}})}(t,e.alongPath.pathD,e);const{glyphs:l,warnings:u}=e,c=Br(l),f={x:null!=(r=Tr(t.x))?r:0,y:null!=(o=Tr(t.y))?o:0},m=[],v=[{start:f.x,end:f.x}];let g=0;const y=(t,e)=>{var n;const r=Vr(e,l,c,u),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,a=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*i;for(let n=0;n<t.length;n++){const o=t.charAt(n),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+e.letterSpacing+(" "===o?e.wordSpacing:0);m.push({x:f.x,y:f.y,width:l,ascent:a,fontSize:e.fontSize,line:g}),f.x+=l,v[g].end=f.x}},b=(t,e)=>{var n,r,o,i;const a=Lr(t,e),s=Tr(t.x),l=Tr(t.y);void 0!==s&&(f.x=s,g=v.length,v.push({start:f.x,end:f.x})),void 0!==l&&(f.y=l),f.x+=null!=(n=Tr(t.dx))?n:0,f.y+=null!=(r=Tr(t.dy))?r:0;const u=null!=(o=Fr(t[X]))?o:Fr(t[Q]);if(u&&!(null==(i=t.children)?void 0:i.length)&&y(u,a),t.children)for(const e of t.children)b(e,a)},k=Dr(t);if(t.children)for(const e of t.children){const t=m.length;if(b(e,k),m.length===t){const t=Lr(e,k),n=Vr(t,l,c),r=(null==n?void 0:n.unitsPerEm)||1e3;m.push({x:f.x,y:f.y,width:0,ascent:(null!=(i=null==n?void 0:n.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:g})}}const A=null!=(a=Fr(t[X]))?a:Fr(t[Q]);A&&!(null==(s=t.children)?void 0:s.length)&&y(A,k);const w=Fr(t.textAnchor);if("middle"===w||"end"===w)for(const t of m){const e=v[t.line].end-v[t.line].start;t.x+="middle"===w?-e/2:-e}return m.map(t=>{var e=t,{line:n}=e;return((t,e)=>{var n={};for(var r in t)h.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&d)for(var r of d(t))e.indexOf(r)<0&&p.call(t,r)&&(n[r]=t[r]);return n})(e,["line"])})}function Gr(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,a-n*u*c+o*l]}function Kr(t){var e,n,r;return{along:(null!=(e=Tr(t.x))?e:0)+(null!=(n=Tr(t.dx))?n:0),perp:null!=(r=Tr(t.dy))?r:0}}function Zr(t,e,n,r,o,i){const{glyphs:a,create:s=Mr,warnings:l}=r,u=e?Ar(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=Br(a),{cells:f,width:d}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u,c;const f=Lr(t,s),d=null!=(l=Fr(t[X]))?l:Fr(t[Q]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=Vr(f,e,n,r);if(t){const e=f.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=Ur(f);for(let a=0;a<d.length;a++){const s=d.charAt(a),l=t.glyphs[s];if(l&&l.d){const t=l.width*e;o.push({glyphD:l.d,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(s)){const a=l&&l.width>0?l.width:.6*t.unitsPerEm,s=a*e;o.push({glyphD:Rr(a,n),widthEm:a,scale:e,paint:r,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=f.letterSpacing+(" "===s?f.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,f)};return a(t,Dr(t)),{cells:o,width:i}}(t,a,c,l);if(!f.length)return to(t,[],s);const{along:h,perp:p}=Kr(t),m=Qr(n),v=Qr(o),b=t=>t>0&&d>0?t/d:1,k="clip"===i&&!u.closed;if(m.animated||v.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(m.times,v.times),n=(t,e)=>h+m.at(e)+b(v.at(e))*t.midBase,r=m.animated?m.loop:v.loop;return to(t,function(t,e,n,r,o,i,a,s=0){const l=Math.max(e.totalLength/Xr,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const f of t){const t=[f.scale,0,0,f.scale,-f.scale*(f.widthEm/2),0],d=Cr(f.glyphD,t),h=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[Yr(r-s*l,3),Yr(o+s*a,3)],rotate:Yr(180*i/Math.PI,3)}}},p=[],m=[],v=(t,e)=>{p.push(h(t,e)),a&&m.push({time:e,value:u(t)?1:0})};v(n(f,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(f,e),a=n(f,o),s=Math.min(Jr,Math.max(1,Math.ceil(Math.abs(a-i)/l)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);v(n(f,r),r)}}qe(p);const b={keyframes:p};void 0!==o&&(b.loop=o);const k={transform:b};if(a&&m.some(t=>0===t.value)){const t={keyframes:m};void 0!==o&&(t.loop=o),k.opacity=t}c.push(i("path",y(g({d:d},Hr(f.paint)),{animate:k}),[]))}return c}(f,u,n,e,r,s,k,p),s)}const A=b(v.at(0)),w=h+m.at(0);return to(t,$r((k?f.filter(t=>{const e=w+t.midBase*A;return e>=0&&e<=u.totalLength}):f).map(t=>({glyphD:t.glyphD,paint:t.paint,m:Gr(u,w+t.midBase*A,t.scale,t.widthEm,p)})),s,l),s)}function Qr(t){var e;const n=In(t);if("animated"===n.kind&&n.keyframes.length>=2){const t=[...n.keyframes].sort((t,e)=>(Number(t.time)||0)-(Number(e.time)||0)),e=t.map(t=>Number(t.time)||0),r=t.map(t=>Number(t.value)||0);return{animated:!0,times:e,loop:n.loop,at(t){if(t<=e[0])return r[0];for(let n=1;n<e.length;n++)if(t<=e[n]){const o=e[n]-e[n-1],i=o>0?(t-e[n-1])/o:1;return r[n-1]+i*(r[n]-r[n-1])}return r[r.length-1]}}}const r="animated"===n.kind?Number(null==(e=n.keyframes[0])?void 0:e.value)||0:"static"===n.kind&&Number(n.value)||0;return{animated:!1,times:[],at:()=>r}}var Xr=48,Jr=64;function Yr(t,e){const n=m(10,e);return Math.round(t*n)/n}function Hr(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function $r(t,e,n){var r,o,i;if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const a=new Map;for(const e of t){const t=JSON.stringify([null!=(r=e.paint.fill)?r:null,null!=(o=e.paint.stroke)?o:null,null!=(i=e.paint.strokeWidth)?i:null]),n=Cr(e.glyphD,e.m),s=a.get(t);s?s.d+=n:a.set(t,{paint:e.paint,d:n})}const s=[];for(const{paint:t,d:n}of a.values())s.push(e("path",g({d:n},Hr(t)),[]));return s}function to(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===Er.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=g({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function eo(t,e){return e.alongPath?Zr(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Wr(t,e)}function no(t,e){const n=y(g({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function ro(t,e,n,r,o,i,a,s){const l=io(r,n,o),u=ao(n,o),c=lo(i,l),f=lo(a,u),d=fo(a),h={type:"path",d:Kt(e)};return uo(h,"strokeDasharray",f),uo(h,"strokeDashoffset",c),uo(h,"strokeOpacity",d),[h]}var oo=1;function io(t,e,n){const[r]=so(n);return n=>e*(-n-r+t)+oo}function ao(t,e){const[n,r]=so(e),o=r-n+1;return e=>{const n=pe(e[0],0,1),r=pe(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=oo;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+oo),s}}function so(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function lo(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>{var n,r,o,i;return{time:null!=(r=null!=(n=t.time)?n:t.t)?r:0,value:e(null!=(o=t.value)?o:t.v),easing:null!=(i=t.easing)?i:t.e}}),loop:t.loop}}function uo(t,e,n){n&&Nn(t,e,n)}var co=10;function fo(t){var e,n,r,o,i,a;const s=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return s(t.value)?{kind:"static",value:0}:void 0;const l=t.keyframes;let u=!1,c=!0;for(const t of l)s(null!=(e=t.value)?e:t.v)?u=!0:c=!1;if(!u)return;if(c)return{kind:"static",value:0};const f=[];for(let t=0;t<l.length;t++){const e=l[t],u=t>0?l[t-1]:void 0,c=t<l.length-1?l[t+1]:void 0,d=null!=(r=null!=(n=e.time)?n:e.t)?r:0,h=s(null!=(o=e.value)?o:e.v),p=u?h&&s(null!=(i=u.value)?i:u.v):h,m=c?h&&s(null!=(a=c.value)?a:c.v):h;p&&!m?(f.push({time:d,value:0}),f.push({time:d+co,value:1})):!p&&m&&(f.push({time:d-co,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function ho(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function po(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function mo(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=vo(t,r,r+1);return t.c&&e.length>1&&(n+=vo(t,e.length-1,0)),n}function vo(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=be(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:u,u);return c.ds[c.ds.length-1]}var go=.5522847498307936;function yo(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=nt(t))?void 0:e.mode)===R.frames?W.frames:W.waapi,glyphs:null==(n=rt(t))?void 0:n.glyphs},o=Bn(t);Vn(o,r.idMap),Rn(o,r,()=>Dn(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=Un(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.sourceId);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=ir(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),Vn(t,e.idMap);const n=[],r=t=>{var e;hr(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&hr(o)&&n++,"use"===o.type&&o.href){const t=Un(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=Un(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=hr(t);if(!n)continue;const r=n.timeCrop;pr(t),mr(t,cr(n),e),r&&fr(t,r,e)}}(t,e),t}(bo(o,r),r);return function(t,e){e.length&&(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function bo(t,e){t.children&&(t.children=t.children.map(t=>bo(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,trimPath:u,clone:c,fillGradient:f,strokeGradient:d,textPath:h,text:p}=null!=n?n:{};n&&delete t.effects;let m=t,v=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.path?h.path:void 0,n=function(t,e,n,r,o,i){return e.glyphs?Zr(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.glyphs"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,v=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?Wr(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.glyphs — left as native <text>"),t):t}(m,p,e),v=!0;return v||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.path||!e.path)return t;const o=Dn(n,"tpath"),{d:i,startShift:a}=Sr(e.path,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:xr(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),Pr(s,"startOffset",Or(e.startOffset,a)),Pr(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return Gn(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return Gn(t,e,n,"stroke")}(m,d,e),m=function(t,e){if(!e)return t;const n=e.subPaths===Z,r=[],o=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)o(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*go,d=o*go,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}}(t);if(void 0===e)return;const n=an(e);if(!n.length)return;const i={leaf:t,subpaths:[]};for(const t of n){const e=mo(t);i.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}r.push(i)};if(o(t),!r.length)return t;let i=0;const a=n?[...r].reverse():r;for(const t of a)for(const e of t.subpaths)n||(i=0),e.startOffsetPx=i,i+=e.lengthPx;const s=i;if(n&&s<.001)return t;const l=In(e.offset),u="absent"===l.kind?{kind:"static",value:0}:l,c=function(t){const e=In(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>{var e,n,r,o;return{time:null!=(n=null!=(e=t.time)?e:t.t)?n:0,value:null!=(r=t.value)?r:t.v,easing:null!=(o=t.easing)?o:t.e}});if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=ho(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=po(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=po(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),f="absent"===c.kind?{kind:"static",value:[0,1]}:c,d=function(t){var e;if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const n=[];for(const r of t.keyframes){const t=null!=(e=r.value)?e:r.v;"number"==typeof t&&n.push(t)}return n}(u),h=[d.length?Math.min(...d):0,d.length?Math.max(...d):0];if(1===r.length&&r[0].leaf===t&&1===r[0].subpaths.length){const e=r[0],o=e.subpaths[0],i=n?s:o.lengthPx;if(i<.001)return t;const a=n?o.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=io(n,e,r),s=ao(e,r),l=g({},t);return delete l.effects,uo(l,"strokeDasharray",lo(i,s)),uo(l,"strokeDashoffset",lo(o,a)),uo(l,"strokeOpacity",fo(i)),l}(e.leaf,i,a,h,u,f)}const p=new Map;for(const t of r){const e=[];for(const r of t.subpaths){const o=n?s:r.lengthPx;if(o<.001)continue;const i=n?r.startOffsetPx/o:0;e.push(...ro(t.leaf,r.subpath,o,i,h,u,f))}p.set(t.leaf,no(t.leaf,e))}const m=t=>p.get(t)||(Array.isArray(t.children)&&t.children.length>0?y(g({},t),{children:t.children.map(m)}):t);return m(t)}(m,u),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Bn(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const n=Bn(l),r=lr(e,t),o=r?Tn(n,r):n;u.push(o)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(m,a,e),m=function(t,e,n,r){if(!e)return t;const o=Un(e.sourceId);if(!o)return r.errors.push("maskedBy.sourceId missing — cannot build mask"),t;const i=Dn(r,"mask");let a={type:"use",href:"#"+o};if(n)a=Yn(a,n,r);else if(er(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=En(t,void 0);if(Array.isArray(e.translate)&&a.push(y(g(g({},r),tr(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(y(g({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(y(g({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;return a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]}),s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]}),l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]}),f}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const v=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);v.push({name:m[1],args:t})}if(!v.length)return;const g=v[v.length-1];if("translate"===g.name)for(let t=v.length-2;t>=0;t--){const c=v[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,h=null!=(r=g.args[0])?r:0,p=null!=(o=g.args[1])?o:0;if(h!==-f||p!==-d)continue;const m={};m.origin=[f,d];for(let e=0;e<t;e++)if("translate"===v[e].name){const t=null!=(i=v[e].args[0])?i:0,n=null!=(a=v[e].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<v.length-1;e++){const t=v[e];if("rotate"===t.name)m.rotate=(null!=(s=m.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;for(const t of v)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};return y&&(A.translate=y),void 0!==b&&(A.rotate=b),k&&(A.scale=k),Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes&&!t.transform.kfs){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}}(t);e&&(a=Yn(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||!(!t.transform||"object"!=typeof t.transform)||er(t)}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?ir(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=nr(l),n=nr(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}return{type:"g",animate:{transform:{keyframes:Array.from(c).sort((t,e)=>t-e).map(t=>{const e=rr(l,t),n=rr(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}(m,s,i,e),m=function(t,e,n){var r,o;if(!e||!e.d&&!e.animate)return t;const i=Dn(n,"clip"),a={type:"path"},s=In(e.d);if("absent"!==s.kind&&("static"===s.kind?a.d=Jn(s.value):(Nn(a,"d",s),void 0!==a.d&&(a.d=Jn(a.d)))),e.animate&&!(null==(r=a.animate)?void 0:r.d)){const t=null!=(o=a.animate)?o:{};t.d=e.animate,a.animate=t}return n.defs.push({type:"clipPath",id:i,children:[a]}),t.clipPath="url(#"+i+")",t}(m,l,e),o?(sr(m,c,e),m=function(t,e,n,r){const o=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=qn(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&qn((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&qn((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=Wn(i.full),r=Wn(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;return 0===l&&0===u?{rest:t}:{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:(function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)||c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform))&&delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes&&!t.transform.kfs){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=g({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:a}=function(t){if(!t)return{};const e=qn(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};return void 0!==t.translate&&(r.translate=t.translate),e&&void 0!==t.origin&&(r.origin=t.origin),void 0!==t.rotate&&(o.rotate=t.rotate),void 0!==t.scale&&(o.scale=t.scale),void 0!==t.skew&&(o.skew=t.skew),void 0===t.origin||e&&!n||(o.origin=t.origin),{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let s=t;s=Tn(s,a);let l={type:"g",id:n,children:[{type:"g",id:r,children:[s]}]};return void 0!==o.transform&&(l.transform=o.transform),void 0!==o.animate&&(l.animate=o.animate),i&&(delete l.id,l=Tn(l,i),l.id=n),l}(m,i,r,o)):m=function(t,e,n,r){return sr(t,e,r),Tn(t,n)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}var ko=t=>{var e,n;return null!=(n=null!=(e=t.t)?e:t.time)?n:0},Ao=t=>{var e;return null!=(e=t.v)?e:t.value},wo=t=>{var e;return null!=(e=t.e)?e:t.easing},xo=t=>{var e;return null!=(e=t.tangentIn)?e:t.ti},jo=t=>{var e;return null!=(e=t.tangentOut)?e:t.to};function Oo(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function So(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Oo(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Po=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function Mo(t,e,n){var r,o;let i=yo(t).root;return i=function(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r,o;if("offsetPath"!==t.alongPathMode)return;const i=null!=(e=t.keyframes)?e:t.kfs;if(!i||i.length<2)return;const a=Ao(i[0]),s=(null==a?void 0:a.origin)&&a.origin.length>=2?[a.origin[0],a.origin[1]]:[0,0],l=[];for(const t of i){const e=Ao(t),r=null==e?void 0:e.translate;if(!r||r.length<2)return;if(Object.keys(e).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(n=null==e?void 0:e.origin)?n:[0,0];if(o[0]!==s[0]||o[1]!==s[1])return;l.push([r[0]+s[0],r[1]+s[1]])}if(!i.some(t=>xo(t)||jo(t)))return;let u="M"+Po(l[0][0])+","+Po(l[0][1]);const c=[];for(let t=0;t<l.length-1;t++){const e=l[t],n=l[t+1],a=null!=(r=jo(i[t]))?r:[0,0],s=null!=(o=xo(i[t+1]))?o:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[n[0]+s[0],n[1]+s[1]];u+="C"+Po(f[0])+","+Po(f[1])+","+Po(d[0])+","+Po(d[1])+","+Po(n[0])+","+Po(n[1]),c.push(So(e,f,d,n))}const f=c.reduce((t,e)=>t+e,0);if(!(f>0))return;const d=[];let h=0;for(let t=0;t<i.length;t++){t>0&&(h+=c[t-1]);const e={t:ko(i[t]),v:h/f},n=wo(i[t]);void 0!==n&&(e.e=n),d.push(e)}return{pathStr:u,distanceKfs:d,autoOrient:!!t.autoOrient,anchor:s}}(i);if(e){const n=g({},o);delete n.transform;const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n.offsetDistance=a;const s=t.transform;let l=s;if(s&&"object"==typeof s){const t=g({},s);delete t.translate,delete t.origin,l=Object.keys(t).length?t:void 0}r=y(g({},t),{animate:n,style:y(g({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:Po(e.anchor[0])+"px "+Po(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==l?r.transform=l:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=y(g({},r),{children:t}))}return r};return e(t)}(i),i=vn(i,null!=(o=null==(r=nt(i))?void 0:r.duration)?o:1e3),e===W.waapi&&(i=nn(i,null==n?void 0:n.motionPath),i=On(i),i=function(t){const e=(t,n)=>{var r;n(t),null==(r=t.children)||r.forEach(t=>e(t,n))};let n=!0;for(;n;){n=!1;const r=new Set;e(t,t=>{var e;"use"===t.type&&"string"==typeof t.href&&r.add((e=t.href).startsWith("#")?e.slice(1):e)}),e(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!r.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,n=!0)})}return t}(i)),i}function _o(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function zo(t,e,n){var r;const o=nt(t)||{},i=bn(t,W.frames),a=o.iterations;let s=1;"number"==typeof a&&(s=a||1),"infinite"===a&&(s=1/0),s<1&&(s=1);const l=+(o.duration||1e3),u=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,c=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,v=-(o.delay||0),g=0,y=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let w=0;const x=()=>{const t=g?(Date.now()-g)*y:0;return v+t},j=()=>{let t=x();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;l>0?(t=pe(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1),n=pe((t-r*e)/e,0,1)):n=t;const o=c||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=An(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const S=()=>!!m&&!!e.isConnected()&&(y<0?x()>0:!(Number.isFinite(u)&&j()>=u)),P=t=>{null!==p&&(_o(p),p=null),(t||S())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void M();const o=j(),i=x();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return M(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return M(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(w&&t-w<A)return;w=t}O(o)}})(),P()}))},M=()=>{if(!m)return;let t=x();Number.isFinite(u)&&t>u&&(t=u),v=t,g=0,m=!1,null!==p&&(_o(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>S(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&v>=u&&(v=0);else if(v<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");v=u}b=!1,m=!0,g=Date.now(),P(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;M(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;M(),v=0,g=0,m=!1,b=!1,O(v),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;v=Number.isFinite(u)?u:j(),g=0,m=!1,null!==p&&(_o(p),p=null),O(d?v:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");let e=x();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,v=e,m&&(g=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(u)&&t>u&&(t=u),v=t,m&&(g=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(j())},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var Io=[1,0,0,1,0,0];function No(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var Co=(t,e)=>[1,0,0,1,t,e],Eo=(t,e)=>[t,0,0,e,0,0];function To(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var Fo=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Lo=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function Do(t){let e=Io;t.translate&&(e=No(e,Co(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=No(e,Co(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=No(e,To(t.rotate))),t.scale&&(e=No(e,Eo(t.scale[0],t.scale[1]))),n&&(e=No(e,Co(-t.origin[0],-t.origin[1]))),e}function Uo(t,e,n){return t+(e-t)*n}function Vo(t,e){return null==t?Io:"string"==typeof t?function(t){let e=Io;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=No(e,Co(n[0]||0,n[1]||0)):"scale"===t?e=No(e,Eo(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=No(e,To(n[0])):"skewX"===t?e=No(e,Fo(n[0])):"skewY"===t?e=No(e,Lo(n[0])):"matrix"===t&&(e=No(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?Do(function(t,e){var n,r,o,i,a,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let u=0;for(;u<t.length-1&&(null!=(o=t[u+1].time)?o:0)<e;)u++;const c=t[u],f=t[u+1],d=(e-(null!=(i=c.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[Uo(h.translate[0],p.translate[0],d),Uo(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=Uo(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[Uo(h.scale[0],p.scale[0],d),Uo(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?Do(t.value):"object"!=typeof t||Array.isArray(t)?Io:Do(t)}var Bo=new Set(["svg","g","symbol"]),Ro=new Set(["defs","mask","clipPath","title"]);function Wo(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Wo(t,e))}function qo(t){return null==t?0:Number(t)}function Go(t){return Math.round(100*t)/100+0}function Ko(t,e,n,r,o){var i;const a=t.type||"";if(Ro.has(a))return;const s=No(e,function(t,e){return t.animate&&t.animate.transform?Vo(t.animate.transform,e):void 0!==t.transform?Vo(t.transform,e):Io}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=No(s,Co(qo(t.x),qo(t.y)));return void(i?Ko(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Bo.has(a)?null==(i=t.children)||i.forEach(t=>Ko(t,s,n,r,o)):o.push(function(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=Go(function(t,e,n,r){var o,i,a,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a:0)<r;)n++;const c=e[n],f=e[n+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return Uo(c.value,f.value,d)}return void 0!==e?Number(e):1}(null==(s=t.animate)?void 0:s.opacity,t.opacity,0,n)),d=t.mask?1:0,h=e.map(Go).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return qo(t.width)+","+qo(t.height)+","+qo(t.x)+","+qo(t.y);case"ellipse":return qo(t.rx)+","+qo(t.ry)+","+qo(t.cx)+","+qo(t.cy);case"circle":return qo(t.r)+","+qo(t.cx)+","+qo(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(qo(c)||"")+"|o:"+f+"|m:"+d}(t,s,n))}function Zo(t,e){var n;e.add(0),(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>Zo(t,e))}function Qo(t,e){const n=new Map;Wo(t,n);const r=[];return Ko(t,Io,e,n,r),r.sort()}function Xo(t,e){const n=new Set;Zo(t,n),Zo(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=Qo(t,o),i=Qo(e,o),a=Jo(n,i),s=Jo(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function Jo(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}function Yo(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=0}=e,i=t.getRootElement();if(!i)return console.warn("setupAnimationTriggers: No root element found for animation."),t;let a=!1;const s=()=>{a&&(a=!1,t.setPlaybackRate(1)),t.play()},l=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":a=!0,t.setPlaybackRate(-1),t.play()}};switch(n){case"load":{const t=()=>s();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{let t=!1;const e=()=>{t=!0,s()},n=()=>{t&&l()};i.addEventListener("mouseenter",e),i.addEventListener("mouseleave",n);break}case"click":{const e=()=>{t.isPlaying()?l():s()};i.addEventListener("click",e);break}case"scrollIntoView":{const t=t=>{var e,n;const r=t.boundingClientRect,o=t.intersectionRect;if(!(null==r?void 0:r.height)||!o)return t.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,a=null!=(n=null==(e=t.rootBounds)?void 0:e.height)?n:1/0,s=Math.min(i,a),l=Math.min(r.height,Number.isFinite(s)?s:r.height);return l>0?o.height/l:t.intersectionRatio},e=Array.from({length:21},(t,e)=>e/20);let n=!1;new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&t(e)>=o?(n=!0,s()):n&&(n=!1,l())})},{threshold:e}).observe(i);break}}return t}function Ho(t){return"#"+t}function $o(t,e,n,r){const o=nt(t)||{};if(!r)if(t.id){const e=Ho(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=zo(t,e||function(t){const e=new Set;return{isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=he(r);const i=Ho(n),a=(null==t?void 0:t.querySelectorAll(i))||document.querySelectorAll(i);0!==a.length||e.has(i)||(e.add(i),console.warn('setAttribute: No elements found for selector "'+i+'"'));for(let t=0;t<a.length;t++){const e=a[t],n="transform"===r&&"pattern"===e.tagName?"patternTransform":r;e.setAttribute(n,o),ue.has(r)&&(e.style[r]=o)}}}}(r),n),a=l(s({},i),{getRootElement:()=>r||null});return o.trigger&&Yo(a,o.trigger),a}function ti(t,e,n,r){var o,i;let a=null!=(o=t.v)?o:t.value;const s=null!=(i=t.e)?i:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;return ie.has(n)&&Array.isArray(a)?u=re(a):"transform"!==n||null===a||"object"!=typeof a||Array.isArray(a)?ae.has(n)?(Array.isArray(a)&&("translate"===n&&(a=a.map(t=>t+"px")),a=a.join(",")),"rotate"===n&&(a+="deg"),u=n+"("+a+")",c="transform"):u="d"===n?'path("'+(a&&"object"==typeof a&&Array.isArray(a.paths)?a.paths:[]).map(t=>Kt(t,!0)).join("")+'")':se.has(n)&&"number"==typeof a?100*a+"%":""+a:(u=le(a,{withUnits:!0}),c="transform"),CSS.supports(he(c),u)||r.add(c),c=ce(c),l[c]=u,l}function ei(t,e,n){var r,o,i,a,u;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(i=n.t)?i:0)-h),r=d.e?$t(d.e)(e):e,{right:o}=ee(d.e,e);c.push({t:0,v:dn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(a=r.t)?a:0)<=n){const e=null!=(u=r.t)?u:0,o=(n-e)/(h-e),i=r.e?$t(r.e)(o):o,{left:a}=ee(r.e,o);c.length>0&&(c[c.length-1]=l(s({},c[c.length-1]),{e:a})),c.push({t:n,v:dn(t,r.v,d.v,i),e:void 0})}break}c.push(d)}return c}function ni(t,e,n){var r;const o=new Map;for(const[i,a]of Object.entries(t)){const t=n.duration||1,u=ei(i,a.kfs||a.keyframes||[],t),c=[];for(let n=0;n<u.length;n++){const o=u[n],a=ti(o,pe((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(a.offset||0)>0&&c.push(l(s({},a),{offset:0})),c.push(a)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(l(s({},c[c.length-1]),{offset:1})),c.length>0&&o.set(i,c)}return o}function ri(t,e,n,r){var o;const i=nt(t)||{};if(!n)if(t.id){const e=Ho(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const a=bn(t,W.waapi),s=[],l=i.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;let f=!1,d=!1;(null==a?void 0:a.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const a=Ho(t.id),l=(null==n?void 0:n.querySelectorAll(a))||document.querySelectorAll(a);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+a+'"');const h=ni(r,c,i),p=i.delay&&i.delay>0?i.delay:void 0;let m;if(i.delay&&i.delay<0&&i.duration){const t=-i.delay;m=u===1/0?t%i.duration:Math.min(t,i.duration*(null!=u?u:1))}const v={duration:i.duration,delay:p,fill:null!=(o=i.fill)?o:"forwards",direction:i.direction,iterations:u};for(let t=0;t<l.length;t++){const n=l[t];for(const[,t]of h)if(t.length>0)try{const r=new KeyframeEffect(n,t,v),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;f||(f=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;d||(d=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==m&&(o.currentTime=m),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const h={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;f=!1,s.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;s.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;f=!1,s.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of s)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(s.forEach(e=>e.playbackRate=t),h),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=s[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{f=!1,s.forEach(e=>{e.currentTime=t})},destroy:()=>{var t;h.cancel(),s.splice(0,s.length),d||(d=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};return i.trigger&&Yo(h,i.trigger),h}function oi(t,e){if(!t)return null;const n=t,{type:a,children:s,style:l}=n,u=((t,e)=>{var n={};for(var a in t)o.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&r)for(var a of r(t))e.indexOf(a)<0&&i.call(t,a)&&(n[a]=t[a]);return n})(n,["type","children","style"]),c=u.domType;void 0!==c&&delete u.domType;const f=rt(t)||e,d=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(l,f);let h;if(s)for(const t of s){const e=oi(t,f);e&&(h||(h=[]),h.push(e))}const p=function(t,e,n,r,o){if(Se.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const i=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e){const n=Ee(t,e[t]);void 0!==n&&(_e.has(t)?i.style[t]=String(n):i.setAttribute(he(t),n))}if(n)for(const t in n)i.style[t]=String(n[t]);if(r)for(const t of r)i.appendChild(t);return o&&(i.textContent=o),i}(a||"g",Te(u),d,h,u[X]||u[Q]);return p&&void 0!==c&&p.setAttribute("type",c),p}var ii="data";function ai(t,e,n,r){const o=Ut(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);t=Mo(t,(nt(t)||{}).mode===R.frames?W.frames:W.waapi);let i=null;if(r){t=je(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=oi(t),i&&e.replaceChildren(i))}return function(t,e,n,r){return function(t,e,n,r){const o=nt(t)||{};return function(t,e,n){let r,o=e;t.resetOnFinish&&(o=l(s({},e),{onFinish:()=>{var t;null==(t=null==e?void 0:e.onFinish)||t.call(e),null==r||r.cancel()}}));const i=n(o);return r=i,t.debugInstName&&(window[t.debugInstName]=i),i}(o,n,n=>o.mode===R.frames?$o(t,e,n,r):ri(t,n,r,o.mode===R.waapi)||$o(t,e,n,r))}(t,e,n,r)}(t,e,n,i)}function si(t){const{src:e,data:n,adapter:r,callbacks:o,container:i}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return ai(n,r,o,i);let a=null,s=[],l=!1;const u=t=>{a?t(a):s&&s.push(t)};return fetch(e).then(t=>t.json()).then(t=>{if(!l)if(et(t)){a=ai(t,r,o,i);const e=s;s=null,null==e||e.forEach(t=>t(a))}else console.error('createAnimator: invalid animation document format at "'+e+'"')}).catch(t=>{s=null,console.error('createAnimator: failed to load "'+e+'"',t)}),{isReady:()=>!!a,getRootElement:()=>a?a.getRootElement():null,isPlaying:()=>(null==a?void 0:a.isPlaying())||!1,play:()=>{u(t=>t.play())},pause:()=>{u(t=>t.pause())},cancel:()=>{u(t=>t.cancel())},finish:()=>{u(t=>t.finish())},setPlaybackRate:t=>{u(e=>e.setPlaybackRate(t))},getCurrentTime:()=>a?a.getCurrentTime():null,setCurrentTime:t=>{u(e=>e.setCurrentTime(t))},destroy:()=>{l=!0,s=null,null==a||a.destroy()}}}function li(){const t=document.querySelectorAll("["+V+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[B]){const t=n.getAttribute(V);t&&(n[B]=si({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=li,window.createAnimator=si,window.setupAnimationTriggers=Yo);export{ie as COLOUR_ATTR_NAMES,ii as PX_ANIMATOR_DATA_KEY,B as PX_ANIM_ATTR_NAME,V as PX_ANIM_SRC_ATTR_NAME,Y as PX_TRANSFORM_PART_KEYS,Wt as PxAnimatedSvgDocumentSchema,ht as PxAnimationDefinitionSchema,bt as PxAnimatorConfigSchema,W as PxAnimatorEngine,R as PxAnimatorMode,At as PxAttrValueSchema,qt as PxBezierPathSchema,kt as PxBindingSchema,It as PxCloneEffectSchema,yt as PxDefsSchema,at as PxEasingOrRefSchema,Dt as PxEffectsSchema,pt as PxElementAnimationSchema,Et as PxFillGradientEffectSchema,$ as PxGradientSpreadMethod,Nt as PxGradientStopSchema,tt as PxGradientType,H as PxGradientUnits,lt as PxKeyframeSchema,st as PxKeyframeValueSchema,ut as PxLoopSchema,Pt as PxMaskedByEffectSchema,Vt as PxNodeBase,Bt as PxNodeSchema,ct as PxPropertyAnimationSchema,St as PxRepeaterEffectSchema,zt as PxRetimeEffectSchema,Tt as PxStrokeGradientEffectSchema,Rt as PxSvgNodeExtra,Lt as PxTextEffectSchema,Ft as PxTextPathEffectSchema,Ot as PxTransformByEffectSchema,ft as PxTransformPartsSchema,dt as PxTransformValueSchema,mt as PxTriggerSchema,_t as PxTrimPathEffectSchema,ue as STYLE_ATTR_NAMES,ae as TRANSFORM_FN_NAMES,yo as applyPlayerEffects,An as calcAnimationValues,he as camelCaseToKebabWordIfNeeded,Zo as collectSampleTimes,si as createAnimator,ai as createAnimatorImpl,zo as createBasicFrameLoopAnimator,$o as createFrameLoopAnimator,Ar as createPathSampler,ri as createWebApiAnimator,D as describeSchema,Xo as diffInEffect,Re as evaluateMotionPathSegment,Sr as extendedPathForBrowser,je as generateNewIds,nt as getAnimatorConfig,ot as getBindings,it as getChildren,rt as getDefs,Te as getNormalizedProps,et as isPxElementFileFormat,Gt as isPxElementFileFormatDeep,Mr as jsonElementFactory,qr as layoutGlyphTextChars,li as loadTagAnimators,Mo as materialiseAllInTree,On as materialiseAnimatedUseInstances,eo as materialiseGlyphText,Zr as materialiseGlyphTextAlongPath,Wr as materialiseGlyphTextHorizontal,mn as materialiseInternalLoopsInPropAnim,vn as materialiseInternalLoopsInTree,We as materialiseMotionPathInPropAnim,nn as materialiseMotionPathsInTree,bn as normalizeDocument,Ue as propAnimIsMotionPath,U as px,oi as renderNode,L as schemaKeys,Yo as setupAnimationTriggers,Or as shiftAnimatable,re as toRGBA,Ut as validateNodeEffects,Qo as visualModelAt};
1
+ var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,s=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&a(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&a(t,n,e[n]);return t},l=(t,r)=>e(t,n(r)),u=Object.defineProperty,c=Object.defineProperties,f=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=Math.pow,v=(t,e,n)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,g=(t,e)=>{for(var n in e||(e={}))h.call(e,n)&&v(t,n,e[n]);if(d)for(var n of d(e))p.call(e,n)&&v(t,n,e[n]);return t},y=(t,e)=>c(t,f(e));function b(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,u=t.c;if(!a.length)return"";const c=[],f=a.length;c.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];e||i[0]!==o[0]||i[1]!==o[1]||u[0]!==f[0]||u[1]!==f[1]?c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1]):c.push("L"+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],u=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function k(t,e,n){return t+(e-t)*n}function w(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=k(t[i]||0,e[i]||0,n);return r}function A(t,e,n){return[k(t[0]||0,e[0]||0,n),k(t[1]||0,e[1]||0,n),k(t[2]||0,e[2]||0,n),k(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function x(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(j(t[i],e[i],n));return o}function j(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],v=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(w(f,h,d));const g=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(a=null==(i=e.i)?void 0:i[n])?a:h;m.push(w(g,y,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;v.push(w(b,k,d))}return{v:p,i:m.length?m:void 0,o:v.length?v:void 0,c:null!=(f=t.c)?f:e.c}}function O(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function S(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=O(e,r,t),((s*n+a)*n+i)*n;var n}}function M(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function P(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=O(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=M(t,e,o),a=M(e,n,o),s=M(n,r,o),l=M(i,a,o),u=M(a,s,o),c=M(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,v=1-d;return m>1e-9&&Math.abs(v)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/v,(c[2][0]-f)/m,(c[2][1]-d)/v]),{left:h,right:p}}function _(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function z(t){const e=Math.round(255*t[0]),n=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+e+","+n+","+r+","+t[3]+")":"rgb("+e+","+n+","+r+")"}function I(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var E=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),C=new Set(["translate","rotate","scale","skew"]),N=new Set(["offset-distance","offsetDistance"]);function T(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),a&&o.push("translate("+-a[0]+c+","+-a[1]+c+")"),o.join("")}var F=new Set(["offset-distance","offsetDistance"]),L=1e3;function D(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function U(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var R=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function V(t){return R.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function B(t,e,n){return Math.max(e,Math.min(t,n))}function W(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var q=1e-4;function G(t,e,n,r,o){const i=K(t,e,n,r,o);return 0===i[0]&&0===i[1]?K(t,e,n,r,o<.5?o+q:o-q):i}function K(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function Z(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=W(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=W(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}function H(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}function X(t){return"scroll"===(null==t?void 0:t.timelineSource)}function Q(t,e,n,r){var o;const[i,a]=function(t,e,n){const r=e,o=n;switch(t){case"cover":return[0,r+o];case"entry":return[0,Math.min(r,o)];case"contain":return[Math.min(r,o),Math.max(r,o)];case"exit":return[Math.max(r,o),r+o];case"entry-crossing":return[0,r];case"exit-crossing":return[o,r+o]}}(null!=(o=null==t?void 0:t.phase)?o:"cover",n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(a-i)}function Y(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var J=class{_canSanitize(t){return this.isValid(t)}optional(){return new $(this)}},$=class extends J{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,e,n){return null==t||this.inner.isValid(t,e,n)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},tt=class extends J{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,n){return"string"==typeof t||(null==e||e.errors.push(Y(null!=n?n:[])+": expected string, got "+typeof t),!1)}},et=class extends J{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,n){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(Y(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},nt=class extends J{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,n){return"boolean"==typeof t||(null==e||e.errors.push(Y(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},rt=class extends J{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,n){return t===this.value||(null==e||e.errors.push(Y(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},ot=class extends J{constructor(t,e){super(),this.values=t,this._default=null!=e?e:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,e,n){return!!this.values.includes(t)||(null==e||e.errors.push(Y(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},it=class extends J{constructor(t,e){super(),this.schemas=t,this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;const o=e&&{errors:[],warnings:[],strict:e.strict};return!!this.schemas.some(e=>e.isValid(t,o,n?[...n]:void 0))||(null==e||e.errors.push(Y(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},at=class extends J{constructor(t,e,n){super(),this._key=t,this._schemas=e,this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];e&&this._map.set(e._default,n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null!=e?this._map.get(e):void 0}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(Y(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},st=class extends J{constructor(t){super(),this._shape=t;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n={};for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(Y(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),e.errors.push(Y(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},lt=class extends J{constructor(t,e){super(),this._shape=t,this._openSchema=e;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=g({},e);for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(n[t]=this._openSchema.sanitize(e[t]));return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(Y(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(this._openSchema)for(const t of Object.keys(r))t in this._shape||(o.push(t),this._openSchema.isValid(r[t],e,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},ut=class extends J{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const n of t)this.item._canSanitize(n)&&e.push(this.item.sanitize(n));return e}isValid(t,e,n){if(!Array.isArray(t))return null==e||e.errors.push(Y(null!=n?n:[])+": expected array, got "+typeof t),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<t.length;n++)r.push("["+n+"]"),this.item.isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},ct=class extends J{constructor(t){super(),this.value=t,this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(Y(null!=n?n:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(const[n,i]of Object.entries(t))r.push(n),this.value.isValid(i,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},ft=class extends J{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},dt=class extends J{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(Y(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},ht=class extends J{constructor(t,e){super(),this.fn=t,this._default=e,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,e,n){return this.schema.isValid(t,e,n)}_canSanitize(t){return this.schema._canSanitize(t)}},pt=class extends J{constructor(t){super(),this.schemas=t,this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(Y(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function mt(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function vt(t){var e;const n=t;return"_shape"in n?{kind:"shape",shape:n._shape}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.fn()}:{kind:"leaf"}}var gt={string:(t="")=>new tt(t),number:(t=0)=>new et(t),boolean:(t=!1)=>new nt(t),literal:t=>new rt(t),enum:(t,e)=>new ot(t,e),union:(t,e)=>new it(t,e),discriminatedUnion:(t,e)=>new at(t,e),object:t=>new st(t),openObject:(t,e)=>new lt(t,e),extendedObject:(t,e)=>new st(g(g({},t._shape),e)),array:t=>new ut(t),record:t=>new ct(t),any:()=>new ft,defined:()=>new dt,tuple:t=>new pt(t),lazy:(t,e)=>new ht(t,e)},yt="data-px-animation-src",bt="_px_animator",kt={auto:"auto",waapi:"waapi",frames:"frames"},wt={waapi:kt.waapi,frames:kt.frames},At="before",xt="userSpaceOnUse",jt="objectBoundingBox",Ot="combined",St="text",Mt="textContent",Pt=new Set(["type","children","animator","meta","animate","effects",St,Mt]),_t=["translate","rotate","scale","origin"],zt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},It={pad:"pad",reflect:"reflect",repeat:"repeat"},Et={linear:"linear",radial:"radial"};function Ct(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function Nt(t){var e;return(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator)}function Tt(t){var e;if(t)return null==(e=Nt(t))?void 0:e.definitions}function Ft(t){var e;if(!t)return;const n=null==(e=Nt(t))?void 0:e.animateById;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Lt(t){return null==t?void 0:t.children}var Dt=gt.union([gt.string(),gt.tuple([gt.number(),gt.number(),gt.number(),gt.number()])]),Ut=gt.union([gt.string(),gt.number(),gt.array(gt.number()),gt.lazy(()=>Wt,{}),gt.object({path:gt.string()}),gt.lazy(()=>gt.object({paths:gt.array(Oe)}),{paths:[]}),gt.lazy(()=>gt.array(he),[])]),Rt=gt.object({time:gt.number().optional(),t:gt.number().optional(),value:Ut.optional(),v:Ut.optional(),easing:Dt.optional(),e:Dt.optional(),tangentOut:gt.tuple([gt.number(),gt.number()]).optional(),to:gt.tuple([gt.number(),gt.number()]).optional(),tangentIn:gt.tuple([gt.number(),gt.number()]).optional(),ti:gt.tuple([gt.number(),gt.number()]).optional(),selected:gt.boolean().optional()}),Vt=gt.object({segmentCount:gt.number().optional(),extend:gt.enum([At,"after"]).optional(),alternate:gt.boolean().optional()}),Bt=gt.object({value:Ut.optional(),keyframes:gt.array(Rt).optional(),kfs:gt.array(Rt).optional(),loop:gt.union([Vt,gt.boolean()]).optional(),autoOrient:gt.boolean().optional()}),Wt=gt.object({translate:gt.tuple([gt.number(),gt.number()]).optional(),rotate:gt.number().optional(),skew:gt.number().optional(),scale:gt.tuple([gt.number(),gt.number()]).optional(),origin:gt.tuple([gt.number(),gt.number()]).optional()}),qt=gt.union([gt.string(),Wt,gt.object({value:Wt}),Bt]),Gt=gt.record(Bt),Kt=gt.union([gt.string(),gt.array(gt.union([gt.string(),Gt])),Gt]),Zt=gt.object({startOn:gt.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:gt.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:gt.number().optional()}),Ht=gt.object({width:gt.number(),d:gt.string()}),Xt=gt.object({fFamily:gt.string(),style:gt.string(),ascent:gt.number(),unitsPerEm:gt.number(),glyphs:gt.record(Ht)}),Qt=gt.object({easings:gt.record(gt.tuple([gt.number(),gt.number(),gt.number(),gt.number()])).optional(),animations:gt.record(Gt).optional(),styles:gt.record(gt.any()).optional(),glyphs:gt.record(Xt).optional()}),Yt=gt.object({phase:gt.enum(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:gt.number().optional()}),Jt=gt.object({start:Yt.optional(),end:Yt.optional()}),$t=gt.object({driver:gt.enum(["custom","native"]).optional(),kind:gt.enum(["view","scroll"]).optional(),axis:gt.enum(["block","inline","x","y"]).optional(),source:gt.enum(["nearest","root"]).optional(),subject:gt.string().optional(),smoothing:gt.number().optional(),pin:gt.boolean().optional(),pinTop:gt.number().optional(),pinDistance:gt.number().optional(),range:Jt.optional()}),te=gt.object({mode:gt.enum([kt.auto,kt.waapi,kt.frames]).optional(),duration:gt.number().optional(),delay:gt.number().optional(),iterations:gt.union([gt.number(),gt.literal("infinite")]).optional(),fill:gt.enum(["forwards","backwards","both","none"]).optional(),direction:gt.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:gt.number().optional(),trigger:Zt.optional(),resetOnFinish:gt.boolean().optional(),definitions:Qt.optional(),animateById:gt.record(Kt).optional(),timelineSource:gt.string().optional(),scroll:$t.optional(),debugInstName:gt.string().optional()}),ee=gt.object({id:gt.string(),animate:Kt}),ne=gt.union([gt.string(),gt.number(),gt.array(gt.number()),gt.object({value:gt.defined()}),Wt]),re=gt.union([gt.number(),gt.object({value:gt.number()}),Bt]),oe=gt.union([gt.tuple([gt.number(),gt.number()]),gt.object({value:gt.tuple([gt.number(),gt.number()])}),Bt]),ie=gt.union([gt.string(),gt.object({value:gt.string()}),Bt]),ae=gt.object({translate:oe.optional(),rotate:re.optional(),scale:oe.optional(),skew:re.optional(),origin:oe.optional()}),se=gt.object({copies:gt.number().optional(),translate:oe.optional(),rotate:re.optional(),skew:re.optional(),scale:oe.optional(),origin:oe.optional()}),le=gt.object({sourceId:gt.string().optional(),maskType:gt.enum(["luminance","alpha"]).optional(),maskUnits:gt.enum([xt,jt]).optional(),maskContentUnits:gt.enum([xt,jt]).optional(),x:gt.number().optional(),y:gt.number().optional(),width:gt.number().optional(),height:gt.number().optional()}),ue=gt.object({d:ie.optional(),animate:Bt.optional()}),ce=gt.object({offset:re.optional(),range:oe.optional(),subPaths:gt.enum(["separate",Ot]).optional()}),fe=gt.object({sourceId:gt.string().optional(),start:gt.number().optional(),stretch:gt.number().optional(),timeCrop:gt.tuple([gt.number(),gt.number()]).optional()}),de=gt.object({type:gt.enum(["content"]).optional(),sourceId:gt.string().optional(),retime:fe.optional()}),he=gt.object({offset:gt.number(),color:gt.string()}),pe=gt.union([gt.array(he),gt.object({value:gt.array(he)}),Bt]),me=gt.object({type:gt.enum([Et.linear,Et.radial]),p1:oe.optional(),p2:oe.optional(),c:oe.optional(),r:re.optional(),fp:oe.optional(),stops:pe.optional(),gradientUnits:gt.enum([zt.userSpaceOnUse,zt.objectBoundingBox]).optional(),spreadMethod:gt.enum([It.pad,It.reflect,It.repeat]).optional(),gradientTransform:gt.string().optional()}),ve=me,ge=gt.object({path:gt.string(),pathOverflow:gt.enum(["clip","extend"]).optional(),lengthAdjust:gt.enum(["spacing","spacingAndGlyphs"]).optional(),method:gt.enum(["align","stretch"]).optional(),spacing:gt.enum(["auto","exact"]).optional(),startOffset:re.optional(),textLength:re.optional()}),ye=gt.object({useGlyphs:gt.boolean().optional()}),be=gt.object({transformBy:ae.optional(),repeater:se.optional(),maskedBy:le.optional(),clipPath:ue.optional(),trimPath:ce.optional(),clone:de.optional(),fillGradient:me.optional(),strokeGradient:ve.optional(),textPath:ge.optional(),text:ye.optional()});function ke(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!be.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}var we=gt.openObject({type:gt.string(),id:gt.string().optional(),meta:gt.any().optional(),effects:be.optional(),animate:Kt.optional(),style:gt.union([gt.string(),gt.record(gt.union([gt.string(),gt.number()]))]).optional()},ne),Ae=gt.openObject(y(g({},we._shape),{children:gt.lazy(()=>gt.array(Ae),[]).optional()}),ne),xe=gt.object({width:gt.union([gt.number(),gt.string()]).optional(),height:gt.union([gt.number(),gt.string()]).optional(),viewBox:gt.string().optional(),animator:te.optional()}),je=gt.openObject(y(g(g({},we._shape),xe._shape),{type:gt.literal("svg"),children:gt.array(Ae).optional()}),ne),Oe=gt.object({v:gt.array(gt.array(gt.number())),i:gt.array(gt.array(gt.number())).optional(),o:gt.array(gt.array(gt.number())).optional(),c:gt.boolean().optional()});function Se(t){const e=je.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}var Me=0;function Pe(){return"_px_"+Date.now().toString(36)+(++Me).toString(36)+Math.random().toString(36).substring(2,6)}function _e(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>_e(t));const e=t,n={};for(const t of Object.keys(e))n[t]=_e(e[t]);return n}function ze(t){var e,n;const r=_e(t),o=new Map,i=new Set(["href","xlink:href"]),a=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["sourceId","targetId","boundElementId"]);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=Pe();o.set(t,n),e.id=n}else e.animate&&(e.id=Pe());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(r),function t(e){if(e&&"object"==typeof e)for(const[n,r]of Object.entries(e))if("children"!==n)if("string"==typeof r)if(i.has(n)&&r.startsWith("#")){const t=r.slice(1),i=o.get(t);i&&(e[n]="#"+i)}else if(a.has(n))e[n]=Ie(r,o);else if(s.has(n)){const t=r.startsWith("#"),i=o.get(t?r.slice(1):r);i&&(e[n]=t?"#"+i:i)}else r.includes("url(#")&&(e[n]=Ie(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=Ie(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const l=null==(e=r.animator)?void 0:e.animateById;if(l&&"object"==typeof l){const t={};for(const[e,r]of Object.entries(l))t[null!=(n=o.get(e))?n:e]=r;r.animator=y(g({},r.animator),{animateById:t})}return r}function Ie(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var Ee=new Set(["script","foreignobject"]),Ce=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Ne=new Set(["href","xlink:href","src"]),Te=new Set(["mixBlendMode","isolation"]),Fe=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Le=/^data:image\/svg\+xml(?:;[^,]*)?,/i,De=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Ue=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Re(t,e){const n=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(n)){if("fill"===n||"stroke"===n||"stopcolor"===n){const t=String(e);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+n+'" blocked: url() must be internal url(#id), got:',e):e}if(Ce.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)||Ne.has(n)&&(Fe.test(t)||Le.test(t)||function(t){const e=De.exec(t);return!!e&&Ue.some(t=>e[1].startsWith(t))}(t))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or data:image/… URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function Ve(t){const e={};for(const n of Object.keys(t)){const r=D(n);if(Pt.has(r))continue;if("style"===r)continue;let o=t[n];if(E.has(r)&&Array.isArray(o))e[r]=z(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes||o.kfs)C.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e.transform=r+"("+o+")"):Array.isArray(o)?e[r]=o.join(","):null!=o&&(e[r]=String(o));else{const t=o.value&&"object"==typeof o.value?o.value:o;e.transform=T(t,{withUnits:!1})}}return e}function Be(t){var e;const n=null!=(e=t.value)?e:t.v;if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const r=n.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function We(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function qe(t){var e;return null!=(e=t.easing)?e:t.e}function Ge(t){var e,n,r;const o=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(o))return!1;if(t.autoOrient)return!0;for(const t of o)if((null!=(n=t.tangentIn)?n:t.ti)||(null!=(r=t.tangentOut)?r:t.to))return!0;return!1}var Ke=new WeakMap;function Ze(t,e,n,r){var o,i;let a=Ke.get(t);const s=null==a?void 0:a.get(e);if(s)return s;const l=null!=(o=t.tangentOut)?o:t.to,u=null!=(i=e.tangentIn)?i:e.ti,c=[n[0]+(l?l[0]:0),n[1]+(l?l[1]:0)],f=[r[0]+(u?u[0]:0),r[1]+(u?u[1]:0)],d=Z(n,c,f,r),h={P0:n,P1:c,P2:f,P3:r,lut:d,totalArc:d.ds[d.ds.length-1]};return a||(a=new WeakMap,Ke.set(t,a)),a.set(e,h),h}function He(t,e,n,r,o,i){const a=Ze(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=e*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(n<=0)return r[0];if(n>=o[i])return r[i];let a=1,s=i;for(;a<s;){const t=a+s>>>1;o[t]<n?a=t+1:s=t}const l=o[s-1],u=o[s]-l,c=u>0?(n-l)/u:0;return r[s-1]+c*(r[s]-r[s-1])}(a.lut,o),l=W(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=G(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Xe(t,e){var n,r,o,i;if(!Ge(t))return t;const a=null!=(n=t.keyframes)?n:t.kfs;if(!Array.isArray(a)||a.length<2)return t;const s=!!t.autoOrient,l=null!=(r=null==e?void 0:e.flatnessTolerance)?r:.5,u=null!=(o=null==e?void 0:e.rotationTolerance)?o:5,c=null!=(i=null==e?void 0:e.maxSamplesPerSegment)?i:32,f=[],d=Be(a[0]);if(!d)return t;const h=s?function(t,e){const n=Be(t),r=Be(e);if(!n||!r)return 0;const o=Ze(t,e,n,r),i=G(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(a[0],a[1]):void 0;f.push(Ye(We(a[0]),tn(Je(a[0]),Je(a[0]),0,d,h,s)));for(let t=0;t<a.length-1;t++){const e=a[t],n=a[t+1],r=Be(e),o=Be(n);r&&o?(s&&t>0&&nn(f,e,n,r,o,u),on(f,e,n,r,o,s,l,u,c)):f.push(Ye(We(n),tn(Je(n),Je(n),1,null!=o?o:[0,0],void 0,s)))}const p=qe(a[a.length-1]);p&&(f[f.length-1].e=p),s&&Qe(f);const m={kfs:f};return void 0!==t.loop&&(m.loop=t.loop),m}function Qe(t){var e;let n;for(const r of t){const t=null!=(e=r.v)?e:r.value;if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let o=t.rotate;for(;o-n>180;)o-=360;for(;o-n<-180;)o+=360;t.rotate=o,n=o}}function Ye(t,e){return{t:t,v:e}}function Je(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function $e(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function tn(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=$e(o,s,n))}return void 0!==o&&(a.rotate=o+en(t,e,n)),a}function en(t,e,n){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==e?void 0:e.rotate)?e.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=$e(r,o,n);return"number"==typeof i?i:0}function nn(t,e,n,r,o,i){var a;const s=t[t.length-1],l=null!=(a=s.v)?a:s.value,u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=Je(e),f=u-en(c,c,0),d=Ze(e,n,r,o),h=G(d.P0,d.P1,d.P2,d.P3,0),p=180*Math.atan2(h[1],h[0])/Math.PI,m=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(p,f);if(Math.abs(m)<=i)return;const v=We(e),g=Math.min(v+rn,(v+We(n))/2),y=tn(Je(e),Je(e),0,r,p,!0);t.push(Ye(g,y))}var rn=.05;function on(t,e,n,r,o,i,a,s,l){const u=Ze(e,n,r,o),c=We(e),f=We(n),d=qe(e),h=(p=d)?S([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Je(e),v=Je(n),g=function(t,e,n,r,o){const i=[];an(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),an(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)sn(a[o],a[o+1],s,t,e,n,r,l);return s}(u,i,a,s,l),y=[];for(const t of g){const e=H(u.lut,t),n=B(u.totalArc>0?e/u.totalArc:t,0,1),r={u:B(h(n),0,1),p:n,pos:W(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=G(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}y.push(r)}let b=d,k=0;const w=t.length-1;for(let e=0;e<y.length;e++){const n=y[e],r=k<1?B((n.u-k)/(1-k),0,1):1,{left:o,right:a}=P(b,r),s=0===e?w:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=tn(m,v,n.p,n.pos,n.rotateDeg,i);t.push(Ye(l,u)),b=a,k=n.u}}function an(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),u=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function sn(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=W(r.P0,r.P1,r.P2,r.P3,t),c=W(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=W(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=W(r.P0,r.P1,r.P2,r.P3,l),p=W(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(ln(d,u,c),ln(h,u,c),ln(p,u,c));let v=!0;if(o){const n=G(r.P0,r.P1,r.P2,r.P3,t),o=G(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(v=!1)}m<=i&&v||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,sn(t,l,n,r,o,i,a,s),sn(l,e,n,r,o,i,a,s))}function ln(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function un(t,e){const n=cn(t,e);return null!=n?n:t}function cn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=cn(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,n=t.transform;if(n&&"object"==typeof n&&Ge(n)){const o=Xe(n,e);o!==n&&(r=y(g({},t),{transform:o}))}}if(!n&&!r)return null;const i=g({},t);return n&&(i.children=n),r&&(i.animate=r),i}function fn(t,e){if(t===e)return!0;if(typeof t!=typeof e||null===t||null===e||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(e))return!1;const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(n=>fn(t[n],e[n]))}function dn(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function hn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function pn(t){return"string"==typeof t&&void 0!==hn(t)}function mn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=hn(t.path);return e?{paths:dn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&pn(e[0])){const t=[];for(const n of e){const e=hn(n);e&&t.push(...dn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&pn(t[0])){const e=[];for(const n of t){const t=hn(n);t&&e.push(...dn(t))}return{paths:e}}return{paths:t}}return pn(t)?{paths:dn(hn(t))}:t}function vn(t,e){var n;if(t)return Array.isArray(t)?t:(null==(n=null==e?void 0:e.easings)?void 0:n[t])?e.easings[t]:void console.warn("Unknown easing name: "+t)}function gn(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function yn(t,e,n,r){var o,i;return"d"===t?{paths:x(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}:E.has(t)?A(e||[0,0,0,1],n||[0,0,0,1],r):"transform"!==t||"object"!=typeof e||null===e||Array.isArray(e)||"object"!=typeof n||null===n||Array.isArray(n)?"rotate"===t&&"number"==typeof e&&"number"==typeof n?k(e,n,r):C.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?w(e||[],n||[],r):k(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=k(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=w(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function bn(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=B(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.extend===At?e.slice(0,c+1):e.slice(u-c);const d=null!=(i=e[0].t)?i:0,h=null!=(a=e[e.length-1].t)?a:0;let p,m;n.extend===At?(p=0,m=d):(p=h,m=r);const v=m-p;if(v<=0)return e;const b=null!=(s=f[0].t)?s:0,k=(null!=(l=f[f.length-1].t)?l:0)-b;if(k<=0)return e;const w=f.map(t=>{var e,n;return{relT:(t.t-b)/k,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),A=Math.floor(v/k),x=v-A*k,j=x/k,O=[],M=n.extend!==At,z=e[e.length-1];let I,E=!1;function C(e,n,r){var o;let i;if(n){i=[];for(let t=w.length-1;t>=0;t--)i.push({relT:1-w[t].relT,v:w[t].v,e:t>0?_(w[t-1].e):void 0,tangentIn:w[t].tangentOut,tangentOut:w[t].tangentIn})}else i=w;const a=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>a+1e-9){const o=i[n-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?S(o.e)(l):l,c=yn(t,o.v,r.v,u),{left:f}=P(o.e,l);return O.length>0&&o.relT<=a&&(O[O.length-1].e=f),void O.push({t:e+a*k,v:c,e:void 0})}const s=O.length>0?O[O.length-1]:z,l=M&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*k))<1e-9;if(l){if(fn(s.v,r.v)){O.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(I=r.e,E=!0);continue}O.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:e+r.relT*k+(l?1:0),v:r.v,e:n<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),O.push(u)}}if(n.extend===At){j>1e-9&&function(e,n,r){let o;if(n){o=[];for(let t=w.length-1;t>=0;t--)o.push({relT:1-w[t].relT,v:w[t].v,e:t>0?_(w[t-1].e):void 0,tangentIn:w[t].tangentOut,tangentOut:w[t].tangentIn})}else o=w;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?S(a.e)(o):o,l=yn(t,a.v,r.v,s),{right:u}=P(a.e,o);O.push({t:e,v:l,e:u})}const s={t:e+(r.relT-i)*k,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),O.push(s)}}(p,!!n.alternate&&A%2==0,j);for(let t=0;t<A;t++){const e=A-1-t,r=!!n.alternate&&e%2==0;C(p+x+t*k,r)}}else{for(let t=0;t<A;t++){const e=!!n.alternate&&t%2==0;C(p+t*k,e)}if(j>1e-9){const t=!!n.alternate&&A%2==0;C(p+A*k,t,j)}}return n.extend===At?[...O,...e]:E&&e.length>0?[...e.slice(0,-1),y(g({},e[e.length-1]),{e:I}),...O]:[...e,...O]}function kn(t,e,n,r){var o,i,a,s,l,u,c;const f=e.keyframes||e.kfs||[],d=[];for(const e of f){const n=null!=(i=null!=(o=e.time)?o:e.t)?i:0;let f=null!=(a=e.value)?a:e.v;const h=null!=(s=e.easing)?s:e.e;"d"===t&&(f=mn(f));const p=U(t)?V(t):t;E.has(p)&&(f=null!=(l=I(f))?l:f);const m={t:n,v:f,e:vn(h,r)},v=null!=(u=e.tangentIn)?u:e.ti,g=null!=(c=e.tangentOut)?c:e.to;v&&(m.tangentIn=v),g&&(m.tangentOut=g),d.push(m)}d.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const h=e.loop,p=!0===h?{}:h||void 0;return p&&d.length>=2?bn(t,d,p,n):d}function wn(t,e,n){var r;const o=e.loop;if(null==o||!1===o)return e;const i=!0===o?{}:o,a=null!=(r=e.keyframes)?r:e.kfs;if(!Array.isArray(a)||a.length<2)return e;const s=U(t)?V(t):t,l=E.has(s),u=a.map(e=>{var n,r,o,i,a,s,u,c;const f=null!=(n=e.t)?n:e.time;let d=null!=(r=e.v)?r:e.value;"d"===t&&(d=mn(d)),l&&(d=null!=(o=I(d))?o:d);const h={t:f,v:d,e:null!=(i=e.e)?i:e.easing};return(null!=(a=e.tangentIn)?a:e.ti)&&(h.tangentIn=null!=(s=e.tangentIn)?s:e.ti),(null!=(u=e.tangentOut)?u:e.to)&&(h.tangentOut=null!=(c=e.tangentOut)?c:e.to),h}),c={kfs:bn(t,u,i,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function An(t,e){const n=xn(t,e);return null!=n?n:t}function xn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=xn(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const n of Object.keys(t)){const o=t[n],i=wn(n,o,e);i!==o&&(r||(r=g({},t)),r[n]=i)}}if(!n&&!r)return null;const i=g({},t);return n&&(i.children=n),r&&(i.animate=r),i}var jn=0;function On(t,e=wt.waapi){const n=Nt(t)||{},r=Tt(t),o=n.duration||1e3,i=[],a=(t,n)=>{if(!n)return null;const i=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=gn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=gn(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===i.length)return null;const a=function(t,e,n,r=wt.waapi){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=kn(i,a,e,n);if(s.length>0){const t={kfs:s};void 0!==a.autoOrient&&(t.autoOrient=a.autoOrient),void 0!==a.loop&&(t.loop=a.loop),o[i]=r===wt.waapi&&"transform"===i?Xe(t):t}}return o}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(i),o,r,e);return 0===Object.keys(a).length?null:{id:t,animate:a}},s=Ft(t);if(s)for(const t of s){const e=a(t.id,t.animate);e&&i.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++jn;t.id=n;const r=a(n,e);r&&i.push(r)}if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e]);return i}function Sn(t,e,n){var r,o,i,a,s,l,u;const c=e.kfs||e.keyframes||[];if(0===c.length)return null;const{prevKf:f,nextKf:d}=function(t,e){var n,r;const o=t.length-1;let i=t[0],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){i=t[s],a=t[s+1];break}e>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(c,n);let h=f===d?0:(p=n,m=null!=(r=f.t)?r:0,(v=null!=(o=d.t)?o:0)===m?0:0+(p-m)/(v-m)*1);var p,m,v;h=B(h,0,1);const g=null!=(i=f.e)?i:f.easing;if(g&&Array.isArray(g))try{h=S(g)(h)}catch(t){}let y=U(t)?V(t):t,j=null;const O=null!=(a=null==f?void 0:f.v)?a:null==f?void 0:f.value,M=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===y)j=x(null!=(l=null==O?void 0:O.paths)?l:Array.isArray(O)?O:[],null!=(u=null==M?void 0:M.paths)?u:Array.isArray(M)?M:[],h).map(t=>b(t)).join("");else if(E.has(y))j=z(A(O||[0,0,0,1],M||[0,0,0,1],h)),y=t;else if("stroke-dasharray"===y)j=w(O||[],M||[],h).join(" "),y=t;else if("transform"!==y||null===O||"object"!=typeof O||Array.isArray(O))"translate"===y?(j="translate("+w(O||[0,0],M||[0,0],h).join(",")+")",y="transform"):"rotate"===y?(j="rotate("+k(+(O||0),+(M||0),h)+")",y="transform"):"scale"===y?(j="scale("+w(O||[1,1],M||[1,1],h).join(",")+")",y="transform"):j=k(+(O||0),+(M||0),h);else{const t=new Set([...O?Object.keys(O):[],...M?Object.keys(M):[]]),n={};for(const e of t){const t=null==O?void 0:O[e],r=null==M?void 0:M[e];if("rotate"===e||"skew"===e)n[e]=k(+(null!=t?t:0),+(null!=r?r:0),h);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=w(t||o,r||o,h);n[e]=i}}if(Ge(e)){const t=O.translate,r=M.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=He(f,d,[+t[0],+t[1]],[+r[0],+r[1]],h,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}j=T(n,{withUnits:!1}),y="transform"}return N.has(y)&&"number"==typeof j&&(j=100*j+"%"),{k:y,v:null===j?"":""+j}}function Mn(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Sn(r,o,e);t&&(n[t.k]=t.v)}return n}function Pn(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Pn);const e={};for(const n of Object.keys(t))e[n]=Pn(t[n]);return e}function _n(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=e();n.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t}),i=t=>{var e;if("string"==typeof t.href&&t.href.startsWith("#")){const e=n.get(t.href.slice(1));e&&(t.href="#"+e)}for(const e of Object.keys(t)){if("children"===e||"effects"===e||"meta"===e||"animate"===e||"href"===e||"id"===e)continue;const n=t[e];"string"==typeof n&&-1!==n.indexOf("url(#")&&(t[e]=o(n))}null==(e=t.children)||e.forEach(i)};return i(t),n}function zn(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function In(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=Cn(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=Nn(t.viewBox);if(e)return[e[2],e[3]];const n=En(t.width),r=En(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=Tn(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return y(g({},s),{children:u})}function En(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Cn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Nn(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}function Tn(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Cn(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return function(t,e,n,r,o,i,a){var s,l,u,c;const f=Pn(e);_n(f,o);const d="symbol"===f.type?Nn(f.viewBox):void 0,h=null!=(l=null!=(s=En(t.width))?s:null==d?void 0:d[2])?l:a[0],p=null!=(c=null!=(u=En(t.height))?u:null==d?void 0:d[3])?c:a[1],m="symbol"===f.type?function(t,e,n,r,o){const i=Nn(t.viewBox),a=y(g({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,h=(o-c*f)/2,p=[];0===d&&0===h||p.push("translate("+d+","+h+")"),1!==f&&p.push("scale("+f+")"),0===s&&0===l||p.push("translate("+-s+","+-l+")"),p.length&&(a.transform=p.join(""));const m=e();return n.push({type:"clipPath",id:m,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+m+")",a}(f,o,i,h,p):f,v=Tn(m,n,r,o,i,a),b=y(g({},t),{type:"g",children:[v]});return delete b.href,delete b.width,delete b.height,function(t){var e;const n=zn(t.x),r=zn(t.y);if(delete t.x,delete t.y,!n&&!r)return t;const o="translate("+n+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const n={type:"g",transform:o,children:null!=(e=t.children)?e:[]};t.children=[n]}else t.transform=o;return t}(b)}(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Tn(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?y(g({},t),{children:s}):t}function Fn(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:"skew"===t?r.skew=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function Ln(t){var e,n,r;if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const o=t,i=null!=(e=o.keyframes)?e:o.kfs;if(i){const t={kind:"animated",keyframes:i.map(Un),autoOrient:o.autoOrient,loop:o.loop},e=null!=(n=o.value)?n:o.v;return void 0!==e&&"animated"===t.kind&&(t.base=e),t}const a=null!=(r=o.value)?r:o.v;if(void 0!==a)return{kind:"static",value:a}}return{kind:"static",value:t}}function Dn(t,e,n,r){var o,i,a,s;const l=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=l(n.value));const u=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,c=g({},u||{}),f={keyframes:n.keyframes};void 0!==n.loop&&(f.loop=n.loop),void 0!==n.autoOrient&&(f.autoOrient=n.autoOrient),c[e]=f,t.animate=c;const d=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==d&&(t[e]=l(d))}function Un(t){if(!t||"object"!=typeof t)return t;const e=t;if(void 0===e.t&&void 0===e.v&&void 0===e.e&&void 0===e.to&&void 0===e.ti)return t;const n=g({},e);return void 0===n.time&&void 0!==e.t&&(n.time=e.t),void 0===n.value&&void 0!==e.v&&(n.value=e.v),void 0===n.easing&&void 0!==e.e&&(n.easing=e.e),void 0===n.tangentOut&&void 0!==e.to&&(n.tangentOut=e.to),void 0===n.tangentIn&&void 0!==e.ti&&(n.tangentIn=e.ti),n}function Rn(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function Vn(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=Wn(r,e.origin,!0),r=Bn(r,"scale",e.scale),r=Bn(r,"skew",e.skew),r=Bn(r,"rotate",e.rotate),r=Wn(r,e.origin,!1),function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?(r=Wn(r,e.origin,!0),r=Bn(r,"translate",e.translate),r=Wn(r,e.origin,!1)):r=Bn(r,"translate",e.translate),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function Bn(t,e,n,r){if(void 0===n)return t;const o=Ln(n);if("static"===o.kind)return{type:"g",transform:{value:Fn(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>Rn(t,Fn(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Wn(t,e,n){if(void 0===e)return t;const r=Ln(e),o=t=>n?[-t[0],-t[1]]:t;if("absent"===r.kind)return t;if("static"===r.kind)return 0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]};if("animated"===r.kind){const e={keyframes:r.keyframes.map(t=>Rn(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function qn(t,e){return"_lw_"+e+"_"+t.nextId++}function Gn(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Kn(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Kn(t,e))}var Zn=Pn;function Hn(t,e,n){var r,o,i;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.type)){const r=Gn(t.effects.clone.sourceId);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>Hn(t,e,n))}function Xn(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function Qn(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function Yn(t,e,n,r){if(!e)return t;const o=qn(n,"grad"),i=function(t,e){const n={type:t.type===Et.radial?"radialGradient":"linearGradient",id:e};return t.type===Et.linear?(Jn(n,"x1","y1",t.p1),Jn(n,"x2","y2",t.p2)):(Jn(n,"cx","cy",t.c),function(t,e,n){const r=Ln(n);"absent"!==r.kind&&Dn(t,"r",r,{asString:!0})}(n,0,t.r),Jn(n,"fx","fy",t.fp)),t.gradientUnits&&(n.gradientUnits=t.gradientUnits),t.spreadMethod&&(n.spreadMethod=t.spreadMethod),t.gradientTransform&&(n.gradientTransform=t.gradientTransform),n.children=function(t){var e,n,r,o;if(!t)return[];const i=Ln(t);if("absent"===i.kind)return[];if("static"===i.kind)return Array.isArray(i.value)?i.value.map($n):[];const a=i.keyframes;if(!a.length)return[];const s=i.loop;let l=0;for(const t of a){const n=null!=(e=t.value)?e:t.v;Array.isArray(n)&&n.length>l&&(l=n.length)}if(!l)return[];const u=null!=(n=a[0].value)?n:a[0].v,c=[];for(let t=0;t<l;t++){const e=null!=(o=null!=(r=null==u?void 0:u[t])?r:tr(a,0,t))?o:{offset:t/Math.max(1,l-1),color:"#000000"};c.push({offset:e.offset,color:e.color})}return c.map((t,e)=>function(t,e,n,r,o){var i,a,s,l,u;const c=[],f=[];let d=!1;for(const r of e){const o=null!=(a=null!=(i=r.time)?i:r.t)?a:0,h=null!=(s=r.value)?s:r.v,p=null!=(l=null==h?void 0:h[n])?l:tr(e,e.indexOf(r),n);if(!p)continue;const m=null!=(u=r.easing)?u:r.e,v={time:o,value:p.color};void 0!==m&&(v.easing=m),c.push(v);const g={time:o,value:p.offset};void 0!==m&&(g.easing=m),f.push(g),p.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:er(t.offset),stopColor:t.color},p={};return c.length&&(p.stopColor={keyframes:c},void 0!==o&&(p.stopColor.loop=o)),d&&f.length&&(p.offset={keyframes:f},void 0!==o&&(p.offset.loop=o)),Object.keys(p).length&&(h.animate=p),h}(t,a,e,0,s))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function Jn(t,e,n,r){var o,i,a;const s=Ln(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function $n(t){return{type:"stop",offset:er(t.offset),stopColor:t.color}}function tr(t,e,n){var r,o;for(let o=e;o>=0;o--){const e=null!=(r=t[o].value)?r:t[o].v;if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=null!=(o=t[r].value)?o:t[r].v;if(null==e?void 0:e[n])return e[n]}}function er(t){return Math.round(1e3*t)/10+"%"}function nr(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.path?t.path:void 0}function rr(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=Ln(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformBy.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=or(o,"translate",e.translate,void 0),o=or(o,"rotate",e.rotate,r),o=or(o,"scale",e.scale,r),o}function or(t,e,n,r,o){if(void 0===n)return t;const i=Ln("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:Fn(e,ir(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=Rn(t,Fn(e,ir(e,t.value),r));return"translate"===e?g(g({},n),ar(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function ir(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function ar(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function sr(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function lr(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function ur(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=cr(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function cr(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function fr(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}return s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t),a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes&&!i.kfs){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}var dr="content";function hr(t,e,n){if(!e)return;const r=Gn(e.sourceId);if(!r)return void(e.type===dr&&n.errors.push("clone: content ref missing sourceId"));const o=e.type===dr&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function pr(t,e){const n={};return void 0!==t.translate&&(n.translate=mr(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=mr(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=mr(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){return mr(t,t=>[Math.pow(t[0],e),Math.pow(t[1],e)],!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function mr(t,e,n=!1){const r=Ln(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return"number"!=typeof t&&!Array.isArray(t)||n?{value:o}:o}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?y(g({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}function vr(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function gr(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-1),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+1,value:0}],a=g({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function yr(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function br(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function kr(t){var e;const n=null==(e=t.effects)?void 0:e.clone;n&&(delete n.retime,0===Object.keys(n).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function wr(t,e,n){const r=Gn(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Ar(r,e,n,new Set);o&&(t.href="#"+o)}function Ar(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=Zn(o);if(function(t,e){_n(t,()=>qn(e,"retimed"))}(i,n),"use"===o.type?jr(i,e.start,e.stretch):xr(i,e.start,e.stretch),kr(i),"use"===o.type&&o.href){const a=Gn(o.href);if(a){const s=br(o),l=s?yr(vr(s),e):e,u=new Set(r);u.add(t);const c=Ar(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=br(t);if("use"===t.type&&s&&t.href){const i=Gn(t.href);if(i){const a=yr(vr(s),e),l=new Set(r);l.add(o);const u=Ar(i,a,n,l);u&&(t.href="#"+u)}kr(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function xr(t,e,n){var r;jr(t,e,n),null==(r=t.children)||r.forEach(t=>xr(t,e,n))}function jr(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}var Or=/[MmLlHhVvCcSsQqTtAaZz]/;function Sr(t,e,n){return{P1:[t[0]+2/3*(e[0]-t[0]),t[1]+2/3*(e[1]-t[1])],P2:[n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1])]}}function Mr(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=Z(a,t,e,r,48);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];Or.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",v=t.toUpperCase();if("Z"!==v){if("M"===v){const e=h()+(n?o:0),r=h()+(n?i:0);o=e,i=r,a=e,s=r,d=t;continue}if("L"===v)m(h()+(n?o:0),h()+(n?i:0));else if("H"===v)m(h()+(n?o:0),i);else if("V"===v)m(o,h()+(n?i:0));else if("C"===v){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===v){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===v){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Sr([o,i],t,e);p(r,a,e)}else if("T"===v){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Sr([o,i],t,e);p(r,a,e)}else{if("A"!==v){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=W(o.P0,o.P1,o.P2,o.P3,a),[u,c]=G(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((n=r,(e=t)<0?0:e>n?n:e));var e,n}}}function Pr(t){const e=Ln(t);if("static"===e.kind&&"number"==typeof e.value)return{min:e.value,max:e.value};if("animated"===e.kind&&e.keyframes.length){const t=e.keyframes.map(t=>Number(t.value)||0);return{min:Math.min(...t),max:Math.max(...t)}}return{min:0,max:0}}function _r(t){let e=0,n=16;const r=t=>{var o,i;const a=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;a&&(n=Math.max(n,a));const s=null!=(i=t.text)?i:t.textContent;if("string"==typeof s&&(e+=s.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var zr=t=>Math.round(1e3*t)/1e3;function Ir(t,e){if(!e||null==t)return t;const n=Ln(t);if("absent"===n.kind)return t;if("static"===n.kind)return"number"==typeof t?n.value+e:{value:n.value+e};const r={keyframes:n.keyframes.map(t=>y(g({},t),{value:(Number(t.value)||0)+e}))};return void 0!==n.loop&&(r.loop=n.loop),void 0!==n.autoOrient&&(r.autoOrient=n.autoOrient),void 0!==n.base&&(r.value=n.base+e),r}function Er(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Mr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=Pr(e.startOffset),s=Pr(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),u=Math.max(0,a.max+s-o),c=l>0?l+i:0,f=u>0?u+i:0;if(f<=0&&c<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(c>0){const e=d.x-Math.cos(d.angle)*c,n=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+zr(e)+","+zr(n)+"L"+zr(d.x)+","+zr(d.y)+r}if(f>0){const t=h.x+Math.cos(h.angle)*f,e=h.y+Math.sin(h.angle)*f;p+="L"+zr(t)+","+zr(e)}return{d:p,startShift:c}}function Cr(t,e,n){null!=n&&Dn(t,e,Ln(n),{asString:!0})}var Nr=(t,e,n)=>{const r={type:t};for(const t in e)void 0!==e[t]&&(r[t]=e[t]);const o=Array.isArray(n)?n.filter(t=>null!=t):null!=n?[n]:[];return o.length&&(r.children=o),r};function Tr(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function Fr(t,e){let n="";for(let r=0;r<t.length;r++){const o=Tr(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function Lr(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var Dr=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Ur(t,e,n=2){const r=[];let o;for(Dr.lastIndex=0;null!==(o=Dr.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=Lr(e,s(),s());i+=t+Fr([r,o],n)}else if("C"===t){const[t,r]=Lr(e,s(),s()),[o,a]=Lr(e,s(),s()),[l,u]=Lr(e,s(),s());i+="C"+Fr([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=Lr(e,s(),s()),[o,a]=Lr(e,s(),s());i+="Q"+Fr([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var Rr=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",St,Mt,"xml:space"];function Vr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function Br(t){return"string"==typeof t?t:void 0}function Wr(t,e){var n,r,o,i,a,s,l;return{fontFamily:null!=(n=Br(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Vr(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=Vr(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Vr(t.wordSpacing))?l:e.wordSpacing}}function qr(t){var e,n,r;return{fontFamily:Br(t.fontFamily),fontSize:null!=(e=Vr(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Vr(t.letterSpacing))?n:0,wordSpacing:null!=(r=Vr(t.wordSpacing))?r:0}}function Gr(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function Kr(t,e,n,r){var o;const i=t.fontFamily?e[t.fontFamily]:n;return i||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),i}function Zr(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function Hr(t,e){if(t<=0||e<=0)return"";const n=.08*t,r=.92*t,o=.92*-e,i=r-n,a=-o,s=Math.max(1,.12*Math.min(i,a)),l="M"+n+" 0L"+r+" 0L"+r+" "+o+"L"+n+" "+o+"Z";if(i<=2*s||a<=2*s)return l;const u=n+s,c=r-s,f=-s,d=o+s;return l+"M"+u+" "+f+"L"+u+" "+d+"L"+c+" "+d+"L"+c+" "+f+"Z"}function Xr(t,e){var n,r,o,i;const{glyphs:a,create:s=Nr,warnings:l}=e,u=Zr(a),c={x:null!=(n=Vr(t.x))?n:0,y:null!=(r=Vr(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{var n;const r=Kr(e,a,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,s=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=Gr(e);for(let n=0;n<t.length;n++){const a=t.charAt(n),l=null==r?void 0:r.glyphs[a];if(l&&l.d)f.push({glyphD:l.d,m:[i,0,0,i,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:i}),c.x+=l.width*i;else if(/\S/.test(a)){const t=l&&l.width>0?l.width:.6*o;f.push({glyphD:Hr(t,s),m:[i,0,0,i,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:i}),c.x+=t*i}else c.x+=(l?l.width:0)*i;c.x+=e.letterSpacing+(" "===a?e.wordSpacing:0),d[h].end=c.x}},m=(t,e)=>{var n,r,o,i;const a=Wr(t,e),s=Vr(t.x),l=Vr(t.y);void 0!==s&&(c.x=s,h=d.length,d.push({start:c.x,end:c.x})),void 0!==l&&(c.y=l),c.x+=null!=(n=Vr(t.dx))?n:0,c.y+=null!=(r=Vr(t.dy))?r:0;const u=null!=(o=Br(t[Mt]))?o:Br(t[St]);if(u&&!(null==(i=t.children)?void 0:i.length)&&p(u,a),t.children)for(const e of t.children)m(e,a)},v=qr(t);if(t.children)for(const e of t.children)m(e,v);const g=null!=(o=Br(t[Mt]))?o:Br(t[St]);g&&!(null==(i=t.children)?void 0:i.length)&&p(g,v);const y=Br(t.textAnchor);if("middle"===y||"end"===y)for(const t of f){const e=d[t.line].end-d[t.line].start,n="middle"===y?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return ao(t,io(f,s,l),s)}function Qr(t,e){var n,r,o,i,a,s;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:i,warnings:a,alongPath:s}=n,l=Mr(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=Zr(i),c=[];let f=0;const d=(t,e)=>{var n,r,o;const s=Wr(t,e),l=null!=(n=Br(t[Mt]))?n:Br(t[St]);if(l&&!(null==(r=t.children)?void 0:r.length)){const t=Kr(s,i,u,a),e=(null==t?void 0:t.unitsPerEm)||1e3,n=s.fontSize/e,r=(null!=(o=null==t?void 0:t.ascent)?o:.9*e)*n;for(let e=0;e<l.length;e++){const o=l.charAt(e),i=null==t?void 0:t.glyphs[o],a=(i?i.width:0)*n,u=a+s.letterSpacing+(" "===o?s.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:a,ascent:r,fontSize:s.fontSize}),f+=u}}if(t.children)for(const e of t.children)d(e,s)};d(t,qr(t));const h=f,p=Ln(null==s?void 0:s.textLength),m="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,v=m>0&&h>0?m/h:1,g=Ln(null==s?void 0:s.startOffset),{along:y,perp:b}=Jr(t),k=y+("animated"===g.kind?Number(null==(o=g.keyframes[0])?void 0:o.value)||0:"static"===g.kind&&Number(g.value)||0),w=t=>({x:t.x-b*Math.sin(t.angle),y:t.y+b*Math.cos(t.angle),angle:t.angle});return c.map(t=>{const e=k+t.advStart*v,n=k+t.advEnd*v,r=w(l.sampleAtDistance(e)),o=w(l.sampleAtDistance(n)),i=l.sampleAtDistance(k+(t.advStart+t.glyphW/2)*v);return{x:r.x,y:r.y,width:t.advEnd-t.advStart,ascent:t.ascent,fontSize:t.fontSize,endX:o.x,endY:o.y,rotation:180*i.angle/Math.PI}})}(t,e.alongPath.pathD,e);const{glyphs:l,warnings:u}=e,c=Zr(l),f={x:null!=(r=Vr(t.x))?r:0,y:null!=(o=Vr(t.y))?o:0},m=[],v=[{start:f.x,end:f.x}];let g=0;const y=(t,e)=>{var n;const r=Kr(e,l,c,u),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,a=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*i;for(let n=0;n<t.length;n++){const o=t.charAt(n),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+e.letterSpacing+(" "===o?e.wordSpacing:0);m.push({x:f.x,y:f.y,width:l,ascent:a,fontSize:e.fontSize,line:g}),f.x+=l,v[g].end=f.x}},b=(t,e)=>{var n,r,o,i;const a=Wr(t,e),s=Vr(t.x),l=Vr(t.y);void 0!==s&&(f.x=s,g=v.length,v.push({start:f.x,end:f.x})),void 0!==l&&(f.y=l),f.x+=null!=(n=Vr(t.dx))?n:0,f.y+=null!=(r=Vr(t.dy))?r:0;const u=null!=(o=Br(t[Mt]))?o:Br(t[St]);if(u&&!(null==(i=t.children)?void 0:i.length)&&y(u,a),t.children)for(const e of t.children)b(e,a)},k=qr(t);if(t.children)for(const e of t.children){const t=m.length;if(b(e,k),m.length===t){const t=Wr(e,k),n=Kr(t,l,c),r=(null==n?void 0:n.unitsPerEm)||1e3;m.push({x:f.x,y:f.y,width:0,ascent:(null!=(i=null==n?void 0:n.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:g})}}const w=null!=(a=Br(t[Mt]))?a:Br(t[St]);w&&!(null==(s=t.children)?void 0:s.length)&&y(w,k);const A=Br(t.textAnchor);if("middle"===A||"end"===A)for(const t of m){const e=v[t.line].end-v[t.line].start;t.x+="middle"===A?-e/2:-e}return m.map(t=>{var e=t,{line:n}=e;return((t,e)=>{var n={};for(var r in t)h.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&d)for(var r of d(t))e.indexOf(r)<0&&p.call(t,r)&&(n[r]=t[r]);return n})(e,["line"])})}function Yr(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,a-n*u*c+o*l]}function Jr(t){var e,n,r;return{along:(null!=(e=Vr(t.x))?e:0)+(null!=(n=Vr(t.dx))?n:0),perp:null!=(r=Vr(t.dy))?r:0}}function $r(t,e,n,r,o,i){const{glyphs:a,create:s=Nr,warnings:l}=r,u=e?Mr(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=Zr(a),{cells:f,width:d}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u,c;const f=Wr(t,s),d=null!=(l=Br(t[Mt]))?l:Br(t[St]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=Kr(f,e,n,r);if(t){const e=f.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=Gr(f);for(let a=0;a<d.length;a++){const s=d.charAt(a),l=t.glyphs[s];if(l&&l.d){const t=l.width*e;o.push({glyphD:l.d,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(s)){const a=l&&l.width>0?l.width:.6*t.unitsPerEm,s=a*e;o.push({glyphD:Hr(a,n),widthEm:a,scale:e,paint:r,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=f.letterSpacing+(" "===s?f.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,f)};return a(t,qr(t)),{cells:o,width:i}}(t,a,c,l);if(!f.length)return ao(t,[],s);const{along:h,perp:p}=Jr(t),m=to(n),v=to(o),b=t=>t>0&&d>0?t/d:1,k="clip"===i&&!u.closed;if(m.animated||v.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(m.times,v.times),n=(t,e)=>h+m.at(e)+b(v.at(e))*t.midBase,r=m.animated?m.loop:v.loop;return ao(t,function(t,e,n,r,o,i,a,s=0){const l=Math.max(e.totalLength/eo,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const f of t){const t=[f.scale,0,0,f.scale,-f.scale*(f.widthEm/2),0],d=Ur(f.glyphD,t),h=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[ro(r-s*l,3),ro(o+s*a,3)],rotate:ro(180*i/Math.PI,3)}}},p=[],m=[],v=(t,e)=>{p.push(h(t,e)),a&&m.push({time:e,value:u(t)?1:0})};v(n(f,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(f,e),a=n(f,o),s=Math.min(no,Math.max(1,Math.ceil(Math.abs(a-i)/l)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);v(n(f,r),r)}}Qe(p);const b={keyframes:p};void 0!==o&&(b.loop=o);const k={transform:b};if(a&&m.some(t=>0===t.value)){const t={keyframes:m};void 0!==o&&(t.loop=o),k.opacity=t}c.push(i("path",y(g({d:d},oo(f.paint)),{animate:k}),[]))}return c}(f,u,n,e,r,s,k,p),s)}const w=b(v.at(0)),A=h+m.at(0);return ao(t,io((k?f.filter(t=>{const e=A+t.midBase*w;return e>=0&&e<=u.totalLength}):f).map(t=>({glyphD:t.glyphD,paint:t.paint,m:Yr(u,A+t.midBase*w,t.scale,t.widthEm,p)})),s,l),s)}function to(t){var e;const n=Ln(t);if("animated"===n.kind&&n.keyframes.length>=2){const t=[...n.keyframes].sort((t,e)=>(Number(t.time)||0)-(Number(e.time)||0)),e=t.map(t=>Number(t.time)||0),r=t.map(t=>Number(t.value)||0);return{animated:!0,times:e,loop:n.loop,at(t){if(t<=e[0])return r[0];for(let n=1;n<e.length;n++)if(t<=e[n]){const o=e[n]-e[n-1],i=o>0?(t-e[n-1])/o:1;return r[n-1]+i*(r[n]-r[n-1])}return r[r.length-1]}}}const r="animated"===n.kind?Number(null==(e=n.keyframes[0])?void 0:e.value)||0:"static"===n.kind&&Number(n.value)||0;return{animated:!1,times:[],at:()=>r}}var eo=48,no=64;function ro(t,e){const n=m(10,e);return Math.round(t*n)/n}function oo(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function io(t,e,n){var r,o,i;if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const a=new Map;for(const e of t){const t=JSON.stringify([null!=(r=e.paint.fill)?r:null,null!=(o=e.paint.stroke)?o:null,null!=(i=e.paint.strokeWidth)?i:null]),n=Ur(e.glyphD,e.m),s=a.get(t);s?s.d+=n:a.set(t,{paint:e.paint,d:n})}const s=[];for(const{paint:t,d:n}of a.values())s.push(e("path",g({d:n},oo(t)),[]));return s}function ao(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===Rr.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=g({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function so(t,e){return e.alongPath?$r(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Xr(t,e)}function lo(t,e){const n=y(g({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function uo(t,e,n,r,o,i,a,s){const l=fo(r,n,o),u=ho(n,o),c=mo(i,l),f=mo(a,u),d=yo(a),h={type:"path",d:b(e)};return vo(h,"strokeDasharray",f),vo(h,"strokeDashoffset",c),vo(h,"strokeOpacity",d),[h]}var co=1;function fo(t,e,n){const[r]=po(n);return n=>e*(-n-r+t)+co}function ho(t,e){const[n,r]=po(e),o=r-n+1;return e=>{const n=B(e[0],0,1),r=B(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=co;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+co),s}}function po(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function mo(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>{var n,r,o,i;return{time:null!=(r=null!=(n=t.time)?n:t.t)?r:0,value:e(null!=(o=t.value)?o:t.v),easing:null!=(i=t.easing)?i:t.e}}),loop:t.loop}}function vo(t,e,n){n&&Dn(t,e,n)}var go=10;function yo(t){var e,n,r,o,i,a;const s=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return s(t.value)?{kind:"static",value:0}:void 0;const l=t.keyframes;let u=!1,c=!0;for(const t of l)s(null!=(e=t.value)?e:t.v)?u=!0:c=!1;if(!u)return;if(c)return{kind:"static",value:0};const f=[];for(let t=0;t<l.length;t++){const e=l[t],u=t>0?l[t-1]:void 0,c=t<l.length-1?l[t+1]:void 0,d=null!=(r=null!=(n=e.time)?n:e.t)?r:0,h=s(null!=(o=e.value)?o:e.v),p=u?h&&s(null!=(i=u.value)?i:u.v):h,m=c?h&&s(null!=(a=c.value)?a:c.v):h;p&&!m?(f.push({time:d,value:0}),f.push({time:d+go,value:1})):!p&&m&&(f.push({time:d-go,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function bo(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function ko(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function wo(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=Ao(t,r,r+1);return t.c&&e.length>1&&(n+=Ao(t,e.length-1,0)),n}function Ao(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=Z(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:u,u);return c.ds[c.ds.length-1]}var xo=.5522847498307936;function jo(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=Nt(t))?void 0:e.mode)===kt.frames?wt.frames:wt.waapi,glyphs:null==(n=Tt(t))?void 0:n.glyphs},o=Zn(t);Kn(o,r.idMap),Hn(o,r,()=>qn(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=Gn(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.sourceId);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=fr(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),Kn(t,e.idMap);const n=[],r=t=>{var e;br(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&br(o)&&n++,"use"===o.type&&o.href){const t=Gn(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=Gn(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=br(t);if(!n)continue;const r=n.timeCrop;kr(t),wr(t,vr(n),e),r&&gr(t,r,e)}}(t,e),t}(Oo(o,r),r);return function(t,e){e.length&&(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function Oo(t,e){t.children&&(t.children=t.children.map(t=>Oo(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,trimPath:u,clone:c,fillGradient:f,strokeGradient:d,textPath:h,text:p}=null!=n?n:{};n&&delete t.effects;let m=t,v=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.path?h.path:void 0,n=function(t,e,n,r,o,i){return e.glyphs?$r(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.glyphs"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,v=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?Xr(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.glyphs — left as native <text>"),t):t}(m,p,e),v=!0;return v||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.path||!e.path)return t;const o=qn(n,"tpath"),{d:i,startShift:a}=Er(e.path,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:_r(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),Cr(s,"startOffset",Ir(e.startOffset,a)),Cr(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return Yn(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return Yn(t,e,n,"stroke")}(m,d,e),m=function(t,e){if(!e)return t;const n=e.subPaths===Ot,r=[],o=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)o(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*xo,d=o*xo,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}}(t);if(void 0===e)return;const n=dn(e);if(!n.length)return;const i={leaf:t,subpaths:[]};for(const t of n){const e=wo(t);i.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}r.push(i)};if(o(t),!r.length)return t;let i=0;const a=n?[...r].reverse():r;for(const t of a)for(const e of t.subpaths)n||(i=0),e.startOffsetPx=i,i+=e.lengthPx;const s=i;if(n&&s<.001)return t;const l=Ln(e.offset),u="absent"===l.kind?{kind:"static",value:0}:l,c=function(t){const e=Ln(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>{var e,n,r,o;return{time:null!=(n=null!=(e=t.time)?e:t.t)?n:0,value:null!=(r=t.value)?r:t.v,easing:null!=(o=t.easing)?o:t.e}});if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=bo(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=ko(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=ko(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),f="absent"===c.kind?{kind:"static",value:[0,1]}:c,d=function(t){var e;if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const n=[];for(const r of t.keyframes){const t=null!=(e=r.value)?e:r.v;"number"==typeof t&&n.push(t)}return n}(u),h=[d.length?Math.min(...d):0,d.length?Math.max(...d):0];if(1===r.length&&r[0].leaf===t&&1===r[0].subpaths.length){const e=r[0],o=e.subpaths[0],i=n?s:o.lengthPx;if(i<.001)return t;const a=n?o.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=fo(n,e,r),s=ho(e,r),l=g({},t);return delete l.effects,vo(l,"strokeDasharray",mo(i,s)),vo(l,"strokeDashoffset",mo(o,a)),vo(l,"strokeOpacity",yo(i)),l}(e.leaf,i,a,h,u,f)}const p=new Map;for(const t of r){const e=[];for(const r of t.subpaths){const o=n?s:r.lengthPx;if(o<.001)continue;const i=n?r.startOffsetPx/o:0;e.push(...uo(t.leaf,r.subpath,o,i,h,u,f))}p.set(t.leaf,lo(t.leaf,e))}const m=t=>p.get(t)||(Array.isArray(t.children)&&t.children.length>0?y(g({},t),{children:t.children.map(m)}):t);return m(t)}(m,u),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Zn(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const n=Zn(l),r=pr(e,t),o=r?Vn(n,r):n;u.push(o)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(m,a,e),m=function(t,e,n,r){if(!e)return t;const o=Gn(e.sourceId);if(!o)return r.errors.push("maskedBy.sourceId missing — cannot build mask"),t;const i=qn(r,"mask");let a={type:"use",href:"#"+o};if(n)a=rr(a,n,r);else if(sr(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=Rn(t,void 0);if(Array.isArray(e.translate)&&a.push(y(g(g({},r),ar(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(y(g({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(y(g({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;return a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]}),s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]}),l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]}),f}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const v=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);v.push({name:m[1],args:t})}if(!v.length)return;const g=v[v.length-1];if("translate"===g.name)for(let t=v.length-2;t>=0;t--){const c=v[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,h=null!=(r=g.args[0])?r:0,p=null!=(o=g.args[1])?o:0;if(h!==-f||p!==-d)continue;const m={};m.origin=[f,d];for(let e=0;e<t;e++)if("translate"===v[e].name){const t=null!=(i=v[e].args[0])?i:0,n=null!=(a=v[e].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<v.length-1;e++){const t=v[e];if("rotate"===t.name)m.rotate=(null!=(s=m.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;for(const t of v)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const w={};return y&&(w.translate=y),void 0!==b&&(w.rotate=b),k&&(w.scale=k),Object.keys(w).length?w:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes&&!t.transform.kfs){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}}(t);e&&(a=rr(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||!(!t.transform||"object"!=typeof t.transform)||sr(t)}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?fr(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=lr(l),n=lr(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}return{type:"g",animate:{transform:{keyframes:Array.from(c).sort((t,e)=>t-e).map(t=>{const e=ur(l,t),n=ur(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}(m,s,i,e),m=function(t,e,n){var r,o;if(!e||!e.d&&!e.animate)return t;const i=qn(n,"clip"),a={type:"path"},s=Ln(e.d);if("absent"!==s.kind&&("static"===s.kind?a.d=nr(s.value):(Dn(a,"d",s),void 0!==a.d&&(a.d=nr(a.d)))),e.animate&&!(null==(r=a.animate)?void 0:r.d)){const t=null!=(o=a.animate)?o:{};t.d=e.animate,a.animate=t}return n.defs.push({type:"clipPath",id:i,children:[a]}),t.clipPath="url(#"+i+")",t}(m,l,e),o?(hr(m,c,e),m=function(t,e,n,r){const o=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=Qn(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&Qn((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&Qn((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=Xn(i.full),r=Xn(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;return 0===l&&0===u?{rest:t}:{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:(function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)||c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform))&&delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes&&!t.transform.kfs){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=g({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:a}=function(t){if(!t)return{};const e=Qn(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};return void 0!==t.translate&&(r.translate=t.translate),e&&void 0!==t.origin&&(r.origin=t.origin),void 0!==t.rotate&&(o.rotate=t.rotate),void 0!==t.scale&&(o.scale=t.scale),void 0!==t.skew&&(o.skew=t.skew),void 0===t.origin||e&&!n||(o.origin=t.origin),{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let s=t;s=Vn(s,a);let l={type:"g",id:n,children:[{type:"g",id:r,children:[s]}]};return void 0!==o.transform&&(l.transform=o.transform),void 0!==o.animate&&(l.animate=o.animate),i&&(delete l.id,l=Vn(l,i),l.id=n),l}(m,i,r,o)):m=function(t,e,n,r){return hr(t,e,r),Vn(t,n)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}var So=t=>{var e,n;return null!=(n=null!=(e=t.t)?e:t.time)?n:0},Mo=t=>{var e;return null!=(e=t.v)?e:t.value},Po=t=>{var e;return null!=(e=t.e)?e:t.easing},_o=t=>{var e;return null!=(e=t.tangentIn)?e:t.ti},zo=t=>{var e;return null!=(e=t.tangentOut)?e:t.to};function Io(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function Eo(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Io(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Co=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function No(t,e,n){var r,o;let i=jo(t).root;return i=function(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r,o;if("offsetPath"!==t.alongPathMode)return;const i=null!=(e=t.keyframes)?e:t.kfs;if(!i||i.length<2)return;const a=Mo(i[0]),s=(null==a?void 0:a.origin)&&a.origin.length>=2?[a.origin[0],a.origin[1]]:[0,0],l=[];for(const t of i){const e=Mo(t),r=null==e?void 0:e.translate;if(!r||r.length<2)return;if(Object.keys(e).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(n=null==e?void 0:e.origin)?n:[0,0];if(o[0]!==s[0]||o[1]!==s[1])return;l.push([r[0]+s[0],r[1]+s[1]])}if(!i.some(t=>_o(t)||zo(t)))return;let u="M"+Co(l[0][0])+","+Co(l[0][1]);const c=[];for(let t=0;t<l.length-1;t++){const e=l[t],n=l[t+1],a=null!=(r=zo(i[t]))?r:[0,0],s=null!=(o=_o(i[t+1]))?o:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[n[0]+s[0],n[1]+s[1]];u+="C"+Co(f[0])+","+Co(f[1])+","+Co(d[0])+","+Co(d[1])+","+Co(n[0])+","+Co(n[1]),c.push(Eo(e,f,d,n))}const f=c.reduce((t,e)=>t+e,0);if(!(f>0))return;const d=[];let h=0;for(let t=0;t<i.length;t++){t>0&&(h+=c[t-1]);const e={t:So(i[t]),v:h/f},n=Po(i[t]);void 0!==n&&(e.e=n),d.push(e)}return{pathStr:u,distanceKfs:d,autoOrient:!!t.autoOrient,anchor:s}}(i);if(e){const n=g({},o);delete n.transform;const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n.offsetDistance=a;const s=t.transform;let l=s;if(s&&"object"==typeof s){const t=g({},s);delete t.translate,delete t.origin,l=Object.keys(t).length?t:void 0}r=y(g({},t),{animate:n,style:y(g({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:Co(e.anchor[0])+"px "+Co(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==l?r.transform=l:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=y(g({},r),{children:t}))}return r};return e(t)}(i),i=An(i,null!=(o=null==(r=Nt(i))?void 0:r.duration)?o:L),e===wt.waapi&&(i=un(i,null==n?void 0:n.motionPath),i=In(i),i=function(t){const e=(t,n)=>{var r;n(t),null==(r=t.children)||r.forEach(t=>e(t,n))};let n=!0;for(;n;){n=!1;const r=new Set;e(t,t=>{var e;"use"===t.type&&"string"==typeof t.href&&r.add((e=t.href).startsWith("#")?e.slice(1):e)}),e(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!r.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,n=!0)})}return t}(i)),i}function To(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function Fo(t,e,n){var r;const o=Nt(t)||{},i=On(t,wt.frames),a=o.iterations;let s=1;"number"==typeof a&&(s=a||1),"infinite"===a&&(s=1/0),s<1&&(s=1);const l=+(o.duration||L),u=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,c=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,v=-(o.delay||0),g=0,y=1,b=!1;const k=o.frameRate,w=k&&k>0?1e3/k:0;let A=0;const x=()=>{const t=g?(Date.now()-g)*y:0;return v+t},j=()=>{let t=x();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;l>0?(t=B(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1),n=B((t-r*e)/e,0,1)):n=t;const o=c||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=Mn(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const S=()=>!!m&&!!e.isConnected()&&(y<0?x()>0:!(Number.isFinite(u)&&j()>=u)),M=t=>{null!==p&&(To(p),p=null),(t||S())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void P();const o=j(),i=x();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return P(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return P(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(w>0){const t=Date.now();if(A&&t-A<w)return;A=t}O(o)}})(),M()}))},P=()=>{if(!m)return;let t=x();Number.isFinite(u)&&t>u&&(t=u),v=t,g=0,m=!1,null!==p&&(To(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>S(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&v>=u&&(v=0);else if(v<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");v=u}b=!1,m=!0,g=Date.now(),M(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;P(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;P(),v=0,g=0,m=!1,b=!1,O(v),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;v=Number.isFinite(u)?u:j(),g=0,m=!1,null!==p&&(To(p),p=null),O(d?v:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");let e=x();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,v=e,m&&(g=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(u)&&t>u&&(t=u),v=t,m&&(g=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(j())},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var Lo=[1,0,0,1,0,0];function Do(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var Uo=(t,e)=>[1,0,0,1,t,e],Ro=(t,e)=>[t,0,0,e,0,0];function Vo(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var Bo=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Wo=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function qo(t){let e=Lo;t.translate&&(e=Do(e,Uo(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=Do(e,Uo(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=Do(e,Vo(t.rotate))),t.scale&&(e=Do(e,Ro(t.scale[0],t.scale[1]))),n&&(e=Do(e,Uo(-t.origin[0],-t.origin[1]))),e}function Go(t,e,n){return t+(e-t)*n}function Ko(t,e){return null==t?Lo:"string"==typeof t?function(t){let e=Lo;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=Do(e,Uo(n[0]||0,n[1]||0)):"scale"===t?e=Do(e,Ro(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=Do(e,Vo(n[0])):"skewX"===t?e=Do(e,Bo(n[0])):"skewY"===t?e=Do(e,Wo(n[0])):"matrix"===t&&(e=Do(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?qo(function(t,e){var n,r,o,i,a,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let u=0;for(;u<t.length-1&&(null!=(o=t[u+1].time)?o:0)<e;)u++;const c=t[u],f=t[u+1],d=(e-(null!=(i=c.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[Go(h.translate[0],p.translate[0],d),Go(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=Go(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[Go(h.scale[0],p.scale[0],d),Go(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?qo(t.value):"object"!=typeof t||Array.isArray(t)?Lo:qo(t)}var Zo=new Set(["svg","g","symbol"]),Ho=new Set(["defs","mask","clipPath","title"]);function Xo(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Xo(t,e))}function Qo(t){return null==t?0:Number(t)}function Yo(t){return Math.round(100*t)/100+0}function Jo(t,e,n,r,o){var i;const a=t.type||"";if(Ho.has(a))return;const s=Do(e,function(t,e){return t.animate&&t.animate.transform?Ko(t.animate.transform,e):void 0!==t.transform?Ko(t.transform,e):Lo}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=Do(s,Uo(Qo(t.x),Qo(t.y)));return void(i?Jo(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Zo.has(a)?null==(i=t.children)||i.forEach(t=>Jo(t,s,n,r,o)):o.push(function(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=Yo(function(t,e,n,r){var o,i,a,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a:0)<r;)n++;const c=e[n],f=e[n+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return Go(c.value,f.value,d)}return void 0!==e?Number(e):1}(null==(s=t.animate)?void 0:s.opacity,t.opacity,0,n)),d=t.mask?1:0,h=e.map(Yo).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return Qo(t.width)+","+Qo(t.height)+","+Qo(t.x)+","+Qo(t.y);case"ellipse":return Qo(t.rx)+","+Qo(t.ry)+","+Qo(t.cx)+","+Qo(t.cy);case"circle":return Qo(t.r)+","+Qo(t.cx)+","+Qo(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(Qo(c)||"")+"|o:"+f+"|m:"+d}(t,s,n))}function $o(t,e){var n;e.add(0),(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>$o(t,e))}function ti(t,e){const n=new Map;Xo(t,n);const r=[];return Jo(t,Lo,e,n,r),r.sort()}function ei(t,e){const n=new Set;$o(t,n),$o(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=ti(t,o),i=ti(e,o),a=ni(n,i),s=ni(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function ni(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}function ri(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=0}=e,i=t.getRootElement();if(!i)return console.warn("setupAnimationTriggers: No root element found for animation."),t;let a=!1;const s=()=>{a&&(a=!1,t.setPlaybackRate(1)),t.play()},l=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":a=!0,t.setPlaybackRate(-1),t.play()}};switch(n){case"load":{const t=()=>s();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{let t=!1;const e=()=>{t=!0,s()},n=()=>{t&&l()};i.addEventListener("mouseenter",e),i.addEventListener("mouseleave",n);break}case"click":{const e=()=>{t.isPlaying()?l():s()};i.addEventListener("click",e);break}case"scrollIntoView":{const t=t=>{var e,n;const r=t.boundingClientRect,o=t.intersectionRect;if(!(null==r?void 0:r.height)||!o)return t.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,a=null!=(n=null==(e=t.rootBounds)?void 0:e.height)?n:1/0,s=Math.min(i,a),l=Math.min(r.height,Number.isFinite(s)?s:r.height);return l>0?o.height/l:t.intersectionRatio},e=Array.from({length:21},(t,e)=>e/20);let n=!1;new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&t(e)>=o?(n=!0,s()):n&&(n=!1,l())})},{threshold:e}).observe(i);break}}return t}function oi(t){return"#"+t}function ii(t,e,n,r){const o=Nt(t)||{};if(!r)if(t.id){const e=oi(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=Fo(t,e||function(t){const e=new Set;return{isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=V(r);const i=oi(n),a=(null==t?void 0:t.querySelectorAll(i))||document.querySelectorAll(i);0!==a.length||e.has(i)||(e.add(i),console.warn('setAttribute: No elements found for selector "'+i+'"'));for(let t=0;t<a.length;t++){const e=a[t],n="transform"===r&&"pattern"===e.tagName?"patternTransform":r;e.setAttribute(n,o),F.has(r)&&(e.style[r]=o)}}}}(r),n),a=l(s({},i),{getRootElement:()=>r||null});return o.trigger&&(X(o)?console.warn("scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)"):ri(a,o.trigger)),a}function ai(t,e,n,r){var o,i;let a=null!=(o=t.v)?o:t.value;const s=null!=(i=t.e)?i:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;return E.has(n)&&Array.isArray(a)?u=z(a):"transform"!==n||null===a||"object"!=typeof a||Array.isArray(a)?C.has(n)?(Array.isArray(a)&&("translate"===n&&(a=a.map(t=>t+"px")),a=a.join(",")),"rotate"===n&&(a+="deg"),u=n+"("+a+")",c="transform"):u="d"===n?'path("'+(a&&"object"==typeof a&&Array.isArray(a.paths)?a.paths:[]).map(t=>b(t,!0)).join("")+'")':N.has(n)&&"number"==typeof a?100*a+"%":""+a:(u=T(a,{withUnits:!0}),c="transform"),CSS.supports(V(c),u)||r.add(c),c=D(c),l[c]=u,l}function si(t,e,n){var r,o,i,a,u;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(i=n.t)?i:0)-h),r=d.e?S(d.e)(e):e,{right:o}=P(d.e,e);c.push({t:0,v:yn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(a=r.t)?a:0)<=n){const e=null!=(u=r.t)?u:0,o=(n-e)/(h-e),i=r.e?S(r.e)(o):o,{left:a}=P(r.e,o);c.length>0&&(c[c.length-1]=l(s({},c[c.length-1]),{e:a})),c.push({t:n,v:yn(t,r.v,d.v,i),e:void 0})}break}c.push(d)}return c}function li(t,e,n){var r;const o=new Map;for(const[i,a]of Object.entries(t)){const t=n.duration||1,u=si(i,a.kfs||a.keyframes||[],t),c=[];for(let n=0;n<u.length;n++){const o=u[n],a=ai(o,B((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(a.offset||0)>0&&c.push(l(s({},a),{offset:0})),c.push(a)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(l(s({},c[c.length-1]),{offset:1})),c.length>0&&o.set(i,c)}return o}function ui(t,e,n,r,o){var i;const a=Nt(t)||{};if(!n)if(t.id){const e=oi(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const s=On(t,wt.waapi),l=[],u=a.iterations;let c;"number"==typeof u&&(c=u),"infinite"===u&&(c=1/0);const f=new Set;let d=!1,h=!1;(null==s?void 0:s.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of s||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const s=oi(t.id),u=(null==n?void 0:n.querySelectorAll(s))||document.querySelectorAll(s);0===u.length&&console.warn('createWebApiAnimator: No elements found for selector "'+s+'"');const p=li(r,f,a),m=a.delay&&a.delay>0?a.delay:void 0;let v;if(a.delay&&a.delay<0&&a.duration){const t=-a.delay;v=c===1/0?t%a.duration:Math.min(t,a.duration*(null!=c?c:1))}const g={duration:a.duration,delay:m,fill:null!=(i=a.fill)?i:"forwards",direction:a.direction,iterations:c};for(let t=0;t<u.length;t++){const n=u[t];for(const[,t]of p)if(t.length>0)try{const r=new KeyframeEffect(n,t,g),i=new Animation(r,o?o.timeline:document.timeline);if(o){const t=i;o.rangeStart&&(t.rangeStart=o.rangeStart),o.rangeEnd&&(t.rangeEnd=o.rangeEnd)}(null==e?void 0:e.onFinish)&&(i.onfinish=()=>{var t;d||(d=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(i.onremove=()=>{var t;h||(h=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==v&&(i.currentTime=v),l.push(i)}catch(t){console.warn(t)}}}if(!r&&f.size)return console.warn("Unsupported CSS attrs: "+[...f].join(", ")),null;const p={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=l[0])?void 0:t.playState)},play:()=>{var t;d=!1,l.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;l.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;d=!1,l.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of l)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(l.forEach(e=>e.playbackRate=t),p),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=l[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{d=!1,l.forEach(e=>{e.currentTime=t})},destroy:()=>{var t;p.cancel(),l.splice(0,l.length),h||(h=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};return a.trigger&&("scroll"===a.timelineSource?console.warn("scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)"):ri(p,a.trigger)),o&&l.forEach(t=>t.play()),p}function ci(t,e,n){var r,o,i;const a="number"==typeof(null==t?void 0:t.fraction)?t.fraction:e,s=null==(o=null==(r=globalThis.CSS)?void 0:r.percent)?void 0:o.call(r,100*a);if(void 0!==s)return n?{rangeName:null!=(i=null==t?void 0:t.phase)?i:"cover",offset:s}:{offset:s}}function fi(t,e){const n=document.body,r=document.documentElement;for(let o=t.parentElement;o;o=o.parentElement){if(o===n||o===r)return null;const t=getComputedStyle(o),i="y"===e?t.overflowY:t.overflowX;if("auto"===i||"scroll"===i||"hidden"===i||"overlay"===i)return o}return null}function di(){return document.scrollingElement||document.documentElement}function hi(t,e){var n,r;const o=null==e?void 0:e.trim();if(!o)return t;if("parent"===o){let e=null;for(let n=t.parentElement;n&&n!==document.body;n=n.parentElement){const t=getComputedStyle(n).position;"sticky"!==t&&"fixed"!==t||(e=n)}return null!=(r=null!=(n=null==e?void 0:e.parentElement)?n:t.parentElement)?r:t}if("scroller"===o)return fi(t,"y")||fi(t,"x")||di();let i=null;try{i=document.querySelector(o)}catch(e){return console.warn('scroll timeline: subject "'+o+'" is not a valid selector — measuring the SVG itself'),t}return i||(console.warn('scroll timeline: subject "'+o+'" matched no element — measuring the SVG itself'),t)}function pi(t,e){var n;const r=t;if(!(null==e?void 0:e.pin)||!r.style)return()=>{};const o=r.style,i=o.position,a=o.top;o.position="sticky",o.top=(null!=(n=e.pinTop)?n:0)+"px";let s=null;const l=t.parentElement;return e.pinDistance&&e.pinDistance>0&&l&&(s=document.createElement("div"),s.setAttribute("data-px-pin",""),s.style.height=100*e.pinDistance+"vh",l.insertBefore(s,t),s.appendChild(t)),()=>{o.position=i,o.top=a,(null==s?void 0:s.parentElement)&&(s.parentElement.insertBefore(t,s),s.remove())}}function mi(t,e,n){let r,o=e;t.resetOnFinish&&(o=l(s({},e),{onFinish:()=>{var t;null==(t=null==e?void 0:e.onFinish)||t.call(e),null==r||r.cancel()}}));const i=n(o);return r=i,t.debugInstName&&(window[t.debugInstName]=i),i}function vi(t,e){if(!t)return null;const n=t,{type:a,children:s,style:l}=n,u=((t,e)=>{var n={};for(var a in t)o.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&r)for(var a of r(t))e.indexOf(a)<0&&i.call(t,a)&&(n[a]=t[a]);return n})(n,["type","children","style"]),c=u.domType;void 0!==c&&delete u.domType;const f=Tt(t)||e,d=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(l,f);let h;if(s)for(const t of s){const e=vi(t,f);e&&(h||(h=[]),h.push(e))}const p=function(t,e,n,r,o){if(Ee.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const i=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e){const n=Re(t,e[t]);void 0!==n&&(Te.has(t)?i.style[t]=String(n):i.setAttribute(V(t),n))}if(n)for(const t in n)i.style[t]=String(n[t]);if(r)for(const t of r)i.appendChild(t);return o&&(i.textContent=o),i}(a||"g",Ve(u),d,h,u[Mt]||u[St]);return p&&void 0!==c&&p.setAttribute("type",c),p}var gi="data";function yi(t,e,n,r){const o=ke(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);t=No(t,(Nt(t)||{}).mode===kt.frames?wt.frames:wt.waapi);let i=null;if(r){t=ze(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=vi(t),i&&e.replaceChildren(i))}return function(t,e,n,r){return function(t,e,n,r){const o=Nt(t)||{};return X(o)?mi(o,n,n=>{var i,a;let s=()=>{};if(o.mode!==kt.frames&&"native"===(null==(i=o.scroll)?void 0:i.driver)&&r){s=pi(r,o.scroll);const e=function(t,e){var n,r,o,i;if(!e||!X(e))return null;const a=e.scroll||{},s=null!=(n=a.kind)?n:"view";if(a.smoothing)return console.warn('scroll timeline: `smoothing` needs the built-in driver — ignoring `driver: "native"`'),null;const l=globalThis,u="view"===s,c=u?l.ViewTimeline:l.ScrollTimeline;if("function"!=typeof c)return null;const f=null!=(r=a.axis)?r:"block";let d;try{d=new c(u?{subject:hi(t,a.subject),axis:f}:{source:"root"===a.source?di():fi(t,"y")||fi(t,"x")||di(),axis:f})}catch(t){return console.warn("scroll timeline: native timeline construction failed — falling back to the custom driver",t),null}return{timeline:d,rangeStart:ci(null==(o=a.range)?void 0:o.start,0,u),rangeEnd:ci(null==(i=a.range)?void 0:i.end,1,u)}}(r,o);if(e){const i=ui(t,n,r,o.mode===kt.waapi,e);if(i){const t=i.destroy.bind(i);return i.destroy=()=>{s(),t()},i}}s(),s=()=>{}}const l=(o.mode!==kt.frames?ui(t,n,r,o.mode===kt.waapi):null)||ii(t,e,n,r),u=(null==(a=l.getRootElement)?void 0:a.call(l))||r;if(u){s=pi(u,o.scroll);const t=("number"==typeof(null==(c=o)?void 0:c.duration)&&c.duration>0?c.duration:L)*("number"==typeof(null==c?void 0:c.iterations)&&c.iterations>0?c.iterations:1),e=function(t,e,n){var r,o;if(!e||!X(e))return null;const i=e.scroll||{},a=null!=(r=i.kind)?r:"view",s=hi(t,i.subject),l=fi(t,"y")||fi(t,"x"),u="scroll"===a&&"root"===i.source?di():l||di(),c=u===di(),f=function(t,e){const n=null!=t?t:"block";if("x"===n||"y"===n)return n;const r=!!e&&e.startsWith("vertical");return"inline"===n?r?"y":"x":r?"x":"y"}(i.axis,getComputedStyle(u).writingMode),d=()=>{if("scroll"===a)return function(t,e,n){var r,o;const i=e>0?B(t/e,0,1):1,a="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,s="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return s<=a?i>=s?1:0:B((i-a)/(s-a),0,1)}("y"===f?u.scrollTop:u.scrollLeft,"y"===f?u.scrollHeight-u.clientHeight:u.scrollWidth-u.clientWidth,i.range);const t=s.getBoundingClientRect();let e,n;if(c)e=0,n="y"===f?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const t=u.getBoundingClientRect();e="y"===f?t.top:t.left,n="y"===f?u.clientHeight:u.clientWidth}return function(t,e,n,r){const o=n-t,i=Q(null==r?void 0:r.start,0,e,n),a=Q(null==r?void 0:r.end,1,e,n);return a<=i?o>=a?1:0:B((o-i)/(a-i),0,1)}(("y"===f?t.top:t.left)-e,"y"===f?t.height:t.width,n,i.range)},h=Math.max(0,null!=(o=i.smoothing)?o:0)/1e3;let p=!1,m=null,v=null,g=0,y=null;const b=()=>{y=null,p||(t=>{if(!h)return void n(t);if(null===m)return m=t,void n(t);if(null!==v)return;g=0;const e=t=>{if(v=null,p)return;const r=g?Math.min(.1,(t-g)/1e3):1/60;g=t;const o=d(),i=1-Math.exp(-r/h);m+=(o-m)*i,Math.abs(o-m)<.001&&(m=o),n(m),m!==o&&(v=requestAnimationFrame(e))};v=requestAnimationFrame(e)})(d())},k=()=>{p||null!==y||(y=requestAnimationFrame(b))},w=c?window:u;let A;w.addEventListener("scroll",k,{passive:!0}),window.addEventListener("resize",k,{passive:!0}),"undefined"!=typeof ResizeObserver&&(A=new ResizeObserver(k),A.observe(s),s!==t&&A.observe(t),c||A.observe(u));const x={destroy:()=>{p||(p=!0,w.removeEventListener("scroll",k),window.removeEventListener("resize",k),null==A||A.disconnect(),null!==y&&(cancelAnimationFrame(y),y=null),null!==v&&(cancelAnimationFrame(v),v=null))},refresh:()=>{p||(m=d(),n(m))}};return x.refresh(),x}(u,o,e=>l.setCurrentTime(e*t));if(e){const t=l.destroy.bind(l);l.destroy=()=>{e.destroy(),s(),t()}}}else console.warn("scroll timeline: no root element to observe — animation will stay at frame 0");var c;return l}):mi(o,n,n=>o.mode===kt.frames?ii(t,e,n,r):ui(t,n,r,o.mode===kt.waapi)||ii(t,e,n,r))}(t,e,n,r)}(t,e,n,i)}function bi(t){const{src:e,data:n,adapter:r,callbacks:o,container:i}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return yi(n,r,o,i);let a=null,s=[],l=!1;const u=t=>{a?t(a):s&&s.push(t)};return fetch(e).then(t=>t.json()).then(t=>{if(!l)if(Ct(t)){a=yi(t,r,o,i);const e=s;s=null,null==e||e.forEach(t=>t(a))}else console.error('createAnimator: invalid animation document format at "'+e+'"')}).catch(t=>{s=null,console.error('createAnimator: failed to load "'+e+'"',t)}),{isReady:()=>!!a,getRootElement:()=>a?a.getRootElement():null,isPlaying:()=>(null==a?void 0:a.isPlaying())||!1,play:()=>{u(t=>t.play())},pause:()=>{u(t=>t.pause())},cancel:()=>{u(t=>t.cancel())},finish:()=>{u(t=>t.finish())},setPlaybackRate:t=>{u(e=>e.setPlaybackRate(t))},getCurrentTime:()=>a?a.getCurrentTime():null,setCurrentTime:t=>{u(e=>e.setCurrentTime(t))},destroy:()=>{l=!0,s=null,null==a||a.destroy()}}}function ki(){const t=document.querySelectorAll("["+yt+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[bt]){const t=n.getAttribute(yt);t&&(n[bt]=bi({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=ki,window.createAnimator=bi,window.setupAnimationTriggers=ri);export{E as COLOUR_ATTR_NAMES,gi as PX_ANIMATOR_DATA_KEY,bt as PX_ANIM_ATTR_NAME,yt as PX_ANIM_SRC_ATTR_NAME,_t as PX_TRANSFORM_PART_KEYS,je as PxAnimatedSvgDocumentSchema,Gt as PxAnimationDefinitionSchema,te as PxAnimatorConfigSchema,wt as PxAnimatorEngine,kt as PxAnimatorMode,ne as PxAttrValueSchema,Oe as PxBezierPathSchema,ee as PxBindingSchema,de as PxCloneEffectSchema,Qt as PxDefsSchema,Dt as PxEasingOrRefSchema,be as PxEffectsSchema,Kt as PxElementAnimationSchema,me as PxFillGradientEffectSchema,It as PxGradientSpreadMethod,he as PxGradientStopSchema,Et as PxGradientType,zt as PxGradientUnits,Rt as PxKeyframeSchema,Ut as PxKeyframeValueSchema,Vt as PxLoopSchema,le as PxMaskedByEffectSchema,we as PxNodeBase,Ae as PxNodeSchema,Bt as PxPropertyAnimationSchema,se as PxRepeaterEffectSchema,fe as PxRetimeEffectSchema,ve as PxStrokeGradientEffectSchema,xe as PxSvgNodeExtra,ye as PxTextEffectSchema,ge as PxTextPathEffectSchema,ae as PxTransformByEffectSchema,Wt as PxTransformPartsSchema,qt as PxTransformValueSchema,Zt as PxTriggerSchema,ce as PxTrimPathEffectSchema,F as STYLE_ATTR_NAMES,C as TRANSFORM_FN_NAMES,jo as applyPlayerEffects,Mn as calcAnimationValues,V as camelCaseToKebabWordIfNeeded,$o as collectSampleTimes,bi as createAnimator,yi as createAnimatorImpl,Fo as createBasicFrameLoopAnimator,ii as createFrameLoopAnimator,Mr as createPathSampler,ui as createWebApiAnimator,vt as describeSchema,ei as diffInEffect,He as evaluateMotionPathSegment,Er as extendedPathForBrowser,ze as generateNewIds,Nt as getAnimatorConfig,Ft as getBindings,Lt as getChildren,Tt as getDefs,Ve as getNormalizedProps,Ct as isPxElementFileFormat,Se as isPxElementFileFormatDeep,Nr as jsonElementFactory,Qr as layoutGlyphTextChars,ki as loadTagAnimators,No as materialiseAllInTree,In as materialiseAnimatedUseInstances,so as materialiseGlyphText,$r as materialiseGlyphTextAlongPath,Xr as materialiseGlyphTextHorizontal,wn as materialiseInternalLoopsInPropAnim,An as materialiseInternalLoopsInTree,Xe as materialiseMotionPathInPropAnim,un as materialiseMotionPathsInTree,On as normalizeDocument,Ge as propAnimIsMotionPath,gt as px,vi as renderNode,mt as schemaKeys,ri as setupAnimationTriggers,Ir as shiftAnimatable,z as toRGBA,ke as validateNodeEffects,ti as visualModelAt};