@pixodesk/svg-animator-core 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=Math.pow,s=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&s(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&s(t,n,e[n]);return t},u=(t,r)=>e(t,n(r));function c(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var f=class{_canSanitize(t){return this.isValid(t)}optional(){return new d(this)}},d=class extends f{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)}},h=class extends f{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(c(null!=n?n:[])+": expected string, got "+typeof t),!1)}},p=class extends f{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(c(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},m=class extends f{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(c(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},v=class extends f{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(c(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},g=class extends f{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(c(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},y=class extends f{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(c(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))}},b=class extends f{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(c(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)}},k=class extends f{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(c(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(c(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},A=class extends f{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=l({},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(c(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)}},x=class extends f{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(c(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)}},w=class extends f{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(c(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)}},j=class extends f{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},O=class extends f{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(c(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},M=class extends f{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)}},S=class extends f{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(c(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 P(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function _(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 z={string:(t="")=>new h(t),number:(t=0)=>new p(t),boolean:(t=!1)=>new m(t),literal:t=>new v(t),enum:(t,e)=>new g(t,e),union:(t,e)=>new y(t,e),discriminatedUnion:(t,e)=>new b(t,e),object:t=>new k(t),openObject:(t,e)=>new A(t,e),extendedObject:(t,e)=>new k(l(l({},t._shape),e)),array:t=>new x(t),record:t=>new w(t),any:()=>new j,defined:()=>new O,tuple:t=>new S(t),lazy:(t,e)=>new M(t,e)},I="data-px-animation-src",N="_px_animator",C={auto:"auto",waapi:"waapi",frames:"frames"},D={waapi:C.waapi,frames:C.frames},F={before:"before",after:"after"},T="luminance",U="alpha",L="userSpaceOnUse",E="objectBoundingBox",B="clip",V="extend",W="spacing",R="spacingAndGlyphs",G="align",Z="stretch",K="auto",q="exact",Q={separate:"separate",combined:"combined"},X="text",J="textContent",Y=new Set(["type","children","animator","meta","animate","effects",X,J]),H=["translate","rotate","scale","origin"],$={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},tt={pad:"pad",reflect:"reflect",repeat:"repeat"},et={linear:"linear",radial:"radial"};function nt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function rt(t){var e;return(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator)}function ot(t){var e;if(t)return null==(e=rt(t))?void 0:e.definitions}function it(t){var e;if(!t)return;const n=null==(e=rt(t))?void 0:e.animateById;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function at(t){return null==t?void 0:t.children}var st=z.union([z.string(),z.tuple([z.number(),z.number(),z.number(),z.number()])]),lt=z.union([z.string(),z.number(),z.array(z.number()),z.lazy(()=>dt,{}),z.object({path:z.string()}),z.lazy(()=>z.object({paths:z.array(Zt)}),{paths:[]}),z.lazy(()=>z.array(Ct),[])]),ut=z.object({time:z.number().optional(),t:z.number().optional(),value:lt.optional(),v:lt.optional(),easing:st.optional(),e:st.optional(),tangentOut:z.tuple([z.number(),z.number()]).optional(),to:z.tuple([z.number(),z.number()]).optional(),tangentIn:z.tuple([z.number(),z.number()]).optional(),ti:z.tuple([z.number(),z.number()]).optional(),selected:z.boolean().optional()}),ct=z.object({segmentCount:z.number().optional(),extend:z.enum([F.before,F.after]).optional(),alternate:z.boolean().optional()}),ft=z.object({value:lt.optional(),keyframes:z.array(ut).optional(),kfs:z.array(ut).optional(),loop:z.union([ct,z.boolean()]).optional(),autoOrient:z.boolean().optional()}),dt=z.object({translate:z.tuple([z.number(),z.number()]).optional(),rotate:z.number().optional(),skew:z.number().optional(),scale:z.tuple([z.number(),z.number()]).optional(),origin:z.tuple([z.number(),z.number()]).optional()}),ht=z.union([z.string(),dt,z.object({value:dt}),ft]),pt=z.record(ft),mt=z.union([z.string(),z.array(z.union([z.string(),pt])),pt]),vt=z.object({startOn:z.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:z.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:z.number().optional()}),gt=z.object({width:z.number(),d:z.string()}),yt=z.object({fFamily:z.string(),style:z.string(),ascent:z.number(),unitsPerEm:z.number(),glyphs:z.record(gt)}),bt=z.object({easings:z.record(z.tuple([z.number(),z.number(),z.number(),z.number()])).optional(),animations:z.record(pt).optional(),styles:z.record(z.any()).optional(),glyphs:z.record(yt).optional()}),kt=z.object({mode:z.enum([C.auto,C.waapi,C.frames]).optional(),duration:z.number().optional(),delay:z.number().optional(),iterations:z.union([z.number(),z.literal("infinite")]).optional(),fill:z.enum(["forwards","backwards","both","none"]).optional(),direction:z.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:z.number().optional(),trigger:vt.optional(),resetOnFinish:z.boolean().optional(),definitions:bt.optional(),animateById:z.record(mt).optional(),timelineSource:z.string().optional(),debugInstName:z.string().optional()}),At=z.object({id:z.string(),animate:mt}),xt=z.union([z.string(),z.number(),z.array(z.number()),z.object({value:z.defined()}),dt]),wt=z.union([z.number(),z.object({value:z.number()}),ft]),jt=z.union([z.tuple([z.number(),z.number()]),z.object({value:z.tuple([z.number(),z.number()])}),ft]),Ot=z.union([z.string(),z.object({value:z.string()}),ft]),Mt=z.object({translate:jt.optional(),rotate:wt.optional(),scale:jt.optional(),skew:wt.optional(),origin:jt.optional()}),St=z.object({copies:z.number().optional(),translate:jt.optional(),rotate:wt.optional(),skew:wt.optional(),scale:jt.optional(),origin:jt.optional()}),Pt=z.object({sourceId:z.string().optional(),maskType:z.enum([T,U]).optional(),maskUnits:z.enum([L,E]).optional(),maskContentUnits:z.enum([L,E]).optional(),x:z.number().optional(),y:z.number().optional(),width:z.number().optional(),height:z.number().optional()}),_t=z.object({d:Ot.optional(),animate:ft.optional()}),zt=z.object({offset:wt.optional(),range:jt.optional(),subPaths:z.enum([Q.separate,Q.combined]).optional()}),It=z.object({sourceId:z.string().optional(),start:z.number().optional(),stretch:z.number().optional(),timeCrop:z.tuple([z.number(),z.number()]).optional()}),Nt=z.object({type:z.enum(["content"]).optional(),sourceId:z.string().optional(),retime:It.optional()}),Ct=z.object({offset:z.number(),color:z.string()}),Dt=z.union([z.array(Ct),z.object({value:z.array(Ct)}),ft]),Ft=z.object({type:z.enum([et.linear,et.radial]),p1:jt.optional(),p2:jt.optional(),c:jt.optional(),r:wt.optional(),fp:jt.optional(),stops:Dt.optional(),gradientUnits:z.enum([$.userSpaceOnUse,$.objectBoundingBox]).optional(),spreadMethod:z.enum([tt.pad,tt.reflect,tt.repeat]).optional(),gradientTransform:z.string().optional()}),Tt=Ft,Ut=z.object({path:z.string(),pathOverflow:z.enum([B,V]).optional(),lengthAdjust:z.enum([W,R]).optional(),method:z.enum([G,Z]).optional(),spacing:z.enum([K,q]).optional(),startOffset:wt.optional(),textLength:wt.optional()}),Lt=z.object({useGlyphs:z.boolean().optional()}),Et=z.object({transformBy:Mt.optional(),repeater:St.optional(),maskedBy:Pt.optional(),clipPath:_t.optional(),trimPath:zt.optional(),clone:Nt.optional(),fillGradient:Ft.optional(),strokeGradient:Tt.optional(),textPath:Ut.optional(),text:Lt.optional()});function Bt(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!Et.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=z.openObject({type:z.string(),id:z.string().optional(),meta:z.any().optional(),effects:Et.optional(),animate:mt.optional(),style:z.union([z.string(),z.record(z.union([z.string(),z.number()]))]).optional()},xt),Wt=z.openObject(u(l({},Vt._shape),{children:z.lazy(()=>z.array(Wt),[]).optional()}),xt),Rt=z.object({width:z.union([z.number(),z.string()]).optional(),height:z.union([z.number(),z.string()]).optional(),viewBox:z.string().optional(),animator:kt.optional()}),Gt=z.openObject(u(l(l({},Vt._shape),Rt._shape),{type:z.literal("svg"),children:z.array(Wt).optional()}),xt),Zt=z.object({v:z.array(z.array(z.number())),i:z.array(z.array(z.number())).optional(),o:z.array(z.array(z.number())).optional(),c:z.boolean().optional()});function Kt(t){const e=Gt.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function qt(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("L"+f[0]+","+f[1]):c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+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 Qt(t,e,n){return t+(e-t)*n}function Xt(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Qt(t[i]||0,e[i]||0,n);return r}function Jt(t,e,n){return[Qt(t[0]||0,e[0]||0,n),Qt(t[1]||0,e[1]||0,n),Qt(t[2]||0,e[2]||0,n),Qt(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Yt(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Ht(t[i],e[i],n));return o}function Ht(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(Xt(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(Xt(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(Xt(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 $t(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 te(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=$t(e,r,t),((s*n+a)*n+i)*n;var n}}function ee(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function ne(t,e,n,r,o){const i=ee(t,e,o),a=ee(e,n,o),s=ee(n,r,o),l=ee(i,a,o),u=ee(a,s,o),c=ee(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}function re(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=$t(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=ne([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 oe(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function ie(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 ae(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 se=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),le=new Set(["translate","rotate","scale","skew"]),ue=new Set(["offset-distance","offsetDistance"]);function ce(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 fe=new Set(["offset-distance","offsetDistance"]),de=1e3;function he(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function pe(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var me=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 ve(t){return me.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function ge(t,e,n){return Math.max(e,Math.min(t,n))}function ye(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 be=1e-4;function ke(t,e,n,r,o){const i=Ae(t,e,n,r,o);if(0===i[0]&&0===i[1]){return Ae(t,e,n,r,o<.5?o+be:o-be)}return i}function Ae(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 xe(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=ye(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=ye(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 we(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 je=0;function Oe(){return"_px_"+Date.now().toString(36)+(++je).toString(36)+Math.random().toString(36).substring(2,6)}function Me(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Me(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Me(e[t]);return n}function Se(t){var e,n;const r=Me(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=Oe();o.set(t,n),e.id=n}else e.animate&&(e.id=Oe());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]=Pe(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]=Pe(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=Pe(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const c=null==(e=r.animator)?void 0:e.animateById;if(c&&"object"==typeof c){const t={};for(const[e,r]of Object.entries(c)){t[null!=(n=o.get(e))?n:e]=r}r.animator=u(l({},r.animator),{animateById:t})}return r}function Pe(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var _e=new Set(["script","foreignobject"]),ze=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Ie=new Set(["href","xlink:href","src"]),Ne=new Set(["mixBlendMode","isolation"]),Ce=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,De=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Fe=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Te=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Ue(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(ze.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Ie.has(n)&&(Ce.test(t)||De.test(t)||function(t){const e=Fe.exec(t);return!!e&&Te.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 Le(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}function Ee(t){const e={};for(const n of Object.keys(t)){const r=he(n);if(Y.has(r))continue;if("style"===r)continue;let o=t[n];if(se.has(r)&&Array.isArray(o))e[r]=ie(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes||o.kfs)le.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=ce(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 Ve(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function We(t){var e;return null!=(e=t.easing)?e:t.e}function Re(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 Ge=new WeakMap;function Ze(t,e,n,r){var o,i;let a=Ge.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=xe(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,Ge.set(t,a)),a.set(e,h),h}function Ke(t,e,n,r,o,i){const a=Ze(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=t.ds[t.ds.length-1],r=e*n,{ts:o,ds:i}=t,a=i.length-1;if(r<=0)return o[0];if(r>=i[a])return o[a];let s=1,l=a;for(;s<l;){const t=s+l>>>1;i[t]<r?s=t+1:l=t}const u=i[l-1],c=i[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(a.lut,o),l=ye(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=ke(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function qe(t,e){var n,r,o,i;if(!Re(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=ke(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(Xe(Ve(a[0]),He(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&&tn(f,e,n,r,o,u),nn(f,e,n,r,o,s,l,u,c)):f.push(Xe(Ve(n),He(Je(n),Je(n),1,null!=o?o:[0,0],void 0,s)))}const p=We(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 Xe(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 Ye(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 He(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]=Ye(o,s,n))}return void 0!==o&&(a.rotate=o+$e(t,e,n)),a}function $e(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=Ye(r,o,n);return"number"==typeof i?i:0}function tn(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-$e(c,c,0),d=Ze(e,n,r,o),h=ke(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=Ve(e),g=Math.min(v+en,(v+Ve(n))/2),y=He(Je(e),Je(e),0,r,p,!0);t.push(Xe(g,y))}var en=.05;function nn(t,e,n,r,o,i,a,s,l){const u=Ze(e,n,r,o),c=Ve(e),f=Ve(n),d=We(e),h=(p=d)?te([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=[];rn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),rn(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++)on(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=we(u.lut,t),n=ge(u.totalArc>0?e/u.totalArc:t,0,1),r={u:ge(h(n),0,1),p:n,pos:ye(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=ke(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?ge((n.u-k)/(1-k),0,1):1,{left:o,right:a}=re(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=He(m,v,n.p,n.pos,n.rotateDeg,i);t.push(Xe(l,u)),b=a,k=n.u}}function rn(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 on(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=ye(r.P0,r.P1,r.P2,r.P3,t),c=ye(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=ye(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=ye(r.P0,r.P1,r.P2,r.P3,l),p=ye(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(an(d,u,c),an(h,u,c),an(p,u,c));let v=!0;if(o){const n=ke(r.P0,r.P1,r.P2,r.P3,t),o=ke(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,on(t,l,n,r,o,i,a,s),on(l,e,n,r,o,i,a,s))}function an(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 sn(t,e){const n=ln(t,e);return null!=n?n:t}function ln(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=ln(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&&Re(n)){const o=qe(n,e);o!==n&&(r=u(l({},t),{transform:o}))}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var un=1;function cn(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=>cn(t[n],e[n]))}function fn(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 dn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function hn(t){return"string"==typeof t&&void 0!==dn(t)}function pn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=dn(t.path);return e?{paths:fn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&hn(e[0])){const t=[];for(const n of e){const e=dn(n);e&&t.push(...fn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&hn(t[0])){const e=[];for(const n of t){const t=dn(n);t&&e.push(...fn(t))}return{paths:e}}return{paths:t}}if(hn(t)){return{paths:fn(dn(t))}}return t}function mn(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 vn(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 gn(t,e,n,r){var o,i;if("d"===t){return{paths:Yt(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)}}return se.has(t)?Jt(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?Qt(e,n,r):le.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Xt(e||[],n||[],r):Qt(+(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]=Qt(+(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]=Xt(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function yn(t,e,n,r){var o,i,a,s,c;const f=e.length-1,d=ge(null!=(o=n.segmentCount)?o:f,1,f);let h;h=n.extend===F.before?e.slice(0,d+1):e.slice(f-d);const p=null!=(i=e[0].t)?i:0,m=null!=(a=e[e.length-1].t)?a:0;let v,g;n.extend===F.before?(v=0,g=p):(v=m,g=r);const y=g-v;if(y<=0)return e;const b=null!=(s=h[0].t)?s:0,k=(null!=(c=h[h.length-1].t)?c:0)-b;if(k<=0)return e;const A=h.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}}),x=Math.floor(y/k),w=y-x*k,j=w/k,O=[],M=n.extend!==F.before,S=e[e.length-1];let P,_=!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?oe(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?te(o.e)(l):l,c=gn(t,o.v,r.v,u),{left:f}=re(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]:S,l=M&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*k))<1e-9;if(l){if(cn(s.v,r.v)){O.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(P=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===F.before){if(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?oe(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?te(a.e)(o):o,l=gn(t,a.v,r.v,s),{right:u}=re(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)}}(v,!!n.alternate&&x%2==0,j)}for(let t=0;t<x;t++){const e=x-1-t,r=!!n.alternate&&e%2==0;z(v+w+t*k,r)}}else{for(let t=0;t<x;t++){const e=!!n.alternate&&t%2==0;z(v+t*k,e)}if(j>1e-9){const t=!!n.alternate&&x%2==0;z(v+x*k,t,j)}}if(n.extend===F.before)return[...O,...e];if(_&&e.length>0){return[...e.slice(0,-1),u(l({},e[e.length-1]),{e:P}),...O]}return[...e,...O]}function bn(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=pn(f));const p=pe(t)?ve(t):t;se.has(p)&&(f=null!=(l=ae(f))?l:f);const m={t:n,v:f,e:mn(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?yn(t,d,p,n):d}function kn(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=pe(t)?ve(t):t,l=se.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=pn(d)),l&&(d=null!=(o=ae(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:yn(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=kn(n,o,e);i!==o&&(r||(r=l({},t)),r[n]=i)}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var wn=0;function jn(t,e=D.waapi){const n=rt(t)||{},r=ot(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=vn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=vn(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=D.waapi){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=bn(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===D.waapi&&"transform"===i?qe(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=it(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_"+ ++wn;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 On(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,g=0,y=1,v===m?g:g+(p-m)/(v-m)*(y-g));var p,m,v,g,y;h=ge(h,0,1);const b=null!=(i=f.e)?i:f.easing;if(b&&Array.isArray(b))try{h=te(b)(h)}catch(t){}let k=pe(t)?ve(t):t,A=null;const x=null!=(a=null==f?void 0:f.v)?a:null==f?void 0:f.value,w=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===k){A=Yt(null!=(l=null==x?void 0:x.paths)?l:Array.isArray(x)?x:[],null!=(u=null==w?void 0:w.paths)?u:Array.isArray(w)?w:[],h).map(t=>qt(t)).join("")}else if(se.has(k))A=ie(Jt(x||[0,0,0,1],w||[0,0,0,1],h)),k=t;else if("stroke-dasharray"===k)A=Xt(x||[],w||[],h).join(" "),k=t;else if("transform"!==k||null===x||"object"!=typeof x||Array.isArray(x))if("translate"===k){A="translate("+Xt(x||[0,0],w||[0,0],h).join(",")+")",k="transform"}else if("rotate"===k){A="rotate("+Qt(+(x||0),+(w||0),h)+")",k="transform"}else if("scale"===k){A="scale("+Xt(x||[1,1],w||[1,1],h).join(",")+")",k="transform"}else{A=Qt(+(x||0),+(w||0),h)}else{const t=new Set([...x?Object.keys(x):[],...w?Object.keys(w):[]]),n={};for(const e of t){const t=null==x?void 0:x[e],r=null==w?void 0:w[e];if("rotate"===e||"skew"===e)n[e]=Qt(+(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=Xt(t||o,r||o,h);n[e]=i}}if(Re(e)){const t=x.translate,r=w.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Ke(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)}}A=ce(n,{withUnits:!1}),k="transform"}return ue.has(k)&&"number"==typeof A&&(A=100*A+"%"),{k:k,v:null===A?"":""+A}}function Mn(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=On(r,o,e);t&&(n[t.k]=t.v)}return n}function Sn(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Sn);const e={};for(const n of Object.keys(t))e[n]=Sn(t[n]);return e}function Pn(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 _n(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function zn(t){var e;const n=_n(t.x),r=_n(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}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=Fn(t.viewBox);if(e)return[e[2],e[3]];const n=Nn(t.width),r=Nn(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 c={type:"defs",children:a},f=[...null!=(e=s.children)?e:[],c];return u(l({},s),{children:f})}function Nn(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 Dn(t,e,n,r,o,i,a){var s,c,f,d;const h=Sn(e);Pn(h,o);const p="symbol"===h.type?Fn(h.viewBox):void 0,m=null!=(c=null!=(s=Nn(t.width))?s:null==p?void 0:p[2])?c:a[0],v=null!=(d=null!=(f=Nn(t.height))?f:null==p?void 0:p[3])?d:a[1],g="symbol"===h.type?function(t,e,n,r,o){const i=Fn(t.viewBox),a=u(l({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,c,f,d]=i,h=f>0&&d>0?Math.min(r/f,o/d):1,p=(r-f*h)/2,m=(o-d*h)/2,v=[];0===p&&0===m||v.push("translate("+p+","+m+")");1!==h&&v.push("scale("+h+")");0===s&&0===c||v.push("translate("+-s+","+-c+")");v.length&&(a.transform=v.join(""));const g=e();return n.push({type:"clipPath",id:g,children:[{type:"rect",x:s,y:c,width:f,height:d}]}),a.clipPath="url(#"+g+")",a}(h,o,i,m,v):h,y=Tn(g,n,r,o,i,a),b=u(l({},t),{type:"g",children:[y]});return delete b.href,delete b.width,delete b.height,zn(b)}function Fn(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 Dn(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?u(l({},t),{children:s}):t}function Un(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(Bn),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 En(t,e,n,r){var o,i,a,s;const u=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]=u(n.value));const c=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,f=l({},c||{}),d={keyframes:n.keyframes};void 0!==n.loop&&(d.loop=n.loop),void 0!==n.autoOrient&&(d.autoOrient=n.autoOrient),f[e]=d,t.animate=f;const h=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!==h&&(t[e]=u(h))}function Bn(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=l({},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 Vn(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 Wn(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=Gn(r,e.origin,!0),r=Rn(r,"scale",e.scale,n),r=Rn(r,"skew",e.skew,n),r=Rn(r,"rotate",e.rotate,n),r=Gn(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=Rn(r,"translate",e.translate,n):(r=Gn(r,e.origin,!0),r=Rn(r,"translate",e.translate,n),r=Gn(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function Rn(t,e,n,r){if(void 0===n)return t;const o=Ln(n);if("static"===o.kind)return{type:"g",transform:{value:Un(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>Vn(t,Un(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 Gn(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=>Vn(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function Zn(t,e){return"_lw_"+e+"_"+t.nextId++}function Kn(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function qn(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>qn(t,e))}var Qn=Sn;function Xn(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=Kn(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=>Xn(t,e,n))}function Jn(t,e,n,r,o){const i=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=Hn(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 u=void 0!==(null==e?void 0:e.translate),c=a||u,f=a&&Hn((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&Hn((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=Yn(i.full),r=Yn(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{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);c?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)?f&&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: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=l({},r);delete e.translate;const n=Object.keys(e).length>0;c||(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:a,inner:s}=function(t){if(!t)return{};const e=Hn(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};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);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let u=t;u=Wn(u,s,o);let c={type:"g",id:n,children:[{type:"g",id:r,children:[u]}]};return void 0!==i.transform&&(c.transform=i.transform),void 0!==i.animate&&(c.animate=i.animate),a&&(delete c.id,c=Wn(c,a,o),c.id=n),c}function Yn(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 Hn(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 $n(t,e,n,r){if(!e)return t;const o=Zn(n,"grad"),i=function(t,e){const n={type:t.type===et.radial?"radialGradient":"linearGradient",id:e};t.type===et.linear?(tr(n,"x1","y1",t.p1),tr(n,"x2","y2",t.p2)):(tr(n,"cx","cy",t.c),function(t,e,n){const r=Ln(n);if("absent"===r.kind)return;En(t,e,r,{asString:!0})}(n,"r",t.r),tr(n,"fx","fy",t.fp));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);return 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(er):[];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:nr(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:nr(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:rr(t.offset),stopColor:t.color},p={};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);return h}(t,a,e,0,s))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function tr(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 er(t){return{type:"stop",offset:rr(t.offset),stopColor:t.color}}function nr(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 rr(t){return Math.round(1e3*t)/10+"%"}function or(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.path?t.path:void 0}function ir(t,e,n,r){if(!e)return t;const o=Kn(e.sourceId);if(!o)return r.errors.push("maskedBy.sourceId missing — cannot build mask"),t;const i=Zn(r,"mask");let a={type:"use",href:"#"+o};if(n)a=ar(a,n,r);else if(cr(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=[],c=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=Vn(t,void 0);if(Array.isArray(e.translate)&&a.push(u(l(l({},r),ur(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(u(l({},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]]),c.push(u(l({},r),{value:t}))}}const f=null==o?void 0:o.loop,d=t=>{const e={keyframes:t};return void 0!==f&&(e.loop=f),e};let h=t;a.length&&(h={type:"g",animate:{transform:d(a)},children:[h]});s.length&&(h={type:"g",animate:{transform:d(s)},children:[h]});c.length&&(h={type:"g",animate:{transform:d(c)},children:[h]});return h}(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={};y&&(A.translate=y);void 0!==b&&(A.rotate=b);k&&(A.scale=k);return 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}}return}(t);e&&(a=ar(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||cr(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?pr(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=fr(l),n=fr(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]}}const f=Array.from(c).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const e=dr(l,t),n=dr(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const c={type:"mask",id:i,children:[a]};return e.maskType&&(c.maskType=e.maskType),e.maskUnits&&(c.maskUnits=e.maskUnits),e.maskContentUnits&&(c.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(c.x=String(e.x)),void 0!==e.y&&(c.y=String(e.y)),void 0!==e.width&&(c.width=String(e.width)),void 0!==e.height&&(c.height=String(e.height)),r.defs.push(c),t.mask="url(#"+i+")",t}function ar(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=sr(o,"translate",e.translate,void 0,n),o=sr(o,"rotate",e.rotate,r,n),o=sr(o,"scale",e.scale,r,n),o}function sr(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:Un(e,lr(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=Vn(t,Un(e,lr(e,t.value),r));return"translate"===e?l(l({},n),ur(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function lr(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function ur(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 cr(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function fr(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 dr(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=hr(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function hr(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 pr(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}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return 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 mr="content";function vr(t,e,n){if(!e)return;const r=Kn(e.sourceId);if(!r)return void(e.type===mr&&n.errors.push("clone: content ref missing sourceId"));const o=e.type===mr&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function gr(t,e){const n={};return void 0!==t.translate&&(n.translate=yr(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=yr(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=yr(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];return yr(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function yr(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?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?u(l({},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 br(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function kr(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=l({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function Ar(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function xr(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function wr(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 jr(t,e,n){const r=Kn(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Or(r,e,n,new Set);o&&(t.href="#"+o)}function Or(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=Qn(o);if(function(t,e){Pn(t,()=>Zn(e,"retimed"))}(i,n),"use"===o.type?Sr(i,e.start,e.stretch):Mr(i,e.start,e.stretch),wr(i),"use"===o.type&&o.href){const a=Kn(o.href);if(a){const s=xr(o),l=s?Ar(br(s),e):e,u=new Set(r);u.add(t);const c=Or(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=xr(t);if("use"===t.type&&s&&t.href){const i=Kn(t.href);if(i){const a=Ar(br(s),e),l=new Set(r);l.add(o);const u=Or(i,a,n,l);u&&(t.href="#"+u)}wr(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 Mr(t,e,n){var r;Sr(t,e,n),null==(r=t.children)||r.forEach(t=>Mr(t,e,n))}function Sr(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 Pr=/[MmLlHhVvCcSsQqTtAaZz]/;function _r(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 zr(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=xe(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];Pr.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}=_r([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}=_r([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]=ye(o.P0,o.P1,o.P2,o.P3,a),[u,c]=ke(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((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}function Ir(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 Nr(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 Cr=t=>Math.round(1e3*t)/1e3;function Dr(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=>u(l({},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 Fr(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=zr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=Ir(e.startOffset),s=Ir(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"+Cr(e)+","+Cr(n)+"L"+Cr(d.x)+","+Cr(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"+Cr(t)+","+Cr(e)}return{d:p,startShift:c}}function Tr(t,e,n){null!=n&&En(t,e,Ln(n),{asString:!0})}var Ur=(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 Lr(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function Er(t,e){let n="";for(let r=0;r<t.length;r++){const o=Lr(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function Br(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var Vr=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Wr(t,e,n=2){const r=[];let o;for(Vr.lastIndex=0;null!==(o=Vr.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]=Br(e,s(),s());i+=t+Er([r,o],n)}else if("C"===t){const[t,r]=Br(e,s(),s()),[o,a]=Br(e,s(),s()),[l,u]=Br(e,s(),s());i+="C"+Er([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=Br(e,s(),s()),[o,a]=Br(e,s(),s());i+="Q"+Er([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",X,J,"xml:space"];function Gr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function Zr(t){return"string"==typeof t?t:void 0}function Kr(t,e){var n,r,o,i,a,s,l;return{fontFamily:null!=(n=Zr(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Gr(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=Gr(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Gr(t.wordSpacing))?l:e.wordSpacing}}function qr(t){var e,n,r;return{fontFamily:Zr(t.fontFamily),fontSize:null!=(e=Gr(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Gr(t.letterSpacing))?n:0,wordSpacing:null!=(r=Gr(t.wordSpacing))?r:0}}function Qr(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 Xr(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 Jr(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function Yr(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,i=.92*-e,a=o-r,s=-i,l=Math.max(1,.12*Math.min(a,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(a<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=i+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function Hr(t,e){var n,r,o,i;const{glyphs:a,create:s=Ur,warnings:l}=e,u=Jr(a),c={x:null!=(n=Gr(t.x))?n:0,y:null!=(r=Gr(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{var n;const r=Xr(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=Qr(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:Yr(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=Kr(t,e),s=Gr(t.x),l=Gr(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=Gr(t.dx))?n:0,c.y+=null!=(r=Gr(t.dy))?r:0;const u=null!=(o=Zr(t[J]))?o:Zr(t[X]);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=Zr(t[J]))?o:Zr(t[X]);g&&!(null==(i=t.children)?void 0:i.length)&&p(g,v);const y=Zr(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 uo(t,lo(f,s,l),s)}function $r(t,e){var n,a,s,l,u,c;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=zr(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=Jr(i),c=[];let f=0;const d=(t,e)=>{var n,r,o;const s=Kr(t,e),l=null!=(n=Zr(t[J]))?n:Zr(t[X]);if(l&&!(null==(r=t.children)?void 0:r.length)){const t=Xr(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}=eo(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:f,warnings:d}=e,h=Jr(f),p={x:null!=(a=Gr(t.x))?a:0,y:null!=(s=Gr(t.y))?s:0},m=[],v=[{start:p.x,end:p.x}];let g=0;const y=(t,e)=>{var n;const r=Xr(e,f,h,d),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:p.x,y:p.y,width:l,ascent:a,fontSize:e.fontSize,line:g}),p.x+=l,v[g].end=p.x}},b=(t,e)=>{var n,r,o,i;const a=Kr(t,e),s=Gr(t.x),l=Gr(t.y);void 0!==s&&(p.x=s,g=v.length,v.push({start:p.x,end:p.x})),void 0!==l&&(p.y=l),p.x+=null!=(n=Gr(t.dx))?n:0,p.y+=null!=(r=Gr(t.dy))?r:0;const u=null!=(o=Zr(t[J]))?o:Zr(t[X]);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=Kr(e,k),n=Xr(t,f,h),r=(null==n?void 0:n.unitsPerEm)||1e3;m.push({x:p.x,y:p.y,width:0,ascent:(null!=(l=null==n?void 0:n.ascent)?l:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:g})}}const A=null!=(u=Zr(t[J]))?u:Zr(t[X]);A&&!(null==(c=t.children)?void 0:c.length)&&y(A,k);const x=Zr(t.textAnchor);if("middle"===x||"end"===x)for(const t of m){const e=v[t.line].end-v[t.line].start;t.x+="middle"===x?-e/2:-e}return m.map(t=>{var e=t,{line:n}=e;return((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})(e,["line"])})}function to(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 eo(t){var e,n,r;return{along:(null!=(e=Gr(t.x))?e:0)+(null!=(n=Gr(t.dx))?n:0),perp:null!=(r=Gr(t.dy))?r:0}}function no(t,e,n,r,o,i){const{glyphs:a,create:s=Ur,warnings:c}=r,f=e?zr(e):null;if(!f)return null==c||c.push("textGlyphs: unparsable along-path geometry"),null;const d=Jr(a),{cells:h,width:p}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u,c;const f=Kr(t,s),d=null!=(l=Zr(t[J]))?l:Zr(t[X]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=Xr(f,e,n,r);if(t){const e=f.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=Qr(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:Yr(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,d,c);if(!h.length)return uo(t,[],s);const{along:m,perp:v}=eo(t),g=ro(n),y=ro(o),b=t=>t>0&&p>0?t/p:1,k="clip"===i&&!f.closed;if(g.animated||y.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}(g.times,y.times),n=(t,e)=>m+g.at(e)+b(y.at(e))*t.midBase,r=g.animated?g.loop:y.loop;return uo(t,function(t,e,n,r,o,i,a,s=0){const c=Math.max(e.totalLength/oo,.5),f=t=>t>=0&&t<=e.totalLength,d=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=Wr(h.glyphD,t),m=(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:[ao(r-s*l,3),ao(o+s*a,3)],rotate:ao(180*i/Math.PI,3)}}},v=[],g=[],y=(t,e)=>{v.push(m(t,e)),a&&g.push({time:e,value:f(t)?1:0})};y(n(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(h,e),a=n(h,o),s=Math.min(io,Math.max(1,Math.ceil(Math.abs(a-i)/c)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);y(n(h,r),r)}}Qe(v);const b={keyframes:v};void 0!==o&&(b.loop=o);const k={transform:b};if(a&&g.some(t=>0===t.value)){const t={keyframes:g};void 0!==o&&(t.loop=o),k.opacity=t}d.push(i("path",u(l({d:p},so(h.paint)),{animate:k}),[]))}return d}(h,f,n,e,r,s,k,v),s)}const A=b(y.at(0)),x=m+g.at(0);return uo(t,lo((k?h.filter(t=>{const e=x+t.midBase*A;return e>=0&&e<=f.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,m:to(f,x+t.midBase*A,t.scale,t.widthEm,v)})),s,c),s)}function ro(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 oo=48,io=64;function ao(t,e){const n=a(10,e);return Math.round(t*n)/n}function so(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 lo(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=Wr(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",l({d:n},so(t)),[]));return s}function uo(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=l({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function co(t,e){return e.alongPath?no(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Hr(t,e)}function fo(t,e,n){if(!e)return t;const r=e.subPaths===Q.combined,o=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)i(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*So,d=o*So,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"}return}(t);if(void 0===e)return;const n=fn(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=Oo(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const e of t.subpaths)r||(a=0),e.startOffsetPx=a,a+=e.lengthPx;const c=a;if(r&&c<.001)return t;const f=Ln(e.offset),d="absent"===f.kind?{kind:"static",value:0}:f,h=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=wo(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=jo(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=jo(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),p="absent"===h.kind?{kind:"static",value:[0,1]}:h,m=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}(d),v=[m.length?Math.min(...m):0,m.length?Math.max(...m):0];if(1===o.length&&o[0].leaf===t&&1===o[0].subpaths.length){const e=o[0],n=e.subpaths[0],i=r?c:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=vo(n,e,r),s=go(e,r),u=l({},t);return delete u.effects,ko(u,"strokeDasharray",bo(i,s)),ko(u,"strokeDashoffset",bo(o,a)),ko(u,"strokeOpacity",xo(i)),u}(e.leaf,i,a,v,d,p)}const g=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?c:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...po(t.leaf,o.subpath,i,a,v,d,p,n))}g.set(t.leaf,ho(t.leaf,e))}const y=t=>{const e=g.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?u(l({},t),{children:t.children.map(y)}):t)};return y(t)}function ho(t,e){const n=u(l({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function po(t,e,n,r,o,i,a,s){const l=vo(r,n,o),u=go(n,o),c=bo(i,l),f=bo(a,u),d=xo(a),h=function(t){return{type:"path",d:t}}(qt(e));return ko(h,"strokeDasharray",f),ko(h,"strokeDashoffset",c),ko(h,"strokeOpacity",d),[h]}var mo=1;function vo(t,e,n){const[r]=yo(n);return n=>e*(-n-r+t)+mo}function go(t,e){const[n,r]=yo(e),o=r-n+1;return e=>{const n=ge(e[0],0,1),r=ge(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=mo;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+mo),s}}function yo(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function bo(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 ko(t,e,n){n&&En(t,e,n)}var Ao=10;function xo(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+Ao,value:1})):!p&&m&&(f.push({time:d-Ao,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function wo(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 jo(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 Oo(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+=Mo(t,r,r+1);return t.c&&e.length>1&&(n+=Mo(t,e.length-1,0)),n}function Mo(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=xe(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 So=.5522847498307936;function Po(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=rt(t))?void 0:e.mode)===C.frames?D.frames:D.waapi,glyphs:null==(n=ot(t))?void 0:n.glyphs},o=Qn(t);qn(o,r.idMap),Xn(o,r,()=>Zn(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=Kn(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=pr(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(),qn(t,e.idMap);const n=[],r=t=>{var e;xr(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&&xr(o)&&n++,"use"===o.type&&o.href){const t=Kn(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=Kn(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=xr(t);if(!n)continue;const r=n.timeCrop;wr(t),jr(t,br(n),e),r&&kr(t,r,e)}}(t,e),t}(_o(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function _o(t,e){t.children&&(t.children=t.children.map(t=>_o(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?no(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?Hr(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=Zn(n,"tpath"),{d:i,startShift:a}=Fr(e.path,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:Nr(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),Tr(s,"startOffset",Dr(e.startOffset,a)),Tr(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return $n(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return $n(t,e,n,"stroke")}(m,d,e),m=fo(m,u,e),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=Qn(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 r=Qn(l),o=gr(e,t),i=o?Wn(r,o,n):r;u.push(i)}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=ir(m,s,i,e),m=function(t,e,n){var r,o;if(!e||!e.d&&!e.animate)return t;const i=Zn(n,"clip"),a={type:"path"},s=Ln(e.d);if("absent"!==s.kind&&("static"===s.kind?a.d=or(s.value):(En(a,"d",s),void 0!==a.d&&(a.d=or(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?(vr(m,c,e),m=Jn(m,i,r,o,e)):m=function(t,e,n,r){return vr(t,e,r),Wn(t,n,r)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}var zo=t=>{var e,n;return null!=(n=null!=(e=t.t)?e:t.time)?n:0},Io=t=>{var e;return null!=(e=t.v)?e:t.value},No=t=>{var e;return null!=(e=t.e)?e:t.easing},Co=t=>{var e;return null!=(e=t.tangentIn)?e:t.ti},Do=t=>{var e;return null!=(e=t.tangentOut)?e:t.to};function Fo(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 To(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Fo(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Uo=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function Lo(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=Io(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=Io(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=>Co(t)||Do(t)))return;let u="M"+Uo(l[0][0])+","+Uo(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=Do(i[t]))?r:[0,0],s=null!=(o=Co(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"+Uo(f[0])+","+Uo(f[1])+","+Uo(d[0])+","+Uo(d[1])+","+Uo(n[0])+","+Uo(n[1]),c.push(To(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:zo(i[t]),v:h/f},n=No(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=l({},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 c=s;if(s&&"object"==typeof s){const t=l({},s);delete t.translate,delete t.origin,c=Object.keys(t).length?t:void 0}r=u(l({},t),{animate:n,style:u(l({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:Uo(e.anchor[0])+"px "+Uo(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==c?r.transform=c: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=u(l({},r),{children:t}))}return r};return e(t)}function Eo(t,e,n){var r,o;let i=Po(t).root;i=Lo(i);return i=An(i,null!=(o=null==(r=rt(i))?void 0:r.duration)?o:de),e===D.waapi&&(i=sn(i,null==n?void 0:n.motionPath),i=In(i),i=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(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&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(i)),i}function Bo(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function Vo(t,e,n){var r;const o=rt(t)||{},i=jn(t,D.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||de),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 x=0;const w=()=>{const t=g?(Date.now()-g)*y:0;return v+t},j=()=>{let t=w();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;if(l>0){t=ge(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1);n=ge((t-r*e)/e,0,1)}else 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 M=()=>!!m&&(!!e.isConnected()&&(y<0?w()>0:!(Number.isFinite(u)&&j()>=u))),S=t=>{null!==p&&(Bo(p),p=null),(t||M())&&(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=w();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(A>0){const t=Date.now();if(x&&t-x<A)return;x=t}O(o)}})(),S()}))},P=()=>{if(!m)return;let t=w();Number.isFinite(u)&&t>u&&(t=u),v=t,g=0,m=!1,null!==p&&(Bo(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>M(),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(),S(!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&&(Bo(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=w();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 Wo=[1,0,0,1,0,0];function Ro(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 Go=(t,e)=>[1,0,0,1,t,e],Zo=(t,e)=>[t,0,0,e,0,0];function Ko(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var qo=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Qo=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function Xo(t){let e=Wo;t.translate&&(e=Ro(e,Go(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=Ro(e,Go(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=Ro(e,Ko(t.rotate))),t.scale&&(e=Ro(e,Zo(t.scale[0],t.scale[1]))),n&&(e=Ro(e,Go(-t.origin[0],-t.origin[1]))),e}function Jo(t,e,n){return t+(e-t)*n}function Yo(t,e){return null==t?Wo:"string"==typeof t?function(t){let e=Wo;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=Ro(e,Go(n[0]||0,n[1]||0)):"scale"===t?e=Ro(e,Zo(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=Ro(e,Ko(n[0])):"skewX"===t?e=Ro(e,qo(n[0])):"skewY"===t?e=Ro(e,Qo(n[0])):"matrix"===t&&(e=Ro(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?Xo(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=[Jo(h.translate[0],p.translate[0],d),Jo(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=Jo(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[Jo(h.scale[0],p.scale[0],d),Jo(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?Xo(t.value):"object"!=typeof t||Array.isArray(t)?Wo:Xo(t)}var Ho=new Set(["svg","g","symbol"]),$o=new Set(["defs","mask","clipPath","title"]);function ti(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>ti(t,e))}function ei(t){return null==t?0:Number(t)}function ni(t){return Math.round(100*t)/100+0}function ri(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=ni(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 Jo(c.value,f.value,d)}return void 0!==e?Number(e):n}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,n)),d=t.mask?1:0,h=e.map(ni).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return ei(t.width)+","+ei(t.height)+","+ei(t.x)+","+ei(t.y);case"ellipse":return ei(t.rx)+","+ei(t.ry)+","+ei(t.cx)+","+ei(t.cy);case"circle":return ei(t.r)+","+ei(t.cx)+","+ei(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(ei(c)||"")+"|o:"+f+"|m:"+d}function oi(t,e,n,r,o){var i;const a=t.type||"";if($o.has(a))return;const s=Ro(e,function(t,e){return t.animate&&t.animate.transform?Yo(t.animate.transform,e):void 0!==t.transform?Yo(t.transform,e):Wo}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=Ro(s,Go(ei(t.x),ei(t.y)));return void(i?oi(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Ho.has(a)?null==(i=t.children)||i.forEach(t=>oi(t,s,n,r,o)):o.push(ri(t,s,n))}function ii(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=>ii(t,e))}function ai(t,e){const n=new Map;ti(t,n);const r=[];return oi(t,Wo,e,n,r),r.sort()}function si(t,e){const n=new Set;ii(t,n),ii(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=ai(t,o),i=ai(e,o),a=li(n,i),s=li(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function li(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}export{se as COLOUR_ATTR_NAMES,Ne as CSS_ONLY_STYLE_PROPS,de as DEFAULT_DURATION_MS,_e as DISALLOWED_SVG_TAGS_LOWER,Y as INTERNAL_ATTRS,un as LOOP_JUMP_SHIFT_MS,ue as PCT_BASED_ATTR_NAMES,N as PX_ANIM_ATTR_NAME,I as PX_ANIM_SRC_ATTR_NAME,H as PX_TRANSFORM_PART_KEYS,Gt as PxAnimatedSvgDocumentSchema,pt as PxAnimationDefinitionSchema,kt as PxAnimatorConfigSchema,D as PxAnimatorEngine,C as PxAnimatorMode,xt as PxAttrValueSchema,Zt as PxBezierPathSchema,At as PxBindingSchema,Nt as PxCloneEffectSchema,bt as PxDefsSchema,st as PxEasingOrRefSchema,Et as PxEffectsSchema,mt as PxElementAnimationSchema,Ft as PxFillGradientEffectSchema,tt as PxGradientSpreadMethod,Ct as PxGradientStopSchema,et as PxGradientType,$ as PxGradientUnits,ut as PxKeyframeSchema,lt as PxKeyframeValueSchema,F as PxLoopExtend,ct as PxLoopSchema,Pt as PxMaskedByEffectSchema,Vt as PxNodeBase,Wt as PxNodeSchema,ft as PxPropertyAnimationSchema,St as PxRepeaterEffectSchema,It as PxRetimeEffectSchema,Tt as PxStrokeGradientEffectSchema,Rt as PxSvgNodeExtra,Lt as PxTextEffectSchema,Ut as PxTextPathEffectSchema,Mt as PxTransformByEffectSchema,dt as PxTransformPartsSchema,ht as PxTransformValueSchema,vt as PxTriggerSchema,zt as PxTrimPathEffectSchema,Q as PxTrimSubPaths,fe as STYLE_ATTR_NAMES,X as TEXT_ATTR,J as TEXT_CONTENT_ATTR,le as TRANSFORM_FN_NAMES,Po as applyPlayerEffects,qt as bezierToSvgPath,Mn as calcAnimationValues,ve as camelCaseToKebabWordIfNeeded,ge as clamp,ii as collectSampleTimes,ce as composeTransformParts,Vo as createBasicFrameLoopAnimator,zr as createPathSampler,te as cubicBezier,Me as deepClone,_ as describeSchema,si as diffInEffect,Ke as evaluateMotionPathSegment,Fr as extendedPathForBrowser,Se as generateNewIds,Oe as generateUniqueId,rt as getAnimatorConfig,it as getBindings,at as getChildren,ot as getDefs,jn as getNormalisedBindings,Ee as getNormalizedProps,Yt as interpolateBeziers,gn as interpolateValue,nt as isPxElementFileFormat,Kt as isPxElementFileFormatDeep,Ur as jsonElementFactory,he as kebabToCamelCaseWord,$r as layoutGlyphTextChars,Eo as materialiseAllInTree,In as materialiseAnimatedUseInstances,co as materialiseGlyphText,no as materialiseGlyphTextAlongPath,Hr as materialiseGlyphTextHorizontal,kn as materialiseInternalLoopsInPropAnim,An as materialiseInternalLoopsInTree,qe as materialiseMotionPathInPropAnim,sn as materialiseMotionPathsInTree,Re as propAnimIsMotionPath,z as px,Le as resolveStyle,oe as reverseEasing,Ue as sanitiseAttributeValue,P as schemaKeys,Dr as shiftAnimatable,re as splitEasing,ne as subdivideCubicBezier,ie as toRGBA,Bt as validateNodeEffects,ai as visualModelAt};
1
+ var t=Object.defineProperty,n=Object.defineProperties,e=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(n,e,r)=>e in n?t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,l=(t,n)=>{for(var e in n||(n={}))o.call(n,e)&&s(t,e,n[e]);if(r)for(var e of r(n))i.call(n,e)&&s(t,e,n[e]);return t},u=(t,r)=>n(t,e(r));function c(t,n=!1){var e,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!=(e=null==l?void 0:l[t-1])?e:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];!n&&i[0]===o[0]&&i[1]===o[1]&&u[0]===f[0]&&u[1]===f[1]?c.push("L"+f[0]+","+f[1]):c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],e=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];!n&&e[0]===t[0]&&e[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+e[0]+","+e[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function f(t,n,e){return t+(n-t)*e}function d(t,n,e){const r=[],o=Math.max(t.length,n.length);for(let i=0;i<o;i++)r[i]=f(t[i]||0,n[i]||0,e);return r}function h(t,n,e){return[f(t[0]||0,n[0]||0,e),f(t[1]||0,n[1]||0,e),f(t[2]||0,n[2]||0,e),f(void 0===t[3]?1:t[3],void 0===n[3]?1:n[3],e)]}function p(t,n,e){const r=Math.max(t.length,n.length),o=[];for(let i=0;i<r;i++)o.push(m(t[i],n[i],e));return o}function m(t,n,e){var r,o,i,a,s,l,u,c,f;if(!t||!n)return t||n||{v:[]};const h=Math.min(Math.max(e,0),1),p=Math.min(t.v.length,n.v.length),m=[],v=[],g=[];for(let e=0;e<p;e++){const f=t.v[e],p=n.v[e];m.push(d(f,p,h));const y=null!=(o=null==(r=t.i)?void 0:r[e])?o:f,b=null!=(a=null==(i=n.i)?void 0:i[e])?a:p;v.push(d(y,b,h));const k=null!=(l=null==(s=t.o)?void 0:s[e])?l:f,A=null!=(c=null==(u=n.o)?void 0:u[e])?c:p;g.push(d(k,A,h))}return{v:m,i:v.length?v:void 0,o:g.length?g:void 0,c:null!=(f=t.c)?f:n.c}}function v(t,n,e){if(e<=0)return 0;if(e>=1)return 1;const r=3*t,o=3*(n-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=e,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-e;if(Math.abs(t)<1e-6)return l;const n=s(l);if(Math.abs(n)<1e-6)break;l-=t/n}for(l=e;u<c;){const t=a(l);if(Math.abs(t-e)<1e-6)return l;e>t?u=l:c=l,l=(c+u)/2}return l}function g(t){const[n,e,r,o]=t,i=3*e,a=3*(o-e)-i,s=1-i-a;return function(t){return e=v(n,r,t),((s*e+a)*e+i)*e;var e}}function y(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function b(t,n,e,r,o){const i=y(t,n,o),a=y(n,e,o),s=y(e,r,o),l=y(i,a,o),u=y(a,s,o),c=y(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}function k(t,n){if(!t)return{left:void 0,right:void 0};if(n<=0)return{left:void 0,right:t};if(n>=1)return{left:t,right:void 0};const[e,r,o,i]=t,a=v(e,o,n),s=[e,r],l=[o,i],{left:u,right:c}=b([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,g=1-d;return m>1e-9&&Math.abs(g)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/g,(c[2][0]-f)/m,(c[2][1]-d)/g]),{left:h,right:p}}function A(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function x(t){const n=Math.round(255*t[0]),e=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+n+","+e+","+r+","+t[3]+")":"rgb("+n+","+e+","+r+")"}function w(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const n=t.slice(1),e=n.length<=4,r=e?n[0]+n[0]:n.slice(0,2),o=e?n[1]+n[1]:n.slice(2,4),i=e?n[2]+n[2]:n.slice(4,6),a=4===n.length?n[3]+n[3]:8===n.length?n.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 n;const e=null==(n=t.match(/rgba?\((.*)\)/))?void 0:n[1];if(!e)throw new Error("Invalid rgb/rgba format");const r=e.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 j=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),O=new Set(["translate","rotate","scale","skew"]),M=new Set(["offset-distance","offsetDistance"]);function S(t,n){var e;if(!t)return"";const r=null==(e=null==n?void 0:n.withUnits)||e,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 P=new Set(["offset-distance","offsetDistance"]),_=1e3;function z(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,n)=>n.toUpperCase()):t}function I(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var N=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 C(t){return N.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function D(t,n,e){return Math.max(n,Math.min(t,e))}function F(t,n,e,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*n[0]+c*e[0]+f*r[0],l*t[1]+u*n[1]+c*e[1]+f*r[1]]}var T=1e-4;function U(t,n,e,r,o){const i=L(t,n,e,r,o);if(0===i[0]&&0===i[1]){return L(t,n,e,r,o<.5?o+T:o-T)}return i}function L(t,n,e,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(n[0]-t[0])+s*(e[0]-n[0])+l*(r[0]-e[0]),a*(n[1]-t[1])+s*(e[1]-n[1])+l*(r[1]-e[1])]}function E(t,n,e,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=F(t,n,e,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=F(t,n,e,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 B(t,n){const{ts:e,ds:r}=t,o=e.length-1;if(n<=e[0])return r[0];if(n>=e[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;e[t]<n?i=t+1:a=t}const s=e[a-1],l=e[a]-s,u=l>0?(n-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}function V(t){return"scroll"===(null==t?void 0:t.timelineSource)}function W(t){return("number"==typeof(null==t?void 0:t.duration)&&t.duration>0?t.duration:_)*("number"==typeof(null==t?void 0:t.iterations)&&t.iterations>0?t.iterations:1)}function R(t,n,e){const r=n,o=e;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]}}function G(t,n,e,r){var o;const[i,a]=R(null!=(o=null==t?void 0:t.phase)?o:"cover",e,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:n)*(a-i)}function Z(t,n,e,r){const o=e-t,i=G(null==r?void 0:r.start,0,n,e),a=G(null==r?void 0:r.end,1,n,e);return a<=i?o>=a?1:0:D((o-i)/(a-i),0,1)}function K(t,n,e){var r,o;const i=n>0?D(t/n,0,1):1,a="number"==typeof(null==(r=null==e?void 0:e.start)?void 0:r.fraction)?e.start.fraction:0,s="number"==typeof(null==(o=null==e?void 0:e.end)?void 0:o.fraction)?e.end.fraction:1;return s<=a?i>=s?1:0:D((i-a)/(s-a),0,1)}function q(t,n){const e=null!=t?t:"block";if("x"===e||"y"===e)return e;const r=!!n&&n.startsWith("vertical");return"inline"===e?r?"y":"x":r?"x":"y"}function Q(t){if(!t.length)return".";let n="";for(const e of t)e.startsWith("[")?n+=e:n+=(n?".":"")+e;return n}var X=class{_canSanitize(t){return this.isValid(t)}optional(){return new J(this)}},J=class extends X{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,n,e){return null==t||this.inner.isValid(t,n,e)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},Y=class extends X{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,n,e){return"string"==typeof t||(null==n||n.errors.push(Q(null!=e?e:[])+": expected string, got "+typeof t),!1)}},H=class extends X{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,n,e){return!("number"!=typeof t||!isFinite(t))||(null==n||n.errors.push(Q(null!=e?e:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},$=class extends X{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,n,e){return"boolean"==typeof t||(null==n||n.errors.push(Q(null!=e?e:[])+": expected boolean, got "+typeof t),!1)}},tt=class extends X{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,n,e){return t===this.value||(null==n||n.errors.push(Q(null!=e?e:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},nt=class extends X{constructor(t,n){super(),this.values=t,this._default=null!=n?n:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,n,e){return!!this.values.includes(t)||(null==n||n.errors.push(Q(null!=e?e:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},et=class extends X{constructor(t,n){super(),this.schemas=t,this._default=null!=n?n:t[0]._default}sanitize(t){for(const n of this.schemas)if(n.isValid(t))return n.sanitize(t);return this._default}isValid(t,n,e){var r;const o=n&&{errors:[],warnings:[],strict:n.strict};return!!this.schemas.some(n=>n.isValid(t,o,e?[...e]:void 0))||(null==n||n.errors.push(Q(null!=e?e:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240)),!1)}_canSanitize(t){return this.schemas.some(n=>n._canSanitize(t))}},rt=class extends X{constructor(t,n,e){super(),this._key=t,this._schemas=n,this._default=null!=e?e:n[0]._default,this._map=new Map;for(const e of n){const n=e._shape[t];n&&this._map.set(n._default,e)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const n=t[this._key];return null!=n?this._map.get(n):void 0}sanitize(t){var n;return(null!=(n=this._findSchema(t))?n:this._schemas[0]).sanitize(t)}isValid(t,n,e){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==n||n.errors.push(Q(null!=e?e:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,n,e)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const n=this._findSchema(t);return n?n._canSanitize(t):this._schemas[0]._canSanitize(t)}},ot=class extends X{constructor(t){super(),this._shape=t;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e={};for(const t of Object.keys(this._shape))e[t]=this._shape[t].sanitize(n[t]);return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(Q(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(null==n?void 0:n.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),n.errors.push(Q(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},it=class extends X{constructor(t,n){super(),this._shape=t,this._openSchema=n;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e=l({},n);for(const t of Object.keys(this._shape))e[t]=this._shape[t].sanitize(n[t]);if(this._openSchema)for(const t of Object.keys(n))t in this._shape||(e[t]=this._openSchema.sanitize(n[t]));return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(Q(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,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],n,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},at=class extends X{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const n=[];for(const e of t)this.item._canSanitize(e)&&n.push(this.item.sanitize(e));return n}isValid(t,n,e){if(!Array.isArray(t))return null==n||n.errors.push(Q(null!=e?e:[])+": expected array, got "+typeof t),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<t.length;e++)r.push("["+e+"]"),this.item.isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},st=class extends X{constructor(t){super(),this.value=t,this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const n={};for(const[e,r]of Object.entries(t))this.value._canSanitize(r)&&(n[e]=this.value.sanitize(r));return n}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(Q(null!=e?e:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(const[e,i]of Object.entries(t))r.push(e),this.value.isValid(i,n,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},lt=class extends X{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return!0}_canSanitize(t){return!0}},ut=class extends X{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return void 0!==t||(null==n||n.errors.push(Q(null!=e?e:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},ct=class extends X{constructor(t,n){super(),this.fn=t,this._default=n,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,n,e){return this.schema.isValid(t,n,e)}_canSanitize(t){return this.schema._canSanitize(t)}},ft=class extends X{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((n,e)=>n.sanitize(t[e])):this._default}isValid(t,n,e){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==n||n.errors.push(Q(null!=e?e:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<this.schemas.length;e++)r.push("["+e+"]"),this.schemas[e].isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function dt(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function ht(t){var n;const e=t;return"_shape"in e?{kind:"shape",shape:e._shape}:"item"in e?{kind:"array",item:e.item}:"inner"in e?{kind:"optional",inner:e.inner}:"fn"in e?{kind:"lazy",resolved:null!=(n=e.resolved)?n:e.fn()}:{kind:"leaf"}}var pt={string:(t="")=>new Y(t),number:(t=0)=>new H(t),boolean:(t=!1)=>new $(t),literal:t=>new tt(t),enum:(t,n)=>new nt(t,n),union:(t,n)=>new et(t,n),discriminatedUnion:(t,n)=>new rt(t,n),object:t=>new ot(t),openObject:(t,n)=>new it(t,n),extendedObject:(t,n)=>new ot(l(l({},t._shape),n)),array:t=>new at(t),record:t=>new st(t),any:()=>new lt,defined:()=>new ut,tuple:t=>new ft(t),lazy:(t,n)=>new ct(t,n)},mt="data-px-animation-src",vt="_px_animator",gt={auto:"auto",waapi:"waapi",frames:"frames"},yt={waapi:gt.waapi,frames:gt.frames},bt={before:"before",after:"after"},kt="luminance",At="alpha",xt="userSpaceOnUse",wt="objectBoundingBox",jt="clip",Ot="extend",Mt="spacing",St="spacingAndGlyphs",Pt="align",_t="stretch",zt="auto",It="exact",Nt={separate:"separate",combined:"combined"},Ct="text",Dt="textContent",Ft=new Set(["type","children","animator","meta","animate","effects",Ct,Dt]),Tt=["translate","rotate","scale","origin"],Ut={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},Lt={pad:"pad",reflect:"reflect",repeat:"repeat"},Et={linear:"linear",radial:"radial"};function Bt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function Vt(t){var n;return(null==t?void 0:t.animator)||(null==(n=null==t?void 0:t.meta)?void 0:n.animator)}function Wt(t){var n;if(t)return null==(n=Vt(t))?void 0:n.definitions}function Rt(t){var n;if(!t)return;const e=null==(n=Vt(t))?void 0:n.animateById;return e?Object.entries(e).map(([t,n])=>({id:t,animate:n})):void 0}function Gt(t){return null==t?void 0:t.children}var Zt=pt.union([pt.string(),pt.tuple([pt.number(),pt.number(),pt.number(),pt.number()])]),Kt=pt.union([pt.string(),pt.number(),pt.array(pt.number()),pt.lazy(()=>Jt,{}),pt.object({path:pt.string()}),pt.lazy(()=>pt.object({paths:pt.array(Cn)}),{paths:[]}),pt.lazy(()=>pt.array(An),[])]),qt=pt.object({time:pt.number().optional(),t:pt.number().optional(),value:Kt.optional(),v:Kt.optional(),easing:Zt.optional(),e:Zt.optional(),tangentOut:pt.tuple([pt.number(),pt.number()]).optional(),to:pt.tuple([pt.number(),pt.number()]).optional(),tangentIn:pt.tuple([pt.number(),pt.number()]).optional(),ti:pt.tuple([pt.number(),pt.number()]).optional(),selected:pt.boolean().optional()}),Qt=pt.object({segmentCount:pt.number().optional(),extend:pt.enum([bt.before,bt.after]).optional(),alternate:pt.boolean().optional()}),Xt=pt.object({value:Kt.optional(),keyframes:pt.array(qt).optional(),kfs:pt.array(qt).optional(),loop:pt.union([Qt,pt.boolean()]).optional(),autoOrient:pt.boolean().optional()}),Jt=pt.object({translate:pt.tuple([pt.number(),pt.number()]).optional(),rotate:pt.number().optional(),skew:pt.number().optional(),scale:pt.tuple([pt.number(),pt.number()]).optional(),origin:pt.tuple([pt.number(),pt.number()]).optional()}),Yt=pt.union([pt.string(),Jt,pt.object({value:Jt}),Xt]),Ht=pt.record(Xt),$t=pt.union([pt.string(),pt.array(pt.union([pt.string(),Ht])),Ht]),tn=pt.object({startOn:pt.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:pt.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:pt.number().optional()}),nn=pt.object({width:pt.number(),d:pt.string()}),en=pt.object({fFamily:pt.string(),style:pt.string(),ascent:pt.number(),unitsPerEm:pt.number(),glyphs:pt.record(nn)}),rn=pt.object({easings:pt.record(pt.tuple([pt.number(),pt.number(),pt.number(),pt.number()])).optional(),animations:pt.record(Ht).optional(),styles:pt.record(pt.any()).optional(),glyphs:pt.record(en).optional()}),on=pt.object({phase:pt.enum(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:pt.number().optional()}),an=pt.object({start:on.optional(),end:on.optional()}),sn=pt.object({driver:pt.enum(["custom","native"]).optional(),kind:pt.enum(["view","scroll"]).optional(),axis:pt.enum(["block","inline","x","y"]).optional(),source:pt.enum(["nearest","root"]).optional(),subject:pt.string().optional(),smoothing:pt.number().optional(),pin:pt.boolean().optional(),pinTop:pt.number().optional(),pinDistance:pt.number().optional(),range:an.optional()}),ln=pt.object({mode:pt.enum([gt.auto,gt.waapi,gt.frames]).optional(),duration:pt.number().optional(),delay:pt.number().optional(),iterations:pt.union([pt.number(),pt.literal("infinite")]).optional(),fill:pt.enum(["forwards","backwards","both","none"]).optional(),direction:pt.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:pt.number().optional(),trigger:tn.optional(),resetOnFinish:pt.boolean().optional(),definitions:rn.optional(),animateById:pt.record($t).optional(),timelineSource:pt.string().optional(),scroll:sn.optional(),debugInstName:pt.string().optional()}),un=pt.object({id:pt.string(),animate:$t}),cn=pt.union([pt.string(),pt.number(),pt.array(pt.number()),pt.object({value:pt.defined()}),Jt]),fn=pt.union([pt.number(),pt.object({value:pt.number()}),Xt]),dn=pt.union([pt.tuple([pt.number(),pt.number()]),pt.object({value:pt.tuple([pt.number(),pt.number()])}),Xt]),hn=pt.union([pt.string(),pt.object({value:pt.string()}),Xt]),pn=pt.object({translate:dn.optional(),rotate:fn.optional(),scale:dn.optional(),skew:fn.optional(),origin:dn.optional()}),mn=pt.object({copies:pt.number().optional(),translate:dn.optional(),rotate:fn.optional(),skew:fn.optional(),scale:dn.optional(),origin:dn.optional()}),vn=pt.object({sourceId:pt.string().optional(),maskType:pt.enum([kt,At]).optional(),maskUnits:pt.enum([xt,wt]).optional(),maskContentUnits:pt.enum([xt,wt]).optional(),x:pt.number().optional(),y:pt.number().optional(),width:pt.number().optional(),height:pt.number().optional()}),gn=pt.object({d:hn.optional(),animate:Xt.optional()}),yn=pt.object({offset:fn.optional(),range:dn.optional(),subPaths:pt.enum([Nt.separate,Nt.combined]).optional()}),bn=pt.object({sourceId:pt.string().optional(),start:pt.number().optional(),stretch:pt.number().optional(),timeCrop:pt.tuple([pt.number(),pt.number()]).optional()}),kn=pt.object({type:pt.enum(["content"]).optional(),sourceId:pt.string().optional(),retime:bn.optional()}),An=pt.object({offset:pt.number(),color:pt.string()}),xn=pt.union([pt.array(An),pt.object({value:pt.array(An)}),Xt]),wn=pt.object({type:pt.enum([Et.linear,Et.radial]),p1:dn.optional(),p2:dn.optional(),c:dn.optional(),r:fn.optional(),fp:dn.optional(),stops:xn.optional(),gradientUnits:pt.enum([Ut.userSpaceOnUse,Ut.objectBoundingBox]).optional(),spreadMethod:pt.enum([Lt.pad,Lt.reflect,Lt.repeat]).optional(),gradientTransform:pt.string().optional()}),jn=wn,On=pt.object({path:pt.string(),pathOverflow:pt.enum([jt,Ot]).optional(),lengthAdjust:pt.enum([Mt,St]).optional(),method:pt.enum([Pt,_t]).optional(),spacing:pt.enum([zt,It]).optional(),startOffset:fn.optional(),textLength:fn.optional()}),Mn=pt.object({useGlyphs:pt.boolean().optional()}),Sn=pt.object({transformBy:pn.optional(),repeater:mn.optional(),maskedBy:vn.optional(),clipPath:gn.optional(),trimPath:yn.optional(),clone:kn.optional(),fillGradient:wn.optional(),strokeGradient:jn.optional(),textPath:On.optional(),text:Mn.optional()});function Pn(t,n){const e=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==n?void 0:n.strict)};if(!Sn.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)e.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,n)=>r(t,o+".children["+n+"]"))};return r(t,"root"),e}var _n=pt.openObject({type:pt.string(),id:pt.string().optional(),meta:pt.any().optional(),effects:Sn.optional(),animate:$t.optional(),style:pt.union([pt.string(),pt.record(pt.union([pt.string(),pt.number()]))]).optional()},cn),zn=pt.openObject(u(l({},_n._shape),{children:pt.lazy(()=>pt.array(zn),[]).optional()}),cn),In=pt.object({width:pt.union([pt.number(),pt.string()]).optional(),height:pt.union([pt.number(),pt.string()]).optional(),viewBox:pt.string().optional(),animator:ln.optional()}),Nn=pt.openObject(u(l(l({},_n._shape),In._shape),{type:pt.literal("svg"),children:pt.array(zn).optional()}),cn),Cn=pt.object({v:pt.array(pt.array(pt.number())),i:pt.array(pt.array(pt.number())).optional(),o:pt.array(pt.array(pt.number())).optional(),c:pt.boolean().optional()});function Dn(t){const n=Nn.isValid(t);return{valid:n,errors:n?[]:["Document failed schema validation"]}}var Fn=0;function Tn(){return"_px_"+Date.now().toString(36)+(++Fn).toString(36)+Math.random().toString(36).substring(2,6)}function Un(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Un(t));const n=t,e={};for(const t of Object.keys(n))e[t]=Un(n[t]);return e}function Ln(t){var n,e;const r=Un(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(n){if(n&&"object"==typeof n){if(n.id&&"string"==typeof n.id){const t=n.id,e=Tn();o.set(t,e),n.id=e}else n.animate&&(n.id=Tn());if(Array.isArray(n.children))for(const e of n.children)t(e)}}(r),function t(n){if(n&&"object"==typeof n)for(const[e,r]of Object.entries(n))if("children"!==e)if("string"==typeof r)if(i.has(e)&&r.startsWith("#")){const t=r.slice(1),i=o.get(t);i&&(n[e]="#"+i)}else if(a.has(e))n[e]=En(r,o);else if(s.has(e)){const t=r.startsWith("#"),i=o.get(t?r.slice(1):r);i&&(n[e]=t?"#"+i:i)}else r.includes("url(#")&&(n[e]=En(r,o));else if("style"===e&&"object"==typeof r&&null!==r)for(const[t,n]of Object.entries(r))"string"==typeof n&&(r[t]=En(n,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const n of r)t(n)}(r);const c=null==(n=r.animator)?void 0:n.animateById;if(c&&"object"==typeof c){const t={};for(const[n,r]of Object.entries(c)){t[null!=(e=o.get(n))?e:n]=r}r.animator=u(l({},r.animator),{animateById:t})}return r}function En(t,n){return t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t})}var Bn=new Set(["script","foreignobject"]),Vn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Wn=new Set(["href","xlink:href","src"]),Rn=new Set(["mixBlendMode","isolation"]),Gn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Zn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Kn=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,qn=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Qn(t,n){const e=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(e)){if("fill"===e||"stroke"===e||"stopcolor"===e){const t=String(n);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+e+'" blocked: url() must be internal url(#id), got:',n):n}if(Vn.has(e)){const t=String(n);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Wn.has(e)&&(Gn.test(t)||Zn.test(t)||function(t){const n=Kn.exec(t);return!!n&&qn.some(t=>n[1].startsWith(t))}(t)))?n:void console.warn('Attribute "'+e+'" blocked: must be #id, url(#id), or data:image/… URI, got:',n)}return n}console.warn("Attribute blocked (event handler / dangerous): ",e)}function Xn(t,n){var e;if(t)return"string"==typeof t?null==(e=null==n?void 0:n.styles)?void 0:e[t]:t}function Jn(t){const n={};for(const e of Object.keys(t)){const r=z(e);if(Ft.has(r))continue;if("style"===r)continue;let o=t[e];if(j.has(r)&&Array.isArray(o))n[r]=x(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes||o.kfs)O.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),n.transform=r+"("+o+")"):Array.isArray(o)?n[r]=o.join(","):null!=o&&(n[r]=String(o));else{const t=o.value&&"object"==typeof o.value?o.value:o;n.transform=S(t,{withUnits:!1})}}return n}function Yn(t){var n;const e=null!=(n=t.value)?n:t.v;if(!e)return;if(Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1])return[e[0],e[1]];const r=e.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function Hn(t){var n,e;return null!=(e=null!=(n=t.time)?n:t.t)?e:0}function $n(t){var n;return null!=(n=t.easing)?n:t.e}function te(t){var n,e,r;const o=null!=(n=t.keyframes)?n:t.kfs;if(!Array.isArray(o))return!1;if(t.autoOrient)return!0;for(const t of o)if((null!=(e=t.tangentIn)?e:t.ti)||(null!=(r=t.tangentOut)?r:t.to))return!0;return!1}var ne=new WeakMap;function ee(t,n,e,r){var o,i;let a=ne.get(t);const s=null==a?void 0:a.get(n);if(s)return s;const l=null!=(o=t.tangentOut)?o:t.to,u=null!=(i=n.tangentIn)?i:n.ti,c=[e[0]+(l?l[0]:0),e[1]+(l?l[1]:0)],f=[r[0]+(u?u[0]:0),r[1]+(u?u[1]:0)],d=E(e,c,f,r),h={P0:e,P1:c,P2:f,P3:r,lut:d,totalArc:d.ds[d.ds.length-1]};return a||(a=new WeakMap,ne.set(t,a)),a.set(n,h),h}function re(t,n,e,r,o,i){const a=ee(t,n,e,r),s=0===a.totalArc?o:function(t,n){const e=t.ds[t.ds.length-1],r=n*e,{ts:o,ds:i}=t,a=i.length-1;if(r<=0)return o[0];if(r>=i[a])return o[a];let s=1,l=a;for(;s<l;){const t=s+l>>>1;i[t]<r?s=t+1:l=t}const u=i[l-1],c=i[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(a.lut,o),l=F(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=U(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function oe(t,n){var e,r,o,i;if(!te(t))return t;const a=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(a)||a.length<2)return t;const s=!!t.autoOrient,l=null!=(r=null==n?void 0:n.flatnessTolerance)?r:.5,u=null!=(o=null==n?void 0:n.rotationTolerance)?o:5,c=null!=(i=null==n?void 0:n.maxSamplesPerSegment)?i:32,f=[],d=Yn(a[0]);if(!d)return t;const h=s?function(t,n){const e=Yn(t),r=Yn(n);if(!e||!r)return 0;const o=ee(t,n,e,r),i=U(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(ae(Hn(a[0]),ue(se(a[0]),se(a[0]),0,d,h,s)));for(let t=0;t<a.length-1;t++){const n=a[t],e=a[t+1],r=Yn(n),o=Yn(e);r&&o?(s&&t>0&&fe(f,n,e,r,o,u),he(f,n,e,r,o,s,l,u,c)):f.push(ae(Hn(e),ue(se(e),se(e),1,null!=o?o:[0,0],void 0,s)))}const p=$n(a[a.length-1]);p&&(f[f.length-1].e=p),s&&ie(f);const m={kfs:f};return void 0!==t.loop&&(m.loop=t.loop),m}function ie(t){var n;let e;for(const r of t){const t=null!=(n=r.v)?n:r.value;if(!t||"number"!=typeof t.rotate)continue;if(void 0===e){e=t.rotate;continue}let o=t.rotate;for(;o-e>180;)o-=360;for(;o-e<-180;)o+=360;t.rotate=o,e=o}}function ae(t,n){return{t:t,v:n}}function se(t){var n;const e=null!=(n=t.value)?n:t.v;if(e&&"object"==typeof e&&!Array.isArray(e))return e}function le(t,n,e){if(void 0===t)return n;if(void 0===n)return t;if("number"==typeof t&&"number"==typeof n)return t+(n-t)*e;if(Array.isArray(t)&&Array.isArray(n)&&t.length===n.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 n[o]?n[o]:0;r[o]=i+(a-i)*e}return r}return e<.5?t:n}function ue(t,n,e,r,o,i){const a={translate:r},s=new Set;if(t)for(const n of Object.keys(t))s.add(n);if(n)for(const t of Object.keys(n))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==n?void 0:n[r];void 0===o&&void 0===s||(a[r]=le(o,s,e))}return void 0!==o&&(a.rotate=o+ce(t,n,e)),a}function ce(t,n,e){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=le(r,o,e);return"number"==typeof i?i:0}function fe(t,n,e,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=se(n),f=u-ce(c,c,0),d=ee(n,e,r,o),h=U(d.P0,d.P1,d.P2,d.P3,0),p=180*Math.atan2(h[1],h[0])/Math.PI,m=function(t,n){let e=t-n;for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}(p,f);if(Math.abs(m)<=i)return;const v=Hn(n),g=Math.min(v+de,(v+Hn(e))/2),y=ue(se(n),se(n),0,r,p,!0);t.push(ae(g,y))}var de=.05;function he(t,n,e,r,o,i,a,s,l){const u=ee(n,e,r,o),c=Hn(n),f=Hn(e),d=$n(n),h=(p=d)?g([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=se(n),v=se(e),y=function(t,n,e,r,o){const i=[];pe(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),pe(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,n)=>t-n);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++)me(a[o],a[o+1],s,t,n,e,r,l);return s}(u,i,a,s,l),b=[];for(const t of y){const n=B(u.lut,t),e=D(u.totalArc>0?n/u.totalArc:t,0,1),r={u:D(h(e),0,1),p:e,pos:F(u.P0,u.P1,u.P2,u.P3,t)};if(i){const n=U(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(n[1],n[0])/Math.PI}b.push(r)}let A=d,x=0;const w=t.length-1;for(let n=0;n<b.length;n++){const e=b[n],r=x<1?D((e.u-x)/(1-x),0,1):1,{left:o,right:a}=k(A,r),s=0===n?w:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+e.u*(f-c),u=ue(m,v,e.p,e.pos,e.rotateDeg,i);t.push(ae(l,u)),A=a,x=e.u}}function pe(t,n,e,r,o){const i=n-t,a=e-n,s=i-2*a+(r-e),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 me(t,n,e,r,o,i,a,s){const l=(t+n)/2,u=F(r.P0,r.P1,r.P2,r.P3,t),c=F(r.P0,r.P1,r.P2,r.P3,n),f=n-t,d=F(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=F(r.P0,r.P1,r.P2,r.P3,l),p=F(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(ve(d,u,c),ve(h,u,c),ve(p,u,c));let v=!0;if(o){const e=U(r.P0,r.P1,r.P2,r.P3,t),o=U(r.P0,r.P1,r.P2,r.P3,n),i=180*Math.atan2(e[1],e[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?e.push(n):(s.remaining-=1,me(t,l,e,r,o,i,a,s),me(l,n,e,r,o,i,a,s))}function ve(t,n,e){const r=e[0]-n[0],o=e[1]-n[1],i=r*r+o*o;if(i<1e-20){const e=t[0]-n[0],r=t[1]-n[1];return Math.sqrt(e*e+r*r)}const a=(t[0]-n[0])*o-(t[1]-n[1])*r;return Math.abs(a)/Math.sqrt(i)}function ge(t,n){const e=ye(t,n);return null!=e?e:t}function ye(t,n){let e,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=ye(t.children[r],n);null!==o&&(e||(e=t.children.slice()),e[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,e=t.transform;if(e&&"object"==typeof e&&te(e)){const o=oe(e,n);o!==e&&(r=u(l({},t),{transform:o}))}}if(!e&&!r)return null;const i=l({},t);return e&&(i.children=e),r&&(i.animate=r),i}var be=1;function ke(t,n){if(t===n)return!0;if(typeof t!=typeof n||null===t||null===n||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(n))return!1;const e=Object.keys(t),r=Object.keys(n);return e.length===r.length&&e.every(e=>ke(t[e],n[e]))}function Ae(t){const n=[];let e;const r=function(t){const n=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),e=[];let r=null;for(const t of n)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},e.push(r);else if(r){const n=+t;r.values.push(Number.isNaN(n)?0:n)}return e}(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;e={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},n.push(e);continue}if(e||(e={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},n.push(e)),"L"===r){const t=o[0]||0,n=o[1]||0;e.v.push([t,n]),e.i.push([t,n]),e.o.push([t,n])}else if("C"===r){const t=o[0]||0,n=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;e.o[e.o.length-1]=[t,n],e.v.push([a,s]),e.i.push([r,i]),e.o.push([a,s])}else"Z"===r||"z"===r?e.c=!0:console.warn('Unsupported path command "'+r+'"')}return n}function xe(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function we(t){return"string"==typeof t&&void 0!==xe(t)}function je(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const n=xe(t.path);return n?{paths:Ae(n)}:t}if(t&&"object"==typeof t&&"paths"in t){const n=t.paths;if(Array.isArray(n)&&n.length>0&&we(n[0])){const t=[];for(const e of n){const n=xe(e);n&&t.push(...Ae(n))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&we(t[0])){const n=[];for(const e of t){const t=xe(e);t&&n.push(...Ae(t))}return{paths:n}}return{paths:t}}if(we(t)){return{paths:Ae(xe(t))}}return t}function Oe(t,n){var e;if(t)return Array.isArray(t)?t:(null==(e=null==n?void 0:n.easings)?void 0:e[t])?n.easings[t]:void console.warn("Unknown easing name: "+t)}function Me(t,n){var e;if("string"==typeof t){const r=null==(e=null==n?void 0:n.animations)?void 0:e[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Se(t,n,e,r){var o,i;if("d"===t){return{paths:p(null!=(o=null==n?void 0:n.paths)?o:Array.isArray(n)?n:[],null!=(i=null==e?void 0:e.paths)?i:Array.isArray(e)?e:[],r)}}return j.has(t)?h(n||[0,0,0,1],e||[0,0,0,1],r):"transform"!==t||"object"!=typeof n||null===n||Array.isArray(n)||"object"!=typeof e||null===e||Array.isArray(e)?"rotate"===t&&"number"==typeof n&&"number"==typeof e?f(n,e,r):O.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?d(n||[],e||[],r):f(+(n||0),+(e||0),r):function(t,n,e){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=n?n:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==n?void 0:n[i];if("rotate"===i||"skew"===i)o[i]=f(+(null!=r?r:0),+(null!=a?a:0),e);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=d(r||t,a||t,e)}else o[i]=null!=a?a:r}return o}(n,e,r)}function Pe(t,n,e,r){var o,i,a,s,c;const f=n.length-1,d=D(null!=(o=e.segmentCount)?o:f,1,f);let h;h=e.extend===bt.before?n.slice(0,d+1):n.slice(f-d);const p=null!=(i=n[0].t)?i:0,m=null!=(a=n[n.length-1].t)?a:0;let v,y;e.extend===bt.before?(v=0,y=p):(v=m,y=r);const b=y-v;if(b<=0)return n;const x=null!=(s=h[0].t)?s:0,w=(null!=(c=h[h.length-1].t)?c:0)-x;if(w<=0)return n;const j=h.map(t=>{var n,e;return{relT:(t.t-x)/w,v:t.v,e:t.e,tangentIn:null!=(n=t.tangentIn)?n:t.ti,tangentOut:null!=(e=t.tangentOut)?e:t.to}}),O=Math.floor(b/w),M=b-O*w,S=M/w,P=[],_=e.extend!==bt.before,z=n[n.length-1];let I,N=!1;function C(n,e,r){var o;let i;if(e){i=[];for(let t=j.length-1;t>=0;t--)i.push({relT:1-j[t].relT,v:j[t].v,e:t>0?A(j[t-1].e):void 0,tangentIn:j[t].tangentOut,tangentOut:j[t].tangentIn})}else i=j;const a=void 0!==r?r:1;for(let e=0;e<i.length;e++){const r=i[e];if(r.relT>a+1e-9){const o=i[e-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?g(o.e)(l):l,c=Se(t,o.v,r.v,u),{left:f}=k(o.e,l);return P.length>0&&o.relT<=a&&(P[P.length-1].e=f),void P.push({t:n+a*w,v:c,e:void 0})}const s=P.length>0?P[P.length-1]:z,l=_&&0===e&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(n+r.relT*w))<1e-9;if(l){if(ke(s.v,r.v)){P.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(I=r.e,N=!0);continue}P.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:n+r.relT*w+(l?1:0),v:r.v,e:e<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),P.push(u)}}if(e.extend===bt.before){if(S>1e-9){!function(n,e,r){let o;if(e){o=[];for(let t=j.length-1;t>=0;t--)o.push({relT:1-j[t].relT,v:j[t].v,e:t>0?A(j[t-1].e):void 0,tangentIn:j[t].tangentOut,tangentOut:j[t].tangentIn})}else o=j;const i=1-r;for(let e=0;e<o.length;e++){const r=o[e];if(r.relT<i-1e-9)continue;const a=o[e-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const e=r.relT-a.relT,o=(i-a.relT)/e,s=a.e?g(a.e)(o):o,l=Se(t,a.v,r.v,s),{right:u}=k(a.e,o);P.push({t:n,v:l,e:u})}const s={t:n+(r.relT-i)*w,v:r.v,e:e<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),P.push(s)}}(v,!!e.alternate&&O%2==0,S)}for(let t=0;t<O;t++){const n=O-1-t,r=!!e.alternate&&n%2==0;C(v+M+t*w,r)}}else{for(let t=0;t<O;t++){const n=!!e.alternate&&t%2==0;C(v+t*w,n)}if(S>1e-9){const t=!!e.alternate&&O%2==0;C(v+O*w,t,S)}}if(e.extend===bt.before)return[...P,...n];if(N&&n.length>0){return[...n.slice(0,-1),u(l({},n[n.length-1]),{e:I}),...P]}return[...n,...P]}function _e(t,n,e,r){var o,i,a,s,l,u,c;const f=n.keyframes||n.kfs||[],d=[];for(const n of f){const e=null!=(i=null!=(o=n.time)?o:n.t)?i:0;let f=null!=(a=n.value)?a:n.v;const h=null!=(s=n.easing)?s:n.e;"d"===t&&(f=je(f));const p=I(t)?C(t):t;j.has(p)&&(f=null!=(l=w(f))?l:f);const m={t:e,v:f,e:Oe(h,r)},v=null!=(u=n.tangentIn)?u:n.ti,g=null!=(c=n.tangentOut)?c:n.to;v&&(m.tangentIn=v),g&&(m.tangentOut=g),d.push(m)}d.sort((t,n)=>{var e,r;return(null!=(e=t.t)?e:0)-(null!=(r=n.t)?r:0)});const h=n.loop,p=!0===h?{}:h||void 0;return p&&d.length>=2?Pe(t,d,p,e):d}function ze(t,n,e){var r;const o=n.loop;if(null==o||!1===o)return n;const i=!0===o?{}:o,a=null!=(r=n.keyframes)?r:n.kfs;if(!Array.isArray(a)||a.length<2)return n;const s=I(t)?C(t):t,l=j.has(s),u=a.map(n=>{var e,r,o,i,a,s,u,c;const f=null!=(e=n.t)?e:n.time;let d=null!=(r=n.v)?r:n.value;"d"===t&&(d=je(d)),l&&(d=null!=(o=w(d))?o:d);const h={t:f,v:d,e:null!=(i=n.e)?i:n.easing};return(null!=(a=n.tangentIn)?a:n.ti)&&(h.tangentIn=null!=(s=n.tangentIn)?s:n.ti),(null!=(u=n.tangentOut)?u:n.to)&&(h.tangentOut=null!=(c=n.tangentOut)?c:n.to),h}),c={kfs:Pe(t,u,i,e)};return void 0!==n.autoOrient&&(c.autoOrient=n.autoOrient),c}function Ie(t,n){const e=Ne(t,n);return null!=e?e:t}function Ne(t,n){let e,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Ne(t.children[r],n);null!==o&&(e||(e=t.children.slice()),e[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const e of Object.keys(t)){const o=t[e],i=ze(e,o,n);i!==o&&(r||(r=l({},t)),r[e]=i)}}if(!e&&!r)return null;const i=l({},t);return e&&(i.children=e),r&&(i.animate=r),i}var Ce=0;function De(t,n=yt.waapi){const e=Vt(t)||{},r=Wt(t),o=e.duration||1e3,i=[],a=(t,e)=>{if(!e)return null;const i=function(t,n){if(!t)return[];const e=[];if("string"==typeof t){const r=Me(t,n);r&&e.push(r)}else if(Array.isArray(t))for(const r of t){const t=Me(r,n);t&&e.push(t)}else e.push(t);return e}(e,r);if(0===i.length)return null;const a=function(t,n,e,r=yt.waapi){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=_e(i,a,n,e);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===yt.waapi&&"transform"===i?oe(t):t}}return o}(function(t){const n={};for(const e of t)for(const[t,r]of Object.entries(e))n[t]=r;return n}(i),o,r,n);return 0===Object.keys(a).length?null:{id:t,animate:a}},s=Rt(t);if(s)for(const t of s){const n=a(t.id,t.animate);n&&i.push(n)}const l=t=>{const n=t.animate;if(n&&Object.keys(n).length>0){const e=t.id||"_px_el_"+ ++Ce;t.id=e;const r=a(e,n);r&&i.push(r)}if(t.children)for(let n=0;n<t.children.length;n++)l(t.children[n])};if(t.children)for(let n=0;n<t.children.length;n++)l(t.children[n]);return i}function Fe(t,n,e){var r,o,i,a,s,l,u;const m=n.kfs||n.keyframes||[];if(0===m.length)return null;const{prevKf:v,nextKf:y}=function(t,n){var e,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!=(e=t[s].t)?e:0,u=null!=(r=t[s+1].t)?r:0;if(l<=n&&n<=u){i=t[s],a=t[s+1];break}n>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(m,e);let b=v===y?0:(k=e,A=null!=(r=v.t)?r:0,w=null!=(o=y.t)?o:0,O=0,P=1,w===A?O:O+(k-A)/(w-A)*(P-O));var k,A,w,O,P;b=D(b,0,1);const _=null!=(i=v.e)?i:v.easing;if(_&&Array.isArray(_))try{b=g(_)(b)}catch(t){}let z=I(t)?C(t):t,N=null;const F=null!=(a=null==v?void 0:v.v)?a:null==v?void 0:v.value,T=null!=(s=null==y?void 0:y.v)?s:null==y?void 0:y.value;if("d"===z){N=p(null!=(l=null==F?void 0:F.paths)?l:Array.isArray(F)?F:[],null!=(u=null==T?void 0:T.paths)?u:Array.isArray(T)?T:[],b).map(t=>c(t)).join("")}else if(j.has(z))N=x(h(F||[0,0,0,1],T||[0,0,0,1],b)),z=t;else if("stroke-dasharray"===z)N=d(F||[],T||[],b).join(" "),z=t;else if("transform"!==z||null===F||"object"!=typeof F||Array.isArray(F))if("translate"===z){N="translate("+d(F||[0,0],T||[0,0],b).join(",")+")",z="transform"}else if("rotate"===z){N="rotate("+f(+(F||0),+(T||0),b)+")",z="transform"}else if("scale"===z){N="scale("+d(F||[1,1],T||[1,1],b).join(",")+")",z="transform"}else{N=f(+(F||0),+(T||0),b)}else{const t=new Set([...F?Object.keys(F):[],...T?Object.keys(T):[]]),e={};for(const n of t){const t=null==F?void 0:F[n],r=null==T?void 0:T[n];if("rotate"===n||"skew"===n)e[n]=f(+(null!=t?t:0),+(null!=r?r:0),b);else if("translate"===n||"scale"===n||"origin"===n){const o="scale"===n?[1,1]:[0,0],i=d(t||o,r||o,b);e[n]=i}}if(te(n)){const t=F.translate,r=T.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=re(v,y,[+t[0],+t[1]],[+r[0],+r[1]],b,!!n.autoOrient);e.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(e.rotate=o.rotateDeg)}}N=S(e,{withUnits:!1}),z="transform"}return M.has(z)&&"number"==typeof N&&(N=100*N+"%"),{k:z,v:null===N?"":""+N}}function Te(t,n){const e={};for(const[r,o]of Object.entries(t)){const t=Fe(r,o,n);t&&(e[t.k]=t.v)}return e}function Ue(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Ue);const n={};for(const e of Object.keys(t))n[e]=Ue(t[e]);return n}function Le(t,n){const e=new Map,r=t=>{var o;if("string"==typeof t.id){const r=n();e.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t}),i=t=>{var n;if("string"==typeof t.href&&t.href.startsWith("#")){const n=e.get(t.href.slice(1));n&&(t.href="#"+n)}for(const n of Object.keys(t)){if("children"===n||"effects"===n||"meta"===n||"animate"===n||"href"===n||"id"===n)continue;const e=t[n];"string"==typeof e&&-1!==e.indexOf("url(#")&&(t[n]=o(e))}null==(n=t.children)||n.forEach(i)};return i(t),e}function Ee(t){const n="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(n)?n:0}function Be(t){var n;const e=Ee(t.x),r=Ee(t.y);if(delete t.x,delete t.y,!e&&!r)return t;const o="translate("+e+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const e={type:"g",transform:o,children:null!=(n=t.children)?n:[]};t.children=[e]}else t.transform=o;return t}function Ve(t){var n;const e=function(t){const n=new Map,e=t=>{var r;"string"==typeof t.id&&n.set(t.id,t),null==(r=t.children)||r.forEach(e)};return e(t),n}(t),r=function(t,n){const e=new WeakMap,r=new Set,o=(t,r)=>{const i=e.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 n in t.animate){a=!0;break}if(!a&&t.children)for(const n of t.children)if(o(n,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const e=Re(t.href),i=e?n.get(e):void 0;i&&(a=o(i,r))}return r.delete(t),e.set(t,a),a};for(const[t,e]of n)o(e,new Set)&&r.add(t);return r}(0,e);if(0===r.size)return t;let o=0;const i=function(t){const n=Ze(t.viewBox);if(n)return[n[2],n[3]];const e=We(t.width),r=We(t.height);return void 0!==e&&void 0!==r?[e,r]:[1,1]}(t),a=[],s=Ke(t,e,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const c={type:"defs",children:a},f=[...null!=(n=s.children)?n:[],c];return u(l({},s),{children:f})}function We(t){if("number"==typeof t)return t;if("string"==typeof t){const n=parseFloat(t);return Number.isFinite(n)?n:void 0}}function Re(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Ge(t,n,e,r,o,i,a){var s,c,f,d;const h=Ue(n);Le(h,o);const p="symbol"===h.type?Ze(h.viewBox):void 0,m=null!=(c=null!=(s=We(t.width))?s:null==p?void 0:p[2])?c:a[0],v=null!=(d=null!=(f=We(t.height))?f:null==p?void 0:p[3])?d:a[1],g="symbol"===h.type?function(t,n,e,r,o){const i=Ze(t.viewBox),a=u(l({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,c,f,d]=i,h=f>0&&d>0?Math.min(r/f,o/d):1,p=(r-f*h)/2,m=(o-d*h)/2,v=[];0===p&&0===m||v.push("translate("+p+","+m+")");1!==h&&v.push("scale("+h+")");0===s&&0===c||v.push("translate("+-s+","+-c+")");v.length&&(a.transform=v.join(""));const g=n();return e.push({type:"clipPath",id:g,children:[{type:"rect",x:s,y:c,width:f,height:d}]}),a.clipPath="url(#"+g+")",a}(h,o,i,m,v):h,y=Ke(g,e,r,o,i,a),b=u(l({},t),{type:"g",children:[y]});return delete b.href,delete b.width,delete b.height,Be(b)}function Ze(t){if("string"!=typeof t)return;const n=t.trim().split(/[\s,]+/).map(Number);return n.length<4||n.some(t=>!Number.isFinite(t))?void 0:[n[0],n[1],n[2],n[3]]}function Ke(t,n,e,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Re(t.href);if(a&&e.has(a)){const s=n.get(a);if(s)return Ge(t,s,n,e,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Ke(t,n,e,r,o,i);return s!==t&&(a=!0),s});return a?u(l({},t),{children:s}):t}function qe(t,n,e){const r={};return"translate"===t?r.translate=n:"rotate"===t?r.rotate=n:"skew"===t?r.skew=n:r.scale=n,e&&"translate"!==t&&(r.origin=e),r}function Qe(t){var n,e,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!=(n=o.keyframes)?n:o.kfs;if(i){const t={kind:"animated",keyframes:i.map(Je),autoOrient:o.autoOrient,loop:o.loop},n=null!=(e=o.value)?e:o.v;return void 0!==n&&"animated"===t.kind&&(t.base=n),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 Xe(t,n,e,r){var o,i,a,s;const u=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===e.kind)return;if("static"===e.kind)return void(t[n]=u(e.value));const c=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,f=l({},c||{}),d={keyframes:e.keyframes};void 0!==e.loop&&(d.loop=e.loop),void 0!==e.autoOrient&&(d.autoOrient=e.autoOrient),f[n]=d,t.animate=f;const h=null!=(s=null!=(i=e.base)?i:null==(o=e.keyframes[0])?void 0:o.value)?s:null==(a=e.keyframes[0])?void 0:a.v;void 0!==h&&(t[n]=u(h))}function Je(t){if(!t||"object"!=typeof t)return t;const n=t;if(void 0===n.t&&void 0===n.v&&void 0===n.e&&void 0===n.to&&void 0===n.ti)return t;const e=l({},n);return void 0===e.time&&void 0!==n.t&&(e.time=n.t),void 0===e.value&&void 0!==n.v&&(e.value=n.v),void 0===e.easing&&void 0!==n.e&&(e.easing=n.e),void 0===e.tangentOut&&void 0!==n.to&&(e.tangentOut=n.to),void 0===e.tangentIn&&void 0!==n.ti&&(e.tangentIn=n.ti),e}function Ye(t,n){const e={value:n};return void 0!==t.time&&(e.time=t.time),void 0!==t.easing&&(e.easing=t.easing),void 0!==t.tangentOut&&(e.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(e.tangentIn=t.tangentIn),e}function He(t,n,e){if(!n)return t;delete t.transform;let r=t;return r=tr(r,n.origin,!0),r=$e(r,"scale",n.scale,e),r=$e(r,"skew",n.skew,e),r=$e(r,"rotate",n.rotate,e),r=tr(r,n.origin,!1),!function(t){if(!t||"object"!=typeof t)return!1;const n=t;return!!n.autoOrient||Array.isArray(n.keyframes)&&n.keyframes.some(t=>t.tangentOut||t.tangentIn)}(n.translate)?r=$e(r,"translate",n.translate,e):(r=tr(r,n.origin,!0),r=$e(r,"translate",n.translate,e),r=tr(r,n.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function $e(t,n,e,r){if(void 0===e)return t;const o=Qe(e);if("static"===o.kind)return{type:"g",transform:{value:qe(n,o.value,void 0)},children:[t]};if("animated"===o.kind){const e={keyframes:o.keyframes.map(t=>Ye(t,qe(n,t.value,void 0)))};return o.autoOrient&&(e.autoOrient=!0),void 0!==o.loop&&(e.loop=o.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function tr(t,n,e){if(void 0===n)return t;const r=Qe(n),o=t=>e?[-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 n={keyframes:r.keyframes.map(t=>Ye(t,{translate:o(t.value)}))};return void 0!==r.loop&&(n.loop=r.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function nr(t,n){return"_lw_"+n+"_"+t.nextId++}function er(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function rr(t,n){var e;"string"==typeof t.id&&n.set(t.id,t),null==(e=t.children)||e.forEach(t=>rr(t,n))}var or=Ue;function ir(t,n,e){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=er(t.effects.clone.sourceId);"string"==typeof r&&r&&!n.contentRefInnerIds.has(r)&&n.contentRefInnerIds.set(r,e(r))}null==(i=t.children)||i.forEach(t=>ir(t,n,e))}function ar(t,n,e,r,o){const i=function(t,n){var e,r,o;const i={};let a=!1;const s=null==(e=t.animate)?void 0:e.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const n=s.keyframes;if(n.some(t=>t.value&&t.value.translate)){const e=lr(s),r={keyframes:n.map(t=>{const n=t.value||{},r={};void 0!==n.translate&&(r.translate=n.translate),e&&void 0!==n.origin&&(r.origin=n.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=n.some(t=>{const n=t.value||{};return void 0!==n.rotate||void 0!==n.scale}),u=n.map(t=>{const n=t.value||{},r={};void 0!==n.rotate&&(r.rotate=n.rotate),void 0!==n.scale&&(r.scale=n.scale),void 0===n.origin||e&&!l||(r.origin=n.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 n={keyframes:u};void 0!==o&&(n.loop=o),t.animate.transform=n}a=!0}}const u=void 0!==(null==n?void 0:n.translate),c=a||u,f=a&&lr((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&lr((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const n=function(t){const n=[],e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(!n.length)return{rest:t||void 0};if(n.every(t=>"translate"===t.name))return{translate:n.map(t=>t.full).join("")};const o=n[0],i=n[n.length-1];if("translate"===i.name&&"translate"===o.name){const e=sr(i.full),r=sr(o.full),a=-e[0],s=-e[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+n.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<n.length&&"translate"===n[s].name;)a.push(n[s].full),s++;if(!a.length)return{rest:t};const l=n.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);c?void 0!==n.translate?n.rest?t.transform=n.rest:delete t.transform:!function(t){const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,e=[];let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(1!==e.length)return!1;if("translate"===e[0].name)return!0;if("matrix"!==e[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(e[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)?f&&function(t){const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let e,r=0,o=!1;for(;e=n.exec(t);)r++,"matrix"===e[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:n.translate&&(i.transform=n.translate,n.rest?t.transform=n.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes&&!t.transform.kfs){const n=t.transform.value,e=!(!n||"object"!=typeof n),r=e?n:t.transform,o=t=>e?{value:t}:t;if(Array.isArray(r.translate)){const n=l({},r);delete n.translate;const e=Object.keys(n).length>0;c||(i.transform=o({translate:r.translate})),e?t.transform=o(n):delete t.transform}}return i}(t,n);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const n=lr(t.translate),e=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);n&&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||n&&!e||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(n);let u=t;u=He(u,s,o);let c={type:"g",id:e,children:[{type:"g",id:r,children:[u]}]};return void 0!==i.transform&&(c.transform=i.transform),void 0!==i.animate&&(c.animate=i.animate),a&&(delete c.id,c=He(c,a,o),c.id=e),c}function sr(t){const n=/translate\(([^)]*)\)/.exec(t);if(!n)return[0,0];const e=n[1].split(/[\s,]+/).filter(Boolean).map(Number);return[e[0]||0,e[1]||0]}function lr(t){if(!t||"object"!=typeof t)return!1;const n=t;return!!n.autoOrient||!!Array.isArray(n.keyframes)&&n.keyframes.some(t=>t.tangentOut||t.tangentIn)}function ur(t,n,e,r){if(!n)return t;const o=nr(e,"grad"),i=function(t,n){const e={type:t.type===Et.radial?"radialGradient":"linearGradient",id:n};t.type===Et.linear?(cr(e,"x1","y1",t.p1),cr(e,"x2","y2",t.p2)):(cr(e,"cx","cy",t.c),function(t,n,e){const r=Qe(e);if("absent"===r.kind)return;Xe(t,n,r,{asString:!0})}(e,"r",t.r),cr(e,"fx","fy",t.fp));t.gradientUnits&&(e.gradientUnits=t.gradientUnits);t.spreadMethod&&(e.spreadMethod=t.spreadMethod);t.gradientTransform&&(e.gradientTransform=t.gradientTransform);return e.children=function(t){var n,e,r,o;if(!t)return[];const i=Qe(t);if("absent"===i.kind)return[];if("static"===i.kind)return Array.isArray(i.value)?i.value.map(fr):[];const a=i.keyframes;if(!a.length)return[];const s=i.loop;let l=0;for(const t of a){const e=null!=(n=t.value)?n:t.v;Array.isArray(e)&&e.length>l&&(l=e.length)}if(!l)return[];const u=null!=(e=a[0].value)?e:a[0].v,c=[];for(let t=0;t<l;t++){const n=null!=(o=null!=(r=null==u?void 0:u[t])?r:dr(a,0,t))?o:{offset:t/Math.max(1,l-1),color:"#000000"};c.push({offset:n.offset,color:n.color})}return c.map((t,n)=>function(t,n,e,r,o){var i,a,s,l,u;const c=[],f=[];let d=!1;for(const r of n){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[e])?l:dr(n,n.indexOf(r),e);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:hr(t.offset),stopColor:t.color},p={};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);return h}(t,a,n,0,s))}(t.stops),e}(n,o);return e.defs.push(i),t[r]="url(#"+o+")",t}function cr(t,n,e,r){var o,i,a;const s=Qe(r);if("absent"===s.kind)return;if("static"===s.kind)return t[n]=String(s.value[0]),void(t[e]=String(s.value[1]));const l=t=>{const n={keyframes:s.keyframes.map(n=>{const e={time:n.time,value:Array.isArray(n.value)?n.value[t]:void 0};return void 0!==n.easing&&(e.easing=n.easing),e})};return void 0!==s.loop&&(n.loop=s.loop),n},u=null!=(o=t.animate)?o:{};u[n]=l(0),u[e]=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[n]=String(c[0]),t[e]=String(c[1]))}function fr(t){return{type:"stop",offset:hr(t.offset),stopColor:t.color}}function dr(t,n,e){var r,o;for(let o=n;o>=0;o--){const n=null!=(r=t[o].value)?r:t[o].v;if(null==n?void 0:n[e])return n[e]}for(let r=n+1;r<t.length;r++){const n=null!=(o=t[r].value)?o:t[r].v;if(null==n?void 0:n[e])return n[e]}}function hr(t){return Math.round(1e3*t)/10+"%"}function pr(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.path?t.path:void 0}function mr(t,n,e,r){if(!n)return t;const o=er(n.sourceId);if(!o)return r.errors.push("maskedBy.sourceId missing — cannot build mask"),t;const i=nr(r,"mask");let a={type:"use",href:"#"+o};if(e)a=vr(a,e,r);else if(kr(t))a=function(t,n){var e;const r=n.animate&&"object"==typeof n.animate&&!Array.isArray(n.animate)?n.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=[],c=[];for(const t of i){const n=(null!=(e=t.value)?e:t.v)||{},r=Ye(t,void 0);if(Array.isArray(n.translate)&&a.push(u(l(l({},r),br(t)),{value:{translate:[-n.translate[0],-n.translate[1]]}})),"number"==typeof n.rotate){const t={rotate:-n.rotate};Array.isArray(n.origin)&&(t.origin=[n.origin[0],n.origin[1]]),s.push(u(l({},r),{value:t}))}if(Array.isArray(n.scale)){const t={scale:[1/n.scale[0],1/n.scale[1]]};Array.isArray(n.origin)&&(t.origin=[n.origin[0],n.origin[1]]),c.push(u(l({},r),{value:t}))}}const f=null==o?void 0:o.loop,d=t=>{const n={keyframes:t};return void 0!==f&&(n.loop=f),n};let h=t;a.length&&(h={type:"g",animate:{transform:d(a)},children:[h]});s.length&&(h={type:"g",animate:{transform:d(s)},children:[h]});c.length&&(h={type:"g",animate:{transform:d(c)},children:[h]});return h}(a,t);else{const n=function(t){if("string"==typeof t.transform){const n=function(t){var n,e,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!=(n=c.args[0])?n:0,d=null!=(e=c.args[1])?e: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 n=0;n<t;n++)if("translate"===v[n].name){const t=null!=(i=v[n].args[0])?i:0,e=null!=(a=v[n].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+e]:[t,e]}for(let n=t+1;n<v.length-1;n++){const t=v[n];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 n=null!=(u=t.args[0])?u:1,e=t.args.length>1?t.args[1]:n;m.scale=m.scale?[m.scale[0]*n,m.scale[1]*e]:[n,e]}}return m}let y,b,k;for(const t of v)if("translate"===t.name){const n=null!=(c=t.args[0])?c:0,e=null!=(f=t.args[1])?f:0;y=y?[y[0]+n,y[1]+e]:[n,e]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const n=null!=(h=t.args[0])?h:1,e=t.args.length>1?t.args[1]:n;k=k?[k[0]*n,k[1]*e]:[n,e]}const A={};y&&(A.translate=y);void 0!==b&&(A.rotate=b);k&&(A.scale=k);return Object.keys(A).length?A:void 0}(t.transform);if(!n)return;const e={};return n.translate&&(e.translate=n.translate),void 0!==n.rotate&&(e.rotate=n.rotate),n.scale&&(e.scale={value:n.scale}),n.origin&&(e.origin=n.origin),Object.keys(e).length?e:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes&&!t.transform.kfs){const n=t.transform.value,e=n&&"object"==typeof n?n:t.transform;if(e&&"object"==typeof e){const t={};return Array.isArray(e.translate)&&(t.translate=e.translate),"number"==typeof e.rotate&&(t.rotate=e.rotate),"number"==typeof e.skew&&(t.skew=e.skew),Array.isArray(e.scale)&&(t.scale={value:e.scale}),Array.isArray(e.origin)&&(t.origin=e.origin),Object.keys(t).length?t:void 0}}return}(t);n&&(a=vr(a,n,r))}const s=void 0===e&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||kr(t))}(t);a=function(t,n,e,r,o){const i=r.idMap.get(e),a=r.maskAncestorChains.get(n)||[],s=o?jr(n,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 n of t.translateKeyframes)c.add(n.time);for(const t of u)if(t.translateKeyframes)for(const n of t.translateKeyframes)c.add(n.time);if(!(c.size>0)){const n=Ar(l),e=Ar(u),r=e[0]-n[0],o=e[1]-n[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}const f=Array.from(c).sort((t,n)=>t-n);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const n=xr(l,t),e=xr(u,t);return{time:t,value:{translate:[e[0]-n[0],e[1]-n[1]]}}})}},children:[t]}}(a,t,o,r,s);const c={type:"mask",id:i,children:[a]};return n.maskType&&(c.maskType=n.maskType),n.maskUnits&&(c.maskUnits=n.maskUnits),n.maskContentUnits&&(c.maskContentUnits=n.maskContentUnits),void 0!==n.x&&(c.x=String(n.x)),void 0!==n.y&&(c.y=String(n.y)),void 0!==n.width&&(c.width=String(n.width)),void 0!==n.height&&(c.height=String(n.height)),r.defs.push(c),t.mask="url(#"+i+")",t}function vr(t,n,e){if(!n)return t;const r=function(t,n){var e;const r=Qe(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(n.warnings.push("transformBy.origin: animated origin approximated by its first keyframe"),null==(e=r.keyframes[0])?void 0:e.value)}(n.origin,e);let o=t;return o=gr(o,"translate",n.translate,void 0,e),o=gr(o,"rotate",n.rotate,r,e),o=gr(o,"scale",n.scale,r,e),o}function gr(t,n,e,r,o){if(void 0===e)return t;const i=Qe("scale"===n&&Array.isArray(e)?[e[0]/100,e[1]/100]:e);if("static"===i.kind)return{type:"g",transform:{value:qe(n,yr(n,i.value),r)},children:[t]};if("animated"===i.kind){const e={keyframes:i.keyframes.map(t=>{const e=Ye(t,qe(n,yr(n,t.value),r));return"translate"===n?l(l({},e),br(t)):e})};return void 0!==i.loop&&(e.loop=i.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function yr(t,n){return"translate"===t?[-n[0],-n[1]]:"rotate"===t?-n:[1/n[0],1/n[1]]}function br(t){var n,e;const r={},o=null!=(n=t.tangentOut)?n:t.to,i=null!=(e=t.tangentIn)?e:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function kr(t){const n=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!n||!n.transform)}function Ar(t){let n=0,e=0;for(const r of t)r.translate&&(n+=r.translate[0],e+=r.translate[1]);return[n,e]}function xr(t,n){let e=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=wr(o.translateKeyframes,n);e+=t[0],r+=t[1]}else o.translate&&(e+=o.translate[0],r+=o.translate[1]);return[e,r]}function wr(t,n){if(n<=t[0].time)return t[0].value;if(n>=t[t.length-1].time)return t[t.length-1].value;for(let e=1;e<t.length;e++)if(n<=t[e].time){const r=t[e-1],o=t[e],i=(n-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 jr(t,n){var e,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,n){const e=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=e.exec(t));){const t=r[1],n=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=n[0]||0,i+=n[1]||0,a=!0):s=!0}s&&n.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return a?[o,i]:void 0}(i,n);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes&&!i.kfs){const t=i.value,e=t&&"object"==typeof t?t:i;e&&"object"==typeof e&&Array.isArray(e.translate)&&(s.translate=[e.translate[0]||0,e.translate[1]||0]),!e||void 0===e.rotate&&void 0===e.scale&&void 0===e.skew||n.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!=(e=a.value)?e: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||n.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}var Or="content";function Mr(t,n,e){if(!n)return;const r=er(n.sourceId);if(!r)return void(n.type===Or&&e.errors.push("clone: content ref missing sourceId"));const o=n.type===Or&&e.contentRefInnerIds.get(r)||r;t.href="#"+o}function Sr(t,n){const e={};return void 0!==t.translate&&(e.translate=Pr(t.translate,t=>[t[0]*n,t[1]*n])),void 0!==t.rotate&&(e.rotate=Pr(t.rotate,t=>t*n)),void 0!==t.skew&&(e.skew=Pr(t.skew,t=>t*n)),void 0!==t.scale&&(e.scale=function(t,n){const e=t=>[Math.pow(t[0],n),Math.pow(t[1],n)];return Pr(t,e,!0)}(t.scale,n)),void 0!==t.origin&&(e.origin=t.origin),Object.keys(e).length?e:void 0}function Pr(t,n,e=!1){const r=Qe(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=n(r.value);return("number"==typeof t||Array.isArray(t))&&!e?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?u(l({},t),{value:n(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=n(r.base)),o}function _r(t){var n,e;return{start:null!=(n=t.start)?n:0,stretch:null!=(e=t.stretch)?e:1}}function zr(t,n,e){const[r,o]=n;if(!Number.isFinite(r)||!Number.isFinite(o))return void e.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=l({},t);for(const n of Object.keys(t))delete t[n];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function Ir(t,n){return{start:n.start+n.stretch*t.start,stretch:n.stretch*t.stretch}}function Nr(t){var n,e;return null==(e=null==(n=t.effects)?void 0:n.clone)?void 0:e.retime}function Cr(t){var n;const e=null==(n=t.effects)?void 0:n.clone;e&&(delete e.retime,0===Object.keys(e).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function Dr(t,n,e){const r=er(t.href);if(!r)return void e.errors.push("retime: <use> has no href to follow");const o=Fr(r,n,e,new Set);o&&(t.href="#"+o)}function Fr(t,n,e,r){if(r.has(t))return void e.errors.push('retime: loop via "'+t+'"');const o=e.idMap.get(t);if(!o)return void e.warnings.push('retime: target "'+t+'" not found');const i=or(o);if(function(t,n){Le(t,()=>nr(n,"retimed"))}(i,e),"use"===o.type?Ur(i,n.start,n.stretch):Tr(i,n.start,n.stretch),Cr(i),"use"===o.type&&o.href){const a=er(o.href);if(a){const s=Nr(o),l=s?Ir(_r(s),n):n,u=new Set(r);u.add(t);const c=Fr(a,l,e,u);c&&(i.href="#"+c)}}else!function(t,n,e,r,o){const i=t=>{var a;const s=Nr(t);if("use"===t.type&&s&&t.href){const i=er(t.href);if(i){const a=Ir(_r(s),n),l=new Set(r);l.add(o);const u=Fr(i,a,e,l);u&&(t.href="#"+u)}Cr(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,n,e,r,t);return e.defs.push(i),"string"==typeof i.id&&e.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function Tr(t,n,e){var r;Ur(t,n,e),null==(r=t.children)||r.forEach(t=>Tr(t,n,e))}function Ur(t,n,e){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=n+r.time*e)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const n of Object.keys(t.animate)){const e=t.animate[n];e&&Array.isArray(e.keyframes)&&r(e.keyframes)}}var Lr=/[MmLlHhVvCcSsQqTtAaZz]/;function Er(t,n,e){return{P1:[t[0]+2/3*(n[0]-t[0]),t[1]+2/3*(n[1]-t[1])],P2:[e[0]+2/3*(n[0]-e[0]),e[1]+2/3*(n[1]-e[1])]}}function Br(t){const n=function(t){const n=function(t){const n=[],e=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=e.exec(t));)n.push(r[0]);return n}(t),e=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(n[r++]),p=(t,n,r)=>{const a=[o,i],s=E(a,t,n,r,48);e.push({P0:a,P1:t,P2:n,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,n)=>{p([o+(t-o)/3,i+(n-i)/3],[o+2*(t-o)/3,i+2*(n-i)/3],[t,n])};for(;r<n.length;){let t=n[r];Lr.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const e=t>="a",v=t.toUpperCase();if("Z"!==v){if("M"===v){const n=h()+(e?o:0),r=h()+(e?i:0);o=n,i=r,a=n,s=r,d=t;continue}if("L"===v)m(h()+(e?o:0),h()+(e?i:0));else if("H"===v)m(h()+(e?o:0),i);else if("V"===v)m(o,h()+(e?i:0));else if("C"===v){const t=[h()+(e?o:0),h()+(e?i:0)],n=[h()+(e?o:0),h()+(e?i:0)],r=[h()+(e?o:0),h()+(e?i:0)];l=n[0],u=n[1],p(t,n,r)}else if("S"===v){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],n=[h()+(e?o:0),h()+(e?i:0)],r=[h()+(e?o:0),h()+(e?i:0)];l=n[0],u=n[1],p(t,n,r)}else if("Q"===v){const t=[h()+(e?o:0),h()+(e?i:0)],n=[h()+(e?o:0),h()+(e?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Er([o,i],t,n);p(r,a,n)}else if("T"===v){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],n=[h()+(e?o:0),h()+(e?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Er([o,i],t,n);p(r,a,n)}else{if("A"!==v){r++;continue}r+=5,m(h()+(e?o:0),h()+(e?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return e.length?e:null}(t);if(!n)return null;const e=new Float64Array(n.length+1);for(let t=0;t<n.length;t++)e[t+1]=e[t]+n[t].len;const r=e[n.length],o=n[0].P0,i=n[n.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<n.length-1&&t>e[r+1];)r++;const o=n[r],i=t-e[r],a=o.len>0?function(t,n){const{ts:e,ds:r}=t,o=r.length-1;if(n<=0)return e[0];if(n>=r[o])return e[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<n?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(n-s)/l:0;return e[a-1]+u*(e[a]-e[a-1])}(o.lut,i):0,[s,l]=F(o.P0,o.P1,o.P2,o.P3,a),[u,c]=U(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 n=t<0?0:r,e=s(n),o=t-n;return{x:e.x+Math.cos(e.angle)*o,y:e.y+Math.sin(e.angle)*o,angle:e.angle}}return s((o=r,(n=t)<(e=0)?e:n>o?o:n));var n,e,o}}}function Vr(t){const n=Qe(t);if("static"===n.kind&&"number"==typeof n.value)return{min:n.value,max:n.value};if("animated"===n.kind&&n.keyframes.length){const t=n.keyframes.map(t=>Number(t.value)||0);return{min:Math.min(...t),max:Math.max(...t)}}return{min:0,max:0}}function Wr(t){let n=0,e=16;const r=t=>{var o,i;const a=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;a&&(e=Math.max(e,a));const s=null!=(i=t.text)?i:t.textContent;if("string"==typeof s&&(n+=s.length),t.children)for(const n of t.children)r(n)};return r(t),n*e}var Rr=t=>Math.round(1e3*t)/1e3;function Gr(t,n){if(!n||null==t)return t;const e=Qe(t);if("absent"===e.kind)return t;if("static"===e.kind)return"number"==typeof t?e.value+n:{value:e.value+n};const r={keyframes:e.keyframes.map(t=>u(l({},t),{value:(Number(t.value)||0)+n}))};return void 0!==e.loop&&(r.loop=e.loop),void 0!==e.autoOrient&&(r.autoOrient=e.autoOrient),void 0!==e.base&&(r.value=e.base+n),r}function Zr(t,n){var e;if("clip"===n.pathOverflow)return{d:t,startShift:0};const r=Br(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=Vr(n.startOffset),s=Vr(n.textLength).max||(null!=(e=n.advance)?e: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 n=d.x-Math.cos(d.angle)*c,e=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+Rr(n)+","+Rr(e)+"L"+Rr(d.x)+","+Rr(d.y)+r}if(f>0){const t=h.x+Math.cos(h.angle)*f,n=h.y+Math.sin(h.angle)*f;p+="L"+Rr(t)+","+Rr(n)}return{d:p,startShift:c}}function Kr(t,n,e){null!=e&&Xe(t,n,Qe(e),{asString:!0})}var qr=(t,n,e)=>{const r={type:t};for(const t in n)void 0!==n[t]&&(r[t]=n[t]);const o=Array.isArray(e)?e.filter(t=>null!=t):null!=e?[e]:[];return o.length&&(r.children=o),r};function Qr(t,n){return Math.round(t)===t?""+Math.round(t):t.toFixed(n)}function Xr(t,n){let e="";for(let r=0;r<t.length;r++){const o=Qr(t[r],n);r>0&&45!==o.charCodeAt(0)&&(e+=" "),e+=o}return e}function Jr(t,n,e){return[t[0]*n+t[2]*e+t[4],t[1]*n+t[3]*e+t[5]]}var Yr=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Hr(t,n,e=2){const r=[];let o;for(Yr.lastIndex=0;null!==(o=Yr.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]=Jr(n,s(),s());i+=t+Xr([r,o],e)}else if("C"===t){const[t,r]=Jr(n,s(),s()),[o,a]=Jr(n,s(),s()),[l,u]=Jr(n,s(),s());i+="C"+Xr([t,r,o,a,l,u],e)}else if("Q"===t){const[t,r]=Jr(n,s(),s()),[o,a]=Jr(n,s(),s());i+="Q"+Xr([t,r,o,a],e)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var $r=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",Ct,Dt,"xml:space"];function to(t){if("number"==typeof t)return t;if("string"==typeof t){const n=parseFloat(t);return isNaN(n)?void 0:n}}function no(t){return"string"==typeof t?t:void 0}function eo(t,n){var e,r,o,i,a,s,l;return{fontFamily:null!=(e=no(t.fontFamily))?e:n.fontFamily,fontSize:null!=(r=to(t.fontSize))?r:n.fontSize,fill:null!=(o=t.fill)?o:n.fill,stroke:null!=(i=t.stroke)?i:n.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:n.strokeWidth,letterSpacing:null!=(s=to(t.letterSpacing))?s:n.letterSpacing,wordSpacing:null!=(l=to(t.wordSpacing))?l:n.wordSpacing}}function ro(t){var n,e,r;return{fontFamily:no(t.fontFamily),fontSize:null!=(n=to(t.fontSize))?n:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(e=to(t.letterSpacing))?e:0,wordSpacing:null!=(r=to(t.wordSpacing))?r:0}}function oo(t){const n={};return void 0!==t.fill&&(n.fill=t.fill),void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),n}function io(t,n,e,r){var o;const i=t.fontFamily?n[t.fontFamily]:e;return i||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),i}function ao(t){const n=Object.keys(t);return 1===n.length?t[n[0]]:void 0}function so(t,n){if(t<=0||n<=0)return"";const e=.08,r=t*e,o=.92*t,i=.92*-n,a=o-r,s=-i,l=Math.max(1,.12*Math.min(a,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(a<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=i+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function lo(t,n){var e,r,o,i;const{glyphs:a,create:s=qr,warnings:l}=n,u=ao(a),c={x:null!=(e=to(t.x))?e:0,y:null!=(r=to(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,n)=>{var e;const r=io(n,a,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=n.fontSize/o,s=null!=(e=null==r?void 0:r.ascent)?e:.9*o,p=oo(n);for(let e=0;e<t.length;e++){const a=t.charAt(e),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:so(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+=n.letterSpacing+(" "===a?n.wordSpacing:0),d[h].end=c.x}},m=(t,n)=>{var e,r,o,i;const a=eo(t,n),s=to(t.x),l=to(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!=(e=to(t.dx))?e:0,c.y+=null!=(r=to(t.dy))?r:0;const u=null!=(o=no(t[Dt]))?o:no(t[Ct]);if(u&&!(null==(i=t.children)?void 0:i.length)&&p(u,a),t.children)for(const n of t.children)m(n,a)},v=ro(t);if(t.children)for(const n of t.children)m(n,v);const g=null!=(o=no(t[Dt]))?o:no(t[Ct]);g&&!(null==(i=t.children)?void 0:i.length)&&p(g,v);const y=no(t.textAnchor);if("middle"===y||"end"===y)for(const t of f){const n=d[t.line].end-d[t.line].start,e="middle"===y?-n/2:-n;t.m=[t.scale,0,0,t.scale,t.x+e,t.y]}return ko(t,bo(f,s,l),s)}function uo(t,n){var e,a,s,l,u,c;if(null==(e=n.alongPath)?void 0:e.pathD)return function(t,n,e){var r,o;const{glyphs:i,warnings:a,alongPath:s}=e,l=Br(n);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=ao(i),c=[];let f=0;const d=(t,n)=>{var e,r,o;const s=eo(t,n),l=null!=(e=no(t[Dt]))?e:no(t[Ct]);if(l&&!(null==(r=t.children)?void 0:r.length)){const t=io(s,i,u,a),n=(null==t?void 0:t.unitsPerEm)||1e3,e=s.fontSize/n,r=(null!=(o=null==t?void 0:t.ascent)?o:.9*n)*e;for(let n=0;n<l.length;n++){const o=l.charAt(n),i=null==t?void 0:t.glyphs[o],a=(i?i.width:0)*e,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 n of t.children)d(n,s)};d(t,ro(t));const h=f,p=Qe(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=Qe(null==s?void 0:s.startOffset),{along:y,perp:b}=fo(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 n=k+t.advStart*v,e=k+t.advEnd*v,r=A(l.sampleAtDistance(n)),o=A(l.sampleAtDistance(e)),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,n.alongPath.pathD,n);const{glyphs:f,warnings:d}=n,h=ao(f),p={x:null!=(a=to(t.x))?a:0,y:null!=(s=to(t.y))?s:0},m=[],v=[{start:p.x,end:p.x}];let g=0;const y=(t,n)=>{var e;const r=io(n,f,h,d),o=(null==r?void 0:r.unitsPerEm)||1e3,i=n.fontSize/o,a=(null!=(e=null==r?void 0:r.ascent)?e:.9*o)*i;for(let e=0;e<t.length;e++){const o=t.charAt(e),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+n.letterSpacing+(" "===o?n.wordSpacing:0);m.push({x:p.x,y:p.y,width:l,ascent:a,fontSize:n.fontSize,line:g}),p.x+=l,v[g].end=p.x}},b=(t,n)=>{var e,r,o,i;const a=eo(t,n),s=to(t.x),l=to(t.y);void 0!==s&&(p.x=s,g=v.length,v.push({start:p.x,end:p.x})),void 0!==l&&(p.y=l),p.x+=null!=(e=to(t.dx))?e:0,p.y+=null!=(r=to(t.dy))?r:0;const u=null!=(o=no(t[Dt]))?o:no(t[Ct]);if(u&&!(null==(i=t.children)?void 0:i.length)&&y(u,a),t.children)for(const n of t.children)b(n,a)},k=ro(t);if(t.children)for(const n of t.children){const t=m.length;if(b(n,k),m.length===t){const t=eo(n,k),e=io(t,f,h),r=(null==e?void 0:e.unitsPerEm)||1e3;m.push({x:p.x,y:p.y,width:0,ascent:(null!=(l=null==e?void 0:e.ascent)?l:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:g})}}const A=null!=(u=no(t[Dt]))?u:no(t[Ct]);A&&!(null==(c=t.children)?void 0:c.length)&&y(A,k);const x=no(t.textAnchor);if("middle"===x||"end"===x)for(const t of m){const n=v[t.line].end-v[t.line].start;t.x+="middle"===x?-n/2:-n}return m.map(t=>{var n=t,{line:e}=n;return((t,n)=>{var e={};for(var a in t)o.call(t,a)&&n.indexOf(a)<0&&(e[a]=t[a]);if(null!=t&&r)for(var a of r(t))n.indexOf(a)<0&&i.call(t,a)&&(e[a]=t[a]);return e})(n,["line"])})}function co(t,n,e,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(n),l=Math.cos(s),u=Math.sin(s),c=r/2;return[e*l,e*u,-e*u,e*l,i-e*l*c-o*u,a-e*u*c+o*l]}function fo(t){var n,e,r;return{along:(null!=(n=to(t.x))?n:0)+(null!=(e=to(t.dx))?e:0),perp:null!=(r=to(t.dy))?r:0}}function ho(t,n,e,r,o,i){const{glyphs:a,create:s=qr,warnings:c}=r,f=n?Br(n):null;if(!f)return null==c||c.push("textGlyphs: unparsable along-path geometry"),null;const d=ao(a),{cells:h,width:p}=function(t,n,e,r){const o=[];let i=0;const a=(t,s)=>{var l,u,c;const f=eo(t,s),d=null!=(l=no(t[Dt]))?l:no(t[Ct]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=io(f,n,e,r);if(t){const n=f.fontSize/t.unitsPerEm,e=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=oo(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*n;o.push({glyphD:l.d,widthEm:l.width,scale:n,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*n;o.push({glyphD:so(a,e),widthEm:a,scale:n,paint:r,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*n;i+=f.letterSpacing+(" "===s?f.wordSpacing:0)}}}if(t.children)for(const n of t.children)a(n,f)};return a(t,ro(t)),{cells:o,width:i}}(t,a,d,c);if(!h.length)return ko(t,[],s);const{along:m,perp:v}=fo(t),g=po(e),y=po(o),b=t=>t>0&&p>0?t/p:1,k="clip"===i&&!f.closed;if(g.animated||y.animated){const n=function(t,n){const e=[...t,...n].sort((t,n)=>t-n),r=[];for(const t of e)r.length&&t===r[r.length-1]||r.push(t);return r}(g.times,y.times),e=(t,n)=>m+g.at(n)+b(y.at(n))*t.midBase,r=g.animated?g.loop:y.loop;return ko(t,function(t,n,e,r,o,i,a,s=0){const c=Math.max(n.totalLength/mo,.5),f=t=>t>=0&&t<=n.totalLength,d=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=Hr(h.glyphD,t),m=(t,e)=>{const{x:r,y:o,angle:i}=n.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:e,value:{translate:[go(r-s*l,3),go(o+s*a,3)],rotate:go(180*i/Math.PI,3)}}},v=[],g=[],y=(t,n)=>{v.push(m(t,n)),a&&g.push({time:n,value:f(t)?1:0})};y(e(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const n=r[t-1],o=r[t],i=e(h,n),a=e(h,o),s=Math.min(vo,Math.max(1,Math.ceil(Math.abs(a-i)/c)));for(let t=1;t<=s;t++){const r=n+t/s*(o-n);y(e(h,r),r)}}ie(v);const b={keyframes:v};void 0!==o&&(b.loop=o);const k={transform:b};if(a&&g.some(t=>0===t.value)){const t={keyframes:g};void 0!==o&&(t.loop=o),k.opacity=t}d.push(i("path",u(l({d:p},yo(h.paint)),{animate:k}),[]))}return d}(h,f,e,n,r,s,k,v),s)}const A=b(y.at(0)),x=m+g.at(0);return ko(t,bo((k?h.filter(t=>{const n=x+t.midBase*A;return n>=0&&n<=f.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,m:co(f,x+t.midBase*A,t.scale,t.widthEm,v)})),s,c),s)}function po(t){var n;const e=Qe(t);if("animated"===e.kind&&e.keyframes.length>=2){const t=[...e.keyframes].sort((t,n)=>(Number(t.time)||0)-(Number(n.time)||0)),n=t.map(t=>Number(t.time)||0),r=t.map(t=>Number(t.value)||0);return{animated:!0,times:n,loop:e.loop,at(t){if(t<=n[0])return r[0];for(let e=1;e<n.length;e++)if(t<=n[e]){const o=n[e]-n[e-1],i=o>0?(t-n[e-1])/o:1;return r[e-1]+i*(r[e]-r[e-1])}return r[r.length-1]}}}const r="animated"===e.kind?Number(null==(n=e.keyframes[0])?void 0:n.value)||0:"static"===e.kind&&Number(e.value)||0;return{animated:!1,times:[],at:()=>r}}var mo=48,vo=64;function go(t,n){const e=a(10,n);return Math.round(t*e)/e}function yo(t){const n={};return void 0!==t.fill&&(n.fill=t.fill),void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),n}function bo(t,n,e){var r,o,i;if(!t.length)return null==e||e.push("textGlyphs: nothing to render"),[];const a=new Map;for(const n of t){const t=JSON.stringify([null!=(r=n.paint.fill)?r:null,null!=(o=n.paint.stroke)?o:null,null!=(i=n.paint.strokeWidth)?i:null]),e=Hr(n.glyphD,n.m),s=a.get(t);s?s.d+=e:a.set(t,{paint:n.paint,d:e})}const s=[];for(const{paint:t,d:e}of a.values())s.push(n("path",l({d:e},yo(t)),[]));return s}function ko(t,n,e){const r={};for(const n of Object.keys(t))"type"!==n&&"children"!==n&&-1===$r.indexOf(n)&&(r[n]=t[n]);if(r.style&&"object"==typeof r.style){const t=l({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return e("g",r,n)}function Ao(t,n){return n.alongPath?ho(t,n.alongPath.pathD,n.alongPath.startOffset,n,n.alongPath.textLength,n.alongPath.pathOverflow):lo(t,n)}function xo(t,n,e){if(!n)return t;const r=n.subPaths===Nt.combined,o=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const n of t.children)i(n);return}const n="string"==typeof t.d?t.d:function(t){var n,e,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(n=t.x)?n:0),a=Number(null!=(e=t.y)?e: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 n=Number(null!=(i=t.cx)?i:0),e=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*Uo,d=o*Uo,h=(t,n,e,r,o,i)=>"C"+t+","+n+" "+e+","+r+" "+o+","+i;return"M"+(n+r)+","+e+h(n+r,e+d,n+f,e+o,n,e+o)+h(n-f,e+o,n-r,e+d,n-r,e)+h(n-r,e-d,n-f,e-o,n,e-o)+h(n+f,e-o,n+r,e-d,n+r,e)+"z"}return}(t);if(void 0===n)return;const e=Ae(n);if(!e.length)return;const r={leaf:t,subpaths:[]};for(const t of e){const n=Fo(t);r.subpaths.push({subpath:t,lengthPx:n,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const n of t.subpaths)r||(a=0),n.startOffsetPx=a,a+=n.lengthPx;const c=a;if(r&&c<.001)return t;const f=Qe(n.offset),d="absent"===f.kind?{kind:"static",value:0}:f,h=function(t){const n=Qe(t);if("animated"!==n.kind)return n;const e=n.keyframes.map(t=>{var n,e,r,o;return{time:null!=(e=null!=(n=t.time)?n:t.t)?e:0,value:null!=(r=t.value)?r:t.v,easing:null!=(o=t.easing)?o:t.e}});if(!e.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:e.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<e.length;t++){const n=e[t-1],o=e[t];if((n.value[1]-n.value[0])*(o.value[1]-o.value[0])<0){const t=Co(n,o);null!==t&&t>n.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,n)=>t-n),i=[];let a=0;for(const t of e){for(;a<o.length&&o[a]<t.time;){const t=o[a++],n=Do(e,t),r=(n[0]+n[1])/2;i.push({time:t,value:[r,r]})}const n=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:n,easing:t.easing})}for(;a<o.length;){const t=o[a++],n=Do(e,t),r=(n[0]+n[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(n.range),p="absent"===h.kind?{kind:"static",value:[0,1]}:h,m=function(t){var n;if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const r of t.keyframes){const t=null!=(n=r.value)?n:r.v;"number"==typeof t&&e.push(t)}return e}(d),v=[m.length?Math.min(...m):0,m.length?Math.max(...m):0];if(1===o.length&&o[0].leaf===t&&1===o[0].subpaths.length){const n=o[0],e=n.subpaths[0],i=r?c:e.lengthPx;if(i<.001)return t;const a=r?e.startOffsetPx/i:0;return function(t,n,e,r,o,i){const a=Mo(e,n,r),s=So(n,r),u=l({},t);return delete u.effects,zo(u,"strokeDasharray",_o(i,s)),zo(u,"strokeDashoffset",_o(o,a)),zo(u,"strokeOpacity",No(i)),u}(n.leaf,i,a,v,d,p)}const g=new Map;for(const t of o){const n=[];for(const o of t.subpaths){const i=r?c:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;n.push(...jo(t.leaf,o.subpath,i,a,v,d,p,e))}g.set(t.leaf,wo(t.leaf,n))}const y=t=>{const n=g.get(t);return n||(Array.isArray(t.children)&&t.children.length>0?u(l({},t),{children:t.children.map(y)}):t)};return y(t)}function wo(t,n){const e=u(l({},t),{type:"g",children:n});return delete e.d,delete e.strokeDasharray,delete e.strokeDashoffset,delete e.effects,e}function jo(t,n,e,r,o,i,a,s){const l=Mo(r,e,o),u=So(e,o),f=_o(i,l),d=_o(a,u),h=No(a),p=function(t){return{type:"path",d:t}}(c(n));return zo(p,"strokeDasharray",d),zo(p,"strokeDashoffset",f),zo(p,"strokeOpacity",h),[p]}var Oo=1;function Mo(t,n,e){const[r]=Po(e);return e=>n*(-e-r+t)+Oo}function So(t,n){const[e,r]=Po(n),o=r-e+1;return n=>{const e=D(n[0],0,1),r=D(n[1],0,1),i=Math.min(e,r),a=Math.max(e,r),s=[0];let l=Oo;for(let n=0;n<o;n++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+Oo),s}}function Po(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function _o(t,n){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:n(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>{var e,r,o,i;return{time:null!=(r=null!=(e=t.time)?e:t.t)?r:0,value:n(null!=(o=t.value)?o:t.v),easing:null!=(i=t.easing)?i:t.e}}),loop:t.loop}}function zo(t,n,e){e&&Xe(t,n,e)}var Io=10;function No(t){var n,e,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!=(n=t.value)?n: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 n=l[t],u=t>0?l[t-1]:void 0,c=t<l.length-1?l[t+1]:void 0,d=null!=(r=null!=(e=n.time)?e:n.t)?r:0,h=s(null!=(o=n.value)?o:n.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+Io,value:1})):!p&&m&&(f.push({time:d-Io,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function Co(t,n){const e=e=>{const r=(e-t.time)/(n.time-t.time),o=t.value[0]+(n.value[0]-t.value[0])*r;return t.value[1]+(n.value[1]-t.value[1])*r-o};let r=t.time,o=n.time,i=e(r);if(0===i)return r;const a=e(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,n=e(t);if(0===n||Math.abs(o-r)<1e-4)return t;i*n<0?o=t:(r=t,i=n)}return(r+o)/2}function Do(t,n){if(n<=t[0].time)return t[0].value;if(n>=t[t.length-1].time)return t[t.length-1].value;for(let e=1;e<t.length;e++)if(n<=t[e].time){const r=t[e-1],o=t[e],i=(n-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 Fo(t){const n=t.v;if(!n||n.length<2)return 0;let e=0;for(let r=0;r<n.length-1;r++)e+=To(t,r,r+1);return t.c&&n.length>1&&(e+=To(t,n.length-1,0)),e}function To(t,n,e){var r,o,i,a;const s=t.v,l=s[n],u=s[e],c=E(l,null!=(o=null==(r=t.o)?void 0:r[n])?o:l,null!=(a=null==(i=t.i)?void 0:i[e])?a:u,u);return c.ds[c.ds.length-1]}var Uo=.5522847498307936;function Lo(t){var n,e;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(n=Vt(t))?void 0:n.mode)===gt.frames?yt.frames:yt.waapi,glyphs:null==(e=Wt(t))?void 0:e.glyphs},o=or(t);rr(o,r.idMap),ir(o,r,()=>nr(r,"inner")),function(t,n){const e=new Set,r=t=>{var o,i;const a=er(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.sourceId);if("string"==typeof a){e.add(t);const r=n.idMap.get(a);r&&e.add(r)}if(Array.isArray(t.children))for(const n of t.children)r(n)};if(r(t),0===e.size)return;const o=(t,r)=>{if(e.has(t)&&n.maskAncestorChains.set(t,r),Array.isArray(t.children)){const e=jr(t,n),i=e?[...r,e]:r;for(const n of t.children)o(n,i)}};o(t,[])}(o,r);const i=function(t,n){return function(t,n){n.idMap.clear(),rr(t,n.idMap);const e=[],r=t=>{var n;Nr(t)&&e.push(t),null==(n=t.children)||n.forEach(r)};r(t);const o=new Map;for(const t of e){let e=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&Nr(o)&&e++,"use"===o.type&&o.href){const t=er(o.href);t&&!r.has(t)&&(r.add(t),i(n.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=er(t.href);a&&(r.add(a),i(n.idMap.get(a))),o.set(t,e)}e.sort((t,n)=>{var e,r;return(null!=(e=o.get(n))?e:0)-(null!=(r=o.get(t))?r:0)});for(const t of e){const e=Nr(t);if(!e)continue;const r=e.timeCrop;Cr(t),Dr(t,_r(e),n),r&&zr(t,r,n)}}(t,n),t}(Eo(o,r),r);return function(t,n){if(!n.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:n})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function Eo(t,n){t.children&&(t.children=t.children.map(t=>Eo(t,n)));const e=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?n.contentRefInnerIds.get(r):void 0;if(!e&&!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!=e?e:{};e&&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,e=function(t,n,e,r,o,i){return n.glyphs?ho(t,e,r,{glyphs:n.glyphs,warnings:n.warnings},o,i):(n.warnings.push("textGlyphs: no definitions.glyphs"),null)}(m,n,t,h.startOffset,h.textLength,h.pathOverflow);e&&(m=e,v=!0)}else m=function(t,n,e){return(null==n?void 0:n.useGlyphs)?e.glyphs?lo(t,{glyphs:e.glyphs,warnings:e.warnings}):(e.warnings.push("textGlyphs: no definitions.glyphs — left as native <text>"),t):t}(m,p,n),v=!0;return v||(m=function(t,n,e){var r;if(!n||"string"!=typeof n.path||!n.path)return t;const o=nr(e,"tpath"),{d:i,startShift:a}=Zr(n.path,{pathOverflow:n.pathOverflow,startOffset:n.startOffset,textLength:n.textLength,advance:Wr(t)});e.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==n.lengthAdjust&&(s.lengthAdjust=n.lengthAdjust),void 0!==n.method&&(s.method=n.method),void 0!==n.spacing&&(s.spacing=n.spacing),Kr(s,"startOffset",Gr(n.startOffset,a)),Kr(s,"textLength",n.textLength),t.children=[s],t}(m,h,n)),m=function(t,n,e){return ur(t,n,e,"fill")}(m,f,n),m=function(t,n,e){return ur(t,n,e,"stroke")}(m,d,n),m=xo(m,u,n),m=function(t,n,e){var r,o;if(!n)return t;const i=null!=(r=n.copies)?r:1;if(i<1)return e.errors.push("repeater.copies invalid: "+n.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=or(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 r=or(l),o=Sr(n,t),i=o?He(r,o,e):r;u.push(i)}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,n),m=mr(m,s,i,n),m=function(t,n,e){var r,o;if(!n||!n.d&&!n.animate)return t;const i=nr(e,"clip"),a={type:"path"},s=Qe(n.d);if("absent"!==s.kind&&("static"===s.kind?a.d=pr(s.value):(Xe(a,"d",s),void 0!==a.d&&(a.d=pr(a.d)))),n.animate&&!(null==(r=a.animate)?void 0:r.d)){const t=null!=(o=a.animate)?o:{};t.d=n.animate,a.animate=t}return e.defs.push({type:"clipPath",id:i,children:[a]}),t.clipPath="url(#"+i+")",t}(m,l,n),o?(Mr(m,c,n),m=ar(m,i,r,o,n)):m=function(t,n,e,r){return Mr(t,n,r),He(t,e,r)}(m,c,i,n),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&n.idMap.set(r,m),m}var Bo=t=>{var n,e;return null!=(e=null!=(n=t.t)?n:t.time)?e:0},Vo=t=>{var n;return null!=(n=t.v)?n:t.value},Wo=t=>{var n;return null!=(n=t.e)?n:t.easing},Ro=t=>{var n;return null!=(n=t.tangentIn)?n:t.ti},Go=t=>{var n;return null!=(n=t.tangentOut)?n:t.to};function Zo(t,n,e,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*n[0]+l*e[0]+u*r[0],a*t[1]+s*n[1]+l*e[1]+u*r[1]]}function Ko(t,n,e,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Zo(t,n,e,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var qo=t=>{const n=Math.round(1e4*t)/1e4;return Object.is(n,-0)?"0":String(n)};function Qo(t){const n=t=>{var e;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const n=function(t){var n,e,r,o;if("offsetPath"!==t.alongPathMode)return;const i=null!=(n=t.keyframes)?n:t.kfs;if(!i||i.length<2)return;const a=Vo(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 n=Vo(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(e=null==n?void 0:n.origin)?e:[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=>Ro(t)||Go(t)))return;let u="M"+qo(l[0][0])+","+qo(l[0][1]);const c=[];for(let t=0;t<l.length-1;t++){const n=l[t],e=l[t+1],a=null!=(r=Go(i[t]))?r:[0,0],s=null!=(o=Ro(i[t+1]))?o:[0,0],f=[n[0]+a[0],n[1]+a[1]],d=[e[0]+s[0],e[1]+s[1]];u+="C"+qo(f[0])+","+qo(f[1])+","+qo(d[0])+","+qo(d[1])+","+qo(e[0])+","+qo(e[1]),c.push(Ko(n,f,d,e))}const f=c.reduce((t,n)=>t+n,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 n={t:Bo(i[t]),v:h/f},e=Wo(i[t]);void 0!==e&&(n.e=e),d.push(n)}return{pathStr:u,distanceKfs:d,autoOrient:!!t.autoOrient,anchor:s}}(i);if(n){const e=l({},o);delete e.transform;const a={keyframes:n.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),e.offsetDistance=a;const s=t.transform;let c=s;if(s&&"object"==typeof s){const t=l({},s);delete t.translate,delete t.origin,c=Object.keys(t).length?t:void 0}r=u(l({},t),{animate:e,style:u(l({},t.style),{offsetPath:"path('"+n.pathStr+"')",offsetAnchor:qo(n.anchor[0])+"px "+qo(n.anchor[1])+"px",offsetRotate:n.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==c?r.transform=c:delete r.transform}}if(null==(e=r.children)?void 0:e.length){const t=r.children.map(n);t.some((t,n)=>t!==r.children[n])&&(r=u(l({},r),{children:t}))}return r};return n(t)}function Xo(t,n,e){var r,o;let i=Lo(t).root;i=Qo(i);return i=Ie(i,null!=(o=null==(r=Vt(i))?void 0:r.duration)?o:_),n===yt.waapi&&(i=ge(i,null==e?void 0:e.motionPath),i=Ve(i),i=function(t){const n=t=>t.startsWith("#")?t.slice(1):t,e=(t,n)=>{var r;n(t),null==(r=t.children)||r.forEach(t=>e(t,n))};let r=!0;for(;r;){r=!1;const o=new Set;e(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(n(t.href))}),e(t,t=>{if(!t.children)return;let n=t.children;"defs"===t.type&&(n=n.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),n=n.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),n.length!==t.children.length&&(t.children=n,r=!0)})}return t}(i)),i}function Jo(t){const n=globalThis;"function"!=typeof n.cancelAnimationFrame?n.clearTimeout(t):n.cancelAnimationFrame(t)}function Yo(t,n,e){var r;const o=Vt(t)||{},i=De(t,yt.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||_),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 x=0;const w=()=>{const t=g?(Date.now()-g)*y:0;return v+t},j=()=>{let t=w();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let e=function(){const n=l>0?l:1;let e=0,r=0;if(l>0){t=D(t,0,s*n),r=Math.max(0,Math.ceil(t/n)-1),r=Math.min(r,s-1);e=D((t-r*n)/n,0,1)}else e=t;const o=c||"normal";let i=e;return"reverse"===o?i=1-e:"alternate"===o?r%2==1&&(i=1-e):"alternate-reverse"===o&&r%2==0&&(i=1-e),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=Te(r,e*l);for(const[e,r]of Object.entries(o))n.setAttribute(t.id,e,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const M=()=>!!m&&(!!n.isConnected()&&(y<0?w()>0:!(Number.isFinite(u)&&j()>=u))),S=t=>{null!==p&&(Jo(p),p=null),(t||M())&&(p=function(t){const n=globalThis;return"function"==typeof n.requestAnimationFrame?n.requestAnimationFrame(t):n.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!n.isConnected())return void P();const o=j(),i=w();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==e?void 0:e.onFinish)||t.call(e)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return P(),O(d?u:0),void(b||(b=!0,null==(r=null==e?void 0:e.onFinish)||r.call(e)));if(A>0){const t=Date.now();if(x&&t-x<A)return;x=t}O(o)}})(),S()}))},P=()=>{if(!m)return;let t=w();Number.isFinite(u)&&t>u&&(t=u),v=t,g=0,m=!1,null!==p&&(Jo(p),p=null),t>=0?O(t):h&&O(0)},z={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>M(),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(),S(!0)}})(),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;P(),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;P(),v=0,g=0,m=!1,b=!1,O(v),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{((t=!0)=>{var n;v=Number.isFinite(u)?u:j(),g=0,m=!1,null!==p&&(Jo(p),p=null),O(d?v:0),t&&!b&&(b=!0,null==(n=null==e?void 0:e.onFinish)||n.call(e))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");let n=w();Number.isFinite(u)&&n>u&&(n=u),t<0!=y<0&&(b=!1),y=t,v=n,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;z.cancel(),null==(t=null==e?void 0:e.onRemove)||t.call(e)}};return z}var Ho=[1,0,0,1,0,0];function $o(t,n){return[t[0]*n[0]+t[2]*n[1],t[1]*n[0]+t[3]*n[1],t[0]*n[2]+t[2]*n[3],t[1]*n[2]+t[3]*n[3],t[0]*n[4]+t[2]*n[5]+t[4],t[1]*n[4]+t[3]*n[5]+t[5]]}var ti=(t,n)=>[1,0,0,1,t,n],ni=(t,n)=>[t,0,0,n,0,0];function ei(t){const n=t*Math.PI/180;return[Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]}var ri=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],oi=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function ii(t){let n=Ho;t.translate&&(n=$o(n,ti(t.translate[0],t.translate[1])));const e=t.origin&&(void 0!==t.rotate||t.scale);return e&&(n=$o(n,ti(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(n=$o(n,ei(t.rotate))),t.scale&&(n=$o(n,ni(t.scale[0],t.scale[1]))),e&&(n=$o(n,ti(-t.origin[0],-t.origin[1]))),n}function ai(t,n,e){return t+(n-t)*e}function si(t,n){return null==t?Ho:"string"==typeof t?function(t){let n=Ho;const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=e.exec(t);){const t=r[1],e=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?n=$o(n,ti(e[0]||0,e[1]||0)):"scale"===t?n=$o(n,ni(e[0],e.length>1?e[1]:e[0])):"rotate"===t?n=$o(n,ei(e[0])):"skewX"===t?n=$o(n,ri(e[0])):"skewY"===t?n=$o(n,oi(e[0])):"matrix"===t&&(n=$o(n,[e[0],e[1],e[2],e[3],e[4],e[5]]))}return n}(t):t.keyframes?ii(function(t,n){var e,r,o,i,a,s,l;if(!t.length)return{};if(n<=(null!=(e=t[0].time)?e:0))return t[0].value||{};if(n>=(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)<n;)u++;const c=t[u],f=t[u+1],d=(n-(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=[ai(h.translate[0],p.translate[0],d),ai(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=ai(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[ai(h.scale[0],p.scale[0],d),ai(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,n)):t.value?ii(t.value):"object"!=typeof t||Array.isArray(t)?Ho:ii(t)}var li=new Set(["svg","g","symbol"]),ui=new Set(["defs","mask","clipPath","title"]);function ci(t,n){var e;"string"==typeof t.id&&n.set(t.id,t),null==(e=t.children)||e.forEach(t=>ci(t,n))}function fi(t){return null==t?0:Number(t)}function di(t){return Math.round(100*t)/100+0}function hi(t,n,e){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=di(function(t,n,e,r){var o,i,a,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const n=t.keyframes;if(r<=(null!=(o=n[0].time)?o:0))return n[0].value;if(r>=(null!=(i=n[n.length-1].time)?i:0))return n[n.length-1].value;let e=0;for(;e<n.length-1&&(null!=(a=n[e+1].time)?a:0)<r;)e++;const c=n[e],f=n[e+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return ai(c.value,f.value,d)}return void 0!==n?Number(n):e}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,e)),d=t.mask?1:0,h=n.map(di).join(",");return t.type+"|"+function(t){var n;switch(t.type){case"rect":return fi(t.width)+","+fi(t.height)+","+fi(t.x)+","+fi(t.y);case"ellipse":return fi(t.rx)+","+fi(t.ry)+","+fi(t.cx)+","+fi(t.cy);case"circle":return fi(t.r)+","+fi(t.cx)+","+fi(t.cy);case"path":return String(null!=(n=t.d)?n:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(fi(c)||"")+"|o:"+f+"|m:"+d}function pi(t,n,e,r,o){var i;const a=t.type||"";if(ui.has(a))return;const s=$o(n,function(t,n){return t.animate&&t.animate.transform?si(t.animate.transform,n):void 0!==t.transform?si(t.transform,n):Ho}(t,e));if("use"===a){const n="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(n),a=$o(s,ti(fi(t.x),fi(t.y)));return void(i?pi(i,a,e,r,o):o.push("UNRESOLVED_USE:#"+n))}li.has(a)?null==(i=t.children)||i.forEach(t=>pi(t,s,e,r,o)):o.push(hi(t,s,e))}function mi(t,n){var e;n.add(0);(t=>{var e;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(e=t[r])?void 0:e.keyframes;Array.isArray(o)&&o.forEach(t=>{var e;return n.add(null!=(e=t.time)?e:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var e;return n.add(null!=(e=t.time)?e:0)}),null==(e=t.children)||e.forEach(t=>mi(t,n))}function vi(t,n){const e=new Map;ci(t,e);const r=[];return pi(t,Ho,n,e,r),r.sort()}function gi(t,n){const e=new Set;mi(t,e),mi(n,e);const r=[];for(const o of Array.from(e).sort((t,n)=>t-n)){const e=vi(t,o),i=vi(n,o),a=yi(e,i),s=yi(i,e);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function yi(t,n){const e=new Map;for(const t of n)e.set(t,(e.get(t)||0)+1);const r=[];for(const n of t){const t=e.get(n)||0;t>0?e.set(n,t-1):r.push(n)}return r}export{j as COLOUR_ATTR_NAMES,Rn as CSS_ONLY_STYLE_PROPS,_ as DEFAULT_DURATION_MS,Bn as DISALLOWED_SVG_TAGS_LOWER,Ft as INTERNAL_ATTRS,be as LOOP_JUMP_SHIFT_MS,M as PCT_BASED_ATTR_NAMES,vt as PX_ANIM_ATTR_NAME,mt as PX_ANIM_SRC_ATTR_NAME,Tt as PX_TRANSFORM_PART_KEYS,Nn as PxAnimatedSvgDocumentSchema,Ht as PxAnimationDefinitionSchema,ln as PxAnimatorConfigSchema,yt as PxAnimatorEngine,gt as PxAnimatorMode,cn as PxAttrValueSchema,Cn as PxBezierPathSchema,un as PxBindingSchema,kn as PxCloneEffectSchema,rn as PxDefsSchema,Zt as PxEasingOrRefSchema,Sn as PxEffectsSchema,$t as PxElementAnimationSchema,wn as PxFillGradientEffectSchema,Lt as PxGradientSpreadMethod,An as PxGradientStopSchema,Et as PxGradientType,Ut as PxGradientUnits,qt as PxKeyframeSchema,Kt as PxKeyframeValueSchema,bt as PxLoopExtend,Qt as PxLoopSchema,vn as PxMaskedByEffectSchema,_n as PxNodeBase,zn as PxNodeSchema,Xt as PxPropertyAnimationSchema,mn as PxRepeaterEffectSchema,bn as PxRetimeEffectSchema,on as PxScrollRangePointSchema,an as PxScrollRangeSchema,sn as PxScrollSchema,jn as PxStrokeGradientEffectSchema,In as PxSvgNodeExtra,Mn as PxTextEffectSchema,On as PxTextPathEffectSchema,pn as PxTransformByEffectSchema,Jt as PxTransformPartsSchema,Yt as PxTransformValueSchema,tn as PxTriggerSchema,yn as PxTrimPathEffectSchema,Nt as PxTrimSubPaths,P as STYLE_ATTR_NAMES,Ct as TEXT_ATTR,Dt as TEXT_CONTENT_ATTR,O as TRANSFORM_FN_NAMES,Lo as applyPlayerEffects,c as bezierToSvgPath,Te as calcAnimationValues,C as camelCaseToKebabWordIfNeeded,D as clamp,mi as collectSampleTimes,S as composeTransformParts,Yo as createBasicFrameLoopAnimator,Br as createPathSampler,g as cubicBezier,Un as deepClone,ht as describeSchema,gi as diffInEffect,re as evaluateMotionPathSegment,Zr as extendedPathForBrowser,Ln as generateNewIds,Tn as generateUniqueId,Vt as getAnimatorConfig,Rt as getBindings,Gt as getChildren,Wt as getDefs,De as getNormalisedBindings,Jn as getNormalizedProps,p as interpolateBeziers,Se as interpolateValue,Bt as isPxElementFileFormat,Dn as isPxElementFileFormatDeep,V as isScrollTimeline,qr as jsonElementFactory,z as kebabToCamelCaseWord,uo as layoutGlyphTextChars,Xo as materialiseAllInTree,Ve as materialiseAnimatedUseInstances,Ao as materialiseGlyphText,ho as materialiseGlyphTextAlongPath,lo as materialiseGlyphTextHorizontal,ze as materialiseInternalLoopsInPropAnim,Ie as materialiseInternalLoopsInTree,oe as materialiseMotionPathInPropAnim,ge as materialiseMotionPathsInTree,te as propAnimIsMotionPath,pt as px,Xn as resolveStyle,A as reverseEasing,Qn as sanitiseAttributeValue,dt as schemaKeys,K as scrollOffsetProgress,R as scrollPhaseInterval,q as scrollResolveAxis,W as scrollTotalDurationMs,Z as scrollViewProgress,Gr as shiftAnimatable,k as splitEasing,b as subdivideCubicBezier,x as toRGBA,Pn as validateNodeEffects,vi as visualModelAt};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixodesk/svg-animator-core",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "Pixodesk SVG animator core — schema, document types, materialisers and sampling shared by all platform players",
5
5
  "license": "MIT",
6
6
  "repository": {