@pixodesk/svg-animator-web 1.0.45 → 1.0.46

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.
@@ -1 +1 @@
1
- var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(t,e)=>{for(var n in e||(e={}))a.call(e,n)&&u(t,n,e[n]);if(s)for(var n of s(e))l.call(e,n)&&u(t,n,e[n]);return t},f=(t,e)=>n(t,o(e)),d={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(d,{PxAnimatorConfigSchema:()=>ne,PxDefinitionsSchema:()=>qt,PxDiagnosticKind:()=>Ai,PxNodeBaseSchema:()=>je,PxScrollSchema:()=>Kt,PxSvgNodeRootSchema:()=>Oe,PxTimelineEngineSetting:()=>st,PxTriggerSchema:()=>Bt,createAdapterAnimator:()=>Ti,createAnimator:()=>xs,generateNewIds:()=>Ee,getAllAnimators:()=>ts,loadTagAnimators:()=>Os,onAnimatorsChange:()=>es,px:()=>U,renderNode:()=>As,setupAnimationTriggers:()=>is,toDomProps:()=>yn,validateDocument:()=>we}),module.exports=(t=d,((t,n,o,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let o of i(n))a.call(t,o)||void 0===o||e(t,o,{get:()=>n[o],enumerable:!(s=r(n,o))||s.enumerable});return t})(e({},"__esModule",{value:!0}),t));var h=Object.defineProperty,p=Object.defineProperties,m=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,b=Math.pow,k=(t,e,n)=>e in t?h(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e)=>{for(var n in e||(e={}))v.call(e,n)&&k(t,n,e[n]);if(g)for(var n of g(e))y.call(e,n)&&k(t,n,e[n]);return t},w=(t,e)=>p(t,m(e)),j=(t,e)=>{var n={};for(var r in t)v.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&g)for(var r of g(t))e.indexOf(r)<0&&y.call(t,r)&&(n[r]=t[r]);return n};function x(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var O=class{_canSanitize(t){return this.isValid(t)}optional(){return new S(this)}},S=class extends O{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)}},P=class extends O{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(x(null!=n?n:[])+": expected string, got "+typeof t),!1)}},M=class extends O{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(x(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},_=class extends O{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(x(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},E=class extends O{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(x(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},N=class extends O{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(x(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},C=class extends O{constructor(t,e){super(),this.schemas=t,this._kind="union",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};if(this.schemas.some(e=>e.isValid(t,o,n?[...n]:void 0)))return!0;if(!e)return!1;const i=x(null!=n?n:[]);let s;e.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let a=-1;const l=[];for(const r of this.schemas){const o={errors:[],warnings:[],strict:e.strict};if(r.isValid(t,o,n?[...n]:void 0),!o.errors.length)continue;const u=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((u>a||u===a&&s&&o.errors.length<s.length)&&(a=u,s=o.errors),u<=i.length)for(const t of o.errors){const e=/: expected (.+?), got /.exec(t);e&&!l.includes(e[1])&&l.push(e[1])}}if(s&&a>i.length)for(const t of s.slice(0,4))e.errors.includes(t)||e.errors.push(t);else l.length&&e.errors.push(i+": expected "+l.join(" | "));return!1}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},T=class extends O{constructor(t,e,n){var r;super(),this._key=t,this._schemas=e,this._kind="discriminatedUnion",this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];if(!e)continue;const o=null!=(r=e.inner)?r:e;this._map.set(o._default,n),e.inner&&(this._absentMember=n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null==e?this._absentMember:this._map.get(e)}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(x(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)}},z=class extends O{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)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(x(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(x(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},F=class extends O{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=A({},e);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}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(x(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)}},D=class extends O{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(x(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)}},R=class extends O{constructor(t){super(),this.value=t,this._kind="record",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(x(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)}},I=class extends O{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},L=class extends O{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(x(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},W=class extends O{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)}},B=class extends O{constructor(t){super(),this.schemas=t,this._kind="tuple",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(x(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}},U={string:(t="")=>new P(t),number:(t=0)=>new M(t),boolean:(t=!1)=>new _(t),literal:t=>new E(t),enum:(t,e)=>new N(t,e),union:(t,e)=>new C(t,e),discriminatedUnion:(t,e)=>new T(t,e),object:t=>new z(t),openObject:(t,e)=>new F(t,e),extendedObject:(t,e)=>new z(A(A({},t._shape),e)),array:t=>new D(t),record:t=>new R(t),any:()=>new I,defined:()=>new L,tuple:t=>new B(t),lazy:(t,e)=>new W(t,e)},V=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function q(t){if("string"!=typeof t)return;const e=V.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}q("1.2");var G="data-px-animation-src",Z="_px_animator",K={load:"load",mouseOver:"mouseOver",click:"click",none:"none"},J={pause:"pause",continue:"continue",reset:"reset"},H={continue:"continue",pause:"pause",reset:"reset",reverse:"reverse"},X="block",Q="inline",Y="nearest",$="root",tt="center",et="bottom",nt=["duration","iterations","engine","frameRate"],rt=["trigger","delay","fillMode","direction"],ot=[...nt,...rt,"fill","resetOnFinish","timelineSource","scroll"],it={native:"native",js:"js"},st=w(A({},it),{auto:"auto"});function at(t){return t===st.js?it.js:it.native}function lt(t){return t===st.native}var ut={start:"load",offScreen:"pause",mouseOut:"continue",visibilityThreshold:.5,visibilityDebounce:150},ct={start:"start",end:"end"},ft={normal:"normal",alternate:"alternate"},dt="userSpaceOnUse",ht="objectBoundingBox",pt={translate:"translate"},mt={separate:"separate",combined:"combined"},gt="textContent",vt="class",yt="transform",bt="offsetDistance",kt=new Set(["type","children","animator","meta","animate","effects",gt]),At={translate:"translate",rotate:"rotate",scale:"scale",origin:"origin"},wt=(At.translate,At.rotate,At.scale,At.origin,"pad"),jt={linear:"linear",radial:"radial"};function xt(t){var e;const n=(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator);if(!n)return;const r=Ot.get(n);if(r)return r;const o=n,i=ot.filter(t=>void 0!==o[t]),s=i.length?A({},o):n;for(const t of i)delete s[t];const a=function(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=St.get(t);if(n)return n;const r=t,{timeline:o}=r,i=j(r,["timeline"]);if(void 0!==e.engine&&(i.engine=e.engine),void 0!==e.frameRate&&(i.frameRate=e.frameRate),"scroll"===e.type||"view"===e.type){i.timelineSource="scroll",void 0!==e.duration&&(i.duration=e.duration),void 0!==e.iterations&&(i.iterations=e.iterations);const t=A({},i.scroll||{});t.kind=e.type,void 0!==e.axis&&(t.axis=e.axis),void 0!==e.source&&(t.source=e.source),void 0!==e.subject&&(t.subject=e.subject),void 0!==e.smoothing&&(t.smoothing=e.smoothing),void 0!==e.range&&(t.range=e.range);const n=e.pin;"boolean"==typeof n?t.pin=n:n&&"object"==typeof n&&(t.pin=!0,void 0!==n.align&&(t.pinAlign=n.align),void 0!==n.offset&&(t.pinOffset=n.offset),void 0!==n.distance&&(t.pinDistance=n.distance)),i.scroll=t}else{if(void 0!==e.duration&&(i.duration=e.duration),void 0!==e.trigger){const t=e.trigger,{finish:n}=t,r=j(t,["finish"]);Object.keys(r).length&&(i.trigger=r),void 0!==n&&(i.resetOnFinish="reset"===n)}void 0!==e.delay&&(i.delay=e.delay),void 0!==e.iterations&&(i.iterations=e.iterations),void 0!==e.direction&&(i.direction=e.direction),void 0!==e.fillMode&&(i.fill=e.fillMode)}return St.set(t,i),i}(s);return Ot.set(n,a),a}var Ot=new WeakMap,St=new WeakMap;function Pt(t){var e;if(t)return null==(e=xt(t))?void 0:e.definitions}var Mt=U.union([U.string(),U.tuple([U.number(),U.number(),U.number(),U.number()])]),_t=U.union([U.string(),U.number(),U.array(U.number()),U.object({pathData:U.string()}),U.lazy(()=>U.array(pe),[]),U.lazy(()=>It,{})]),Et=U.object({time:U.number().optional(),value:_t.optional(),easing:Mt.optional(),tangentOut:U.tuple([U.number(),U.number()]).optional(),tangentIn:U.tuple([U.number(),U.number()]).optional()}),Nt=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},Ct=t=>{var e;return null!=(e=t.value)?e:t.v},Tt=t=>{var e;return null!=(e=t.easing)?e:t.e},zt=t=>t.tangentIn,Ft=t=>t.tangentOut,Dt=U.object({segmentCount:U.number().optional(),repeatAt:U.enum([ct.start,ct.end]).optional(),direction:U.enum([ft.normal,ft.alternate]).optional()}),Rt=U.object({value:_t.optional(),keyframes:U.array(Et).optional(),loop:U.union([Dt,U.boolean()]).optional(),autoOrient:U.boolean().optional(),alongPathMode:U.enum(["sampled","offsetPath"]).optional()}),It=U.object({translate:U.tuple([U.number(),U.number()]).optional(),rotate:U.number().optional(),skew:U.number().optional(),scale:U.tuple([U.number(),U.number()]).optional(),origin:U.tuple([U.number(),U.number()]).optional()}),Lt=(U.union([U.string(),It,U.object({value:It}),Rt]),U.record(Rt)),Wt=U.union([U.string(),U.array(U.union([U.string(),Lt])),Lt]),Bt=U.object({start:U.enum([K.load,K.mouseOver,K.click,K.none],ut.start).optional(),offScreen:U.enum([J.pause,J.continue,J.reset],ut.offScreen).optional(),mouseOut:U.enum([H.continue,H.pause,H.reset,H.reverse],ut.mouseOut).optional(),finish:U.enum(["hold","reset"]).optional(),visibilityThreshold:U.number().optional(),visibilityDebounce:U.number().optional()}),Ut=U.object({width:U.number(),pathData:U.string()}),Vt=U.object({fontFamily:U.string(),fontStyle:U.string(),ascent:U.number(),unitsPerEm:U.number(),glyphs:U.record(Ut)}),qt=U.object({easings:U.record(U.tuple([U.number(),U.number(),U.number(),U.number()])).optional(),animations:U.record(Lt).optional(),fonts:U.record(Vt).optional()}),Gt=U.object({phase:U.enum(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:U.number().optional()}),Zt=U.object({start:Gt.optional(),end:Gt.optional()}),Kt=U.object({kind:U.enum(["view","scroll"]).optional(),axis:U.enum([X,Q,"x","y"]).optional(),source:U.enum([Y,$]).optional(),subject:U.string().optional(),smoothing:U.number().optional(),pin:U.boolean().optional(),pinAlign:U.enum(["top",tt,et]).optional(),pinOffset:U.number().optional(),pinDistance:U.number().optional(),range:Zt.optional()}),Jt=U.object({align:U.enum(["top",tt,et]).optional(),offset:U.number().optional(),distance:U.number().optional()}),Ht=U.enum([st.auto,st.native,st.js]).optional(),Xt=U.object({type:U.literal("time").optional(),engine:Ht,frameRate:U.number().optional(),duration:U.number().optional(),trigger:Bt.optional(),delay:U.number().optional(),iterations:U.union([U.number(),U.literal("infinite")]).optional(),fillMode:U.enum(["forwards","backwards","both","none"]).optional(),direction:U.enum(["normal","reverse","alternate","alternate-reverse"]).optional()}),Qt={duration:U.number().optional(),iterations:U.number().optional(),engine:Ht,frameRate:U.number().optional(),axis:U.enum([X,Q,"x","y"]).optional(),source:U.enum([Y,$]).optional(),subject:U.string().optional(),smoothing:U.number().optional(),pin:U.union([U.boolean(),Jt]).optional(),range:Zt.optional()},Yt=U.object(A({type:U.literal("scroll")},Qt)),$t=U.object(A({type:U.literal("view")},Qt)),te=U.discriminatedUnion("type",[Xt,Yt,$t]),ee=U.object({target:U.string(),animateWith:U.array(U.string())}),ne=U.object({timeline:te.optional(),definitions:qt.optional(),bindings:U.array(ee).optional(),debugGlobalName:U.string().optional(),version:U.string().optional()}),re=U.union([U.string(),U.number(),U.array(U.number()),U.object({value:U.defined()}),It]),oe=U.union([U.number(),Rt,U.object({value:U.number()})]),ie=U.union([U.tuple([U.number(),U.number()]),Rt,U.object({value:U.tuple([U.number(),U.number()])})]),se=U.union([U.string(),Rt,U.object({value:U.string()})]),ae=U.object({translate:ie.optional(),rotate:oe.optional(),scale:ie.optional(),skew:oe.optional(),origin:ie.optional()}),le=U.object({copies:U.number().optional(),translate:ie.optional(),rotate:oe.optional(),skew:oe.optional(),scale:ie.optional(),origin:ie.optional()}),ue=U.object({source:U.string().optional(),maskType:U.enum(["luminance","alpha"]).optional(),maskUnits:U.enum([dt,ht]).optional(),maskContentUnits:U.enum([dt,ht]).optional(),x:U.number().optional(),y:U.number().optional(),width:U.number().optional(),height:U.number().optional()}),ce=U.object({pathData:se.optional()}),fe=U.object({offset:oe.optional(),range:ie.optional(),subPaths:U.enum([mt.separate,mt.combined]).optional()}),de=U.object({start:U.number().optional(),stretch:U.number().optional(),timeCrop:U.tuple([U.number(),U.number()]).optional()}),he=U.object({without:U.enum([pt.translate]).optional(),source:U.string().optional(),retime:de.optional()}),pe=U.object({offset:U.number(),color:U.string()}),me=U.union([U.array(pe),U.object({value:U.array(pe)}),Rt]),ge=U.object({type:U.enum([jt.linear,jt.radial]),start:ie.optional(),end:ie.optional(),center:ie.optional(),radius:oe.optional(),focal:ie.optional(),stops:me.optional(),gradientUnits:U.enum([dt,ht]).optional(),spreadMethod:U.enum([wt,"reflect","repeat"]).optional(),gradientTransform:U.string().optional()}),ve=ge,ye=U.object({pathData:U.string(),pathOverflow:U.enum(["clip","extend"]).optional(),lengthAdjust:U.enum(["spacing","spacingAndGlyphs"]).optional(),method:U.enum(["align","stretch"]).optional(),spacing:U.enum(["auto","exact"]).optional(),startOffset:oe.optional(),textLength:oe.optional()}),be=U.object({useGlyphs:U.boolean().optional()}),ke=U.object({transformBy:ae.optional(),repeater:le.optional(),maskedBy:ue.optional(),clipPath:ce.optional(),strokeTrim:fe.optional(),clone:he.optional(),fillGradient:ge.optional(),strokeGradient:ve.optional(),textPath:ye.optional(),text:be.optional()});function Ae(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!ke.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}function we(t,e){var n;const r=!1!==(null==e?void 0:e.strict),o={errors:[],warnings:[],strict:r},i=Se.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const e of Ae(t,{strict:r}))i.includes(e)||i.push(e);const e=null==(n=xt(t))?void 0:n.definitions;for(const n of function(t,e){if(!e||!Object.keys(e).length)return[];const n=[],r=(t,o,i,s)=>{var a,l;if(!t)return;const u="string"==typeof t.fontFamily?t.fontFamily:void 0,c=null!=u?u:i,f=s||"text"===t.type&&!!(null==(l=null==(a=t.effects)?void 0:a.text)?void 0:l.useGlyphs);if(f&&u&&!Object.prototype.hasOwnProperty.call(e,u)){const t=o+': glyph-mode text uses font-family "'+u+'", which has no entry in animator.definitions.fonts';n.includes(t)||n.push(t)}Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]",c,f))};return r(t,"root",void 0,!1),n}(t,null==e?void 0:e.fonts))i.includes(n)||i.push(n);for(const n of function(t,e){const n=[],r=(t,o)=>{if(Array.isArray(t))return void t.forEach((t,e)=>r(t,o+"["+e+"]"));if(!t||"object"!=typeof t)return;const i=t.easing;if(!("string"!=typeof i||e&&Object.prototype.hasOwnProperty.call(e,i))){const t=o+'.easing: "'+i+'" names no entry in animator.definitions.easings — it will play linear';n.includes(t)||n.push(t)}for(const[e,n]of Object.entries(t))"easing"!==e&&n&&"object"==typeof n&&r(n,o+"."+e)};return r(t,"root"),n}(t,null==e?void 0:e.easings))i.includes(n)||i.push(n);for(const e of function(t){var e;const n=null==(e=xt(t))?void 0:e.version;return void 0===n||void 0!==q(n)?[]:["root.animator.version: "+JSON.stringify(n)+' is not a version stamp ("a.b" or "a.b.c") — it reads as unstamped']}(t))i.includes(e)||i.push(e)}return i}var je=U.openObject({type:U.string(),domType:U.string().optional(),textContent:U.string().optional(),id:U.string().optional(),meta:U.any().optional(),effects:ke.optional(),animate:Wt.optional(),style:U.record(U.union([U.string(),U.number()])).optional()},re),xe=U.openObject(w(A({},je._shape),{children:U.lazy(()=>U.array(xe),[]).optional()}),re),Oe=U.object({width:U.union([U.number(),U.string()]).optional(),height:U.union([U.number(),U.string()]).optional(),viewBox:U.string().optional(),animator:ne.optional()}),Se=U.openObject(w(A(A({},je._shape),Oe._shape),{type:U.literal("svg"),children:U.array(xe).optional()}),re),Pe=(U.object({v:U.array(U.array(U.number())),i:U.array(U.array(U.number())).optional(),o:U.array(U.array(U.number())).optional(),c:U.boolean().optional()}),0);function Me(){return"_px_"+Date.now().toString(36)+(++Pe).toString(36)+Math.random().toString(36).substring(2,6)}function _e(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>_e(t));const e=t,n={};for(const t of Object.keys(e))n[t]=_e(e[t]);return n}function Ee(t){var e;const n=_e(t),r=new Map,o=new Set(["href","xlink:href"]),i=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["targetId","boundElementId"]),a=(t,e)=>"source"===t&&("maskedBy"===e||"clone"===e);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=Me();r.set(t,n),e.id=n}else e.animate&&(e.id=Me());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(n),function t(e,n){if(e&&"object"==typeof e)for(const[l,u]of Object.entries(e))if("children"!==l)if("string"==typeof u)if(o.has(l)&&u.startsWith("#")){const t=u.slice(1),n=r.get(t);n&&(e[l]="#"+n)}else if(i.has(l))e[l]=Ne(u,r);else if(s.has(l)||a(l,n)){const t=u.startsWith("#"),n=r.get(t?u.slice(1):u);n&&(e[l]=t?"#"+n:n)}else u.includes("url(#")&&(e[l]=Ne(u,r));else if("style"===l&&"object"==typeof u&&null!==u)for(const[t,e]of Object.entries(u))"string"==typeof e&&(u[t]=Ne(e,r));else"object"==typeof u&&null!==u&&t(u,l);else if(Array.isArray(u))for(const e of u)t(e)}(n);const l=null==(e=n.animator)?void 0:e.bindings;if(Array.isArray(l)){const t=l.map(t=>{var e;const n=t.target.startsWith("#"),o=n?t.target.slice(1):t.target,i=null!=(e=r.get(o))?e:o;return w(A({},t),{target:n?"#"+i:i})});n.animator=w(A({},n.animator),{bindings:t})}return n}function Ne(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function Ce(t,e=!1){var n,r,o,i;const s=t.v,a=t.i,l=t.o,u=t.c;if(!s.length)return"";const c=[],f=s.length;c.push("M"+s[0][0]+","+s[0][1]);for(let t=1;t<f;t++){const o=s[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==a?void 0:a[t])?r:s[t],f=s[t];e||i[0]!==o[0]||i[1]!==o[1]||u[0]!==f[0]||u[1]!==f[1]?c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1]):c.push("L"+f[0]+","+f[1])}if(u&&f>0){const t=s[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==a?void 0:a[0])?i:s[0],u=s[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 Te(t,e,n){return t+(e-t)*n}function ze(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Te(t[i]||0,e[i]||0,n);return r}function Fe(t,e,n){return[Te(t[0]||0,e[0]||0,n),Te(t[1]||0,e[1]||0,n),Te(t[2]||0,e[2]||0,n),Te(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function De(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Re(t[i],e[i],n));return o}function Re(t,e,n){var r,o,i,s,a,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=[],g=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(ze(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(s=null==(i=e.i)?void 0:i[n])?s:h;m.push(ze(v,y,d));const b=null!=(l=null==(a=t.o)?void 0:a[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;g.push(ze(b,k,d))}return{v:p,i:m.length?m:void 0,o:g.length?g:void 0,c:null!=(f=t.c)?f:e.c}}function Ie(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 s(t){return((i*t+o)*t+r)*t}function a(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=s(l)-n;if(Math.abs(t)<1e-6)return l;const e=a(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=s(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function Le(t){const[e,n,r,o]=t,i=3*n,s=3*(o-n)-i,a=1-i-s;return function(t){return n=Ie(e,r,t),((a*n+s)*n+i)*n;var n}}function We(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Be(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,s=Ie(n,o,e),a=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=We(t,e,o),s=We(e,n,o),a=We(n,r,o),l=We(i,s,o),u=We(s,a,o),c=We(l,u,o);return{left:[t,i,l,c],right:[c,u,a,r]}}([0,0],a,l,[1,1],s),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 Ue(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Ve(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 qe(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),s=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,a=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==s&&a.push(parseInt(s,16)/255),a}(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 Ge=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),Ze=new Set(["translate","rotate","scale","skew"]),Ke=new Set(["offset-distance","offsetDistance"]);function Je(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,s=t.origin,a=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+")"),s&&o.push("translate("+s[0]+c+","+s[1]+c+")"),null!=a&&o.push("rotate("+a+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),s&&o.push("translate("+-s[0]+c+","+-s[1]+c+")"),o.join("")}var He=new Set(["offset-distance","offsetDistance"]),Xe=1e3;function Qe(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Ye(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var $e=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 tn(t){return $e.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function en(t,e,n){return Math.max(e,Math.min(t,n))}function nn(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,s=i*i,a=o*o,l=s*i,u=3*o*s,c=3*a*i,f=a*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 rn=1e-4;function on(t,e,n,r,o){const i=sn(t,e,n,r,o);return 0===i[0]&&0===i[1]?sn(t,e,n,r,o<.5?o+rn:o-rn):i}function sn(t,e,n,r,o){const i=1-o,s=3*i*i,a=6*o*i,l=3*o*o;return[s*(e[0]-t[0])+a*(n[0]-e[0])+l*(r[0]-n[0]),s*(e[1]-t[1])+a*(n[1]-e[1])+l*(r[1]-n[1])]}function an(t,e,n,r,o=100){const i=o+1,s=new Float64Array(i),a=new Float64Array(i);let l=nn(t,e,n,r,0);s[0]=0,a[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=nn(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),s[c]=i,a[c]=u,l=f}return{ts:s,ds:a}}function ln(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,s=o;for(;i<s;){const t=i+s>>>1;n[t]<e?i=t+1:s=t}const a=n[s-1],l=n[s]-a,u=l>0?(e-a)/l:0;return r[s-1]+u*(r[s]-r[s-1])}var un=new Set(["script","foreignobject"]),cn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),fn=new Set(["href","xlink:href","src"]),dn=new Set(["mixBlendMode","isolation"]),hn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,pn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,mn=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,gn=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function vn(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(cn.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)||fn.has(n)&&(hn.test(t)||pn.test(t)||function(t){const e=mn.exec(t);return!!e&&gn.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 yn(t){const e={};for(const n of Object.keys(t)){const r=Qe(n);if(kt.has(r))continue;if("style"===r)continue;let o=t[n];if(Ge.has(r)&&Array.isArray(o))e[r]=Ve(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)Ze.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e[yt]=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[yt]=Je(t,{withUnits:!1})}}return e}function bn(t,e){if(!t)return t;const n=e&&"object"==typeof e&&!Array.isArray(e)?e:function(t){var e,n;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let s,a=-1;for(;null!==(s=o.exec(t));){const t=s[1],o=i.indexOf(t);if(o<0||o<=a)return;a=o;const l=s[2].split(/[\s,]+/).filter(Boolean).map(Number);if(l.some(t=>Number.isNaN(t)))return;if("translate"===t){if(l.length<1||l.length>2)return;r.translate=[l[0],null!=(e=l[1])?e:0]}else if("rotate"===t){if(1!==l.length)return;r.rotate=l[0]}else if("skewX"===t){if(1!==l.length)return;r.skew=l[0]}else{if(l.length<1||l.length>2)return;r.scale=[l[0],null!=(n=l[1])?n:l[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}(e);if(!n||!Object.keys(n).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?A(A({},n),t):t,o=t[yt];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=w(A({},e),{keyframes:e.keyframes.map(t=>w(A({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),w(A({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>Ze.has(t));if(1!==i.length)return t;const s=i[0],a=t[s];if(!a||"object"!=typeof a||!Array.isArray(a.keyframes))return t;const l=w(A({},a),{keyframes:a.keyframes.map(t=>w(A({},t),{value:w(A({},n),{[s]:t.value})}))});void 0!==l.value&&(l.value=w(A({},n),{[s]:l.value}));const u=A({},t);return delete u[s],w(A({},u),{transform:l})}function kn(t){const e=Ct(t);if(!e)return;if(Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1])return[e[0],e[1]];const n=e.translate;return Array.isArray(n)&&n.length>=2?[n[0],n[1]]:void 0}function An(t){return Nt(t)}function wn(t){return Tt(t)}function jn(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(zt(t)||Ft(t))return!0;return!1}var xn=new WeakMap;function On(t,e,n,r){let o=xn.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const s=Ft(t),a=zt(e),l=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],u=[r[0]+(a?a[0]:0),r[1]+(a?a[1]:0)],c=an(n,l,u,r),f={P0:n,P1:l,P2:u,P3:r,lut:c,totalArc:c.ds[c.ds.length-1]};return o||(o=new WeakMap,xn.set(t,o)),o.set(e,f),f}var Sn=.5,Pn=5,Mn=32;function _n(t,e){var n,r,o;if(!jn(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,a=null!=(n=null==e?void 0:e.flatnessTolerance)?n:Sn,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:Pn,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:Mn,c=[],f=kn(i[0]);if(!f)return t;const d=s?function(t,e){const n=kn(t),r=kn(e);if(!n||!r)return 0;const o=On(t,e,n,r),i=on(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(i[0],i[1]):void 0;c.push(Nn(An(i[0]),zn(Cn(i[0]),Cn(i[0]),0,f,d,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=kn(e),o=kn(n);r&&o?(s&&t>0&&Dn(c,e,n,r,o,l),In(c,e,n,r,o,s,a,l,u)):c.push(Nn(An(n),zn(Cn(n),Cn(n),1,null!=o?o:[0,0],void 0,s)))}const h=wn(i[i.length-1]);h&&(c[c.length-1].e=h),s&&En(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function En(t){let e;for(const n of t){const t=Ct(n);if(!t||"number"!=typeof t.rotate)continue;if(void 0===e){e=t.rotate;continue}let r=t.rotate;for(;r-e>180;)r-=360;for(;r-e<-180;)r+=360;t.rotate=r,e=r}}function Nn(t,e){return{t:t,v:e}}function Cn(t){const e=Ct(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function Tn(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,s="number"==typeof e[o]?e[o]:0;r[o]=i+(s-i)*n}return r}return n<.5?t:e}function zn(t,e,n,r,o,i){const s={translate:r},a=new Set;if(t)for(const e of Object.keys(t))a.add(e);if(e)for(const t of Object.keys(e))a.add(t);for(const r of a){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],a=null==e?void 0:e[r];void 0===o&&void 0===a||(s[r]=Tn(o,a,n))}return void 0!==o&&(s.rotate=o+Fn(t,e,n)),s}function Fn(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=Tn(r,o,n);return"number"==typeof i?i:0}function Dn(t,e,n,r,o,i){const s=t[t.length-1],a=Ct(s),l=null==a?void 0:a.rotate;if("number"!=typeof l)return;const u=Cn(e),c=l-Fn(u,u,0),f=On(e,n,r,o),d=on(f.P0,f.P1,f.P2,f.P3,0),h=180*Math.atan2(d[1],d[0])/Math.PI,p=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(h,c);if(Math.abs(p)<=i)return;const m=An(e),g=Math.min(m+Rn,(m+An(n))/2),v=zn(Cn(e),Cn(e),0,r,h,!0);t.push(Nn(g,v))}var Rn=.05;function In(t,e,n,r,o,i,s,a,l){const u=On(e,n,r,o),c=An(e),f=An(n),d=wn(e),h=(p=d)?Le([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Cn(e),g=Cn(n),v=function(t,e,n,r,o){const i=[];Ln(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),Ln(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const s=[0];for(const t of i)t>s[s.length-1]+1e-6&&t<.999999&&s.push(t);s.push(1);const a=[],l={remaining:o-s.length};for(let o=0;o<s.length-1;o++)Wn(s[o],s[o+1],a,t,e,n,r,l);return a}(u,i,s,a,l),y=[];for(const t of v){const e=ln(u.lut,t),n=en(u.totalArc>0?e/u.totalArc:t,0,1),r={u:en(h(n),0,1),p:n,pos:nn(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=on(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?en((n.u-k)/(1-k),0,1):1,{left:o,right:s}=Be(b,r),a=0===e?A:t.length-1;o?t[a].e=o:delete t[a].e;const l=c+n.u*(f-c),u=zn(m,g,n.p,n.pos,n.rotateDeg,i);t.push(Nn(l,u)),b=s,k=n.u}}function Ln(t,e,n,r,o){const i=e-t,s=n-e,a=i-2*s+(r-n),l=2*(s-i),u=i;if(Math.abs(a)<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*a*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*a),h=(-l+f)/(2*a);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function Wn(t,e,n,r,o,i,s,a){const l=(t+e)/2,u=nn(r.P0,r.P1,r.P2,r.P3,t),c=nn(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=nn(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=nn(r.P0,r.P1,r.P2,r.P3,l),p=nn(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(Bn(d,u,c),Bn(h,u,c),Bn(p,u,c));let g=!0;if(o){const n=on(r.P0,r.P1,r.P2,r.P3,t),o=on(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,a=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-a);l>180&&(l=360-l),l>s&&(g=!1)}m<=i&&g||a.remaining<=0||f<1e-6?n.push(e):(a.remaining-=1,Wn(t,l,n,r,o,i,s,a),Wn(l,e,n,r,o,i,s,a))}function Bn(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 s=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(s)/Math.sqrt(i)}function Un(t,e){const n=Vn(t,e);return null!=n?n:t}function Vn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Vn(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 n=bn(o,t.transform),i=n.transform;if(i&&"object"==typeof i&&jn(i)){const t=_n(i,e);t!==i&&(r=w(A({},n),{transform:t}))}}if(!n&&!r)return null;const i=A({},t);return n&&(i.children=n),r&&(i.animate=r),i}var qn=1;function Gn(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=>Gn(t[n],e[n]))}function Zn(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,s=o[4]||0,a=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([s,a]),n.i.push([r,i]),n.o.push([s,a])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Kn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Jn(t){return"string"==typeof t&&void 0!==Kn(t)}function Hn(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const e=Kn(t.pathData);return e?{paths:Zn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&Jn(e[0])){const t=[];for(const n of e){const e=Kn(n);e&&t.push(...Zn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Jn(t[0])){const e=[];for(const n of t){const t=Kn(n);t&&e.push(...Zn(t))}return{paths:e}}return{paths:t}}return Jn(t)?{paths:Zn(Kn(t))}:t}function Xn(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 Qn(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Yn(t,e,n,r){var o,i;return"d"===t?{paths:De(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)}:Ge.has(t)?Fe(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?Te(e,n,r):Ze.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?ze(e||[],n||[],r):Te(+(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],s=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=Te(+(null!=r?r:0),+(null!=s?s:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=ze(r||t,s||t,n)}else o[i]=null!=s?s:r}return o}(e,n,r)}function $n(t,e,n,r){var o,i,s,a,l;const u=e.length-1,c=en(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.repeatAt===ct.start?e.slice(0,c+1):e.slice(u-c);const d=null!=(i=e[0].t)?i:0,h=null!=(s=e[e.length-1].t)?s:0;let p,m;n.repeatAt===ct.start?(p=0,m=d):(p=h,m=r);const g=m-p;if(g<=0)return e;const v=null!=(a=f[0].t)?a:0,y=(null!=(l=f[f.length-1].t)?l:0)-v;if(y<=0)return e;const b=f.map(t=>({relT:(t.t-v)/y,v:t.v,e:t.e,tangentIn:zt(t),tangentOut:Ft(t)})),k=Math.floor(g/y),j=g-k*y,x=j/y,O=[],S=n.repeatAt!==ct.start,P=e[e.length-1];let M,_=!1;function E(e,n,r){var o;let i;if(n){i=[];for(let t=b.length-1;t>=0;t--)i.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Ue(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else i=b;const s=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>s+1e-9){const o=i[n-1],a=r.relT-o.relT,l=(s-o.relT)/a,u=o.e?Le(o.e)(l):l,c=Yn(t,o.v,r.v,u),{left:f}=Be(o.e,l);return O.length>0&&o.relT<=s&&(O[O.length-1].e=f),void O.push({t:e+s*y,v:c,e:void 0})}const a=O.length>0?O[O.length-1]:P,l=S&&0===n&&void 0!==a&&Math.abs((null!=(o=a.t)?o:0)-(e+r.relT*y))<1e-9;if(l){if(Gn(a.v,r.v)){O.length>0?(a.e=r.e,a.tangentOut=r.tangentOut):(M=r.e,_=!0);continue}O.length>0&&(delete a.tangentIn,delete a.tangentOut)}const u={t:e+r.relT*y+(l?qn: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.repeatAt===ct.start){x>1e-9&&function(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Ue(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const s=o[n-1];if(s&&s.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-s.relT,o=(i-s.relT)/n,a=s.e?Le(s.e)(o):o,l=Yn(t,s.v,r.v,a),{right:u}=Be(s.e,o);O.push({t:e,v:l,e:u})}const a={t:e+(r.relT-i)*y,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(a.tangentIn=r.tangentIn),r.tangentOut&&(a.tangentOut=r.tangentOut),O.push(a)}}(p,n.direction===ft.alternate&&k%2==0,x);for(let t=0;t<k;t++){const e=k-1-t,r=n.direction===ft.alternate&&e%2==0;E(p+j+t*y,r)}}else{for(let t=0;t<k;t++){const e=n.direction===ft.alternate&&t%2==0;E(p+t*y,e)}if(x>1e-9){const t=n.direction===ft.alternate&&k%2==0;E(p+k*y,t,x)}}return n.repeatAt===ct.start?[...O,...e]:_&&e.length>0?[...e.slice(0,-1),w(A({},e[e.length-1]),{e:M}),...O]:[...e,...O]}function tr(t,e,n,r){var o;const i=e.keyframes||[],s=[];for(const e of i){const n=Nt(e);let i=Ct(e);const a=Tt(e);"d"===t&&(i=Hn(i));const l=Ye(t)?tn(t):t;Ge.has(l)&&(i=null!=(o=qe(i))?o:i);const u={t:n,v:i,e:Xn(a,r)},c=zt(e),f=Ft(e);c&&(u.tangentIn=c),f&&(u.tangentOut=f),s.push(u)}s.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const a=e.loop,l=!0===a?{}:a||void 0;return l&&s.length>=2?$n(t,s,l,n):s}function er(t,e,n){const r=e.loop;if(null==r||!1===r)return e;const o=!0===r?{}:r,i=e.keyframes;if(!Array.isArray(i)||i.length<2)return e;const s=Ye(t)?tn(t):t,a=Ge.has(s),l=i.map(e=>{var n;const r=Nt(e);let o=Ct(e);"d"===t&&(o=Hn(o)),a&&(o=null!=(n=qe(o))?n:o);const i={t:r,v:o,e:Tt(e)},s=zt(e),l=Ft(e);return s&&(i.tangentIn=s),l&&(i.tangentOut=l),i}),u={keyframes:$n(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function nr(t,e){const n=rr(t,e);return null!=n?n:t}function rr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=rr(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=er(n,o,e);i!==o&&(r||(r=A({},t)),r[n]=i)}}if(!n&&!r)return null;const i=A({},t);return n&&(i.children=n),r&&(i.animate=r),i}var or=0;function ir(t,e=it.native){const n=xt(t)||{},r=Pt(t),o=n.duration||1e3,i=[],s=(t,n,i)=>{if(0===n.length)return null;const s=function(t,e,n,r=it.native){const o={};for(const[i,s]of Object.entries(t)){if("transform"===i&&"offsetPath"===s.alongPathMode&&void 0!==t.offsetDistance)continue;const a=tr(i,s,e,n);if(a.length>0){const t={keyframes:a};void 0!==s.autoOrient&&(t.autoOrient=s.autoOrient),void 0!==s.loop&&(t.loop=s.loop),o[i]=r===it.native&&"transform"===i?_n(t):t}}return o}(bn(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(n),i),o,r,e);return 0===Object.keys(s).length?null:{id:t,animate:s}},a=function(t){var e;if(t)return null==(e=xt(t))?void 0:e.bindings}(t);if(a)for(const t of a){const e=t.target.startsWith("#")?t.target.slice(1):t.target,n=t.animateWith.map(t=>Qn(t,r)).filter(t=>!!t),o=s(e,n);o&&i.push(o)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++or;t.id=n;const o=s(n,function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=Qn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=Qn(r,e);t&&n.push(t)}else n.push(t);return n}(e,r),t.transform);o&&i.push(o)}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 sr(t,e,n){var r,o,i,s,a;const l=e.keyframes||[];if(0===l.length)return null;const{prevKf:u,nextKf:c}=function(t,e){var n,r;const o=t.length-1;let i=t[0],s=t[o>0?1:0];for(let a=0;a<o;a++){const l=null!=(n=t[a].t)?n:0,u=null!=(r=t[a+1].t)?r:0;if(l<=e&&e<=u){i=t[a],s=t[a+1];break}e>u&&a===o-1&&(i=t[o>0?o-1:0],s=t[o])}return{prevKf:i,nextKf:s}}(l,n);let f=u===c?0:(d=n,h=null!=(r=u.t)?r:0,(p=null!=(o=c.t)?o:0)===h?0:0+(d-h)/(p-h)*1);var d,h,p;f=en(f,0,1);const m=Tt(u);if(m&&Array.isArray(m))try{f=Le(m)(f)}catch(t){}let g=Ye(t)?tn(t):t,v=null;const y=null==u?void 0:u.v,b=null==c?void 0:c.v;if("d"===g)v=De(null!=(i=null==y?void 0:y.paths)?i:Array.isArray(y)?y:[],null!=(s=null==b?void 0:b.paths)?s:Array.isArray(b)?b:[],f).map(t=>Ce(t)).join("");else if(Ge.has(g))v=Ve(Fe(y||[0,0,0,1],b||[0,0,0,1],f)),g=t;else if("stroke-dasharray"===g)v=ze(y||[],b||[],f).join(" "),g=t;else if("transform"!==g||null===y||"object"!=typeof y||Array.isArray(y))"translate"===g?(v="translate("+ze(y||[0,0],b||[0,0],f).join(",")+")",g="transform"):"rotate"===g?(v="rotate("+Te(+(y||0),+(b||0),f)+")",g="transform"):"scale"===g?(v="scale("+ze(y||[1,1],b||[1,1],f).join(",")+")",g="transform"):v=Te(+(y||0),+(b||0),f);else{const t=new Set([...y?Object.keys(y):[],...b?Object.keys(b):[]]),n={};for(const e of t){const t=null==y?void 0:y[e],r=null==b?void 0:b[e];if("rotate"===e||"skew"===e)n[e]=Te(+(null!=t?t:0),+(null!=r?r:0),f);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=ze(t||o,r||o,f);n[e]=i}}if(jn(e)){const t=y.translate,r=b.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,e,n,r,o,i){const s=On(t,e,n,r),a=0===s.totalArc?o:function(t,e){const n=e*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(n<=0)return r[0];if(n>=o[i])return r[i];let s=1,a=i;for(;s<a;){const t=s+a>>>1;o[t]<n?s=t+1:a=t}const l=o[a-1],u=o[a]-l,c=u>0?(n-l)/u:0;return r[a-1]+c*(r[a]-r[a-1])}(s.lut,o),l=nn(s.P0,s.P1,s.P2,s.P3,a);if(!i)return{translate:l};const u=on(s.P0,s.P1,s.P2,s.P3,a);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}(u,c,[+t[0],+t[1]],[+r[0],+r[1]],f,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg+(null!=(a=n.rotate)?a:0))}}v=Je(n,{withUnits:!1}),g="transform"}return Ke.has(g)&&"number"==typeof v&&(v=100*v+"%"),{k:g,v:null===v?"":""+v}}function ar(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=sr(r,o,e);t&&(n[t.k]=t.v)}return n}var lr=48,ur=/[MmLlHhVvCcSsQqTtAaZz]/;function cr(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 fr(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,s=0,a=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const s=[o,i],a=an(s,t,e,r,lr);n.push({P0:s,P1:t,P2:e,P3:r,lut:a,len:a.ds[a.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];ur.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",g=t.toUpperCase();if("Z"!==g){if("M"===g){const e=h()+(n?o:0),r=h()+(n?i:0);o=e,i=r,s=e,a=r,d=t;continue}if("L"===g)m(h()+(n?o:0),h()+(n?i:0));else if("H"===g)m(h()+(n?o:0),i);else if("V"===g)m(o,h()+(n?i:0));else if("C"===g){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"===g){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"===g){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:s}=cr([o,i],t,e);p(r,s,e)}else if("T"===g){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:s}=cr([o,i],t,e);p(r,s,e)}else{if("A"!==g){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(s,a),o=s,i=a,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,s=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,a=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],s=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,s=o;for(;i<s;){const t=i+s>>>1;r[t]<e?i=t+1:s=t}const a=r[s-1],l=r[s]-a,u=l>0?(e-a)/l:0;return n[s-1]+u*(n[s]-n[s-1])}(o.lut,i):0,[a,l]=nn(o.P0,o.P1,o.P2,o.P3,s),[u,c]=on(o.P0,o.P1,o.P2,o.P3,s);return{x:a,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:s,sampleAtDistance(t){if(s&&r>0&&(t<0||t>r))return a((t%r+r)%r);if(!s&&(t<0||t>r)){const e=t<0?0:r,n=a(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 a((n=r,(e=t)<0?0:e>n?n:e));var e,n}}}function dr(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 hr(t){var e,n;if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const r=t,o=r.keyframes;if(o){const t={kind:"animated",keyframes:o.map(mr),autoOrient:r.autoOrient,loop:r.loop},n=null!=(e=r.value)?e:r.v;return void 0!==n&&"animated"===t.kind&&(t.base=n),t}const i=null!=(n=r.value)?n:r.v;if(void 0!==i)return{kind:"static",value:i}}return{kind:"static",value:t}}function pr(t,e,n,r){var o,i,s,a;const l=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=l(n.value));const u=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,c=A({},u||{}),f={keyframes:n.keyframes};void 0!==n.loop&&(f.loop=n.loop),void 0!==n.autoOrient&&(f.autoOrient=n.autoOrient),c[e]=f,t.animate=c;const d=null!=(a=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?a:null==(s=n.keyframes[0])?void 0:s.v;void 0!==d&&(t[e]=l(d))}function mr(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=A({},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 gr(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 vr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(vr);const e={};for(const n of Object.keys(t))e[n]=vr(t[n]);return e}function yr(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 br(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function kr(t){var e;const n=br(t.x),r=br(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 Ar(t,e){return"_lw_"+e+"_"+t.nextId++}function wr(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function jr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>jr(t,e))}var xr=vr,Or=.15;function Sr(t){const e=hr(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 Pr(t){let e=0,n=16;const r=t=>{var o;const i=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;i&&(n=Math.max(n,i));const s=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 Mr=t=>Math.round(1e3*t)/1e3;function _r(t,e,n){null!=n&&pr(t,e,hr(n),{asString:!0})}var Er=(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 Nr(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function Cr(t,e){let n="";for(let r=0;r<t.length;r++){const o=Nr(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function Tr(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var zr=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Fr(t,e,n=2){const r=[];let o;for(zr.lastIndex=0;null!==(o=zr.exec(t));)r.push(o[0]);let i="",s=0;const a=()=>parseFloat(r[s++]);for(;s<r.length;){const t=r[s++];if("M"===t||"L"===t){const[r,o]=Tr(e,a(),a());i+=t+Cr([r,o],n)}else if("C"===t){const[t,r]=Tr(e,a(),a()),[o,s]=Tr(e,a(),a()),[l,u]=Tr(e,a(),a());i+="C"+Cr([t,r,o,s,l,u],n)}else if("Q"===t){const[t,r]=Tr(e,a(),a()),[o,s]=Tr(e,a(),a());i+="Q"+Cr([t,r,o,s],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var Dr=16,Rr=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",gt,"xml:space"],Ir=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],Lr=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function Wr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function Br(t){return"string"==typeof t?t:void 0}function Ur(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of Lr)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function Vr(t,e){var n,r,o,i,s,a,l,u,c,f;const d="text"===t.type,h=t.style,p=e=>{var n;return d?void 0:null!=(n=t[e])?n:null==h?void 0:h[e]},m={fontFamily:null!=(n=Br(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Wr(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(s=t.strokeWidth)?s:e.strokeWidth,letterSpacing:null!=(a=Wr(t.letterSpacing))?a:e.letterSpacing,wordSpacing:null!=(l=Wr(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=Wr(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:Ur(t))?c:e.animate};for(const t of Ir){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function qr(t){var e,n,r;return{fontFamily:Br(t.fontFamily),fontSize:null!=(e=Wr(t.fontSize))?e:Dr,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Wr(t.letterSpacing))?n:0,wordSpacing:null!=(r=Wr(t.wordSpacing))?r:0}}function Gr(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&1!==t.opacity&&(e.opacity=t.opacity);for(const n of Ir)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function Zr(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 Kr(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}var Jr=.6,Hr="px-missing-glyph";function Xr(t,e){if(t<=0||e<=0)return"";const n=.08*t,r=.92*t,o=.92*-e,i=r-n,s=-o,a=Math.max(1,.12*Math.min(i,s)),l="M"+n+" 0L"+r+" 0L"+r+" "+o+"L"+n+" "+o+"Z";if(i<=2*a||s<=2*a)return l;const u=n+a,c=r-a,f=-a,d=o+a;return l+"M"+u+" "+f+"L"+u+" "+d+"L"+c+" "+d+"L"+c+" "+f+"Z"}function Qr(t,e,n,r,o=0){const{x:i,y:s,angle:a}=t.sampleAtDistance(e),l=Math.cos(a),u=Math.sin(a),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,s-n*u*c+o*l]}function Yr(t){var e;const n=hr(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 $r=48,to=64;function eo(t,e){const n=b(10,e);return Math.round(t*n)/n}function no(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(e.opacity=t.opacity);for(const n of Ir)void 0!==t[n]&&(e[n]=t[n]);return e}function ro(t){return t?{[vt]:Hr}:{}}function oo(t,e,n){if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const r=new Map;for(const e of t){const t=JSON.stringify([e.paint,!!e.isMissing]),n=Fr(e.glyphD,e.m),o=r.get(t);o?o.d+=n:r.set(t,{paint:e.paint,d:n,isMissing:e.isMissing})}const o=[];for(const{paint:t,d:n,isMissing:i}of r.values())o.push(e("path",A(A(A({d:n},no(t)),ro(i)),void 0!==t.animate?{animate:A({},t.animate)}:{}),[]));return o}function io(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=A({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function so(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=lo(r,e.origin,!0),r=ao(r,"scale",e.scale),r=ao(r,"skew",e.skew),r=ao(r,"rotate",e.rotate),r=lo(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=lo(r,e.origin,!0),r=ao(r,"translate",e.translate),r=lo(r,e.origin,!1)):r=ao(r,"translate",e.translate),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function ao(t,e,n,r){if(void 0===n)return t;const o=hr(n);if("static"===o.kind)return{type:"g",transform:{value:dr(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>gr(t,dr(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 lo(t,e,n){if(void 0===e)return t;const r=hr(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=>gr(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function uo(t,e,n){var r,o,i;if("use"===t.type&&"translate"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.without)){const r=wr(t.effects.clone.source);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>uo(t,e,n))}function co(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 fo(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 ho(t,e,n,r){if(!e)return t;const o=Ar(n,"grad"),i=function(t,e){const n={type:t.type===jt.radial?"radialGradient":"linearGradient",id:e};return t.type===jt.linear?(po(n,"x1","y1",t.start),po(n,"x2","y2",t.end)):(po(n,"cx","cy",t.center),function(t,e,n){const r=hr(n);"absent"!==r.kind&&pr(t,"r",r,{asString:!0})}(n,0,t.radius),po(n,"fx","fy",t.focal)),t.gradientUnits&&(n.gradientUnits=t.gradientUnits),t.spreadMethod&&(n.spreadMethod=t.spreadMethod),t.gradientTransform&&(n.gradientTransform=t.gradientTransform),n.children=function(t){var e,n;if(!t)return[];const r=hr(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(mo):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let s=0;for(const t of o){const e=Ct(t);Array.isArray(e)&&e.length>s&&(s=e.length)}if(!s)return[];const a=Ct(o[0]),l=[];for(let t=0;t<s;t++){const r=null!=(n=null!=(e=null==a?void 0:a[t])?e:go(o,0,t))?n:{offset:t/Math.max(1,s-1),color:"#000000"};l.push({offset:r.offset,color:r.color})}return l.map((t,e)=>function(t,e,n,r,o){var i;const s=[],a=[];let l=!1;for(const r of e){const o=Nt(r),u=Ct(r),c=null!=(i=null==u?void 0:u[n])?i:go(e,e.indexOf(r),n);if(!c)continue;const f=Tt(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),s.push(d);const h={time:o,value:c.offset};void 0!==f&&(h.easing=f),a.push(h),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:vo(t.offset),stopColor:t.color},c={};return s.length&&(c.stopColor={keyframes:s},void 0!==o&&(c.stopColor.loop=o)),l&&a.length&&(c.offset={keyframes:a},void 0!==o&&(c.offset.loop=o)),Object.keys(c).length&&(u.animate=c),u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function po(t,e,n,r){var o,i,s;const a=hr(r);if("absent"===a.kind)return;if("static"===a.kind)return t[e]=String(a.value[0]),void(t[n]=String(a.value[1]));const l=t=>{const e={keyframes:a.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!==a.loop&&(e.loop=a.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(s=a.base)?s:null==(i=a.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function mo(t){return{type:"stop",offset:vo(t.offset),stopColor:t.color}}function go(t,e,n){for(let r=e;r>=0;r--){const e=Ct(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=Ct(t[r]);if(null==e?void 0:e[n])return e[n]}}function vo(t){return Math.round(1e3*t)/10+"%"}function yo(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function bo(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=hr(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=ko(o,"translate",e.translate,void 0),o=ko(o,"rotate",e.rotate,r),o=ko(o,"scale",e.scale,r),o}function ko(t,e,n,r,o){if(void 0===n)return t;const i=hr("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:dr(e,Ao(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=gr(t,dr(e,Ao(e,t.value),r));return"translate"===e?A(A({},n),wo(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Ao(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function wo(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 jo(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function xo(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 Oo(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=So(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function So(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 Po(t,e){var n,r,o;const i=t.transform,s=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!s)return;const a={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,s=!1,a=!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,s=!0):a=!0}return a&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t),s?[o,i]:void 0}(i,e);t&&(a.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(a.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(s&&Array.isArray(s.keyframes)){const t=s.keyframes,i=[];for(const s of t){const t=null!=(n=s.value)?n:s.v,a=null!=(o=null!=(r=s.time)?r:s.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:a,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&&(a.translateKeyframes=i)}return a.translate||a.translateKeyframes?a:void 0}function Mo(t,e,n){if(!e)return;const r=wr(e.source);if(!r)return void(e.without===pt.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===pt.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function _o(t,e){const n={};return void 0!==t.translate&&(n.translate=Eo(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=Eo(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=Eo(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){return Eo(t,t=>[Math.pow(t[0],e),Math.pow(t[1],e)],!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function Eo(t,e,n=!1){const r=hr(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return"number"!=typeof t&&!Array.isArray(t)||n?{value:o}:o}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?w(A({},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}var No=!1;function Co(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}var To=1;function zo(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-To),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+To,value:0}],s=A({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[s],t.animate={opacity:{keyframes:i}}}function Fo(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Do(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function Ro(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 Io(t,e,n){const r=wr(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Lo(r,e,n,new Set);if(o)if(No){const e=n.idMap.get(o);t.type="g",delete t.href,t.children=[e],kr(t),n.defs=n.defs.filter(t=>t!==e)}else t.href="#"+o}function Lo(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=xr(o);if(function(t,e){yr(t,()=>Ar(e,"retimed"))}(i,n),"use"===o.type?Bo(i,e.start,e.stretch):Wo(i,e.start,e.stretch),Ro(i),"use"===o.type&&o.href){const s=wr(o.href);if(s){const a=Do(o),l=a?Fo(Co(a),e):e,u=new Set(r);u.add(t);const c=Lo(s,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var s;const a=Do(t);if("use"===t.type&&a&&t.href){const i=wr(t.href);if(i){const s=Fo(Co(a),e),l=new Set(r);l.add(o);const u=Lo(i,s,n,l);u&&(t.href="#"+u)}Ro(t)}null==(s=t.children)||s.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 Wo(t,e,n){var r;Bo(t,e,n),null==(r=t.children)||r.forEach(t=>Wo(t,e,n))}function Bo(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)}}function Uo(t,e){const n=w(A({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Vo(t,e,n,r,o,i,s,a){const l=Go(r,n,o),u=Zo(n,o),c=Jo(i,l),f=Jo(s,u),d=Qo(s),h={type:"path",d:Ce(e)};return Ho(h,"strokeDasharray",f),Ho(h,"strokeDashoffset",c),Ho(h,"strokeOpacity",d),[h]}var qo=1;function Go(t,e,n){const[r]=Ko(n);return n=>e*(-n-r+t)+qo}function Zo(t,e){const[n,r]=Ko(e),o=r-n+1;return e=>{const n=en(e[0],0,1),r=en(e[1],0,1),i=Math.min(n,r),s=Math.max(n,r),a=[0];let l=qo;for(let e=0;e<o;e++)a.push(l+i*t),a.push((s-i)*t),l=(1-s)*t;return a.push(l+qo),a}}function Ko(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Jo(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:Nt(t),value:e(Ct(t)),easing:Tt(t)})),loop:t.loop}}function Ho(t,e,n){n&&pr(t,e,n)}var Xo=10;function Qo(t){const e=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return e(t.value)?{kind:"static",value:0}:void 0;const n=t.keyframes;let r=!1,o=!0;for(const t of n)e(Ct(t))?r=!0:o=!1;if(!r)return;if(o)return{kind:"static",value:0};const i=[];for(let t=0;t<n.length;t++){const r=n[t],o=t>0?n[t-1]:void 0,s=t<n.length-1?n[t+1]:void 0,a=Nt(r),l=e(Ct(r)),u=o?l&&e(Ct(o)):l,c=s?l&&e(Ct(s)):l;u&&!c?(i.push({time:a,value:0}),i.push({time:a+Xo,value:1})):!u&&c&&(i.push({time:a-Xo,value:1}),i.push({time:a,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function Yo(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 s=n(o);if(0===s)return o;if(i*s>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 $o(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 ti(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+=ei(t,r,r+1);return t.c&&e.length>1&&(n+=ei(t,e.length-1,0)),n}function ei(t,e,n){var r,o,i,s;const a=t.v,l=a[e],u=a[n],c=an(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(s=null==(i=t.i)?void 0:i[n])?s:u,u);return c.ds[c.ds.length-1]}var ni=.5522847498307936;function ri(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:at(null==(e=xt(t))?void 0:e.engine),glyphs:null==(n=Pt(t))?void 0:n.fonts},o=xr(t);jr(o,r.idMap),uo(o,r,()=>Ar(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const s=wr(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof s){n.add(t);const r=e.idMap.get(s);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=Po(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(),jr(t,e.idMap);const n=[],r=t=>{var e;Do(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 s;if(o){if(o!==t&&Do(o)&&n++,"use"===o.type&&o.href){const t=wr(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(s=o.children)||s.forEach(i)}},s=wr(t.href);s&&(r.add(s),i(e.idMap.get(s))),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=Do(t);if(!n)continue;const r=n.timeCrop;Ro(t),Io(t,Co(n),e),r&&zo(t,r,e)}}(t,e),t}(oi(o,r),r);return function(t,e){e.length&&(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function oi(t,e){t.children&&(t.children=t.children.map(t=>oi(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:s,maskedBy:a,clipPath:l,strokeTrim:u,clone:c,fillGradient:f,strokeGradient:d,textPath:h,text:p}=null!=n?n:{};n&&delete t.effects;let m=t,g=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.pathData?h.pathData:void 0,n=function(t,e,n,r,o,i){return e.glyphs?function(t,e,n,r,o,i){const{glyphs:s,create:a=Er,warnings:l}=r,u=e?fr(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=Kr(s),{cells:f,width:d}=function(t,e,n,r){const o=[];let i=0;const s=(t,a)=>{var l,u;const c=Vr(t,a),f=Br(t[gt]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=Zr(c,e,n,r);if(t){const e=c.fontSize/t.unitsPerEm,n=null!=(u=t.ascent)?u:.9*t.unitsPerEm,r=Gr(c);for(let s=0;s<f.length;s++){const a=f.charAt(s),l=t.glyphs[a];if(l&&l.pathData){const t=l.width*e;o.push({glyphD:l.pathData,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(a)){const s=l&&l.width>0?l.width:Jr*t.unitsPerEm,a=s*e;o.push({glyphD:Xr(s,n),widthEm:s,scale:e,paint:r,isMissing:!0,midBase:i+a/2}),i+=a}else i+=(l?l.width:0)*e;i+=c.letterSpacing+(" "===a?c.wordSpacing:0)}}}if(t.children)for(const e of t.children)s(e,c)};return s(t,qr(t)),{cells:o,width:i}}(t,s,c,l);if(!f.length)return io(t,[],a);const{along:h,perp:p}=function(t){var e,n,r;return{along:(null!=(e=Wr(t.x))?e:0)+(null!=(n=Wr(t.dx))?n:0),perp:null!=(r=Wr(t.dy))?r:0}}(t),m=Yr(n),g=Yr(o),v=t=>t>0&&d>0?t/d:1,y="clip"===i&&!u.closed;if(m.animated||g.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(m.times,g.times),n=(t,e)=>h+m.at(e)+v(g.at(e))*t.midBase,r=m.animated?m.loop:g.loop;return io(t,function(t,e,n,r,o,i,s,a=0){const l=Math.max(e.totalLength/$r,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const f of t){const t=[f.scale,0,0,f.scale,-f.scale*(f.widthEm/2),0],d=Fr(f.glyphD,t),h=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),s=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[eo(r-a*l,3),eo(o+a*s,3)],rotate:eo(180*i/Math.PI,3)}}},p=[],m=[],g=(t,e)=>{p.push(h(t,e)),s&&m.push({time:e,value:u(t)?1:0})};g(n(f,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(f,e),s=n(f,o),a=Math.min(to,Math.max(1,Math.ceil(Math.abs(s-i)/l)));for(let t=1;t<=a;t++){const r=e+t/a*(o-e);g(n(f,r),r)}}En(p);const v={keyframes:p};void 0!==o&&(v.loop=o);const y={transform:v};if(f.paint.animate&&Object.assign(y,f.paint.animate),s&&m.some(t=>0===t.value)){const t={keyframes:m};void 0!==o&&(t.loop=o),y.opacity=t}c.push(i("path",w(A(A({d:d},no(f.paint)),ro(f.isMissing)),{animate:y}),[]))}return c}(f,u,n,e,r,a,y,p),a)}const b=v(g.at(0)),k=h+m.at(0);return io(t,oo((y?f.filter(t=>{const e=k+t.midBase*b;return e>=0&&e<=u.totalLength}):f).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:Qr(u,k+t.midBase*b,t.scale,t.widthEm,p)})),a,l),a)}(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.fonts"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,g=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?function(t,e){var n,r,o;const{glyphs:i,create:s=Er,warnings:a}=e,l=Kr(i),u={x:null!=(n=Wr(t.x))?n:0,y:null!=(r=Wr(t.y))?r:0},c=[],f=[{start:u.x,end:u.x}];let d=0;const h=(t,e)=>{var n;const r=Zr(e,i,l,a),o=(null==r?void 0:r.unitsPerEm)||1e3,s=e.fontSize/o,h=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=Gr(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),a=null==r?void 0:r.glyphs[i];if(a&&a.pathData)c.push({glyphD:a.pathData,m:[s,0,0,s,u.x,u.y],paint:p,line:d,x:u.x,y:u.y,scale:s}),u.x+=a.width*s;else if(/\S/.test(i)){const t=a&&a.width>0?a.width:Jr*o;c.push({glyphD:Xr(t,h),m:[s,0,0,s,u.x,u.y],paint:p,isMissing:!0,line:d,x:u.x,y:u.y,scale:s}),u.x+=t*s}else u.x+=(a?a.width:0)*s;u.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),f[d].end=u.x}},p=(t,e)=>{var n,r,o;const i=Vr(t,e),s=Wr(t.x),a=Wr(t.y);void 0!==s&&(u.x=s,d=f.length,f.push({start:u.x,end:u.x})),void 0!==a&&(u.y=a),u.x+=null!=(n=Wr(t.dx))?n:0,u.y+=null!=(r=Wr(t.dy))?r:0;const l=Br(t[gt]);if(l&&!(null==(o=t.children)?void 0:o.length)&&h(l,i),t.children)for(const e of t.children)p(e,i)},m=qr(t);if(t.children)for(const e of t.children)p(e,m);const g=Br(t[gt]);g&&!(null==(o=t.children)?void 0:o.length)&&h(g,m);const v=Br(t.textAnchor);if("middle"===v||"end"===v)for(const t of c){const e=f[t.line].end-f[t.line].start,n="middle"===v?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return io(t,oo(c,s,a),s)}(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.fonts — left as native <text>"),t):t}(m,p,e),g=!0;return g||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.pathData||!e.pathData)return t;const o=Ar(n,"tpath"),{d:i,startShift:s}=function(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=fr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=Or*o,s=Sr(e.startOffset),a=Sr(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-s.min),u=Math.max(0,s.max+a-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"+Mr(e)+","+Mr(n)+"L"+Mr(d.x)+","+Mr(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"+Mr(t)+","+Mr(e)}return{d:p,startShift:c}}(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:Pr(t)});n.defs.push({type:"path",id:o,d:i});const a={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(a.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(a.method=e.method),void 0!==e.spacing&&(a.spacing=e.spacing),_r(a,"startOffset",function(t,e){if(!e||null==t)return t;const n=hr(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=>w(A({},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}(e.startOffset,s)),_r(a,"textLength",e.textLength),t.children=[a],t}(m,h,e)),m=function(t,e,n){return ho(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return ho(t,e,n,"stroke")}(m,d,e),m=function(t,e){if(!e)return t;const n=e.subPaths===mt.combined,r=[],o=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)o(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,s,a,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),s=Number(null!=(n=t.y)?n:0),a=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+a)+","+s+"L"+(i+a)+","+(s+l)+"L"+i+","+(s+l)+"L"+i+","+s+"L"+(i+a)+","+s+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(s=t.cy)?s:0),r="circle"===t.type?Number(null!=(a=t.r)?a: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*ni,d=o*ni,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}}(t);if(void 0===e)return;const n=Zn(e);if(!n.length)return;const i={leaf:t,subpaths:[]};for(const t of n){const e=ti(t);i.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}r.push(i)};if(o(t),!r.length)return t;let i=0;const s=n?[...r].reverse():r;for(const t of s)for(const e of t.subpaths)n||(i=0),e.startOffsetPx=i,i+=e.lengthPx;const a=i;if(n&&a<.001)return t;const l=hr(e.offset),u="absent"===l.kind?{kind:"static",value:0}:l,c=function(t){const e=hr(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:Nt(t),value:Ct(t),easing:Tt(t)}));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=Yo(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 s=0;for(const t of n){for(;s<o.length&&o[s]<t.time;){const t=o[s++],e=$o(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(;s<o.length;){const t=o[s++],e=$o(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),f="absent"===c.kind?{kind:"static",value:[0,1]}:c,d=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=Ct(n);"number"==typeof t&&e.push(t)}return e}(u),h=[d.length?Math.min(...d):0,d.length?Math.max(...d):0];if(1===r.length&&r[0].leaf===t&&1===r[0].subpaths.length){const e=r[0],o=e.subpaths[0],i=n?a:o.lengthPx;if(i<.001)return t;const s=n?o.startOffsetPx/i:0;return function(t,e,n,r,o,i){const s=Go(n,e,r),a=Zo(e,r),l=A({},t);return delete l.effects,Ho(l,"strokeDasharray",Jo(i,a)),Ho(l,"strokeDashoffset",Jo(o,s)),Ho(l,"strokeOpacity",Qo(i)),l}(e.leaf,i,s,h,u,f)}const p=new Map;for(const t of r){const e=[];for(const r of t.subpaths){const o=n?a:r.lengthPx;if(o<.001)continue;const i=n?r.startOffsetPx/o:0;e.push(...Vo(t.leaf,r.subpath,o,i,h,u,f))}p.set(t.leaf,Uo(t.leaf,e))}const m=t=>p.get(t)||(Array.isArray(t.children)&&t.children.length>0?w(A({},t),{children:t.children.map(m)}):t);return m(t)}(m,u),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const s=t.transform,a=null==(o=t.animate)?void 0:o.transform,l=xr(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const n=xr(l),r=_o(e,t),o=r?so(n,r):n;u.push(o)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==s&&(c.transform=s),void 0!==a&&(c.animate={transform:a}),c}(m,s,e),m=function(t,e,n,r){if(!e)return t;const o=wr(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=Ar(r,"mask");let s={type:"use",href:"#"+o};if(n)s=bo(s,n,r);else if(jo(t))s=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 s=[],a=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=gr(t,void 0);if(Array.isArray(e.translate)&&s.push(w(A(A({},r),wo(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]]),a.push(w(A({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(w(A({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;return s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]}),a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]}),l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]}),f}(s,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,s,a,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const g=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:m[1],args:t})}if(!g.length)return;const v=g[g.length-1];if("translate"===v.name)for(let t=g.length-2;t>=0;t--){const c=g[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=v.args[0])?r:0,p=null!=(o=v.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"===g[e].name){const t=null!=(i=g[e].args[0])?i:0,n=null!=(s=g[e].args[1])?s:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)m.rotate=(null!=(a=m.rotate)?a: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 g)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};return y&&(A.translate=y),void 0!==b&&(A.rotate=b),k&&(A.scale=k),Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}}(t);e&&(s=bo(s,e,r))}const a=void 0===n&&!function(t){return"string"==typeof t.transform||!(!t.transform||"object"!=typeof t.transform)||jo(t)}(t);s=function(t,e,n,r,o){const i=r.idMap.get(n),s=r.maskAncestorChains.get(e)||[],a=o?Po(e,r):void 0,l=a?[...s,a]:s,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=xo(l),n=xo(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}return{type:"g",animate:{transform:{keyframes:Array.from(c).sort((t,e)=>t-e).map(t=>{const e=Oo(l,t),n=Oo(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(s,t,o,r,a);const l={type:"mask",id:i,children:[s]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}(m,a,i,e),m=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=Ar(n,"clip"),o={type:"path"},i=hr(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=yo(i.value):(pr(o,"d",i),void 0!==o.d&&(o.d=yo(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(Mo(m,c,e),m=function(t,e,n,r){const o=function(t,e){var n,r,o;const i={};let s=!1;const a=null==(n=t.animate)?void 0:n.transform;if(a&&"object"==typeof a&&Array.isArray(a.keyframes)){const e=a.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=fo(a),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})};a.autoOrient&&(r.autoOrient=!0);const o=a.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}s=!0}}const l=void 0!==(null==e?void 0:e.translate),u=s||l,c=s&&fo((null==(r=t.animate)?void 0:r.transform)||void 0)||s&&fo((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=co(i.full),r=co(o.full),s=-n[0],a=-n[1],l=r[0]-s,u=r[1]-a;return 0===l&&0===u?{rest:t}:{translate:"translate("+l+","+u+")",rest:"translate("+s+","+a+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const s=[];let a=0;for(;a<e.length&&"translate"===e[a].name;)s.push(e[a].full),a++;if(!s.length)return{rest:t};const l=e.slice(a).map(t=>t.full).join("");return{translate:s.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:(function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)||c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform))&&delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){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=A({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:s}=function(t){if(!t)return{};const e=fo(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};return void 0!==t.translate&&(r.translate=t.translate),e&&void 0!==t.origin&&(r.origin=t.origin),void 0!==t.rotate&&(o.rotate=t.rotate),void 0!==t.scale&&(o.scale=t.scale),void 0!==t.skew&&(o.skew=t.skew),void 0===t.origin||e&&!n||(o.origin=t.origin),{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let a=t;a=so(a,s);let l={type:"g",id:n,children:[{type:"g",id:r,children:[a]}]};return void 0!==o.transform&&(l.transform=o.transform),void 0!==o.animate&&(l.animate=o.animate),i&&(delete l.id,l=so(l,i),l.id=n),l}(m,i,r,o)):m=function(t,e,n,r){return Mo(t,e,r),so(t,n)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}function ii(t,e,n,r,o){const i=1-o,s=i*i*i,a=3*i*i*o,l=3*i*o*o,u=o*o*o;return[s*t[0]+a*e[0]+l*n[0]+u*r[0],s*t[1]+a*e[1]+l*n[1]+u*r[1]]}function si(t,e,n,r,o=64){let i=0,s=t;for(let a=1;a<=o;a++){const l=ii(t,e,n,r,a/o);i+=Math.hypot(l[0]-s[0],l[1]-s[1]),s=l}return i}var ai=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function li(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function ui(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function ci(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 fi(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const s=ui(t.href);if(s&&n.has(s)){const a=e.get(s);if(a)return function(t,e,n,r,o,i,s){var a,l,u,c;const f=vr(e);yr(f,o);const d="symbol"===f.type?ci(f.viewBox):void 0,h=null!=(l=null!=(a=li(t.width))?a:null==d?void 0:d[2])?l:s[0],p=null!=(c=null!=(u=li(t.height))?u:null==d?void 0:d[3])?c:s[1],m="symbol"===f.type?function(t,e,n,r,o){const i=ci(t.viewBox),s=w(A({},t),{type:"g"});if(delete s.viewBox,delete s.preserveAspectRatio,delete s.width,delete s.height,!i)return s;const[a,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,h=(o-c*f)/2,p=[];0===d&&0===h||p.push("translate("+d+","+h+")"),1!==f&&p.push("scale("+f+")"),0===a&&0===l||p.push("translate("+-a+","+-l+")"),p.length&&(s.transform=p.join(""));const m=e();return n.push({type:"clipPath",id:m,children:[{type:"rect",x:a,y:l,width:u,height:c}]}),s.clipPath="url(#"+m+")",s}(f,o,i,h,p):f,g=fi(m,n,r,o,i,s),v=w(A({},t),{type:"g",children:[g]});return delete v.href,delete v.width,delete v.height,kr(v)}(t,a,e,n,r,o,i)}}if(!t.children)return t;let s=!1;const a=t.children.map(t=>{const a=fi(t,e,n,r,o,i);return a!==t&&(s=!0),a});return s?w(A({},t),{children:a}):t}var di="transform",hi=new Set(["reverse","alternate-reverse"]),pi="__px_rest_";function mi(t,e){if(void 0!==t[e])return!1;if(Ze.has(e))return!1;if(e===di)for(const e of Ze)if(void 0!==t[e])return!1;return!0}function gi(t,e,n){const r=Object.values(ar({[e]:t[e]},n));return 1===r.length&&""!==r[0]?r[0]:void 0}function vi(t,e){const n=_e(t),r=new Map;for(const[t,e]of yi(n))void 0===e.id&&(e.id=pi+t),r.set(String(e.id),t);const o=new Map;for(const t of ir(n,e)){const e=r.get(t.id);void 0!==e&&o.set(e,t.animate)}return o}function yi(t){const e=new Map;let n=0;const r=t=>{if(t.animate&&e.set(String(n++),t),t.children)for(const e of t.children)r(e)};if(t.children)for(const e of t.children)r(e);return e}function bi(t,e,n){var r,o;let i=ri(t).root;return i=function(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=Ct(o[0]),s=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],a=[];let l=!1;for(const t of o){const n=Ct(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>t!==At.translate&&t!==At.origin&&t!==At.rotate))return;if(void 0!==(null==n?void 0:n.rotate)){if(0!==n.rotate)return;l=!0}const o=null!=(e=null==n?void 0:n.origin)?e:[0,0];if(o[0]!==s[0]||o[1]!==s[1])return;a.push([r[0]+s[0],r[1]+s[1]])}if(!o.some(t=>zt(t)||Ft(t)))return;let u="M"+ai(a[0][0])+","+ai(a[0][1]);const c=[];for(let t=0;t<a.length-1;t++){const e=a[t],i=a[t+1],s=null!=(n=Ft(o[t]))?n:[0,0],l=null!=(r=zt(o[t+1]))?r:[0,0],f=[e[0]+s[0],e[1]+s[1]],d=[i[0]+l[0],i[1]+l[1]];u+="C"+ai(f[0])+","+ai(f[1])+","+ai(d[0])+","+ai(d[1])+","+ai(i[0])+","+ai(i[1]),c.push(si(e,f,d,i))}const f=c.reduce((t,e)=>t+e,0);if(!(f>0))return;const d=[];let h=0;for(let t=0;t<o.length;t++){t>0&&(h+=c[t-1]);const e={t:Nt(o[t]),v:h/f},n=Tt(o[t]);void 0!==n&&(e.e=n),d.push(e)}return{pathStr:u,distanceKfs:d,autoOrient:!!t.autoOrient,anchor:s,keyframesCarryRotate:l}}(i);if(e){const n=A({},o);delete n[yt];const s={keyframes:e.distanceKfs};void 0!==i.loop&&(s.loop=i.loop),n[bt]=s;const a=t.transform;let l=a;if(a&&"object"==typeof a){const t=A({},a);delete t[At.translate],delete t[At.origin],e.keyframesCarryRotate&&delete t[At.rotate],l=Object.keys(t).length?t:void 0}r=w(A({},t),{animate:n,style:w(A({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:ai(e.anchor[0])+"px "+ai(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==l?r.transform=l:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=w(A({},r),{children:t}))}return r};return e(t)}(i),i=nr(i,null!=(o=null==(r=xt(i))?void 0:r.duration)?o:Xe),e===it.native&&(i=Un(i,null==n?void 0:n.motionPath),i=function(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 s=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){s=!0;break}if(!s&&t.children)for(const e of t.children)if(o(e,r)){s=!0;break}if(!s&&"use"===t.type&&"string"==typeof t.href){const n=ui(t.href),i=n?e.get(n):void 0;i&&(s=o(i,r))}return r.delete(t),n.set(t,s),s};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=ci(t.viewBox);if(e)return[e[2],e[3]];const n=li(t.width),r=li(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),s=[],a=fi(t,n,r,()=>"_lw_use_mat_"+ ++o,s,i);if(0===s.length)return a;const l={type:"defs",children:s},u=[...null!=(e=a.children)?e:[],l];return w(A({},a),{children:u})}(i),i=function(t){const e=(t,n)=>{var r;n(t),null==(r=t.children)||r.forEach(t=>e(t,n))};let n=!0;for(;n;){n=!1;const r=new Set;e(t,t=>{var e;"use"===t.type&&"string"==typeof t.href&&r.add((e=t.href).startsWith("#")?e.slice(1):e)}),e(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!r.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,n=!0)})}return t}(i)),i=function(t,e){var n;const r=_e(t),o=xt(r)||{},i=+(o.duration||Xe),s=hi.has(String(o.direction))?i:0,a=yi(r);if(!a.size)return r;const l=vi(r,e),u=new Map;for(const[t,e]of l){const r=a.get(t);if(r)for(const o of Object.keys(e)){if(!mi(r,o))continue;const i=gi(e,o,s);void 0!==i&&(r[o]=i,u.set(t,[...null!=(n=u.get(t))?n:[],o]))}}if(u.size){const t=vi(r,e);for(const[e,n]of u){if(JSON.stringify(t.get(e))===JSON.stringify(l.get(e)))continue;const r=a.get(e);if(r)for(const t of n)delete r[t]}}return r}(i,e),i}var ki=(t=>(t[t.buildFailed=1001]="buildFailed",t[t.invalidDocumentAtSrc=1002]="invalidDocumentAtSrc",t[t.loadFailed=1003]="loadFailed",t[t.animationBuildFailed=1004]="animationBuildFailed",t[t.effectsShape=1101]="effectsShape",t[t.timelineOverrideIgnored=1102]="timelineOverrideIgnored",t[t.blockedTag=1103]="blockedTag",t[t.unsupportedAnimatedAttrs=1104]="unsupportedAnimatedAttrs",t[t.noBindings=1105]="noBindings",t[t.unresolvedBinding=1106]="unresolvedBinding",t[t.triggersNoRoot=1201]="triggersNoRoot",t[t.noRootForSelector=1202]="noRootForSelector",t[t.noRootElement=1203]="noRootElement",t[t.noElementsForSelector=1206]="noElementsForSelector",t[t.setAttributeNoElement=1207]="setAttributeNoElement",t[t.scrollSmoothingNeedsOwnDriver=1301]="scrollSmoothingNeedsOwnDriver",t[t.scrollNativeUnavailable=1302]="scrollNativeUnavailable",t[t.scrollSubjectInvalid=1303]="scrollSubjectInvalid",t[t.scrollSubjectNoMatch=1304]="scrollSubjectNoMatch",t[t.scrollNoRootToObserve=1305]="scrollNoRootToObserve",t[t.scrollTriggerIgnored=1306]="scrollTriggerIgnored",t[t.rateRejected=1401]="rateRejected",t[t.controlPropsConflict=1501]="controlPropsConflict",t[t.rnCompileFailed=1601]="rnCompileFailed",t[t.rnRenderFailed=1602]="rnRenderFailed",t[t.rnBoundaryCaught=1603]="rnBoundaryCaught",t[t.rnUnsupported=1604]="rnUnsupported",t))(ki||{}),Ai={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"},wi="https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";function ji(t){return"PX"+t+" "+wi+"#px"+t}function xi(t,e){const n=e?e+" ":"";return{warn:(e,r,...o)=>{const i=ji(r);(null==t?void 0:t.onWarn)?t.onWarn({code:r,kind:e,data:o,message:i}):(null==t?void 0:t.muteWarn)||console.warn(n+e+" "+i,...o)},error:(e,r,...o)=>{const i=ji(r),s=function(t){return t.find(t=>t instanceof Error)}(o);(null==t?void 0:t.onError)?t.onError({code:r,kind:e,data:o,message:i,error:s}):(null==t?void 0:t.muteError)||console.error(n+e+" "+i,...o)}}}var Oi=6,Si="setPlaybackRate: rate must be finite and non-zero";function Pi(t){return Number.isFinite(t)&&0!==t}function Mi(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function _i(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function Ei(t,e,n){const r=Mi(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function Ni(t,e,n){const r=Mi(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function Ci(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function Ti(t,e,n){var r;const o=xt(t)||{},i=ir(t,it.js),s=o.iterations;let a=1;"number"==typeof s&&(a=s||1),"infinite"===s&&(a=1/0),a<1&&(a=1);const l=+(o.duration||Xe),u=l&&a?l*(a===1/0?1/0:a):l?(null!=a?a: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,g=-(o.delay||0),v=0,y=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let w=0;const j=()=>{const t=v?(Date.now()-v)*y:0;return g+t},x=()=>{let t=j();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;l>0?(t=en(t,0,a*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,a-1),n=en((t-r*e)/e,0,1)):n=t;const o=c||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=ar(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(x()):h&&O(0));const S=()=>!!m&&!!e.isConnected()&&(y<0?j()>0:!(Number.isFinite(u)&&x()>=u)),P=t=>{null!==p&&(Ci(p),p=null),(t||S())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void M();const o=x(),i=j();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return M(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return M(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(w&&t-w<A)return;w=t}O(o)}})(),P()}))},M=()=>{if(!m)return;let t=j();Number.isFinite(u)&&t>u&&(t=u),g=t,v=0,m=!1,null!==p&&(Ci(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>S(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&g>=u&&(g=0);else if(g<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");g=u}b=!1,m=!0,v=Date.now(),P(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;M(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;M(),g=0,v=0,m=!1,b=!1,O(g),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;g=Number.isFinite(u)?u:x(),v=0,m=!1,null!==p&&(Ci(p),p=null),O(d?g:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!Pi(t))return void console.warn(Si);let e=j();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,g=e,m&&(v=Date.now())},getCurrentTime:()=>x(),setCurrentTime:t=>{t=_i(t,u),g=t,m&&(v=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(x())},getCurrentProgress:()=>Ei(x(),l,a),setCurrentProgress:t=>{_.setCurrentTime(Ni(t,l,a))},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var zi=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],Fi=["definitions","bindings"],Di=t=>!!t&&"object"==typeof t&&!Array.isArray(t),Ri=t=>Di(t)&&"string"==typeof t.type?t.type:"time",Ii=t=>"scroll"===t||"view"===t;function Li(t,e){const n=Di(t)?A({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?Di(r)?n[t]=Li(n[t],r):n[t]=r:delete n[t]}return n}function Wi(t,e,n){const r=Ri(t),o=Di(e)&&"string"==typeof e.type?String(e.type):r;let i;if(o!==r){const n={};if(Di(t))for(const e of nt)void 0!==t[e]&&(n[e]=t[e]);i=Li(n,e)}else i=Li(t,e);if(Ii(o)){for(const t of rt)void 0!==i[t]&&(n("animator.timeline."+t+": no slot on a '"+o+"' timeline — dropped"),delete i[t]);"infinite"===i.iterations&&(n("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete i.iterations)}return i}var Bi="className",Ui="class",Vi="domType",qi="type",Gi="g";function Zi(t,e,n){return t?Ki(t,e,n,!0,0):null}function Ki(t,e,n,r,o){const i=t,{type:s,children:a,style:l}=i,u=j(i,["type","children","style"]),c=s||Gi;if(un.has(c.toLowerCase()))return(null!=n?n:xi(void 0,"[PxAnimator]")).warn(Ai.document,1103,c),null;const f=u[Vi];void 0!==f&&delete u[Vi];const d={};let h;const p=yn(u);for(const t of Object.keys(p)){const e=vn(t,p[t]);void 0!==e&&(dn.has(t)?(null!=h?h:h={})[t]=String(e):d[t===Bi?Ui:tn(t)]=e)}if(void 0!==f&&(d[qi]=String(f)),l)for(const t of Object.keys(l))(null!=h?h:h={})[t]=String(l[t]);const m=[];a&&a.forEach((t,r)=>{const o=Ki(t,e,n,!1,r);null!==o&&m.push(o)});const g=u[gt],v=!m.length&&"string"==typeof g&&g?g:void 0;return e({tag:c,attrs:d,style:h,children:m,text:v,node:t,isRoot:r,index:o})}function Ji(t){return"scroll"===(null==t?void 0:t.timelineSource)}var Hi="cover";function Xi(t,e,n,r){var o;const[i,s]=function(t,e,n){const r=e,o=n;switch(t){case"cover":return[0,r+o];case"entry":return[0,Math.min(r,o)];case"contain":return[Math.min(r,o),Math.max(r,o)];case"exit":return[Math.max(r,o),r+o];case"entry-crossing":return[0,r];case"exit-crossing":return[o,r+o]}}(null!=(o=null==t?void 0:t.phase)?o:Hi,n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(s-i)}var Qi=Symbol.for("@pixodesk/svg-animator-web:animators"),Yi="__pixodeskAnimators";function $i(){const t=globalThis;let e=t[Qi];if(!e){const n=new Set,r=new Set;e={animators:n,listeners:r,getAll:()=>Array.from(n),subscribe:t=>(r.add(t),()=>{r.delete(t)})},t[Qi]=e,void 0===t[Yi]&&(t[Yi]=e)}return e}function ts(){return $i().getAll()}function es(t){return $i().subscribe(t)}function ns(t,e){for(const n of $i().listeners)try{n(t,e)}catch(t){setTimeout(()=>{throw t},0)}}ut.offScreen,ut.visibilityThreshold,ut.visibilityDebounce;var rs=Array.from({length:21},(t,e)=>e/20);function os(t){return{requestStart:()=>t.play(),dispose:()=>{}}}function is(t,e,n){const r=null!=n?n:xi(void 0,"[PxAnimator]"),o=[],i=()=>{for(const t of o.splice(0))t()},s=function(t){var e,n,r,o,i;return{start:null!=(e=null==t?void 0:t.start)?e:ut.start,offScreen:null!=(n=null==t?void 0:t.offScreen)?n:ut.offScreen,mouseOut:null!=(r=null==t?void 0:t.mouseOut)?r:ut.mouseOut,visibilityThreshold:null!=(o=null==t?void 0:t.visibilityThreshold)?o:ut.visibilityThreshold,visibilityDebounce:null!=(i=null==t?void 0:t.visibilityDebounce)?i:ut.visibilityDebounce}}(e),a=t.getRootElement();if(!a)return r.warn(Ai.host,ki.triggersNoRoot),i;let l=!1;const u=function(t,e,n){if(e.offScreen===J.continue)return os(n);if("undefined"==typeof IntersectionObserver)return os(n);const r=e.visibilityThreshold,o=e.visibilityDebounce;let i,s,a=!1,l=!1,u=0;const c=()=>{void 0!==s&&(clearTimeout(s),s=void 0)},f=()=>{s=void 0,!0!==i&&(i=!0,(a||l)&&(a=!1,l=!1,n.play()))},d=()=>{c(),!1!==i&&(i=!1,n.isPlaying()&&(e.offScreen===J.reset?n.cancel():n.pause(),l=!0))},h=t=>{if(u=t,"undefined"==typeof document||"hidden"!==document.visibilityState)if(t>=r){if(!0===i||void 0!==s)return;o>0?s=setTimeout(f,o):f()}else t<=0?d():!0!==i&&c();else d()},p=new IntersectionObserver(t=>{const e=t[t.length-1];e&&h(e.isIntersecting?function(t){var e,n;const r=t.boundingClientRect,o=t.intersectionRect;if(!(null==r?void 0:r.height)||!o)return t.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,s=null!=(n=null==(e=t.rootBounds)?void 0:e.height)?n:1/0,a=Math.min(i,s),l=Math.min(r.height,Number.isFinite(a)?a:r.height);return l>0?o.height/l:t.intersectionRatio}(e):0)},{threshold:rs});p.observe(t);const m=()=>{h(u)},g="undefined"!=typeof document;return g&&document.addEventListener("visibilitychange",m),{requestStart:t=>{if(t||!0===i)return c(),i=!0,a=!1,l=!1,void n.play();a=!0},dispose:()=>{c(),p.disconnect(),g&&document.removeEventListener("visibilitychange",m)}}}(a,s,{isPlaying:()=>t.isPlaying(),play:()=>{l&&(l=!1,t.setPlaybackRate(1)),t.play()},pause:()=>t.pause(),cancel:()=>t.cancel()});switch(o.push(()=>u.dispose()),s.start){case K.load:{const t=()=>u.requestStart(!1);"complete"===document.readyState?t():(window.addEventListener("load",t,{once:!0}),o.push(()=>window.removeEventListener("load",t)));break}case K.mouseOver:{let e=!1;const n=()=>{e=!0,u.requestStart(!0)},r=()=>{e&&(()=>{switch(s.mouseOut){case H.pause:t.pause();break;case H.reset:t.cancel();break;case H.reverse:l=!0,t.setPlaybackRate(-1),t.play();case H.continue:}})()};a.addEventListener("mouseenter",n),a.addEventListener("mouseleave",r),o.push(()=>{a.removeEventListener("mouseenter",n),a.removeEventListener("mouseleave",r)});break}case K.click:{const e=()=>{t.isPlaying()?t.pause():u.requestStart(!0)};a.addEventListener("click",e),o.push(()=>a.removeEventListener("click",e));break}case K.none:}return i}function ss(t){return"#"+function(t){const e=globalThis.CSS;return"function"==typeof(null==e?void 0:e.escape)?e.escape(t):t.replace(/^([0-9])/,(t,e)=>"\\3"+e+" ").replace(/([^\w\-\\ ])/g,"\\$1")}(t)}function as(t,e,n,r){var o;const i=xt(t)||{},s=xi(n,"[PxAnimator]");if(!r)if(t.id){const e=ss(t.id);(r=document.querySelector(e))||s.warn(Ai.host,ki.noRootForSelector,e)}else s.warn(Ai.host,ki.noRootElement);const a=Ti(t,e||function(t,e){const n=new Set,r=null!=e?e:xi(void 0,"[PxAnimator]");return{isConnected:()=>!t||t.isConnected,setAttribute:(e,o,i)=>{o=tn(o);const s=ss(e),a=(null==t?void 0:t.querySelectorAll(s))||document.querySelectorAll(s);0!==a.length||n.has(s)||(n.add(s),r.warn(Ai.host,ki.setAttributeNoElement,s));for(let t=0;t<a.length;t++){const e=a[t],n="transform"===o&&"pattern"===e.tagName?"patternTransform":o;e.setAttribute(n,i),He.has(o)&&(e.style[o]=i)}}}}(r,s),n),l=f(c({},a),{getRootElement:()=>r||null});if(Ji(i))i.trigger&&s.warn(Ai.usage,ki.scrollTriggerIgnored);else{const t=is(l,null!=(o=i.trigger)?o:{},s),e=l.destroy.bind(l);l.destroy=()=>{t(),e()}}return l}function ls(t,e,n,r){let o=Ct(t);const i=Tt(t),s={offset:e,easing:i&&Array.isArray(i)?"cubic-bezier("+i.join(",")+")":void 0};let a,l=n;return Ge.has(n)&&Array.isArray(o)?a=Ve(o):"transform"!==n||null===o||"object"!=typeof o||Array.isArray(o)?Ze.has(n)?(Array.isArray(o)&&("translate"===n&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===n&&(o+="deg"),a=n+"("+o+")",l="transform"):a="d"===n?'path("'+(o&&"object"==typeof o&&Array.isArray(o.paths)?o.paths:[]).map(t=>Ce(t,!0)).join("")+'")':Ke.has(n)&&"number"==typeof o?100*o+"%":""+o:(a=Je(o,{withUnits:!0}),l="transform"),CSS.supports(tn(l),a)||r.add(l),l=Qe(l),s[l]=a,s}function us(t,e,n){var r,o,i,s,a;const l=[];for(let u=0;u<e.length;u++){const d=e[u],h=null!=(r=d.t)?r:0;if(h<0){const n=e[u+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(i=n.t)?i:0)-h),r=d.e?Le(d.e)(e):e,{right:o}=Be(d.e,e);l.push({t:0,v:Yn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[u-1];if(r&&(null!=(s=r.t)?s:0)<=n){const e=null!=(a=r.t)?a:0,o=(n-e)/(h-e),i=r.e?Le(r.e)(o):o,{left:s}=Be(r.e,o);l.length>0&&(l[l.length-1]=f(c({},l[l.length-1]),{e:s})),l.push({t:n,v:Yn(t,r.v,d.v,i),e:void 0})}break}l.push(d)}return l}function cs(t,e,n){var r;const o=new Map;for(const[i,s]of Object.entries(t)){const t=n.duration||1,a=us(i,s.keyframes||[],t),l=[];for(let n=0;n<a.length;n++){const o=a[n],s=ls(o,en((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(s.offset||0)>0&&l.push(f(c({},s),{offset:0})),l.push(s)}l.length>0&&(l[l.length-1].offset||0)<1&&l.push(f(c({},l[l.length-1]),{offset:1})),l.length>0&&o.set(i,l)}return o}function fs(t,e,n,r,o){var i,s;const a=xt(t)||{},l=xi(e,"[PxAnimator]");if(!n)if(t.id){const e=ss(t.id);(n=document.querySelector(e))||l.warn(Ai.host,ki.noRootForSelector,e)}else l.warn(Ai.host,ki.noRootElement);const u=ir(t,it.native),c=[],f=a.iterations;let d;"number"==typeof f&&(d=f),"infinite"===f&&(d=1/0);const h=new Set;let p=!1,m=!1;(null==u?void 0:u.length)||l.warn(Ai.document,ki.noBindings);for(const t of u||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){l.warn(Ai.document,ki.unresolvedBinding,t);continue}const s=ss(t.id),u=(null==n?void 0:n.querySelectorAll(s))||document.querySelectorAll(s);0===u.length&&l.warn(Ai.host,ki.noElementsForSelector,s);const f=cs(r,h,a),g=a.delay&&a.delay>0?a.delay:void 0;let v;if(a.delay&&a.delay<0&&a.duration){const t=-a.delay;v=d===1/0?t%a.duration:Math.min(t,a.duration*(null!=d?d:1))}const y={duration:a.duration,delay:g,fill:null!=(i=a.fill)?i:"forwards",direction:a.direction,iterations:d};for(let t=0;t<u.length;t++){const n=u[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(n,t,y),i=new Animation(r,o?o.timeline:document.timeline);if(o){const t=i;o.rangeStart&&(t.rangeStart=o.rangeStart),o.rangeEnd&&(t.rangeEnd=o.rangeEnd)}(null==e?void 0:e.onFinish)&&(i.onfinish=()=>{var t;p||(p=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(i.onremove=()=>{var t;m||(m=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==v&&(i.currentTime=v),c.push(i)}catch(t){l.warn(Ai.internal,ki.animationBuildFailed,t)}}}if(!r&&h.size)return l.warn(Ai.platform,ki.unsupportedAnimatedAttrs,[...h].join(", ")),null;const g={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=c[0])?void 0:t.playState)},play:()=>{var t;p=!1,c.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;c.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;p=!1,c.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of c)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>Pi(t)?(c.forEach(e=>e.playbackRate=t),g):(l.warn(Ai.usage,ki.rateRejected),g),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=c[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{var e;const n=function(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}(null!=(e=a.duration)?e:0,null!=d?d:1),r=n>0?_i(t,n):Math.max(0,t);p=!1,c.forEach(t=>{t.currentTime=r})},getCurrentProgress:()=>{var t;const e=g.getCurrentTime();return null===e?null:Ei(e,null!=(t=a.duration)?t:0,null!=d?d:1)},setCurrentProgress:t=>{var e;g.setCurrentTime(Ni(t,null!=(e=a.duration)?e:0,null!=d?d:1))},destroy:()=>{var t;g.cancel(),c.splice(0,c.length),m||(m=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};if("scroll"===a.timelineSource)a.trigger&&l.warn(Ai.usage,ki.scrollTriggerIgnored);else{const t=is(g,null!=(s=a.trigger)?s:{},l),e=g.destroy.bind(g);g.destroy=()=>{t(),e()}}return o&&c.forEach(t=>t.play()),g}function ds(t,e,n){var r,o,i;const s="number"==typeof(null==t?void 0:t.fraction)?t.fraction:e,a=null==(o=null==(r=globalThis.CSS)?void 0:r.percent)?void 0:o.call(r,100*s);if(void 0!==a)return n?{rangeName:null!=(i=null==t?void 0:t.phase)?i:"cover",offset:a}:{offset:a}}function hs(t,e){const n=document.body,r=document.documentElement;for(let o=t.parentElement;o;o=o.parentElement){if(o===n||o===r)return null;const t=getComputedStyle(o),i="y"===e?t.overflowY:t.overflowX;if("auto"===i||"scroll"===i||"hidden"===i||"overlay"===i)return o}return null}function ps(){return document.scrollingElement||document.documentElement}var ms="parent",gs="scroller";function vs(t,e,n){var r,o;const i=null!=n?n:xi(void 0,"[PxAnimator]"),s=null==e?void 0:e.trim();if(!s)return t;if(s===ms){let e=null;for(let n=t.parentElement;n&&n!==document.body;n=n.parentElement){const t=getComputedStyle(n).position;"sticky"!==t&&"fixed"!==t||(e=n)}return null!=(o=null!=(r=null==e?void 0:e.parentElement)?r:t.parentElement)?o:t}if(s===gs)return hs(t,"y")||hs(t,"x")||ps();let a=null;try{a=document.querySelector(s)}catch(e){return i.warn(Ai.document,ki.scrollSubjectInvalid,s),t}return a||(i.warn(Ai.host,ki.scrollSubjectNoMatch,s),t)}function ys(t,e){const n=t;if(!(null==e?void 0:e.pin)||!n.style)return()=>{};const r=n.style,o=r.position,i=r.top;r.position="sticky";const s="center"===e.pinAlign?.5:"bottom"===e.pinAlign?1:0,a=()=>{var n;const o=null!=(n=e.pinOffset)?n:0;if(!s)return void(r.top=o+"px");const i=function(t){const e=hs(t,"y");return e?e.clientHeight:document.documentElement.clientHeight}(t),a=t.getBoundingClientRect().height;r.top=Math.round((i-a)*s+o)+"px"};a();let l=null;const u=s?a:null;s&&(u&&window.addEventListener("resize",u),"undefined"!=typeof ResizeObserver&&(l=new ResizeObserver(a),l.observe(t)));let c=null;const f=t.parentElement;return e.pinDistance&&e.pinDistance>0&&f&&(c=document.createElement("div"),c.setAttribute("data-px-pin",""),c.style.height=100*e.pinDistance+"vh",f.insertBefore(c,t),c.appendChild(t)),()=>{u&&window.removeEventListener("resize",u),null==l||l.disconnect(),r.position=o,r.top=i,(null==c?void 0:c.parentElement)&&(c.parentElement.insertBefore(t,c),c.remove())}}function bs(t,e,n){let r,o=e;t.resetOnFinish&&(o=f(c({},e),{onFinish:()=>{var t;null==(t=null==e?void 0:e.onFinish)||t.call(e),null==r||r.cancel()}}));const i=n(o);return r=i,t.debugGlobalName&&(window[t.debugGlobalName]=i),i}var ks=({tag:t,attrs:e,style:n,children:r,text:o})=>{const i=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t of Object.keys(e))i.setAttribute(t,e[t]);if(n){const t=i.style;for(const e of Object.keys(n))t[e]=n[e]}for(const t of r)i.appendChild(t);return void 0!==o&&(i.textContent=o),i};function As(t,e,n){return Zi(t,ks,n)}function ws(t,e,n,r,o,i,s){const a=xi(n,"[PxAnimator]"),l=Ae(t);for(const t of l)a.warn(Ai.document,ki.effectsShape,t);if(function(t){const{problems:e}=function(t){try{return{problems:we(t)}}catch(t){return{problems:[]}}}(t);if(!e.length)return;const n=e.slice(0,Oi),r=e.length-n.length;console.warn("[PxAnimator] createAnimator: this document does not match the animation schema in "+e.length+" place"+(1===e.length?"":"s")+".\n"+n.map(t=>" - "+t).join("\n")+(r>0?"\n … and "+r+" more":"")+"\n\nIf you did not author these keys, the usual cause is a build that MANGLES PROPERTY NAMES. An animation document is data loaded at runtime, so renaming the property reads inside the player stops them matching the keys in the JSON, and the animation silently does nothing. Feed the published reserved-name list to your minifier — @pixodesk/svg-animator-web/mangle-reserved.json — see docs/library/minification.md.")}(t),void 0!==o||i){const e=function(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetTimeline);if(!t||void 0===e||!(i||null!==e&&Di(e)&&Object.keys(e).length))return{doc:t,warnings:[]};const s=t,a=Di(s.animator),l=!a&&Di(null==(r=s.meta)?void 0:r.animator),u=a?s.animator:l?s.meta.animator:void 0,c=[];a&&Di(null==(o=s.meta)?void 0:o.animator)&&c.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let f=u;if(i){const t={};for(const e of Fi)Di(u)&&void 0!==u[e]&&(t[e]=u[e]);f=t}const d=function(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!Di(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=Di(t)?zi.filter(e=>void 0!==t[e]):[];o.length&&r("animator: the base carries the flat runtime spelling ("+o.join(", ")+"); the patch merges the wire spelling only");const i=Di(t)?A({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?Di(n)?i[t]=Li(i[t],n):i[t]=n:i.timeline=Di(n)?Wi(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}(f,null!=e?e:{});return c.push(...d.warnings),d.config===u?{doc:t,warnings:c}:l?{doc:w(A({},s),{meta:w(A({},s.meta),{animator:d.config})}),warnings:c}:{doc:w(A({},s),{animator:d.config}),warnings:c}}(t,null!=o?o:{},{resetTimeline:!!i});for(const t of e.warnings)a.warn(Ai.usage,ki.timelineOverrideIgnored,t);t=e.doc}t=bi(t,at((xt(t)||{}).engine));let u=null;if(r){t=Ee(t);const e="string"==typeof r?document.querySelector(r):r;e&&(u=As(t,0,a),u&&e.replaceChildren(u))}!u&&s&&(u=s);const c=function(t,e,n,r){return function(t,e,n,r){const o=xt(t)||{},i=xi(n,"[PxAnimator]");return Ji(o)?bs(o,n,n=>{var s;let a=()=>{};if(o.engine!==st.js&&r){a=ys(r,o.scroll);const e=function(t,e,n){var r,o,i,s;const a=null!=n?n:xi(void 0,"[PxAnimator]");if(!e||!Ji(e))return null;const l=e.scroll||{},u=null!=(r=l.kind)?r:"view";if(l.smoothing)return a.warn(Ai.platform,ki.scrollSmoothingNeedsOwnDriver),null;const c=globalThis,f="view"===u,d=f?c.ViewTimeline:c.ScrollTimeline;if("function"!=typeof d)return null;const h=null!=(o=l.axis)?o:"block";let p;try{p=new d(f?{subject:vs(t,l.subject,a),axis:h}:{source:"root"===l.source?ps():hs(t,"y")||hs(t,"x")||ps(),axis:h})}catch(t){return a.warn(Ai.platform,ki.scrollNativeUnavailable,t),null}return{timeline:p,rangeStart:ds(null==(i=l.range)?void 0:i.start,0,f),rangeEnd:ds(null==(s=l.range)?void 0:s.end,1,f)}}(r,o,i);if(e){const i=fs(t,n,r,lt(o.engine),e);if(i){const t=i.destroy.bind(i);return i.destroy=()=>{a(),t()},i}}a(),a=()=>{}}const l=(o.engine!==st.js?fs(t,n,r,lt(o.engine)):null)||as(t,e,n,r),u=(null==(s=l.getRootElement)?void 0:s.call(l))||r;if(u){a=ys(u,o.scroll);const t=("number"==typeof(null==(c=o)?void 0:c.duration)&&c.duration>0?c.duration:Xe)*("number"==typeof(null==c?void 0:c.iterations)&&c.iterations>0?c.iterations:1),e=function(t,e,n,r){var o,i;if(!e||!Ji(e))return null;const s=null!=r?r:xi(void 0,"[PxAnimator]"),a=e.scroll||{},l=null!=(o=a.kind)?o:"view",u=vs(t,a.subject,s),c=hs(t,"y")||hs(t,"x"),f="scroll"===l&&"root"===a.source?ps():c||ps(),d=f===ps(),h=function(t,e){const n=null!=t?t:"block";if("x"===n||"y"===n)return n;const r=!!e&&e.startsWith("vertical");return"inline"===n?r?"y":"x":r?"x":"y"}(a.axis,getComputedStyle(f).writingMode),p=()=>{if("scroll"===l)return function(t,e,n){var r,o;const i=e>0?en(t/e,0,1):1,s="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,a="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return a<=s?i>=a?1:0:en((i-s)/(a-s),0,1)}("y"===h?f.scrollTop:f.scrollLeft,"y"===h?f.scrollHeight-f.clientHeight:f.scrollWidth-f.clientWidth,a.range);const t=u.getBoundingClientRect();let e,n;if(d)e=0,n="y"===h?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const t=f.getBoundingClientRect();e="y"===h?t.top:t.left,n="y"===h?f.clientHeight:f.clientWidth}return function(t,e,n,r){const o=n-t,i=Xi(null==r?void 0:r.start,0,e,n),s=Xi(null==r?void 0:r.end,1,e,n);return s<=i?o>=s?1:0:en((o-i)/(s-i),0,1)}(("y"===h?t.top:t.left)-e,"y"===h?t.height:t.width,n,a.range)},m=Math.max(0,null!=(i=a.smoothing)?i:0)/1e3;let g=!1,v=null,y=null,b=0,k=null;const A=()=>{k=null,g||(t=>{if(!m)return void n(t);if(null===v)return v=t,void n(t);if(null!==y)return;b=0;const e=t=>{if(y=null,g)return;const r=b?Math.min(.1,(t-b)/1e3):1/60;b=t;const o=p(),i=1-Math.exp(-r/m);v+=(o-v)*i,Math.abs(o-v)<.001&&(v=o),n(v),v!==o&&(y=requestAnimationFrame(e))};y=requestAnimationFrame(e)})(p())},w=()=>{g||null!==k||(k=requestAnimationFrame(A))},j=d?window:f;let x;j.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w,{passive:!0}),"undefined"!=typeof ResizeObserver&&(x=new ResizeObserver(w),x.observe(u),u!==t&&x.observe(t),d||x.observe(f));const O={destroy:()=>{g||(g=!0,j.removeEventListener("scroll",w),window.removeEventListener("resize",w),null==x||x.disconnect(),null!==k&&(cancelAnimationFrame(k),k=null),null!==y&&(cancelAnimationFrame(y),y=null))},refresh:()=>{g||(v=p(),n(v))}};return O.refresh(),O}(u,o,e=>l.setCurrentTime(e*t),i);if(e){const t=l.destroy.bind(l);l.destroy=()=>{e.destroy(),a(),t()}}}else i.warn(Ai.host,ki.scrollNoRootToObserve);var c;return l}):bs(o,n,n=>o.engine===st.js?as(t,e,n,r):fs(t,n,r,lt(o.engine))||as(t,e,n,r))}(t,e,n,r)}(t,e,n,u);if(r&&u){const t=u,e=c.destroy.bind(c);c.destroy=()=>{e(),t.remove()}}return c}function js(t){return"adapter"in t||"rootElement"in t}function xs(t){const{src:e,doc:n,container:r,resetTimeline:o}=t,i=js(t)?t.adapter:void 0,s=js(t)?t.rootElement:void 0,a=function(t){const{timeline:e,duration:n,delay:r,iterations:o,start:i}=t;return function(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("timeline override: not valid JSON — ignored",t),n=void 0}else n=null!=t?t:void 0;const{duration:r,delay:o,iterations:i,start:s}=e;if(void 0===r&&void 0===o&&void 0===i&&void 0===s)return void 0===n?void 0:{timeline:n};const a=Di(n)?A({},n):{};return void 0!==r&&(a.duration=r),void 0!==o&&(a.delay=o),void 0!==i&&(a.iterations=i),void 0!==s&&(a.trigger=w(A({},a.trigger),{start:s})),{timeline:a}}(e,{duration:n,delay:r,iterations:o,start:i})}(t);let l;const u=function(t){const e=t=>{l&&ns(t,l)};return f(c({},t),{onPlay:()=>{var n;null==(n=null==t?void 0:t.onPlay)||n.call(t),e("play")},onPause:()=>{var n;null==(n=null==t?void 0:t.onPause)||n.call(t),e("pause")},onCancel:()=>{var n;null==(n=null==t?void 0:t.onCancel)||n.call(t),e("cancel")},onFinish:()=>{var n;null==(n=null==t?void 0:t.onFinish)||n.call(t),e("finish")}})}(function(t){const{onPlay:e,onPause:n,onCancel:r,onFinish:o,onRemove:i,onStop:s,onWarn:a,onError:l,muteWarn:u,muteError:c}=null!=t?t:{},f=t=>t||s?()=>{null==t||t(),null==s||s()}:void 0;return{onPlay:e,onPause:f(n),onCancel:f(r),onFinish:f(o),onRemove:f(i),onWarn:a,onError:l,muteWarn:u,muteError:c}}(t));if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `doc`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `doc` is required");let d=null,h=[],p=!1;const m=t=>{d?t(d):h&&h.push(t)},g=xi(u,"[PxAnimator]"),v=(t,e,...n)=>{h=null,g.error(t,e,...n)},y=t=>{try{(t=>{d=t;const e=h;h=null,null==e||e.forEach(e=>e(t))})(ws(t,i,u,r,a,o,s))}catch(t){const e=function(t){return t instanceof Error?t:new Error(String(t))}(t);v(Ai.internal,ki.buildFailed,e)}};return l={isReady:()=>!!d,getRootElement:()=>d?d.getRootElement():null,isPlaying:()=>(null==d?void 0:d.isPlaying())||!1,play:()=>{m(t=>t.play())},pause:()=>{m(t=>t.pause())},cancel:()=>{m(t=>t.cancel())},finish:()=>{m(t=>t.finish())},setPlaybackRate:t=>{m(e=>e.setPlaybackRate(t))},getCurrentTime:()=>d?d.getCurrentTime():null,setCurrentTime:t=>{m(e=>e.setCurrentTime(t))},getCurrentProgress:()=>d?d.getCurrentProgress():null,setCurrentProgress:t=>{m(e=>e.setCurrentProgress(t))},destroy:()=>{p=!0,h=null,null==d||d.destroy()}},function(t){const e=$i();if(e.animators.has(t))return;e.animators.add(t),ns("add",t);const n=t.destroy.bind(t);t.destroy=()=>{n(),e.animators.delete(t)&&ns("remove",t)}}(l),void 0!==n?y(n):fetch(e).then(t=>t.json()).then(t=>{p||(function(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}(t)?y(t):v(Ai.document,ki.invalidDocumentAtSrc,e))}).catch(t=>{var n;v(Ai.host,ki.loadFailed,e,null!=(n=null==t?void 0:t.message)?n:String(t))}),l}function Os(t){const e=document.querySelectorAll("["+G+"]");for(let n=0;n<e.length;n++){const r=e[n];if(!r[Z]){const e=r.getAttribute(G);e&&(r[Z]=xs(f(c({},t),{src:e,container:r})))}}}
1
+ "use strict";var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(t,e)=>{for(var n in e||(e={}))a.call(e,n)&&u(t,n,e[n]);if(s)for(var n of s(e))l.call(e,n)&&u(t,n,e[n]);return t},f=(t,e)=>n(t,o(e)),d={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(d,{PxAnimatorConfigSchema:()=>ve,PxDefinitionsSchema:()=>oe,PxDiagnosticKind:()=>Li,PxNodeBaseSchema:()=>Re,PxScrollSchema:()=>ae,PxSvgNodeRootSchema:()=>Le,PxTimelineEngineSetting:()=>ht,PxTriggerSchema:()=>ee,createAdapterAnimator:()=>Qi,createAnimator:()=>Us,generateNewIds:()=>qe,getAllAnimators:()=>ys,loadTagAnimators:()=>Vs,onAnimatorsChange:()=>bs,px:()=>V,renderNode:()=>Ls,setupAnimationTriggers:()=>js,toDomProps:()=>Cn,validateDocument:()=>Fe}),module.exports=(t=d,((t,n,o,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let o of i(n))a.call(t,o)||void 0===o||e(t,o,{get:()=>n[o],enumerable:!(s=r(n,o))||s.enumerable});return t})(e({},"__esModule",{value:!0}),t));var h=Object.defineProperty,p=Object.defineProperties,m=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,b=Math.pow,k=(t,e,n)=>e in t?h(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e)=>{for(var n in e||(e={}))g.call(e,n)&&k(t,n,e[n]);if(v)for(var n of v(e))y.call(e,n)&&k(t,n,e[n]);return t},w=(t,e)=>p(t,m(e)),j=(t,e)=>{var n={};for(var r in t)g.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&v)for(var r of v(t))e.indexOf(r)<0&&y.call(t,r)&&(n[r]=t[r]);return n};function x(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var O=class{constructor(t){this._statesDefault=t}_canSanitize(t){return this.isValid(t)}absentDefault(){return this._default}optional(){return new S(this)}},S=class extends O{constructor(t){super(t._statesDefault),this.inner=t,this._default=void 0}absentDefault(){return this.inner._statesDefault?this.inner._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)}},P=class extends O{constructor(t,e){super(e),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(x(null!=n?n:[])+": expected string, got "+typeof t),!1)}},M=class extends O{constructor(t,e){super(e),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(x(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},_=class extends O{constructor(t,e){super(e),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(x(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},E=class extends O{constructor(t){super(!0),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(x(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},N=class extends O{constructor(t,e,n){super(n),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(x(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},C=class extends O{constructor(t,e,n){super(n),this.schemas=t,this._kind="union",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};if(this.schemas.some(e=>e.isValid(t,o,n?[...n]:void 0)))return!0;if(!e)return!1;const i=x(null!=n?n:[]);let s;e.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let a=-1;const l=[];for(const r of this.schemas){const o={errors:[],warnings:[],strict:e.strict};if(r.isValid(t,o,n?[...n]:void 0),!o.errors.length)continue;const u=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((u>a||u===a&&s&&o.errors.length<s.length)&&(a=u,s=o.errors),u<=i.length)for(const t of o.errors){const e=/: expected (.+?), got /.exec(t);e&&!l.includes(e[1])&&l.push(e[1])}}if(s&&a>i.length)for(const t of s.slice(0,4))e.errors.includes(t)||e.errors.push(t);else l.length&&e.errors.push(i+": expected "+l.join(" | "));return!1}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},T=class extends O{constructor(t,e,n){var r;super(!1),this._key=t,this._schemas=e,this._kind="discriminatedUnion",this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];if(!e)continue;const o=null!=(r=e.inner)?r:e;this._map.set(o._default,n),e.inner&&(this._absentMember=n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null==e?this._absentMember:this._map.get(e)}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(x(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)}};function D(t){const e={};for(const n of Object.keys(t))t[n]._statesDefault&&(e[n]=t[n].absentDefault());return Object.freeze(e)}var z=class extends O{constructor(t){super(!1),this._shape=t;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e,this.defaults=D(t)}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n={};for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(x(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(x(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},F=class extends O{constructor(t,e){super(!1),this._shape=t,this._openSchema=e;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n,this.defaults=D(t)}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=A({},e);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}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(x(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)}},R=class extends O{constructor(t){super(!1),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(x(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)}},I=class extends O{constructor(t){super(!1),this.value=t,this._kind="record",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(x(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)}},L=class extends O{constructor(){super(!1),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},W=class extends O{constructor(){super(!1),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(x(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},B=class extends O{constructor(t,e){super(!1),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)}},U=class extends O{constructor(t){super(!1),this.schemas=t,this._kind="tuple",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(x(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}},V={string:function(t){return void 0===t?new P("",!1):new P(t,!0)},number:function(t){return void 0===t?new M(0,!1):new M(t,!0)},boolean:function(t){return void 0===t?new _(!1,!1):new _(t,!0)},literal:t=>new E(t),enum:function(t,e){return void 0===e?new N(t,void 0,!1):new N(t,e,!0)},union:function(t,e){return void 0===e?new C(t,void 0,!1):new C(t,e,!0)},discriminatedUnion:(t,e)=>new T(t,e),object:t=>new z(t),openObject:(t,e)=>new F(t,e),extendedObject:(t,e)=>new z(A(A({},t._shape),e)),array:t=>new R(t),record:t=>new I(t),any:()=>new L,defined:()=>new W,tuple:t=>new U(t),lazy:(t,e)=>new B(t,e)},q=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function G(t){if("string"!=typeof t)return;const e=q.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}G("1.2");var Z="forwards",K="normal",H="data-px-animation-src",J="_px_animator",X={load:"load",mouseOver:"mouseOver",click:"click",none:"none"},Q={pause:"pause",continue:"continue",reset:"reset"},Y={continue:"continue",pause:"pause",reset:"reset",reverse:"reverse"},$="view",tt="block",et="inline",nt="nearest",rt="root",ot="top",it="center",st="bottom",at="cover",lt="sampled",ut=["duration","iterations","engine","frameRate"],ct=["trigger","delay","fillMode","direction"],ft=[...ut,...ct,"fill","resetOnFinish","timelineSource","scroll"],dt={native:"native",js:"js"},ht=w(A({},dt),{auto:"auto"});function pt(t){return t===ht.js?dt.js:dt.native}function mt(t){return t===ht.native}var vt={start:"load",offScreen:"pause",mouseOut:"continue",visibilityThreshold:.5,visibilityDebounce:150,finish:"hold"},gt=1e3,yt=1,bt={start:"start",end:"end"},kt={normal:"normal",alternate:"alternate"},At="luminance",wt="userSpaceOnUse",jt="objectBoundingBox",xt={translate:"translate"},Ot="extend",St="spacing",Pt="align",Mt="exact",_t={separate:"separate",combined:"combined"},Et="textContent",Nt="class",Ct="transform",Tt="offsetDistance",Dt=new Set(["type","children","animator","meta","animate","effects",Et]),zt={translate:"translate",rotate:"rotate",scale:"scale",origin:"origin"},Ft=(zt.translate,zt.rotate,zt.scale,zt.origin,"pad"),Rt={linear:"linear",radial:"radial"};function It(t){var e;const n=(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator);if(!n)return;const r=Lt.get(n);if(r)return r;const o=n,i=ft.filter(t=>void 0!==o[t]),s=i.length?A({},o):n;for(const t of i)delete s[t];const a=function(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=Wt.get(t);if(n)return n;const r=t,{timeline:o}=r,i=j(r,["timeline"]);if(void 0!==e.engine&&(i.engine=e.engine),void 0!==e.frameRate&&(i.frameRate=e.frameRate),"scroll"===e.type||"view"===e.type){i.timelineSource="scroll",void 0!==e.duration&&(i.duration=e.duration),void 0!==e.iterations&&(i.iterations=e.iterations);const t=A({},i.scroll||{});t.kind=e.type,void 0!==e.axis&&(t.axis=e.axis),void 0!==e.source&&(t.source=e.source),void 0!==e.subject&&(t.subject=e.subject),void 0!==e.smoothing&&(t.smoothing=e.smoothing),void 0!==e.range&&(t.range=e.range);const n=e.pin;"boolean"==typeof n?t.pin=n:n&&"object"==typeof n&&(t.pin=!0,void 0!==n.align&&(t.pinAlign=n.align),void 0!==n.offset&&(t.pinOffset=n.offset),void 0!==n.distance&&(t.pinDistance=n.distance)),i.scroll=t}else{if(void 0!==e.duration&&(i.duration=e.duration),void 0!==e.trigger){const t=e.trigger,{finish:n}=t,r=j(t,["finish"]);Object.keys(r).length&&(i.trigger=r),void 0!==n&&(i.resetOnFinish="reset"===n)}void 0!==e.delay&&(i.delay=e.delay),void 0!==e.iterations&&(i.iterations=e.iterations),void 0!==e.direction&&(i.direction=e.direction),void 0!==e.fillMode&&(i.fill=e.fillMode)}return Wt.set(t,i),i}(s);return Lt.set(n,a),a}var Lt=new WeakMap,Wt=new WeakMap;function Bt(t){var e;if(t)return null==(e=It(t))?void 0:e.definitions}var Ut=V.union([V.string(),V.tuple([V.number(),V.number(),V.number(),V.number()])]),Vt=V.union([V.string(),V.number(),V.array(V.number()),V.object({pathData:V.string()}),V.lazy(()=>V.array(Me),[]),V.lazy(()=>Yt,{})]),qt=V.object({time:V.number().optional(),value:Vt.optional(),easing:Ut.optional(),tangentOut:V.tuple([V.number(),V.number()]).optional(),tangentIn:V.tuple([V.number(),V.number()]).optional()}),Gt=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},Zt=t=>{var e;return null!=(e=t.value)?e:t.v},Kt=t=>{var e;return null!=(e=t.easing)?e:t.e},Ht=t=>t.tangentIn,Jt=t=>t.tangentOut,Xt=V.object({segmentCount:V.number().optional(),repeatAt:V.enum([bt.start,bt.end],bt.end).optional(),direction:V.enum([kt.normal,kt.alternate],kt.normal).optional()}),Qt=V.object({value:Vt.optional(),keyframes:V.array(qt).optional(),loop:V.union([Xt,V.boolean()]).optional(),autoOrient:V.boolean().optional(),alongPathMode:V.enum([lt,"offsetPath"],lt).optional()}),Yt=V.object({translate:V.tuple([V.number(),V.number()]).optional(),rotate:V.number().optional(),skew:V.number().optional(),scale:V.tuple([V.number(),V.number()]).optional(),origin:V.tuple([V.number(),V.number()]).optional()}),$t=(V.union([V.string(),Yt,V.object({value:Yt}),Qt]),V.record(Qt)),te=V.union([V.string(),V.array(V.union([V.string(),$t])),$t]),ee=V.object({start:V.enum([X.load,X.mouseOver,X.click,X.none],vt.start).optional(),offScreen:V.enum([Q.pause,Q.continue,Q.reset],vt.offScreen).optional(),mouseOut:V.enum([Y.continue,Y.pause,Y.reset,Y.reverse],vt.mouseOut).optional(),finish:V.enum(["hold","reset"],vt.finish).optional(),visibilityThreshold:V.number(vt.visibilityThreshold).optional(),visibilityDebounce:V.number(vt.visibilityDebounce).optional()}),ne=V.object({width:V.number(),pathData:V.string()}),re=V.object({fontFamily:V.string(),fontStyle:V.string(),ascent:V.number(),unitsPerEm:V.number(),glyphs:V.record(ne)}),oe=V.object({easings:V.record(V.tuple([V.number(),V.number(),V.number(),V.number()])).optional(),animations:V.record($t).optional(),fonts:V.record(re).optional()}),ie=V.object({phase:V.enum([at,"contain","entry","exit","entry-crossing","exit-crossing"],at).optional(),fraction:V.number().optional()}),se=V.object({start:ie.optional(),end:ie.optional()}),ae=V.object({kind:V.enum([$,"scroll"],$).optional(),axis:V.enum([tt,et,"x","y"],tt).optional(),source:V.enum([nt,rt],nt).optional(),subject:V.string().optional(),smoothing:V.number().optional(),pin:V.boolean(!1).optional(),pinAlign:V.enum([ot,it,st],ot).optional(),pinOffset:V.number().optional(),pinDistance:V.number().optional(),range:se.optional()}),le=V.object({align:V.enum([ot,it,st],ot).optional(),offset:V.number().optional(),distance:V.number().optional()}),ue=V.enum([ht.auto,ht.native,ht.js],ht.auto).optional(),ce=V.object({type:V.literal("time").optional(),engine:ue,frameRate:V.number().optional(),duration:V.number(gt).optional(),trigger:ee.optional(),delay:V.number(0).optional(),iterations:V.union([V.number(yt),V.literal("infinite")],yt).optional(),fillMode:V.enum([Z,"backwards","both","none"],Z).optional(),direction:V.enum([K,"reverse","alternate","alternate-reverse"],K).optional()}),fe={duration:V.number().optional(),iterations:V.number().optional(),engine:ue,frameRate:V.number().optional(),axis:V.enum([tt,et,"x","y"],tt).optional(),source:V.enum([nt,rt],nt).optional(),subject:V.string().optional(),smoothing:V.number().optional(),pin:V.union([V.boolean(),le]).optional(),range:se.optional()},de=V.object(A({type:V.literal("scroll")},fe)),he=V.object(A({type:V.literal("view")},fe)),pe=V.discriminatedUnion("type",[ce,de,he]),me=V.object({target:V.string(),animateWith:V.array(V.string())}),ve=V.object({timeline:pe.optional(),definitions:oe.optional(),bindings:V.array(me).optional(),debugGlobalName:V.string().optional(),version:V.string().optional()}),ge=V.union([V.string(),V.number(),V.array(V.number()),V.object({value:V.defined()}),Yt]),ye=V.union([V.number(),Qt,V.object({value:V.number()})]),be=V.union([V.tuple([V.number(),V.number()]),Qt,V.object({value:V.tuple([V.number(),V.number()])})]),ke=V.union([V.string(),Qt,V.object({value:V.string()})]),Ae=V.object({translate:be.optional(),rotate:ye.optional(),scale:be.optional(),skew:ye.optional(),origin:be.optional()}),we=V.object({copies:V.number().optional(),translate:be.optional(),rotate:ye.optional(),skew:ye.optional(),scale:be.optional(),origin:be.optional()}),je=V.object({source:V.string().optional(),maskType:V.enum([At,"alpha"],At).optional(),maskUnits:V.enum([wt,jt],jt).optional(),maskContentUnits:V.enum([wt,jt],wt).optional(),x:V.number().optional(),y:V.number().optional(),width:V.number().optional(),height:V.number().optional()}),xe=V.object({pathData:ke.optional()}),Oe=V.object({offset:ye.optional(),range:be.optional(),subPaths:V.enum([_t.separate,_t.combined],_t.separate).optional()}),Se=V.object({start:V.number().optional(),stretch:V.number().optional(),timeCrop:V.tuple([V.number(),V.number()]).optional()}),Pe=V.object({without:V.enum([xt.translate]).optional(),source:V.string().optional(),retime:Se.optional()}),Me=V.object({offset:V.number(),color:V.string()}),_e=V.union([V.array(Me),V.object({value:V.array(Me)}),Qt]),Ee=V.object({type:V.enum([Rt.linear,Rt.radial]),start:be.optional(),end:be.optional(),center:be.optional(),radius:ye.optional(),focal:be.optional(),stops:_e.optional(),gradientUnits:V.enum([wt,jt],jt).optional(),spreadMethod:V.enum([Ft,"reflect","repeat"],Ft).optional(),gradientTransform:V.string().optional()}),Ne=Ee,Ce=V.object({pathData:V.string(),pathOverflow:V.enum(["clip",Ot],Ot).optional(),lengthAdjust:V.enum([St,"spacingAndGlyphs"],St).optional(),method:V.enum([Pt,"stretch"],Pt).optional(),spacing:V.enum(["auto",Mt],Mt).optional(),startOffset:ye.optional(),textLength:ye.optional()}),Te=V.object({useGlyphs:V.boolean().optional()}),De=V.object({transformBy:Ae.optional(),repeater:we.optional(),maskedBy:je.optional(),clipPath:xe.optional(),strokeTrim:Oe.optional(),clone:Pe.optional(),fillGradient:Ee.optional(),strokeGradient:Ne.optional(),textPath:Ce.optional(),text:Te.optional()});function ze(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!De.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}function Fe(t,e){var n;const r=!1!==(null==e?void 0:e.strict),o={errors:[],warnings:[],strict:r},i=We.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const e of ze(t,{strict:r}))i.includes(e)||i.push(e);const e=null==(n=It(t))?void 0:n.definitions;for(const n of function(t,e){if(!e||!Object.keys(e).length)return[];const n=[],r=(t,o,i,s)=>{var a,l;if(!t)return;const u="string"==typeof t.fontFamily?t.fontFamily:void 0,c=null!=u?u:i,f=s||"text"===t.type&&!!(null==(l=null==(a=t.effects)?void 0:a.text)?void 0:l.useGlyphs);if(f&&u&&!Object.prototype.hasOwnProperty.call(e,u)){const t=o+': glyph-mode text uses font-family "'+u+'", which has no entry in animator.definitions.fonts';n.includes(t)||n.push(t)}Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]",c,f))};return r(t,"root",void 0,!1),n}(t,null==e?void 0:e.fonts))i.includes(n)||i.push(n);for(const n of function(t,e){const n=[],r=(t,o)=>{if(Array.isArray(t))return void t.forEach((t,e)=>r(t,o+"["+e+"]"));if(!t||"object"!=typeof t)return;const i=t.easing;if(!("string"!=typeof i||e&&Object.prototype.hasOwnProperty.call(e,i))){const t=o+'.easing: "'+i+'" names no entry in animator.definitions.easings — it will play linear';n.includes(t)||n.push(t)}for(const[e,n]of Object.entries(t))"easing"!==e&&n&&"object"==typeof n&&r(n,o+"."+e)};return r(t,"root"),n}(t,null==e?void 0:e.easings))i.includes(n)||i.push(n);for(const e of function(t){var e;const n=null==(e=It(t))?void 0:e.version;return void 0===n||void 0!==G(n)?[]:["root.animator.version: "+JSON.stringify(n)+' is not a version stamp ("a.b" or "a.b.c") — it reads as unstamped']}(t))i.includes(e)||i.push(e)}return i}var Re=V.openObject({type:V.string(),domType:V.string().optional(),textContent:V.string().optional(),id:V.string().optional(),meta:V.any().optional(),effects:De.optional(),animate:te.optional(),style:V.record(V.union([V.string(),V.number()])).optional()},ge),Ie=V.openObject(w(A({},Re._shape),{children:V.lazy(()=>V.array(Ie),[]).optional()}),ge),Le=V.object({width:V.union([V.number(),V.string()]).optional(),height:V.union([V.number(),V.string()]).optional(),viewBox:V.string().optional(),animator:ve.optional()}),We=V.openObject(w(A(A({},Re._shape),Le._shape),{type:V.literal("svg"),children:V.array(Ie).optional()}),ge),Be=(V.object({v:V.array(V.array(V.number())),i:V.array(V.array(V.number())).optional(),o:V.array(V.array(V.number())).optional(),c:V.boolean().optional()}),0);function Ue(){return"_px_"+Date.now().toString(36)+(++Be).toString(36)+Math.random().toString(36).substring(2,6)}function Ve(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Ve(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Ve(e[t]);return n}function qe(t){var e;const n=Ve(t),r=new Map,o=new Set(["href","xlink:href"]),i=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["targetId","boundElementId"]),a=(t,e)=>"source"===t&&("maskedBy"===e||"clone"===e);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=Ue();r.set(t,n),e.id=n}else e.animate&&(e.id=Ue());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(n),function t(e,n){if(e&&"object"==typeof e)for(const[l,u]of Object.entries(e))if("children"!==l)if("string"==typeof u)if(o.has(l)&&u.startsWith("#")){const t=u.slice(1),n=r.get(t);n&&(e[l]="#"+n)}else if(i.has(l))e[l]=Ge(u,r);else if(s.has(l)||a(l,n)){const t=u.startsWith("#"),n=r.get(t?u.slice(1):u);n&&(e[l]=t?"#"+n:n)}else u.includes("url(#")&&(e[l]=Ge(u,r));else if("style"===l&&"object"==typeof u&&null!==u)for(const[t,e]of Object.entries(u))"string"==typeof e&&(u[t]=Ge(e,r));else"object"==typeof u&&null!==u&&t(u,l);else if(Array.isArray(u))for(const e of u)t(e)}(n);const l=null==(e=n.animator)?void 0:e.bindings;if(Array.isArray(l)){const t=l.map(t=>{var e;const n=t.target.startsWith("#"),o=n?t.target.slice(1):t.target,i=null!=(e=r.get(o))?e:o;return w(A({},t),{target:n?"#"+i:i})});n.animator=w(A({},n.animator),{bindings:t})}return n}function Ge(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function Ze(t,e=!1){var n,r,o,i;const s=t.v,a=t.i,l=t.o,u=t.c;if(!s.length)return"";const c=[],f=s.length;c.push("M"+s[0][0]+","+s[0][1]);for(let t=1;t<f;t++){const o=s[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==a?void 0:a[t])?r:s[t],f=s[t];e||i[0]!==o[0]||i[1]!==o[1]||u[0]!==f[0]||u[1]!==f[1]?c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1]):c.push("L"+f[0]+","+f[1])}if(u&&f>0){const t=s[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==a?void 0:a[0])?i:s[0],u=s[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 Ke(t,e,n){return t+(e-t)*n}function He(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Ke(t[i]||0,e[i]||0,n);return r}function Je(t,e,n){return[Ke(t[0]||0,e[0]||0,n),Ke(t[1]||0,e[1]||0,n),Ke(t[2]||0,e[2]||0,n),Ke(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Xe(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Qe(t[i],e[i],n));return o}function Qe(t,e,n){var r,o,i,s,a,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(He(f,h,d));const g=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(s=null==(i=e.i)?void 0:i[n])?s:h;m.push(He(g,y,d));const b=null!=(l=null==(a=t.o)?void 0:a[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;v.push(He(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 Ye(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 s(t){return((i*t+o)*t+r)*t}function a(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=s(l)-n;if(Math.abs(t)<1e-6)return l;const e=a(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=s(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function $e(t){const[e,n,r,o]=t,i=3*n,s=3*(o-n)-i,a=1-i-s;return function(t){return n=Ye(e,r,t),((a*n+s)*n+i)*n;var n}}function tn(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function en(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,s=Ye(n,o,e),a=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=tn(t,e,o),s=tn(e,n,o),a=tn(n,r,o),l=tn(i,s,o),u=tn(s,a,o),c=tn(l,u,o);return{left:[t,i,l,c],right:[c,u,a,r]}}([0,0],a,l,[1,1],s),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 nn(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function rn(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 on(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),s=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,a=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==s&&a.push(parseInt(s,16)/255),a}(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 sn=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),an=new Set(["translate","rotate","scale","skew"]),ln=new Set(["offset-distance","offsetDistance"]);function un(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,s=t.origin,a=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+")"),s&&o.push("translate("+s[0]+c+","+s[1]+c+")"),null!=a&&o.push("rotate("+a+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),s&&o.push("translate("+-s[0]+c+","+-s[1]+c+")"),o.join("")}function cn(t){var e,n;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let s,a=-1;for(;null!==(s=o.exec(t));){const t=s[1],o=i.indexOf(t);if(o<0||o<=a)return;a=o;const l=s[2].split(/[\s,]+/).filter(Boolean).map(Number);if(l.some(t=>Number.isNaN(t)))return;if("translate"===t){if(l.length<1||l.length>2)return;r.translate=[l[0],null!=(e=l[1])?e:0]}else if("rotate"===t){if(1!==l.length)return;r.rotate=l[0]}else if("skewX"===t){if(1!==l.length)return;r.skew=l[0]}else{if(l.length<1||l.length>2)return;r.scale=[l[0],null!=(n=l[1])?n:l[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}var fn=new Set(["offset-distance","offsetDistance"]);function dn(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function hn(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var pn=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 mn(t){return pn.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function vn(t,e,n){return Math.max(e,Math.min(t,n))}function gn(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,s=i*i,a=o*o,l=s*i,u=3*o*s,c=3*a*i,f=a*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 yn=1e-4;function bn(t,e,n,r,o){const i=kn(t,e,n,r,o);return 0===i[0]&&0===i[1]?kn(t,e,n,r,o<.5?o+yn:o-yn):i}function kn(t,e,n,r,o){const i=1-o,s=3*i*i,a=6*o*i,l=3*o*o;return[s*(e[0]-t[0])+a*(n[0]-e[0])+l*(r[0]-n[0]),s*(e[1]-t[1])+a*(n[1]-e[1])+l*(r[1]-n[1])]}function An(t,e,n,r,o=100){const i=o+1,s=new Float64Array(i),a=new Float64Array(i);let l=gn(t,e,n,r,0);s[0]=0,a[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=gn(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),s[c]=i,a[c]=u,l=f}return{ts:s,ds:a}}function wn(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,s=o;for(;i<s;){const t=i+s>>>1;n[t]<e?i=t+1:s=t}const a=n[s-1],l=n[s]-a,u=l>0?(e-a)/l:0;return r[s-1]+u*(r[s]-r[s-1])}var jn=new Set(["script","foreignobject"]),xn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),On=new Set(["href","xlink:href","src"]),Sn=new Set(["mixBlendMode","isolation"]),Pn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Mn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,_n=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,En=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Nn(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(xn.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)||On.has(n)&&(Pn.test(t)||Mn.test(t)||function(t){const e=_n.exec(t);return!!e&&En.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 Cn(t){const e={};for(const n of Object.keys(t)){const r=dn(n);if(Dt.has(r))continue;if("style"===r)continue;let o=t[n];if(sn.has(r)&&Array.isArray(o))e[r]=rn(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)an.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e[Ct]=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[Ct]=un(t,{withUnits:!1})}}return e}function Tn(t,e){if(!t)return t;const n=e&&"object"==typeof e&&!Array.isArray(e)?e:cn(e);if(!n||!Object.keys(n).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?A(A({},n),t):t,o=t[Ct];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=w(A({},e),{keyframes:e.keyframes.map(t=>w(A({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),w(A({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>an.has(t));if(1!==i.length)return t;const s=i[0],a=t[s];if(!a||"object"!=typeof a||!Array.isArray(a.keyframes))return t;const l=w(A({},a),{keyframes:a.keyframes.map(t=>w(A({},t),{value:w(A({},n),{[s]:t.value})}))});void 0!==l.value&&(l.value=w(A({},n),{[s]:l.value}));const u=A({},t);return delete u[s],w(A({},u),{transform:l})}function Dn(t){const e=Zt(t);if(!e)return;if(Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1])return[e[0],e[1]];const n=e.translate;return Array.isArray(n)&&n.length>=2?[n[0],n[1]]:void 0}function zn(t){return Gt(t)}function Fn(t){return Kt(t)}function Rn(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(Ht(t)||Jt(t))return!0;return!1}var In=new WeakMap;function Ln(t,e,n,r){let o=In.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const s=Jt(t),a=Ht(e),l=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],u=[r[0]+(a?a[0]:0),r[1]+(a?a[1]:0)],c=An(n,l,u,r),f={P0:n,P1:l,P2:u,P3:r,lut:c,totalArc:c.ds[c.ds.length-1]};return o||(o=new WeakMap,In.set(t,o)),o.set(e,f),f}var Wn=.5,Bn=5,Un=32;function Vn(t,e){var n,r,o;if(!Rn(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,a=null!=(n=null==e?void 0:e.flatnessTolerance)?n:Wn,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:Bn,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:Un,c=[],f=Dn(i[0]);if(!f)return t;const d=s?function(t,e){const n=Dn(t),r=Dn(e);if(!n||!r)return 0;const o=Ln(t,e,n,r),i=bn(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(i[0],i[1]):void 0;c.push(Gn(zn(i[0]),Hn(Zn(i[0]),Zn(i[0]),0,f,d,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=Dn(e),o=Dn(n);r&&o?(s&&t>0&&Xn(c,e,n,r,o,l),Yn(c,e,n,r,o,s,a,l,u)):c.push(Gn(zn(n),Hn(Zn(n),Zn(n),1,null!=o?o:[0,0],void 0,s)))}const h=Fn(i[i.length-1]);h&&(c[c.length-1].e=h),s&&qn(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function qn(t){let e;for(const n of t){const t=Zt(n);if(!t||"number"!=typeof t.rotate)continue;if(void 0===e){e=t.rotate;continue}let r=t.rotate;for(;r-e>180;)r-=360;for(;r-e<-180;)r+=360;t.rotate=r,e=r}}function Gn(t,e){return{t:t,v:e}}function Zn(t){const e=Zt(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function Kn(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,s="number"==typeof e[o]?e[o]:0;r[o]=i+(s-i)*n}return r}return n<.5?t:e}function Hn(t,e,n,r,o,i){const s={translate:r},a=new Set;if(t)for(const e of Object.keys(t))a.add(e);if(e)for(const t of Object.keys(e))a.add(t);for(const r of a){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],a=null==e?void 0:e[r];void 0===o&&void 0===a||(s[r]=Kn(o,a,n))}return void 0!==o&&(s.rotate=o+Jn(t,e,n)),s}function Jn(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=Kn(r,o,n);return"number"==typeof i?i:0}function Xn(t,e,n,r,o,i){const s=t[t.length-1],a=Zt(s),l=null==a?void 0:a.rotate;if("number"!=typeof l)return;const u=Zn(e),c=l-Jn(u,u,0),f=Ln(e,n,r,o),d=bn(f.P0,f.P1,f.P2,f.P3,0),h=180*Math.atan2(d[1],d[0])/Math.PI,p=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(h,c);if(Math.abs(p)<=i)return;const m=zn(e),v=Math.min(m+Qn,(m+zn(n))/2),g=Hn(Zn(e),Zn(e),0,r,h,!0);t.push(Gn(v,g))}var Qn=.05;function Yn(t,e,n,r,o,i,s,a,l){const u=Ln(e,n,r,o),c=zn(e),f=zn(n),d=Fn(e),h=(p=d)?$e([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Zn(e),v=Zn(n),g=function(t,e,n,r,o){const i=[];$n(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),$n(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const s=[0];for(const t of i)t>s[s.length-1]+1e-6&&t<.999999&&s.push(t);s.push(1);const a=[],l={remaining:o-s.length};for(let o=0;o<s.length-1;o++)tr(s[o],s[o+1],a,t,e,n,r,l);return a}(u,i,s,a,l),y=[];for(const t of g){const e=wn(u.lut,t),n=vn(u.totalArc>0?e/u.totalArc:t,0,1),r={u:vn(h(n),0,1),p:n,pos:gn(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=bn(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?vn((n.u-k)/(1-k),0,1):1,{left:o,right:s}=en(b,r),a=0===e?A:t.length-1;o?t[a].e=o:delete t[a].e;const l=c+n.u*(f-c),u=Hn(m,v,n.p,n.pos,n.rotateDeg,i);t.push(Gn(l,u)),b=s,k=n.u}}function $n(t,e,n,r,o){const i=e-t,s=n-e,a=i-2*s+(r-n),l=2*(s-i),u=i;if(Math.abs(a)<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*a*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*a),h=(-l+f)/(2*a);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function tr(t,e,n,r,o,i,s,a){const l=(t+e)/2,u=gn(r.P0,r.P1,r.P2,r.P3,t),c=gn(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=gn(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=gn(r.P0,r.P1,r.P2,r.P3,l),p=gn(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(er(d,u,c),er(h,u,c),er(p,u,c));let v=!0;if(o){const n=bn(r.P0,r.P1,r.P2,r.P3,t),o=bn(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,a=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-a);l>180&&(l=360-l),l>s&&(v=!1)}m<=i&&v||a.remaining<=0||f<1e-6?n.push(e):(a.remaining-=1,tr(t,l,n,r,o,i,s,a),tr(l,e,n,r,o,i,s,a))}function er(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 s=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(s)/Math.sqrt(i)}function nr(t,e){const n=rr(t,e);return null!=n?n:t}function rr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=rr(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 n=Tn(o,t.transform),i=n.transform;if(i&&"object"==typeof i&&Rn(i)){const t=Vn(i,e);t!==i&&(r=w(A({},n),{transform:t}))}}if(!n&&!r)return null;const i=A({},t);return n&&(i.children=n),r&&(i.animate=r),i}var or=1;function ir(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=>ir(t[n],e[n]))}function sr(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,s=o[4]||0,a=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([s,a]),n.i.push([r,i]),n.o.push([s,a])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function ar(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function lr(t){return"string"==typeof t&&void 0!==ar(t)}function ur(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const e=ar(t.pathData);return e?{paths:sr(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&lr(e[0])){const t=[];for(const n of e){const e=ar(n);e&&t.push(...sr(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&lr(t[0])){const e=[];for(const n of t){const t=ar(n);t&&e.push(...sr(t))}return{paths:e}}return{paths:t}}return lr(t)?{paths:sr(ar(t))}:t}function cr(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 fr(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 dr(t,e,n,r){var o,i;return"d"===t?{paths:Xe(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)}:sn.has(t)?Je(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?Ke(e,n,r):an.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?He(e||[],n||[],r):Ke(+(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],s=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=Ke(+(null!=r?r:0),+(null!=s?s:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=He(r||t,s||t,n)}else o[i]=null!=s?s:r}return o}(e,n,r)}function hr(t,e,n,r){var o,i,s,a,l;const u=e.length-1,c=vn(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.repeatAt===bt.start?e.slice(0,c+1):e.slice(u-c);const d=null!=(i=e[0].t)?i:0,h=null!=(s=e[e.length-1].t)?s:0;let p,m;n.repeatAt===bt.start?(p=0,m=d):(p=h,m=r);const v=m-p;if(v<=0)return e;const g=null!=(a=f[0].t)?a:0,y=(null!=(l=f[f.length-1].t)?l:0)-g;if(y<=0)return e;const b=f.map(t=>({relT:(t.t-g)/y,v:t.v,e:t.e,tangentIn:Ht(t),tangentOut:Jt(t)})),k=Math.floor(v/y),j=v-k*y,x=j/y,O=[],S=n.repeatAt!==bt.start,P=e[e.length-1];let M,_=!1;function E(e,n,r){var o;let i;if(n){i=[];for(let t=b.length-1;t>=0;t--)i.push({relT:1-b[t].relT,v:b[t].v,e:t>0?nn(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else i=b;const s=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>s+1e-9){const o=i[n-1],a=r.relT-o.relT,l=(s-o.relT)/a,u=o.e?$e(o.e)(l):l,c=dr(t,o.v,r.v,u),{left:f}=en(o.e,l);return O.length>0&&o.relT<=s&&(O[O.length-1].e=f),void O.push({t:e+s*y,v:c,e:void 0})}const a=O.length>0?O[O.length-1]:P,l=S&&0===n&&void 0!==a&&Math.abs((null!=(o=a.t)?o:0)-(e+r.relT*y))<1e-9;if(l){if(ir(a.v,r.v)){O.length>0?(a.e=r.e,a.tangentOut=r.tangentOut):(M=r.e,_=!0);continue}O.length>0&&(delete a.tangentIn,delete a.tangentOut)}const u={t:e+r.relT*y+(l?or: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.repeatAt===bt.start){x>1e-9&&function(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?nn(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const s=o[n-1];if(s&&s.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-s.relT,o=(i-s.relT)/n,a=s.e?$e(s.e)(o):o,l=dr(t,s.v,r.v,a),{right:u}=en(s.e,o);O.push({t:e,v:l,e:u})}const a={t:e+(r.relT-i)*y,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(a.tangentIn=r.tangentIn),r.tangentOut&&(a.tangentOut=r.tangentOut),O.push(a)}}(p,n.direction===kt.alternate&&k%2==0,x);for(let t=0;t<k;t++){const e=k-1-t,r=n.direction===kt.alternate&&e%2==0;E(p+j+t*y,r)}}else{for(let t=0;t<k;t++){const e=n.direction===kt.alternate&&t%2==0;E(p+t*y,e)}if(x>1e-9){const t=n.direction===kt.alternate&&k%2==0;E(p+k*y,t,x)}}return n.repeatAt===bt.start?[...O,...e]:_&&e.length>0?[...e.slice(0,-1),w(A({},e[e.length-1]),{e:M}),...O]:[...e,...O]}function pr(t,e,n,r){var o;const i=e.keyframes||[],s=[];for(const e of i){const n=Gt(e);let i=Zt(e);const a=Kt(e);"d"===t&&(i=ur(i));const l=hn(t)?mn(t):t;sn.has(l)&&(i=null!=(o=on(i))?o:i);const u={t:n,v:i,e:cr(a,r)},c=Ht(e),f=Jt(e);c&&(u.tangentIn=c),f&&(u.tangentOut=f),s.push(u)}s.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const a=e.loop,l=!0===a?{}:a||void 0;return l&&s.length>=2?hr(t,s,l,n):s}function mr(t,e,n){const r=e.loop;if(null==r||!1===r)return e;const o=!0===r?{}:r,i=e.keyframes;if(!Array.isArray(i)||i.length<2)return e;const s=hn(t)?mn(t):t,a=sn.has(s),l=i.map(e=>{var n;const r=Gt(e);let o=Zt(e);"d"===t&&(o=ur(o)),a&&(o=null!=(n=on(o))?n:o);const i={t:r,v:o,e:Kt(e)},s=Ht(e),l=Jt(e);return s&&(i.tangentIn=s),l&&(i.tangentOut=l),i}),u={keyframes:hr(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function vr(t,e){const n=gr(t,e);return null!=n?n:t}function gr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=gr(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=mr(n,o,e);i!==o&&(r||(r=A({},t)),r[n]=i)}}if(!n&&!r)return null;const i=A({},t);return n&&(i.children=n),r&&(i.animate=r),i}var yr=0;function br(t,e=dt.native){const n=It(t)||{},r=Bt(t),o=n.duration||1e3,i=[],s=(t,n,i)=>{if(0===n.length)return null;const s=function(t,e,n,r=dt.native){const o={};for(const[i,s]of Object.entries(t)){if("transform"===i&&"offsetPath"===s.alongPathMode&&void 0!==t.offsetDistance)continue;const a=pr(i,s,e,n);if(a.length>0){const t={keyframes:a};void 0!==s.autoOrient&&(t.autoOrient=s.autoOrient),void 0!==s.loop&&(t.loop=s.loop),o[i]=r===dt.native&&"transform"===i?Vn(t):t}}return o}(Tn(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(n),i),o,r,e);return 0===Object.keys(s).length?null:{id:t,animate:s}},a=function(t){var e;if(t)return null==(e=It(t))?void 0:e.bindings}(t);if(a)for(const t of a){const e=t.target.startsWith("#")?t.target.slice(1):t.target,n=t.animateWith.map(t=>fr(t,r)).filter(t=>!!t),o=s(e,n);o&&i.push(o)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++yr;t.id=n;const o=s(n,function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=fr(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=fr(r,e);t&&n.push(t)}else n.push(t);return n}(e,r),t.transform);o&&i.push(o)}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 kr(t,e,n){var r,o,i,s,a;const l=e.keyframes||[];if(0===l.length)return null;const{prevKf:u,nextKf:c}=function(t,e){var n,r;const o=t.length-1;let i=t[0],s=t[o>0?1:0];for(let a=0;a<o;a++){const l=null!=(n=t[a].t)?n:0,u=null!=(r=t[a+1].t)?r:0;if(l<=e&&e<=u){i=t[a],s=t[a+1];break}e>u&&a===o-1&&(i=t[o>0?o-1:0],s=t[o])}return{prevKf:i,nextKf:s}}(l,n);let f=u===c?0:(d=n,h=null!=(r=u.t)?r:0,(p=null!=(o=c.t)?o:0)===h?0:0+(d-h)/(p-h)*1);var d,h,p;f=vn(f,0,1);const m=Kt(u);if(m&&Array.isArray(m))try{f=$e(m)(f)}catch(t){}let v=hn(t)?mn(t):t,g=null;const y=null==u?void 0:u.v,b=null==c?void 0:c.v;if("d"===v)g=Xe(null!=(i=null==y?void 0:y.paths)?i:Array.isArray(y)?y:[],null!=(s=null==b?void 0:b.paths)?s:Array.isArray(b)?b:[],f).map(t=>Ze(t)).join("");else if(sn.has(v))g=rn(Je(y||[0,0,0,1],b||[0,0,0,1],f)),v=t;else if("stroke-dasharray"===v)g=He(y||[],b||[],f).join(" "),v=t;else if("transform"!==v||null===y||"object"!=typeof y||Array.isArray(y))"translate"===v?(g="translate("+He(y||[0,0],b||[0,0],f).join(",")+")",v="transform"):"rotate"===v?(g="rotate("+Ke(+(y||0),+(b||0),f)+")",v="transform"):"scale"===v?(g="scale("+He(y||[1,1],b||[1,1],f).join(",")+")",v="transform"):g=Ke(+(y||0),+(b||0),f);else{const t=new Set([...y?Object.keys(y):[],...b?Object.keys(b):[]]),n={};for(const e of t){const t=null==y?void 0:y[e],r=null==b?void 0:b[e];if("rotate"===e||"skew"===e)n[e]=Ke(+(null!=t?t:0),+(null!=r?r:0),f);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=He(t||o,r||o,f);n[e]=i}}if(Rn(e)){const t=y.translate,r=b.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,e,n,r,o,i){const s=Ln(t,e,n,r),a=0===s.totalArc?o:function(t,e){const n=e*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(n<=0)return r[0];if(n>=o[i])return r[i];let s=1,a=i;for(;s<a;){const t=s+a>>>1;o[t]<n?s=t+1:a=t}const l=o[a-1],u=o[a]-l,c=u>0?(n-l)/u:0;return r[a-1]+c*(r[a]-r[a-1])}(s.lut,o),l=gn(s.P0,s.P1,s.P2,s.P3,a);if(!i)return{translate:l};const u=bn(s.P0,s.P1,s.P2,s.P3,a);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}(u,c,[+t[0],+t[1]],[+r[0],+r[1]],f,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg+(null!=(a=n.rotate)?a:0))}}g=un(n,{withUnits:!1}),v="transform"}return ln.has(v)&&"number"==typeof g&&(g=100*g+"%"),{k:v,v:null===g?"":""+g}}function Ar(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=kr(r,o,e);t&&(n[t.k]=t.v)}return n}var wr=48,jr=/[MmLlHhVvCcSsQqTtAaZz]/;function xr(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 Or(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,s=0,a=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const s=[o,i],a=An(s,t,e,r,wr);n.push({P0:s,P1:t,P2:e,P3:r,lut:a,len:a.ds[a.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];jr.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,s=e,a=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:s}=xr([o,i],t,e);p(r,s,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:s}=xr([o,i],t,e);p(r,s,e)}else{if("A"!==v){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(s,a),o=s,i=a,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,s=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,a=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],s=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,s=o;for(;i<s;){const t=i+s>>>1;r[t]<e?i=t+1:s=t}const a=r[s-1],l=r[s]-a,u=l>0?(e-a)/l:0;return n[s-1]+u*(n[s]-n[s-1])}(o.lut,i):0,[a,l]=gn(o.P0,o.P1,o.P2,o.P3,s),[u,c]=bn(o.P0,o.P1,o.P2,o.P3,s);return{x:a,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:s,sampleAtDistance(t){if(s&&r>0&&(t<0||t>r))return a((t%r+r)%r);if(!s&&(t<0||t>r)){const e=t<0?0:r,n=a(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 a((n=r,(e=t)<0?0:e>n?n:e));var e,n}}}function Sr(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 Pr(t){var e,n;if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const r=t,o=r.keyframes;if(o){const t={kind:"animated",keyframes:o.map(_r),autoOrient:r.autoOrient,loop:r.loop},n=null!=(e=r.value)?e:r.v;return void 0!==n&&"animated"===t.kind&&(t.base=n),t}const i=null!=(n=r.value)?n:r.v;if(void 0!==i)return{kind:"static",value:i}}return{kind:"static",value:t}}function Mr(t,e,n,r){var o,i,s,a;const l=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=l(n.value));const u=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,c=A({},u||{}),f={keyframes:n.keyframes};void 0!==n.loop&&(f.loop=n.loop),void 0!==n.autoOrient&&(f.autoOrient=n.autoOrient),c[e]=f,t.animate=c;const d=null!=(a=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?a:null==(s=n.keyframes[0])?void 0:s.v;void 0!==d&&(t[e]=l(d))}function _r(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=A({},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 Er(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 Nr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Nr);const e={};for(const n of Object.keys(t))e[n]=Nr(t[n]);return e}function Cr(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 Tr(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Dr(t){var e;const n=Tr(t.x),r=Tr(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 zr(t,e){return"_lw_"+e+"_"+t.nextId++}function Fr(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Rr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Rr(t,e))}var Ir=Nr,Lr=.15;function Wr(t){const e=Pr(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 Br(t){let e=0,n=16;const r=t=>{var o;const i=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;i&&(n=Math.max(n,i));const s=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 Ur=t=>Math.round(1e3*t)/1e3;function Vr(t,e,n){null!=n&&Mr(t,e,Pr(n),{asString:!0})}var qr=(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 Gr(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function Zr(t,e){let n="";for(let r=0;r<t.length;r++){const o=Gr(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function Kr(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var Hr=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Jr(t,e,n=2){const r=[];let o;for(Hr.lastIndex=0;null!==(o=Hr.exec(t));)r.push(o[0]);let i="",s=0;const a=()=>parseFloat(r[s++]);for(;s<r.length;){const t=r[s++];if("M"===t||"L"===t){const[r,o]=Kr(e,a(),a());i+=t+Zr([r,o],n)}else if("C"===t){const[t,r]=Kr(e,a(),a()),[o,s]=Kr(e,a(),a()),[l,u]=Kr(e,a(),a());i+="C"+Zr([t,r,o,s,l,u],n)}else if("Q"===t){const[t,r]=Kr(e,a(),a()),[o,s]=Kr(e,a(),a());i+="Q"+Zr([t,r,o,s],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var Xr=16,Qr=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",Et,"xml:space"],Yr=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],$r=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function to(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function eo(t){return"string"==typeof t?t:void 0}function no(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of $r)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function ro(t,e){var n,r,o,i,s,a,l,u,c,f;const d="text"===t.type,h=t.style,p=e=>{var n;return d?void 0:null!=(n=t[e])?n:null==h?void 0:h[e]},m={fontFamily:null!=(n=eo(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=to(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(s=t.strokeWidth)?s:e.strokeWidth,letterSpacing:null!=(a=to(t.letterSpacing))?a:e.letterSpacing,wordSpacing:null!=(l=to(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=to(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:no(t))?c:e.animate};for(const t of Yr){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function oo(t){var e,n,r;return{fontFamily:eo(t.fontFamily),fontSize:null!=(e=to(t.fontSize))?e:Xr,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=to(t.letterSpacing))?n:0,wordSpacing:null!=(r=to(t.wordSpacing))?r:0}}function io(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&1!==t.opacity&&(e.opacity=t.opacity);for(const n of Yr)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function so(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 ao(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}var lo=.6,uo="px-missing-glyph";function co(t,e){if(t<=0||e<=0)return"";const n=.08*t,r=.92*t,o=.92*-e,i=r-n,s=-o,a=Math.max(1,.12*Math.min(i,s)),l="M"+n+" 0L"+r+" 0L"+r+" "+o+"L"+n+" "+o+"Z";if(i<=2*a||s<=2*a)return l;const u=n+a,c=r-a,f=-a,d=o+a;return l+"M"+u+" "+f+"L"+u+" "+d+"L"+c+" "+d+"L"+c+" "+f+"Z"}function fo(t,e,n,r,o=0){const{x:i,y:s,angle:a}=t.sampleAtDistance(e),l=Math.cos(a),u=Math.sin(a),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,s-n*u*c+o*l]}function ho(t){var e;const n=Pr(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 po=48,mo=64;function vo(t,e){const n=b(10,e);return Math.round(t*n)/n}function go(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(e.opacity=t.opacity);for(const n of Yr)void 0!==t[n]&&(e[n]=t[n]);return e}function yo(t){return t?{[Nt]:uo}:{}}function bo(t,e,n){if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const r=new Map;for(const e of t){const t=JSON.stringify([e.paint,!!e.isMissing]),n=Jr(e.glyphD,e.m),o=r.get(t);o?o.d+=n:r.set(t,{paint:e.paint,d:n,isMissing:e.isMissing})}const o=[];for(const{paint:t,d:n,isMissing:i}of r.values())o.push(e("path",A(A(A({d:n},go(t)),yo(i)),void 0!==t.animate?{animate:A({},t.animate)}:{}),[]));return o}function ko(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===Qr.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=A({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function Ao(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=jo(r,e.origin,!0),r=wo(r,"scale",e.scale),r=wo(r,"skew",e.skew),r=wo(r,"rotate",e.rotate),r=jo(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=jo(r,e.origin,!0),r=wo(r,"translate",e.translate),r=jo(r,e.origin,!1)):r=wo(r,"translate",e.translate),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function wo(t,e,n,r){if(void 0===n)return t;const o=Pr(n);if("static"===o.kind)return{type:"g",transform:{value:Sr(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>Er(t,Sr(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 jo(t,e,n){if(void 0===e)return t;const r=Pr(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=>Er(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function xo(t,e,n){var r,o,i;if("use"===t.type&&"translate"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.without)){const r=Fr(t.effects.clone.source);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>xo(t,e,n))}function Oo(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 So(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 Po(t,e,n,r){if(!e)return t;const o=zr(n,"grad"),i=function(t,e){const n={type:t.type===Rt.radial?"radialGradient":"linearGradient",id:e};return t.type===Rt.linear?(Mo(n,"x1","y1",t.start),Mo(n,"x2","y2",t.end)):(Mo(n,"cx","cy",t.center),function(t,e,n){const r=Pr(n);"absent"!==r.kind&&Mr(t,"r",r,{asString:!0})}(n,0,t.radius),Mo(n,"fx","fy",t.focal)),t.gradientUnits&&(n.gradientUnits=t.gradientUnits),t.spreadMethod&&(n.spreadMethod=t.spreadMethod),t.gradientTransform&&(n.gradientTransform=t.gradientTransform),n.children=function(t){var e,n;if(!t)return[];const r=Pr(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(_o):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let s=0;for(const t of o){const e=Zt(t);Array.isArray(e)&&e.length>s&&(s=e.length)}if(!s)return[];const a=Zt(o[0]),l=[];for(let t=0;t<s;t++){const r=null!=(n=null!=(e=null==a?void 0:a[t])?e:Eo(o,0,t))?n:{offset:t/Math.max(1,s-1),color:"#000000"};l.push({offset:r.offset,color:r.color})}return l.map((t,e)=>function(t,e,n,r,o){var i;const s=[],a=[];let l=!1;for(const r of e){const o=Gt(r),u=Zt(r),c=null!=(i=null==u?void 0:u[n])?i:Eo(e,e.indexOf(r),n);if(!c)continue;const f=Kt(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),s.push(d);const h={time:o,value:c.offset};void 0!==f&&(h.easing=f),a.push(h),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:No(t.offset),stopColor:t.color},c={};return s.length&&(c.stopColor={keyframes:s},void 0!==o&&(c.stopColor.loop=o)),l&&a.length&&(c.offset={keyframes:a},void 0!==o&&(c.offset.loop=o)),Object.keys(c).length&&(u.animate=c),u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function Mo(t,e,n,r){var o,i,s;const a=Pr(r);if("absent"===a.kind)return;if("static"===a.kind)return t[e]=String(a.value[0]),void(t[n]=String(a.value[1]));const l=t=>{const e={keyframes:a.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!==a.loop&&(e.loop=a.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(s=a.base)?s:null==(i=a.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function _o(t){return{type:"stop",offset:No(t.offset),stopColor:t.color}}function Eo(t,e,n){for(let r=e;r>=0;r--){const e=Zt(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=Zt(t[r]);if(null==e?void 0:e[n])return e[n]}}function No(t){return Math.round(1e3*t)/10+"%"}function Co(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function To(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=Pr(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=Do(o,"translate",e.translate,void 0),o=Do(o,"rotate",e.rotate,r),o=Do(o,"scale",e.scale,r),o}function Do(t,e,n,r,o){if(void 0===n)return t;const i=Pr("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:Sr(e,zo(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=Er(t,Sr(e,zo(e,t.value),r));return"translate"===e?A(A({},n),Fo(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function zo(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Fo(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 Ro(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Io(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 Lo(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Wo(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Wo(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 Bo(t,e){var n,r,o;const i=t.transform,s=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!s)return;const a={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,s=!1,a=!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,s=!0):a=!0}return a&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t),s?[o,i]:void 0}(i,e);t&&(a.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(a.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(s&&Array.isArray(s.keyframes)){const t=s.keyframes,i=[];for(const s of t){const t=null!=(n=s.value)?n:s.v,a=null!=(o=null!=(r=s.time)?r:s.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:a,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&&(a.translateKeyframes=i)}return a.translate||a.translateKeyframes?a:void 0}function Uo(t,e,n){if(!e)return;const r=Fr(e.source);if(!r)return void(e.without===xt.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===xt.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Vo(t,e){const n={};return void 0!==t.translate&&(n.translate=qo(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=qo(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=qo(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){return qo(t,t=>[Math.pow(t[0],e),Math.pow(t[1],e)],!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function qo(t,e,n=!1){const r=Pr(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return"number"!=typeof t&&!Array.isArray(t)||n?{value:o}:o}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?w(A({},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}var Go=!1;function Zo(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}var Ko=1;function Ho(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-Ko),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+Ko,value:0}],s=A({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[s],t.animate={opacity:{keyframes:i}}}function Jo(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Xo(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function Qo(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 Yo(t,e,n){const r=Fr(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=$o(r,e,n,new Set);if(o)if(Go){const e=n.idMap.get(o);t.type="g",delete t.href,t.children=[e],Dr(t),n.defs=n.defs.filter(t=>t!==e)}else t.href="#"+o}function $o(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=Ir(o);if(function(t,e){Cr(t,()=>zr(e,"retimed"))}(i,n),"use"===o.type?ei(i,e.start,e.stretch):ti(i,e.start,e.stretch),Qo(i),"use"===o.type&&o.href){const s=Fr(o.href);if(s){const a=Xo(o),l=a?Jo(Zo(a),e):e,u=new Set(r);u.add(t);const c=$o(s,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var s;const a=Xo(t);if("use"===t.type&&a&&t.href){const i=Fr(t.href);if(i){const s=Jo(Zo(a),e),l=new Set(r);l.add(o);const u=$o(i,s,n,l);u&&(t.href="#"+u)}Qo(t)}null==(s=t.children)||s.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 ti(t,e,n){var r;ei(t,e,n),null==(r=t.children)||r.forEach(t=>ti(t,e,n))}function ei(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)}}function ni(t,e){const n=w(A({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function ri(t,e,n,r,o,i,s,a){const l=ii(r,n,o),u=si(n,o),c=li(i,l),f=li(s,u),d=fi(s),h={type:"path",d:Ze(e)};return ui(h,"strokeDasharray",f),ui(h,"strokeDashoffset",c),ui(h,"strokeOpacity",d),[h]}var oi=1;function ii(t,e,n){const[r]=ai(n);return n=>e*(-n-r+t)+oi}function si(t,e){const[n,r]=ai(e),o=r-n+1;return e=>{const n=vn(e[0],0,1),r=vn(e[1],0,1),i=Math.min(n,r),s=Math.max(n,r),a=[0];let l=oi;for(let e=0;e<o;e++)a.push(l+i*t),a.push((s-i)*t),l=(1-s)*t;return a.push(l+oi),a}}function ai(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function li(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:Gt(t),value:e(Zt(t)),easing:Kt(t)})),loop:t.loop}}function ui(t,e,n){n&&Mr(t,e,n)}var ci=10;function fi(t){const e=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return e(t.value)?{kind:"static",value:0}:void 0;const n=t.keyframes;let r=!1,o=!0;for(const t of n)e(Zt(t))?r=!0:o=!1;if(!r)return;if(o)return{kind:"static",value:0};const i=[];for(let t=0;t<n.length;t++){const r=n[t],o=t>0?n[t-1]:void 0,s=t<n.length-1?n[t+1]:void 0,a=Gt(r),l=e(Zt(r)),u=o?l&&e(Zt(o)):l,c=s?l&&e(Zt(s)):l;u&&!c?(i.push({time:a,value:0}),i.push({time:a+ci,value:1})):!u&&c&&(i.push({time:a-ci,value:1}),i.push({time:a,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function di(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 s=n(o);if(0===s)return o;if(i*s>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 hi(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 pi(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+=mi(t,r,r+1);return t.c&&e.length>1&&(n+=mi(t,e.length-1,0)),n}function mi(t,e,n){var r,o,i,s;const a=t.v,l=a[e],u=a[n],c=An(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(s=null==(i=t.i)?void 0:i[n])?s:u,u);return c.ds[c.ds.length-1]}var vi=.5522847498307936;function gi(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:pt(null==(e=It(t))?void 0:e.engine),glyphs:null==(n=Bt(t))?void 0:n.fonts},o=Ir(t);Rr(o,r.idMap),xo(o,r,()=>zr(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const s=Fr(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof s){n.add(t);const r=e.idMap.get(s);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=Bo(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(),Rr(t,e.idMap);const n=[],r=t=>{var e;Xo(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 s;if(o){if(o!==t&&Xo(o)&&n++,"use"===o.type&&o.href){const t=Fr(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(s=o.children)||s.forEach(i)}},s=Fr(t.href);s&&(r.add(s),i(e.idMap.get(s))),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=Xo(t);if(!n)continue;const r=n.timeCrop;Qo(t),Yo(t,Zo(n),e),r&&Ho(t,r,e)}}(t,e),t}(yi(o,r),r);return function(t,e){e.length&&(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function yi(t,e){t.children&&(t.children=t.children.map(t=>yi(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:s,maskedBy:a,clipPath:l,strokeTrim: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.pathData?h.pathData:void 0,n=function(t,e,n,r,o,i){return e.glyphs?function(t,e,n,r,o,i){const{glyphs:s,create:a=qr,warnings:l}=r,u=e?Or(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=ao(s),{cells:f,width:d}=function(t,e,n,r){const o=[];let i=0;const s=(t,a)=>{var l,u;const c=ro(t,a),f=eo(t[Et]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=so(c,e,n,r);if(t){const e=c.fontSize/t.unitsPerEm,n=null!=(u=t.ascent)?u:.9*t.unitsPerEm,r=io(c);for(let s=0;s<f.length;s++){const a=f.charAt(s),l=t.glyphs[a];if(l&&l.pathData){const t=l.width*e;o.push({glyphD:l.pathData,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(a)){const s=l&&l.width>0?l.width:lo*t.unitsPerEm,a=s*e;o.push({glyphD:co(s,n),widthEm:s,scale:e,paint:r,isMissing:!0,midBase:i+a/2}),i+=a}else i+=(l?l.width:0)*e;i+=c.letterSpacing+(" "===a?c.wordSpacing:0)}}}if(t.children)for(const e of t.children)s(e,c)};return s(t,oo(t)),{cells:o,width:i}}(t,s,c,l);if(!f.length)return ko(t,[],a);const{along:h,perp:p}=function(t){var e,n,r;return{along:(null!=(e=to(t.x))?e:0)+(null!=(n=to(t.dx))?n:0),perp:null!=(r=to(t.dy))?r:0}}(t),m=ho(n),v=ho(o),g=t=>t>0&&d>0?t/d:1,y="clip"===i&&!u.closed;if(m.animated||v.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(m.times,v.times),n=(t,e)=>h+m.at(e)+g(v.at(e))*t.midBase,r=m.animated?m.loop:v.loop;return ko(t,function(t,e,n,r,o,i,s,a=0){const l=Math.max(e.totalLength/po,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const f of t){const t=[f.scale,0,0,f.scale,-f.scale*(f.widthEm/2),0],d=Jr(f.glyphD,t),h=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),s=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[vo(r-a*l,3),vo(o+a*s,3)],rotate:vo(180*i/Math.PI,3)}}},p=[],m=[],v=(t,e)=>{p.push(h(t,e)),s&&m.push({time:e,value:u(t)?1:0})};v(n(f,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(f,e),s=n(f,o),a=Math.min(mo,Math.max(1,Math.ceil(Math.abs(s-i)/l)));for(let t=1;t<=a;t++){const r=e+t/a*(o-e);v(n(f,r),r)}}qn(p);const g={keyframes:p};void 0!==o&&(g.loop=o);const y={transform:g};if(f.paint.animate&&Object.assign(y,f.paint.animate),s&&m.some(t=>0===t.value)){const t={keyframes:m};void 0!==o&&(t.loop=o),y.opacity=t}c.push(i("path",w(A(A({d:d},go(f.paint)),yo(f.isMissing)),{animate:y}),[]))}return c}(f,u,n,e,r,a,y,p),a)}const b=g(v.at(0)),k=h+m.at(0);return ko(t,bo((y?f.filter(t=>{const e=k+t.midBase*b;return e>=0&&e<=u.totalLength}):f).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:fo(u,k+t.midBase*b,t.scale,t.widthEm,p)})),a,l),a)}(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.fonts"),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?function(t,e){var n,r,o;const{glyphs:i,create:s=qr,warnings:a}=e,l=ao(i),u={x:null!=(n=to(t.x))?n:0,y:null!=(r=to(t.y))?r:0},c=[],f=[{start:u.x,end:u.x}];let d=0;const h=(t,e)=>{var n;const r=so(e,i,l,a),o=(null==r?void 0:r.unitsPerEm)||1e3,s=e.fontSize/o,h=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=io(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),a=null==r?void 0:r.glyphs[i];if(a&&a.pathData)c.push({glyphD:a.pathData,m:[s,0,0,s,u.x,u.y],paint:p,line:d,x:u.x,y:u.y,scale:s}),u.x+=a.width*s;else if(/\S/.test(i)){const t=a&&a.width>0?a.width:lo*o;c.push({glyphD:co(t,h),m:[s,0,0,s,u.x,u.y],paint:p,isMissing:!0,line:d,x:u.x,y:u.y,scale:s}),u.x+=t*s}else u.x+=(a?a.width:0)*s;u.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),f[d].end=u.x}},p=(t,e)=>{var n,r,o;const i=ro(t,e),s=to(t.x),a=to(t.y);void 0!==s&&(u.x=s,d=f.length,f.push({start:u.x,end:u.x})),void 0!==a&&(u.y=a),u.x+=null!=(n=to(t.dx))?n:0,u.y+=null!=(r=to(t.dy))?r:0;const l=eo(t[Et]);if(l&&!(null==(o=t.children)?void 0:o.length)&&h(l,i),t.children)for(const e of t.children)p(e,i)},m=oo(t);if(t.children)for(const e of t.children)p(e,m);const v=eo(t[Et]);v&&!(null==(o=t.children)?void 0:o.length)&&h(v,m);const g=eo(t.textAnchor);if("middle"===g||"end"===g)for(const t of c){const e=f[t.line].end-f[t.line].start,n="middle"===g?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return ko(t,bo(c,s,a),s)}(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.fonts — 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.pathData||!e.pathData)return t;const o=zr(n,"tpath"),{d:i,startShift:s}=function(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Or(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=Lr*o,s=Wr(e.startOffset),a=Wr(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-s.min),u=Math.max(0,s.max+a-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"+Ur(e)+","+Ur(n)+"L"+Ur(d.x)+","+Ur(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"+Ur(t)+","+Ur(e)}return{d:p,startShift:c}}(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:Br(t)});n.defs.push({type:"path",id:o,d:i});const a={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(a.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(a.method=e.method),void 0!==e.spacing&&(a.spacing=e.spacing),Vr(a,"startOffset",function(t,e){if(!e||null==t)return t;const n=Pr(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=>w(A({},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}(e.startOffset,s)),Vr(a,"textLength",e.textLength),t.children=[a],t}(m,h,e)),m=function(t,e,n){return Po(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return Po(t,e,n,"stroke")}(m,d,e),m=function(t,e){if(!e)return t;const n=e.subPaths===_t.combined,r=[],o=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)o(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,s,a,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),s=Number(null!=(n=t.y)?n:0),a=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+a)+","+s+"L"+(i+a)+","+(s+l)+"L"+i+","+(s+l)+"L"+i+","+s+"L"+(i+a)+","+s+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(s=t.cy)?s:0),r="circle"===t.type?Number(null!=(a=t.r)?a: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*vi,d=o*vi,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}}(t);if(void 0===e)return;const n=sr(e);if(!n.length)return;const i={leaf:t,subpaths:[]};for(const t of n){const e=pi(t);i.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}r.push(i)};if(o(t),!r.length)return t;let i=0;const s=n?[...r].reverse():r;for(const t of s)for(const e of t.subpaths)n||(i=0),e.startOffsetPx=i,i+=e.lengthPx;const a=i;if(n&&a<.001)return t;const l=Pr(e.offset),u="absent"===l.kind?{kind:"static",value:0}:l,c=function(t){const e=Pr(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:Gt(t),value:Zt(t),easing:Kt(t)}));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=di(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 s=0;for(const t of n){for(;s<o.length&&o[s]<t.time;){const t=o[s++],e=hi(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(;s<o.length;){const t=o[s++],e=hi(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),f="absent"===c.kind?{kind:"static",value:[0,1]}:c,d=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=Zt(n);"number"==typeof t&&e.push(t)}return e}(u),h=[d.length?Math.min(...d):0,d.length?Math.max(...d):0];if(1===r.length&&r[0].leaf===t&&1===r[0].subpaths.length){const e=r[0],o=e.subpaths[0],i=n?a:o.lengthPx;if(i<.001)return t;const s=n?o.startOffsetPx/i:0;return function(t,e,n,r,o,i){const s=ii(n,e,r),a=si(e,r),l=A({},t);return delete l.effects,ui(l,"strokeDasharray",li(i,a)),ui(l,"strokeDashoffset",li(o,s)),ui(l,"strokeOpacity",fi(i)),l}(e.leaf,i,s,h,u,f)}const p=new Map;for(const t of r){const e=[];for(const r of t.subpaths){const o=n?a:r.lengthPx;if(o<.001)continue;const i=n?r.startOffsetPx/o:0;e.push(...ri(t.leaf,r.subpath,o,i,h,u,f))}p.set(t.leaf,ni(t.leaf,e))}const m=t=>p.get(t)||(Array.isArray(t.children)&&t.children.length>0?w(A({},t),{children:t.children.map(m)}):t);return m(t)}(m,u),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const s=t.transform,a=null==(o=t.animate)?void 0:o.transform,l=Ir(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const n=Ir(l),r=Vo(e,t),o=r?Ao(n,r):n;u.push(o)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==s&&(c.transform=s),void 0!==a&&(c.animate={transform:a}),c}(m,s,e),m=function(t,e,n,r){if(!e)return t;const o=Fr(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=zr(r,"mask");let s={type:"use",href:"#"+o};if(n)s=To(s,n,r);else if(Ro(t))s=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 s=[],a=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=Er(t,void 0);if(Array.isArray(e.translate)&&s.push(w(A(A({},r),Fo(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]]),a.push(w(A({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(w(A({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;return s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]}),a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]}),l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]}),f}(s,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,s,a,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!=(s=v[e].args[1])?s: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!=(a=m.rotate)?a:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;for(const t of v)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};return y&&(A.translate=y),void 0!==b&&(A.rotate=b),k&&(A.scale=k),Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}}(t);e&&(s=To(s,e,r))}const a=void 0===n&&!function(t){return"string"==typeof t.transform||!(!t.transform||"object"!=typeof t.transform)||Ro(t)}(t);s=function(t,e,n,r,o){const i=r.idMap.get(n),s=r.maskAncestorChains.get(e)||[],a=o?Bo(e,r):void 0,l=a?[...s,a]:s,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=Io(l),n=Io(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}return{type:"g",animate:{transform:{keyframes:Array.from(c).sort((t,e)=>t-e).map(t=>{const e=Lo(l,t),n=Lo(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(s,t,o,r,a);const l={type:"mask",id:i,children:[s]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}(m,a,i,e),m=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=zr(n,"clip"),o={type:"path"},i=Pr(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=Co(i.value):(Mr(o,"d",i),void 0!==o.d&&(o.d=Co(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(Uo(m,c,e),m=function(t,e,n,r){const o=function(t,e){var n,r,o;const i={};let s=!1;const a=null==(n=t.animate)?void 0:n.transform;if(a&&"object"==typeof a&&Array.isArray(a.keyframes)){const e=a.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=So(a),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})};a.autoOrient&&(r.autoOrient=!0);const o=a.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}s=!0}}const l=void 0!==(null==e?void 0:e.translate),u=s||l,c=s&&So((null==(r=t.animate)?void 0:r.transform)||void 0)||s&&So((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=Oo(i.full),r=Oo(o.full),s=-n[0],a=-n[1],l=r[0]-s,u=r[1]-a;return 0===l&&0===u?{rest:t}:{translate:"translate("+l+","+u+")",rest:"translate("+s+","+a+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const s=[];let a=0;for(;a<e.length&&"translate"===e[a].name;)s.push(e[a].full),a++;if(!s.length)return{rest:t};const l=e.slice(a).map(t=>t.full).join("");return{translate:s.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:(function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)||c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform))&&delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){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=A({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:s}=function(t){if(!t)return{};const e=So(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};return void 0!==t.translate&&(r.translate=t.translate),e&&void 0!==t.origin&&(r.origin=t.origin),void 0!==t.rotate&&(o.rotate=t.rotate),void 0!==t.scale&&(o.scale=t.scale),void 0!==t.skew&&(o.skew=t.skew),void 0===t.origin||e&&!n||(o.origin=t.origin),{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let a=t;a=Ao(a,s);let l={type:"g",id:n,children:[{type:"g",id:r,children:[a]}]};return void 0!==o.transform&&(l.transform=o.transform),void 0!==o.animate&&(l.animate=o.animate),i&&(delete l.id,l=Ao(l,i),l.id=n),l}(m,i,r,o)):m=function(t,e,n,r){return Uo(t,e,r),Ao(t,n)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}function bi(t,e,n,r,o){const i=1-o,s=i*i*i,a=3*i*i*o,l=3*i*o*o,u=o*o*o;return[s*t[0]+a*e[0]+l*n[0]+u*r[0],s*t[1]+a*e[1]+l*n[1]+u*r[1]]}function ki(t,e,n,r,o=64){let i=0,s=t;for(let a=1;a<=o;a++){const l=bi(t,e,n,r,a/o);i+=Math.hypot(l[0]-s[0],l[1]-s[1]),s=l}return i}var Ai=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function wi(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function ji(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function xi(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 Oi(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const s=ji(t.href);if(s&&n.has(s)){const a=e.get(s);if(a)return function(t,e,n,r,o,i,s){var a,l,u,c;const f=Nr(e);Cr(f,o);const d="symbol"===f.type?xi(f.viewBox):void 0,h=null!=(l=null!=(a=wi(t.width))?a:null==d?void 0:d[2])?l:s[0],p=null!=(c=null!=(u=wi(t.height))?u:null==d?void 0:d[3])?c:s[1],m="symbol"===f.type?function(t,e,n,r,o){const i=xi(t.viewBox),s=w(A({},t),{type:"g"});if(delete s.viewBox,delete s.preserveAspectRatio,delete s.width,delete s.height,!i)return s;const[a,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,h=(o-c*f)/2,p=[];0===d&&0===h||p.push("translate("+d+","+h+")"),1!==f&&p.push("scale("+f+")"),0===a&&0===l||p.push("translate("+-a+","+-l+")"),p.length&&(s.transform=p.join(""));const m=e();return n.push({type:"clipPath",id:m,children:[{type:"rect",x:a,y:l,width:u,height:c}]}),s.clipPath="url(#"+m+")",s}(f,o,i,h,p):f,v=Oi(m,n,r,o,i,s),g=w(A({},t),{type:"g",children:[v]});return delete g.href,delete g.width,delete g.height,Dr(g)}(t,a,e,n,r,o,i)}}if(!t.children)return t;let s=!1;const a=t.children.map(t=>{const a=Oi(t,e,n,r,o,i);return a!==t&&(s=!0),a});return s?w(A({},t),{children:a}):t}var Si="transform",Pi=new Set(["reverse","alternate-reverse"]),Mi=[0,.25,.5,.75,1],_i="__px_rest_";function Ei(t,e){return void 0===t[e]&&(e!==Si||Ni(t))}function Ni(t){if(void 0!==t[Si])return!1;for(const e of an)if(void 0!==t[e])return!1;return!0}function Ci(t,e,n){const r=Object.values(Ar({[e]:t[e]},n));return 1===r.length&&""!==r[0]?r[0]:void 0}function Ti(t,e){const n={};for(const e of Object.keys(t))an.has(e)&&(n[e]=t[e]);const r=Ar(n,e)[Si];if(!r)return;const o=cn(r.replace(/(px|deg)\b/g,""));return o&&Object.keys(o).length?o:void 0}function Di(t,e,n){if(!t||!e)return t===e;const r=(t,e)=>JSON.stringify(Ar(t,e)).replace(/\s+/g,"");return Mi.every(o=>r(t,o*n)===r(e,o*n))}function zi(t,e){const n=Ve(t),r=new Map;for(const[t,e]of Fi(n))void 0===e.id&&(e.id=_i+t),r.set(String(e.id),t);const o=new Map;for(const t of br(n,e)){const e=r.get(t.id);void 0!==e&&o.set(e,t.animate)}return o}function Fi(t){const e=new Map;let n=0;const r=t=>{if(t.animate&&e.set(String(n++),t),t.children)for(const e of t.children)r(e)};if(t.children)for(const e of t.children)r(e);return e}function Ri(t,e,n){var r,o;let i=gi(t).root;return i=function(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=Zt(o[0]),s=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],a=[];let l=!1;for(const t of o){const n=Zt(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>t!==zt.translate&&t!==zt.origin&&t!==zt.rotate))return;if(void 0!==(null==n?void 0:n.rotate)){if(0!==n.rotate)return;l=!0}const o=null!=(e=null==n?void 0:n.origin)?e:[0,0];if(o[0]!==s[0]||o[1]!==s[1])return;a.push([r[0]+s[0],r[1]+s[1]])}if(!o.some(t=>Ht(t)||Jt(t)))return;let u="M"+Ai(a[0][0])+","+Ai(a[0][1]);const c=[];for(let t=0;t<a.length-1;t++){const e=a[t],i=a[t+1],s=null!=(n=Jt(o[t]))?n:[0,0],l=null!=(r=Ht(o[t+1]))?r:[0,0],f=[e[0]+s[0],e[1]+s[1]],d=[i[0]+l[0],i[1]+l[1]];u+="C"+Ai(f[0])+","+Ai(f[1])+","+Ai(d[0])+","+Ai(d[1])+","+Ai(i[0])+","+Ai(i[1]),c.push(ki(e,f,d,i))}const f=c.reduce((t,e)=>t+e,0);if(!(f>0))return;const d=[];let h=0;for(let t=0;t<o.length;t++){t>0&&(h+=c[t-1]);const e={t:Gt(o[t]),v:h/f},n=Kt(o[t]);void 0!==n&&(e.e=n),d.push(e)}return{pathStr:u,distanceKfs:d,autoOrient:!!t.autoOrient,anchor:s,keyframesCarryRotate:l}}(i);if(e){const n=A({},o);delete n[Ct];const s={keyframes:e.distanceKfs};void 0!==i.loop&&(s.loop=i.loop),n[Tt]=s;const a=t.transform;let l=a;if(a&&"object"==typeof a){const t=A({},a);delete t[zt.translate],delete t[zt.origin],e.keyframesCarryRotate&&delete t[zt.rotate],l=Object.keys(t).length?t:void 0}r=w(A({},t),{animate:n,style:w(A({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:Ai(e.anchor[0])+"px "+Ai(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==l?r.transform=l:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=w(A({},r),{children:t}))}return r};return e(t)}(i),i=vr(i,null!=(o=null==(r=It(i))?void 0:r.duration)?o:gt),e===dt.native&&(i=nr(i,null==n?void 0:n.motionPath),i=function(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 s=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){s=!0;break}if(!s&&t.children)for(const e of t.children)if(o(e,r)){s=!0;break}if(!s&&"use"===t.type&&"string"==typeof t.href){const n=ji(t.href),i=n?e.get(n):void 0;i&&(s=o(i,r))}return r.delete(t),n.set(t,s),s};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=xi(t.viewBox);if(e)return[e[2],e[3]];const n=wi(t.width),r=wi(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),s=[],a=Oi(t,n,r,()=>"_lw_use_mat_"+ ++o,s,i);if(0===s.length)return a;const l={type:"defs",children:s},u=[...null!=(e=a.children)?e:[],l];return w(A({},a),{children:u})}(i),i=function(t){const e=(t,n)=>{var r;n(t),null==(r=t.children)||r.forEach(t=>e(t,n))};let n=!0;for(;n;){n=!1;const r=new Set;e(t,t=>{var e;"use"===t.type&&"string"==typeof t.href&&r.add((e=t.href).startsWith("#")?e.slice(1):e)}),e(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!r.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,n=!0)})}return t}(i)),i=function(t,e){var n,r;const o=Ve(t),i=It(o)||{},s=+(i.duration||gt),a=Pi.has(String(i.direction))?s:0,l=Fi(o);if(!l.size)return o;const u=zi(o,e),c=new Map;for(const[t,e]of u){const o=l.get(t);if(!o)continue;const i=Object.keys(e);for(const r of i){if(an.has(r))continue;if(!Ei(o,r))continue;const i=Ci(e,r,a);void 0!==i&&(o[r]=i,c.set(t,[...null!=(n=c.get(t))?n:[],r]))}if(i.some(t=>an.has(t))&&Ni(o)){const n=Ti(e,a);n&&(o[Si]=n,c.set(t,[...null!=(r=c.get(t))?r:[],Si]))}}if(c.size){const t=zi(o,e);for(const[e,n]of c){if(Di(u.get(e),t.get(e),s))continue;const r=l.get(e);if(r)for(const t of n)delete r[t]}}return o}(i,e),i}var Ii=(t=>(t[t.buildFailed=1001]="buildFailed",t[t.invalidDocumentAtSrc=1002]="invalidDocumentAtSrc",t[t.loadFailed=1003]="loadFailed",t[t.animationBuildFailed=1004]="animationBuildFailed",t[t.effectsShape=1101]="effectsShape",t[t.timelineOverrideIgnored=1102]="timelineOverrideIgnored",t[t.blockedTag=1103]="blockedTag",t[t.unsupportedAnimatedAttrs=1104]="unsupportedAnimatedAttrs",t[t.noBindings=1105]="noBindings",t[t.unresolvedBinding=1106]="unresolvedBinding",t[t.triggersNoRoot=1201]="triggersNoRoot",t[t.noRootForSelector=1202]="noRootForSelector",t[t.noRootElement=1203]="noRootElement",t[t.noElementsForSelector=1206]="noElementsForSelector",t[t.setAttributeNoElement=1207]="setAttributeNoElement",t[t.scrollSmoothingNeedsOwnDriver=1301]="scrollSmoothingNeedsOwnDriver",t[t.scrollNativeUnavailable=1302]="scrollNativeUnavailable",t[t.scrollSubjectInvalid=1303]="scrollSubjectInvalid",t[t.scrollSubjectNoMatch=1304]="scrollSubjectNoMatch",t[t.scrollNoRootToObserve=1305]="scrollNoRootToObserve",t[t.scrollTriggerIgnored=1306]="scrollTriggerIgnored",t[t.rateRejected=1401]="rateRejected",t[t.controlPropsConflict=1501]="controlPropsConflict",t[t.rnCompileFailed=1601]="rnCompileFailed",t[t.rnRenderFailed=1602]="rnRenderFailed",t[t.rnBoundaryCaught=1603]="rnBoundaryCaught",t[t.rnUnsupported=1604]="rnUnsupported",t))(Ii||{}),Li={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"},Wi="https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";function Bi(t){return"PX"+t+" "+Wi+"#px"+t}function Ui(t,e){const n=e?e+" ":"";return{warn:(e,r,...o)=>{const i=Bi(r);(null==t?void 0:t.onWarn)?t.onWarn({code:r,kind:e,data:o,message:i}):(null==t?void 0:t.muteWarn)||console.warn(n+e+" "+i,...o)},error:(e,r,...o)=>{const i=Bi(r),s=function(t){return t.find(t=>t instanceof Error)}(o);(null==t?void 0:t.onError)?t.onError({code:r,kind:e,data:o,message:i,error:s}):(null==t?void 0:t.muteError)||console.error(n+e+" "+i,...o)}}}var Vi=6,qi="setPlaybackRate: rate must be finite and non-zero";function Gi(t){return Number.isFinite(t)&&0!==t}function Zi(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function Ki(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function Hi(t,e,n){const r=Zi(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function Ji(t,e,n){const r=Zi(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function Xi(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function Qi(t,e,n){var r;const o=It(t)||{},i=br(t,dt.js),s=o.iterations;let a=1;"number"==typeof s&&(a=s||yt),"infinite"===s&&(a=1/0),a<1&&(a=1);const l=+(o.duration||gt),u=l&&a?l*(a===1/0?1/0:a):l?(null!=a?a:yt)*l:0,c=o.direction||ce.defaults.direction,f=null!=(r=o.fill)?r:ce.defaults.fillMode,d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,v=-(o.delay||0),g=0,y=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let w=0;const j=()=>{const t=g?(Date.now()-g)*y:0;return v+t},x=()=>{let t=j();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;l>0?(t=vn(t,0,a*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,a-1),n=vn((t-r*e)/e,0,1)):n=t;const o=c||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=Ar(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(x()):h&&O(0));const S=()=>!!m&&!!e.isConnected()&&(y<0?j()>0:!(Number.isFinite(u)&&x()>=u)),P=t=>{null!==p&&(Xi(p),p=null),(t||S())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void M();const o=x(),i=j();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return M(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return M(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(w&&t-w<A)return;w=t}O(o)}})(),P()}))},M=()=>{if(!m)return;let t=j();Number.isFinite(u)&&t>u&&(t=u),v=t,g=0,m=!1,null!==p&&(Xi(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>S(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&v>=u&&(v=0);else if(v<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");v=u}b=!1,m=!0,g=Date.now(),P(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;M(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;M(),v=0,g=0,m=!1,b=!1,O(v),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;v=Number.isFinite(u)?u:x(),g=0,m=!1,null!==p&&(Xi(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(!Gi(t))return void console.warn(qi);let e=j();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,v=e,m&&(g=Date.now())},getCurrentTime:()=>x(),setCurrentTime:t=>{t=Ki(t,u),v=t,m&&(g=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(x())},getCurrentProgress:()=>Hi(x(),l,a),setCurrentProgress:t=>{_.setCurrentTime(Ji(t,l,a))},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var Yi=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],$i=["definitions","bindings"],ts=t=>!!t&&"object"==typeof t&&!Array.isArray(t),es=t=>ts(t)&&"string"==typeof t.type?t.type:"time",ns=t=>"scroll"===t||"view"===t;function rs(t,e){const n=ts(t)?A({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?ts(r)?n[t]=rs(n[t],r):n[t]=r:delete n[t]}return n}function os(t,e,n){const r=es(t),o=ts(e)&&"string"==typeof e.type?String(e.type):r;let i;if(o!==r){const n={};if(ts(t))for(const e of ut)void 0!==t[e]&&(n[e]=t[e]);i=rs(n,e)}else i=rs(t,e);if(ns(o)){for(const t of ct)void 0!==i[t]&&(n("animator.timeline."+t+": no slot on a '"+o+"' timeline — dropped"),delete i[t]);"infinite"===i.iterations&&(n("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete i.iterations)}return i}var is="className",ss="class",as="domType",ls="type",us="g";function cs(t,e,n){return t?fs(t,e,n,!0,0):null}function fs(t,e,n,r,o){const i=t,{type:s,children:a,style:l}=i,u=j(i,["type","children","style"]),c=s||us;if(jn.has(c.toLowerCase()))return(null!=n?n:Ui(void 0,"[PxAnimator]")).warn(Li.document,1103,c),null;const f=u[as];void 0!==f&&delete u[as];const d={};let h;const p=Cn(u);for(const t of Object.keys(p)){const e=Nn(t,p[t]);void 0!==e&&(Sn.has(t)?(null!=h?h:h={})[t]=String(e):d[t===is?ss:mn(t)]=e)}if(void 0!==f&&(d[ls]=String(f)),l)for(const t of Object.keys(l))(null!=h?h:h={})[t]=String(l[t]);const m=[];a&&a.forEach((t,r)=>{const o=fs(t,e,n,!1,r);null!==o&&m.push(o)});const v=u[Et],g=!m.length&&"string"==typeof v&&v?v:void 0;return e({tag:c,attrs:d,style:h,children:m,text:g,node:t,isRoot:r,index:o})}function ds(t){return"scroll"===(null==t?void 0:t.timelineSource)}var hs="cover";function ps(t,e,n,r){var o;const[i,s]=function(t,e,n){const r=e,o=n;switch(t){case"cover":return[0,r+o];case"entry":return[0,Math.min(r,o)];case"contain":return[Math.min(r,o),Math.max(r,o)];case"exit":return[Math.max(r,o),r+o];case"entry-crossing":return[0,r];case"exit-crossing":return[o,r+o]}}(null!=(o=null==t?void 0:t.phase)?o:hs,n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(s-i)}var ms=Symbol.for("@pixodesk/svg-animator-web:animators"),vs="__pixodeskAnimators";function gs(){const t=globalThis;let e=t[ms];if(!e){const n=new Set,r=new Set;e={animators:n,listeners:r,getAll:()=>Array.from(n),subscribe:t=>(r.add(t),()=>{r.delete(t)})},t[ms]=e,void 0===t[vs]&&(t[vs]=e)}return e}function ys(){return gs().getAll()}function bs(t){return gs().subscribe(t)}function ks(t,e){for(const n of gs().listeners)try{n(t,e)}catch(t){setTimeout(()=>{throw t},0)}}vt.offScreen,vt.visibilityThreshold,vt.visibilityDebounce;var As=Array.from({length:21},(t,e)=>e/20);function ws(t){return{requestStart:()=>t.play(),dispose:()=>{}}}function js(t,e,n){const r=null!=n?n:Ui(void 0,"[PxAnimator]"),o=[],i=()=>{for(const t of o.splice(0))t()},s=function(t){var e,n,r,o,i;return{start:null!=(e=null==t?void 0:t.start)?e:vt.start,offScreen:null!=(n=null==t?void 0:t.offScreen)?n:vt.offScreen,mouseOut:null!=(r=null==t?void 0:t.mouseOut)?r:vt.mouseOut,visibilityThreshold:null!=(o=null==t?void 0:t.visibilityThreshold)?o:vt.visibilityThreshold,visibilityDebounce:null!=(i=null==t?void 0:t.visibilityDebounce)?i:vt.visibilityDebounce}}(e),a=t.getRootElement();if(!a)return r.warn(Li.host,Ii.triggersNoRoot),i;let l=!1;const u=function(t,e,n){if(e.offScreen===Q.continue)return ws(n);if("undefined"==typeof IntersectionObserver)return ws(n);const r=e.visibilityThreshold,o=e.visibilityDebounce;let i,s,a=!1,l=!1,u=0;const c=()=>{void 0!==s&&(clearTimeout(s),s=void 0)},f=()=>{s=void 0,!0!==i&&(i=!0,(a||l)&&(a=!1,l=!1,n.play()))},d=()=>{c(),!1!==i&&(i=!1,n.isPlaying()&&(e.offScreen===Q.reset?n.cancel():n.pause(),l=!0))},h=t=>{if(u=t,"undefined"==typeof document||"hidden"!==document.visibilityState)if(t>=r){if(!0===i||void 0!==s)return;o>0?s=setTimeout(f,o):f()}else t<=0?d():!0!==i&&c();else d()},p=new IntersectionObserver(t=>{const e=t[t.length-1];e&&h(e.isIntersecting?function(t){var e,n;const r=t.boundingClientRect,o=t.intersectionRect;if(!(null==r?void 0:r.height)||!o)return t.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,s=null!=(n=null==(e=t.rootBounds)?void 0:e.height)?n:1/0,a=Math.min(i,s),l=Math.min(r.height,Number.isFinite(a)?a:r.height);return l>0?o.height/l:t.intersectionRatio}(e):0)},{threshold:As});p.observe(t);const m=()=>{h(u)},v="undefined"!=typeof document;return v&&document.addEventListener("visibilitychange",m),{requestStart:t=>{if(t||!0===i)return c(),i=!0,a=!1,l=!1,void n.play();a=!0},dispose:()=>{c(),p.disconnect(),v&&document.removeEventListener("visibilitychange",m)}}}(a,s,{isPlaying:()=>t.isPlaying(),play:()=>{l&&(l=!1,t.setPlaybackRate(1)),t.play()},pause:()=>t.pause(),cancel:()=>t.cancel()});switch(o.push(()=>u.dispose()),s.start){case X.load:{const t=()=>u.requestStart(!1);"complete"===document.readyState?t():(window.addEventListener("load",t,{once:!0}),o.push(()=>window.removeEventListener("load",t)));break}case X.mouseOver:{let e=!1;const n=()=>{e=!0,u.requestStart(!0)},r=()=>{e&&(()=>{switch(s.mouseOut){case Y.pause:t.pause();break;case Y.reset:t.cancel();break;case Y.reverse:l=!0,t.setPlaybackRate(-1),t.play();case Y.continue:}})()};a.addEventListener("mouseenter",n),a.addEventListener("mouseleave",r),o.push(()=>{a.removeEventListener("mouseenter",n),a.removeEventListener("mouseleave",r)});break}case X.click:{const e=()=>{t.isPlaying()?t.pause():u.requestStart(!0)};a.addEventListener("click",e),o.push(()=>a.removeEventListener("click",e));break}case X.none:}return i}function xs(t){return"#"+function(t){const e=globalThis.CSS;return"function"==typeof(null==e?void 0:e.escape)?e.escape(t):t.replace(/^([0-9])/,(t,e)=>"\\3"+e+" ").replace(/([^\w\-\\ ])/g,"\\$1")}(t)}function Os(t,e,n,r){var o;const i=It(t)||{},s=Ui(n,"[PxAnimator]");if(!r)if(t.id){const e=xs(t.id);(r=document.querySelector(e))||s.warn(Li.host,Ii.noRootForSelector,e)}else s.warn(Li.host,Ii.noRootElement);const a=Qi(t,e||function(t,e){const n=new Set,r=null!=e?e:Ui(void 0,"[PxAnimator]");return{isConnected:()=>!t||t.isConnected,setAttribute:(e,o,i)=>{o=mn(o);const s=xs(e),a=(null==t?void 0:t.querySelectorAll(s))||document.querySelectorAll(s);0!==a.length||n.has(s)||(n.add(s),r.warn(Li.host,Ii.setAttributeNoElement,s));for(let t=0;t<a.length;t++){const e=a[t],n="transform"===o&&"pattern"===e.tagName?"patternTransform":o;e.setAttribute(n,i),fn.has(o)&&(e.style[o]=i)}}}}(r,s),n),l=f(c({},a),{getRootElement:()=>r||null});if(ds(i))i.trigger&&s.warn(Li.usage,Ii.scrollTriggerIgnored);else{const t=js(l,null!=(o=i.trigger)?o:{},s),e=l.destroy.bind(l);l.destroy=()=>{t(),e()}}return l}function Ss(t,e,n,r){let o=Zt(t);const i=Kt(t),s={offset:e,easing:i&&Array.isArray(i)?"cubic-bezier("+i.join(",")+")":void 0};let a,l=n;return sn.has(n)&&Array.isArray(o)?a=rn(o):"transform"!==n||null===o||"object"!=typeof o||Array.isArray(o)?an.has(n)?(Array.isArray(o)&&("translate"===n&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===n&&(o+="deg"),a=n+"("+o+")",l="transform"):a="d"===n?'path("'+(o&&"object"==typeof o&&Array.isArray(o.paths)?o.paths:[]).map(t=>Ze(t,!0)).join("")+'")':ln.has(n)&&"number"==typeof o?100*o+"%":""+o:(a=un(o,{withUnits:!0}),l="transform"),CSS.supports(mn(l),a)||r.add(l),l=dn(l),s[l]=a,s}function Ps(t,e,n){var r,o,i,s,a;const l=[];for(let u=0;u<e.length;u++){const d=e[u],h=null!=(r=d.t)?r:0;if(h<0){const n=e[u+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(i=n.t)?i:0)-h),r=d.e?$e(d.e)(e):e,{right:o}=en(d.e,e);l.push({t:0,v:dr(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[u-1];if(r&&(null!=(s=r.t)?s:0)<=n){const e=null!=(a=r.t)?a:0,o=(n-e)/(h-e),i=r.e?$e(r.e)(o):o,{left:s}=en(r.e,o);l.length>0&&(l[l.length-1]=f(c({},l[l.length-1]),{e:s})),l.push({t:n,v:dr(t,r.v,d.v,i),e:void 0})}break}l.push(d)}return l}function Ms(t,e,n){var r;const o=new Map;for(const[i,s]of Object.entries(t)){const t=n.duration||1,a=Ps(i,s.keyframes||[],t),l=[];for(let n=0;n<a.length;n++){const o=a[n],s=Ss(o,vn((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(s.offset||0)>0&&l.push(f(c({},s),{offset:0})),l.push(s)}l.length>0&&(l[l.length-1].offset||0)<1&&l.push(f(c({},l[l.length-1]),{offset:1})),l.length>0&&o.set(i,l)}return o}function _s(t,e,n,r,o){var i,s;const a=It(t)||{},l=Ui(e,"[PxAnimator]");if(!n)if(t.id){const e=xs(t.id);(n=document.querySelector(e))||l.warn(Li.host,Ii.noRootForSelector,e)}else l.warn(Li.host,Ii.noRootElement);const u=br(t,dt.native),c=[],f=a.iterations;let d;"number"==typeof f&&(d=f),"infinite"===f&&(d=1/0);const h=new Set;let p=!1,m=!1;(null==u?void 0:u.length)||l.warn(Li.document,Ii.noBindings);for(const t of u||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){l.warn(Li.document,Ii.unresolvedBinding,t);continue}const s=xs(t.id),u=(null==n?void 0:n.querySelectorAll(s))||document.querySelectorAll(s);0===u.length&&l.warn(Li.host,Ii.noElementsForSelector,s);const f=Ms(r,h,a),v=a.delay&&a.delay>0?a.delay:void 0;let g;if(a.delay&&a.delay<0&&a.duration){const t=-a.delay;g=d===1/0?t%a.duration:Math.min(t,a.duration*(null!=d?d:yt))}const y={duration:a.duration,delay:v,fill:null!=(i=a.fill)?i:"forwards",direction:a.direction,iterations:d};for(let t=0;t<u.length;t++){const n=u[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(n,t,y),i=new Animation(r,o?o.timeline:document.timeline);if(o){const t=i;o.rangeStart&&(t.rangeStart=o.rangeStart),o.rangeEnd&&(t.rangeEnd=o.rangeEnd)}(null==e?void 0:e.onFinish)&&(i.onfinish=()=>{var t;p||(p=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(i.onremove=()=>{var t;m||(m=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==g&&(i.currentTime=g),c.push(i)}catch(t){l.warn(Li.internal,Ii.animationBuildFailed,t)}}}if(!r&&h.size)return l.warn(Li.platform,Ii.unsupportedAnimatedAttrs,[...h].join(", ")),null;const v={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=c[0])?void 0:t.playState)},play:()=>{var t;p=!1,c.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;c.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;p=!1,c.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of c)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>Gi(t)?(c.forEach(e=>e.playbackRate=t),v):(l.warn(Li.usage,Ii.rateRejected),v),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=c[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{var e;const n=function(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}(null!=(e=a.duration)?e:0,null!=d?d:yt),r=n>0?Ki(t,n):Math.max(0,t);p=!1,c.forEach(t=>{t.currentTime=r})},getCurrentProgress:()=>{var t;const e=v.getCurrentTime();return null===e?null:Hi(e,null!=(t=a.duration)?t:0,null!=d?d:yt)},setCurrentProgress:t=>{var e;v.setCurrentTime(Ji(t,null!=(e=a.duration)?e:0,null!=d?d:yt))},destroy:()=>{var t;v.cancel(),c.splice(0,c.length),m||(m=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};if("scroll"===a.timelineSource)a.trigger&&l.warn(Li.usage,Ii.scrollTriggerIgnored);else{const t=js(v,null!=(s=a.trigger)?s:{},l),e=v.destroy.bind(v);v.destroy=()=>{t(),e()}}return o&&c.forEach(t=>t.play()),v}function Es(t,e,n){var r,o,i;const s="number"==typeof(null==t?void 0:t.fraction)?t.fraction:e,a=null==(o=null==(r=globalThis.CSS)?void 0:r.percent)?void 0:o.call(r,100*s);if(void 0!==a)return n?{rangeName:null!=(i=null==t?void 0:t.phase)?i:"cover",offset:a}:{offset:a}}function Ns(t,e){const n=document.body,r=document.documentElement;for(let o=t.parentElement;o;o=o.parentElement){if(o===n||o===r)return null;const t=getComputedStyle(o),i="y"===e?t.overflowY:t.overflowX;if("auto"===i||"scroll"===i||"hidden"===i||"overlay"===i)return o}return null}function Cs(){return document.scrollingElement||document.documentElement}var Ts="parent",Ds="scroller";function zs(t,e,n){var r,o;const i=null!=n?n:Ui(void 0,"[PxAnimator]"),s=null==e?void 0:e.trim();if(!s)return t;if(s===Ts){let e=null;for(let n=t.parentElement;n&&n!==document.body;n=n.parentElement){const t=getComputedStyle(n).position;"sticky"!==t&&"fixed"!==t||(e=n)}return null!=(o=null!=(r=null==e?void 0:e.parentElement)?r:t.parentElement)?o:t}if(s===Ds)return Ns(t,"y")||Ns(t,"x")||Cs();let a=null;try{a=document.querySelector(s)}catch(e){return i.warn(Li.document,Ii.scrollSubjectInvalid,s),t}return a||(i.warn(Li.host,Ii.scrollSubjectNoMatch,s),t)}function Fs(t,e){const n=t;if(!(null==e?void 0:e.pin)||!n.style)return()=>{};const r=n.style,o=r.position,i=r.top;r.position="sticky";const s="center"===e.pinAlign?.5:"bottom"===e.pinAlign?1:0,a=()=>{var n;const o=null!=(n=e.pinOffset)?n:0;if(!s)return void(r.top=o+"px");const i=function(t){const e=Ns(t,"y");return e?e.clientHeight:document.documentElement.clientHeight}(t),a=t.getBoundingClientRect().height;r.top=Math.round((i-a)*s+o)+"px"};a();let l=null;const u=s?a:null;s&&(u&&window.addEventListener("resize",u),"undefined"!=typeof ResizeObserver&&(l=new ResizeObserver(a),l.observe(t)));let c=null;const f=t.parentElement;return e.pinDistance&&e.pinDistance>0&&f&&(c=document.createElement("div"),c.setAttribute("data-px-pin",""),c.style.height=100*e.pinDistance+"vh",f.insertBefore(c,t),c.appendChild(t)),()=>{u&&window.removeEventListener("resize",u),null==l||l.disconnect(),r.position=o,r.top=i,(null==c?void 0:c.parentElement)&&(c.parentElement.insertBefore(t,c),c.remove())}}function Rs(t,e,n){let r,o=e;t.resetOnFinish&&(o=f(c({},e),{onFinish:()=>{var t;null==(t=null==e?void 0:e.onFinish)||t.call(e),null==r||r.cancel()}}));const i=n(o);return r=i,t.debugGlobalName&&(window[t.debugGlobalName]=i),i}var Is=({tag:t,attrs:e,style:n,children:r,text:o})=>{const i=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t of Object.keys(e))i.setAttribute(t,e[t]);if(n){const t=i.style;for(const e of Object.keys(n))t[e]=n[e]}for(const t of r)i.appendChild(t);return void 0!==o&&(i.textContent=o),i};function Ls(t,e,n){return cs(t,Is,n)}function Ws(t,e,n,r,o,i,s){const a=Ui(n,"[PxAnimator]"),l=ze(t);for(const t of l)a.warn(Li.document,Ii.effectsShape,t);if(function(t){const{problems:e}=function(t){try{return{problems:Fe(t)}}catch(t){return{problems:[]}}}(t);if(!e.length)return;const n=e.slice(0,Vi),r=e.length-n.length;console.warn("[PxAnimator] createAnimator: this document does not match the animation schema in "+e.length+" place"+(1===e.length?"":"s")+".\n"+n.map(t=>" - "+t).join("\n")+(r>0?"\n … and "+r+" more":"")+"\n\nIf you did not author these keys, the usual cause is a build that MANGLES PROPERTY NAMES. An animation document is data loaded at runtime, so renaming the property reads inside the player stops them matching the keys in the JSON, and the animation silently does nothing. Feed the published reserved-name list to your minifier — @pixodesk/svg-animator-web/mangle-reserved.json — see docs/library/minification.md.")}(t),void 0!==o||i){const e=function(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetTimeline);if(!t||void 0===e||!(i||null!==e&&ts(e)&&Object.keys(e).length))return{doc:t,warnings:[]};const s=t,a=ts(s.animator),l=!a&&ts(null==(r=s.meta)?void 0:r.animator),u=a?s.animator:l?s.meta.animator:void 0,c=[];a&&ts(null==(o=s.meta)?void 0:o.animator)&&c.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let f=u;if(i){const t={};for(const e of $i)ts(u)&&void 0!==u[e]&&(t[e]=u[e]);f=t}const d=function(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!ts(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=ts(t)?Yi.filter(e=>void 0!==t[e]):[];o.length&&r("animator: the base carries the flat runtime spelling ("+o.join(", ")+"); the patch merges the wire spelling only");const i=ts(t)?A({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?ts(n)?i[t]=rs(i[t],n):i[t]=n:i.timeline=ts(n)?os(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}(f,null!=e?e:{});return c.push(...d.warnings),d.config===u?{doc:t,warnings:c}:l?{doc:w(A({},s),{meta:w(A({},s.meta),{animator:d.config})}),warnings:c}:{doc:w(A({},s),{animator:d.config}),warnings:c}}(t,null!=o?o:{},{resetTimeline:!!i});for(const t of e.warnings)a.warn(Li.usage,Ii.timelineOverrideIgnored,t);t=e.doc}t=Ri(t,pt((It(t)||{}).engine));let u=null;if(r){t=qe(t);const e="string"==typeof r?document.querySelector(r):r;e&&(u=Ls(t,0,a),u&&e.replaceChildren(u))}!u&&s&&(u=s);const c=function(t,e,n,r){return function(t,e,n,r){const o=It(t)||{},i=Ui(n,"[PxAnimator]");return ds(o)?Rs(o,n,n=>{var s;let a=()=>{};if(o.engine!==ht.js&&r){a=Fs(r,o.scroll);const e=function(t,e,n){var r,o,i,s;const a=null!=n?n:Ui(void 0,"[PxAnimator]");if(!e||!ds(e))return null;const l=e.scroll||{},u=null!=(r=l.kind)?r:"view";if(l.smoothing)return a.warn(Li.platform,Ii.scrollSmoothingNeedsOwnDriver),null;const c=globalThis,f="view"===u,d=f?c.ViewTimeline:c.ScrollTimeline;if("function"!=typeof d)return null;const h=null!=(o=l.axis)?o:"block";let p;try{p=new d(f?{subject:zs(t,l.subject,a),axis:h}:{source:"root"===l.source?Cs():Ns(t,"y")||Ns(t,"x")||Cs(),axis:h})}catch(t){return a.warn(Li.platform,Ii.scrollNativeUnavailable,t),null}return{timeline:p,rangeStart:Es(null==(i=l.range)?void 0:i.start,0,f),rangeEnd:Es(null==(s=l.range)?void 0:s.end,1,f)}}(r,o,i);if(e){const i=_s(t,n,r,mt(o.engine),e);if(i){const t=i.destroy.bind(i);return i.destroy=()=>{a(),t()},i}}a(),a=()=>{}}const l=(o.engine!==ht.js?_s(t,n,r,mt(o.engine)):null)||Os(t,e,n,r),u=(null==(s=l.getRootElement)?void 0:s.call(l))||r;if(u){a=Fs(u,o.scroll);const t=("number"==typeof(null==(c=o)?void 0:c.duration)&&c.duration>0?c.duration:gt)*("number"==typeof(null==c?void 0:c.iterations)&&c.iterations>0?c.iterations:1),e=function(t,e,n,r){var o,i;if(!e||!ds(e))return null;const s=null!=r?r:Ui(void 0,"[PxAnimator]"),a=e.scroll||{},l=null!=(o=a.kind)?o:"view",u=zs(t,a.subject,s),c=Ns(t,"y")||Ns(t,"x"),f="scroll"===l&&"root"===a.source?Cs():c||Cs(),d=f===Cs(),h=function(t,e){const n=null!=t?t:"block";if("x"===n||"y"===n)return n;const r=!!e&&e.startsWith("vertical");return"inline"===n?r?"y":"x":r?"x":"y"}(a.axis,getComputedStyle(f).writingMode),p=()=>{if("scroll"===l)return function(t,e,n){var r,o;const i=e>0?vn(t/e,0,1):1,s="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,a="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return a<=s?i>=a?1:0:vn((i-s)/(a-s),0,1)}("y"===h?f.scrollTop:f.scrollLeft,"y"===h?f.scrollHeight-f.clientHeight:f.scrollWidth-f.clientWidth,a.range);const t=u.getBoundingClientRect();let e,n;if(d)e=0,n="y"===h?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const t=f.getBoundingClientRect();e="y"===h?t.top:t.left,n="y"===h?f.clientHeight:f.clientWidth}return function(t,e,n,r){const o=n-t,i=ps(null==r?void 0:r.start,0,e,n),s=ps(null==r?void 0:r.end,1,e,n);return s<=i?o>=s?1:0:vn((o-i)/(s-i),0,1)}(("y"===h?t.top:t.left)-e,"y"===h?t.height:t.width,n,a.range)},m=Math.max(0,null!=(i=a.smoothing)?i:0)/1e3;let v=!1,g=null,y=null,b=0,k=null;const A=()=>{k=null,v||(t=>{if(!m)return void n(t);if(null===g)return g=t,void n(t);if(null!==y)return;b=0;const e=t=>{if(y=null,v)return;const r=b?Math.min(.1,(t-b)/1e3):1/60;b=t;const o=p(),i=1-Math.exp(-r/m);g+=(o-g)*i,Math.abs(o-g)<.001&&(g=o),n(g),g!==o&&(y=requestAnimationFrame(e))};y=requestAnimationFrame(e)})(p())},w=()=>{v||null!==k||(k=requestAnimationFrame(A))},j=d?window:f;let x;j.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w,{passive:!0}),"undefined"!=typeof ResizeObserver&&(x=new ResizeObserver(w),x.observe(u),u!==t&&x.observe(t),d||x.observe(f));const O={destroy:()=>{v||(v=!0,j.removeEventListener("scroll",w),window.removeEventListener("resize",w),null==x||x.disconnect(),null!==k&&(cancelAnimationFrame(k),k=null),null!==y&&(cancelAnimationFrame(y),y=null))},refresh:()=>{v||(g=p(),n(g))}};return O.refresh(),O}(u,o,e=>l.setCurrentTime(e*t),i);if(e){const t=l.destroy.bind(l);l.destroy=()=>{e.destroy(),a(),t()}}}else i.warn(Li.host,Ii.scrollNoRootToObserve);var c;return l}):Rs(o,n,n=>o.engine===ht.js?Os(t,e,n,r):_s(t,n,r,mt(o.engine))||Os(t,e,n,r))}(t,e,n,r)}(t,e,n,u);if(r&&u){const t=u,e=c.destroy.bind(c);c.destroy=()=>{e(),t.remove()}}return c}function Bs(t){return"adapter"in t||"rootElement"in t}function Us(t){const{src:e,doc:n,container:r,resetTimeline:o}=t,i=Bs(t)?t.adapter:void 0,s=Bs(t)?t.rootElement:void 0,a=function(t){const{timeline:e,duration:n,delay:r,iterations:o,start:i}=t;return function(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("timeline override: not valid JSON — ignored",t),n=void 0}else n=null!=t?t:void 0;const{duration:r,delay:o,iterations:i,start:s}=e;if(void 0===r&&void 0===o&&void 0===i&&void 0===s)return void 0===n?void 0:{timeline:n};const a=ts(n)?A({},n):{};return void 0!==r&&(a.duration=r),void 0!==o&&(a.delay=o),void 0!==i&&(a.iterations=i),void 0!==s&&(a.trigger=w(A({},a.trigger),{start:s})),{timeline:a}}(e,{duration:n,delay:r,iterations:o,start:i})}(t);let l;const u=function(t){const e=t=>{l&&ks(t,l)};return f(c({},t),{onPlay:()=>{var n;null==(n=null==t?void 0:t.onPlay)||n.call(t),e("play")},onPause:()=>{var n;null==(n=null==t?void 0:t.onPause)||n.call(t),e("pause")},onCancel:()=>{var n;null==(n=null==t?void 0:t.onCancel)||n.call(t),e("cancel")},onFinish:()=>{var n;null==(n=null==t?void 0:t.onFinish)||n.call(t),e("finish")}})}(function(t){const{onPlay:e,onPause:n,onCancel:r,onFinish:o,onRemove:i,onStop:s,onWarn:a,onError:l,muteWarn:u,muteError:c}=null!=t?t:{},f=t=>t||s?()=>{null==t||t(),null==s||s()}:void 0;return{onPlay:e,onPause:f(n),onCancel:f(r),onFinish:f(o),onRemove:f(i),onWarn:a,onError:l,muteWarn:u,muteError:c}}(t));if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `doc`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `doc` is required");let d=null,h=[],p=!1;const m=t=>{d?t(d):h&&h.push(t)},v=Ui(u,"[PxAnimator]"),g=(t,e,...n)=>{h=null,v.error(t,e,...n)},y=t=>{try{(t=>{d=t;const e=h;h=null,null==e||e.forEach(e=>e(t))})(Ws(t,i,u,r,a,o,s))}catch(t){const e=function(t){return t instanceof Error?t:new Error(String(t))}(t);g(Li.internal,Ii.buildFailed,e)}};return l={isReady:()=>!!d,getRootElement:()=>d?d.getRootElement():null,isPlaying:()=>(null==d?void 0:d.isPlaying())||!1,play:()=>{m(t=>t.play())},pause:()=>{m(t=>t.pause())},cancel:()=>{m(t=>t.cancel())},finish:()=>{m(t=>t.finish())},setPlaybackRate:t=>{m(e=>e.setPlaybackRate(t))},getCurrentTime:()=>d?d.getCurrentTime():null,setCurrentTime:t=>{m(e=>e.setCurrentTime(t))},getCurrentProgress:()=>d?d.getCurrentProgress():null,setCurrentProgress:t=>{m(e=>e.setCurrentProgress(t))},destroy:()=>{p=!0,h=null,null==d||d.destroy()}},function(t){const e=gs();if(e.animators.has(t))return;e.animators.add(t),ks("add",t);const n=t.destroy.bind(t);t.destroy=()=>{n(),e.animators.delete(t)&&ks("remove",t)}}(l),void 0!==n?y(n):fetch(e).then(t=>t.json()).then(t=>{p||(function(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}(t)?y(t):g(Li.document,Ii.invalidDocumentAtSrc,e))}).catch(t=>{var n;g(Li.host,Ii.loadFailed,e,null!=(n=null==t?void 0:t.message)?n:String(t))}),l}function Vs(t){const e=document.querySelectorAll("["+H+"]");for(let n=0;n<e.length;n++){const r=e[n];if(!r[J]){const e=r.getAttribute(H);e&&(r[J]=Us(f(c({},t),{src:e,container:r})))}}}