@pixodesk/svg-animator-core 1.0.45 → 1.0.47

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
- "use strict";var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=Math.pow,u=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,f=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&u(t,n,e[n]);if(a)for(var n of a(e))l.call(e,n)&&u(t,n,e[n]);return t},d=(t,e)=>n(t,o(e)),h=(t,e)=>{var n={};for(var r in t)s.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&a)for(var r of a(t))e.indexOf(r)<0&&l.call(t,r)&&(n[r]=t[r]);return n},p={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(p,{PX_ANIM_ATTR_NAME:()=>it,PX_ANIM_SRC_ATTR_NAME:()=>ot,PX_COLOR_ATTR_NAMES:()=>In,PX_CSS_ONLY_STYLE_PROPS:()=>Ga,PX_DEFAULT_DURATION_MS:()=>Vn,PX_DISALLOWED_SVG_TAGS_LOWER:()=>Fa,PX_LOOP_JUMP_SHIFT_MS:()=>xr,PX_PCT_BASED_ATTR_NAMES:()=>Cn,PX_STYLE_ATTR_NAMES:()=>Ln,PX_TEXT_CONTENT_ATTR:()=>se,PX_TRANSFORM_FN_NAMES:()=>Dn,PX_UNKNOWN_KEY_ERROR:()=>m,bezierToSvgPath:()=>bn,camelCaseToKebabWordIfNeeded:()=>Bn,clamp:()=>Xn,composeTransformParts:()=>Rn,createDiagnostics:()=>Ua,createPathSampler:()=>co,cubicBezier:()=>Pn,deepClone:()=>Pa,diffFieldUniverse:()=>ps,diffInEffect:()=>oo,extendedPathForBrowser:()=>ci,generateUniqueId:()=>Ma,interpolateValue:()=>zr,isScrollTimeline:()=>os,kebabToCamelCaseWord:()=>Wn,keyframeEasing:()=>_e,keyframeValue:()=>je,layoutGlyphTextChars:()=>Lo,materializeGlyphText:()=>Yo,materializeGlyphTextAlongPath:()=>Uo,materializeMotionPathInPropAnim:()=>sr,mergeStaticTransformIntoAnimDef:()=>Qn,planSchemaRelease:()=>ms,prepareDocumentForRender:()=>Ra,releaseLogProblems:()=>gs,renderPxTree:()=>ns,reportDocumentDiagnostics:()=>hi,reverseEasing:()=>Nn,sanitizeAttributeValue:()=>Ya,schemaFieldUniverse:()=>ds,scrollOffsetProgress:()=>us,scrollPhaseInterval:()=>as,scrollResolveAxis:()=>fs,scrollTotalDurationMs:()=>is,scrollViewProgress:()=>cs,splitEasing:()=>zn,subdivideCubicBezier:()=>_n,toRGBA:()=>Tn}),module.exports=(t=p,((t,n,o,a)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of i(n))s.call(t,l)||l===o||e(t,l,{get:()=>n[l],enumerable:!(a=r(n,l))||a.enumerable});return t})(e({},"__esModule",{value:!0}),t));var m="unexpected extra key";function g(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var v=class{_canSanitize(t){return this.isValid(t)}optional(){return new y(this)}},y=class extends v{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)}},k=class extends v{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(g(null!=n?n:[])+": expected string, got "+typeof t),!1)}},b=class extends v{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(g(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},A=class extends v{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(g(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},x=class extends v{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(g(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},w=class extends v{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(g(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},O=class extends v{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=g(null!=n?n:[]);let a;e.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let s=-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 c=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((c>s||c===s&&a&&o.errors.length<a.length)&&(s=c,a=o.errors),c<=i.length)for(const t of o.errors){const e=/: expected (.+?), got /.exec(t);e&&!l.includes(e[1])&&l.push(e[1])}}if(a&&s>i.length)for(const t of a.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))}},S=class extends v{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(g(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)}},M=class extends v{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(g(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(g(o)+": "+m),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},P=class extends v{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=f({},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(g(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)}},j=class extends v{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(g(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)}},_=class extends v{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(g(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)}},z=class extends v{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},N=class extends v{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(g(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},T=class extends v{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)}},E=class extends v{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(g(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function I(t){var e;const n=t;switch(n._kind){case"union":return{kind:"union",members:n.schemas};case"discriminatedUnion":return{kind:"discriminatedUnion",key:n._key,members:n._schemas};case"record":return{kind:"record",value:n.value};case"tuple":return{kind:"tuple",items:n.schemas}}return"_shape"in n?{kind:"shape",shape:n._shape,openValue:n._openSchema}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.resolved=n.fn()}:{kind:"leaf"}}var D=(t="")=>new k(t),C=(t=0)=>new b(t),R=(t=!1)=>new A(t),L=t=>new x(t),V=(t,e)=>new w(t,e),W=(t,e)=>new O(t,e),U=(t,e)=>new S(t,e),F=t=>new M(t),B=(t,e)=>new P(t,e),X=t=>new j(t),G=t=>new _(t),K=()=>new z,q=()=>new N,Z=t=>new E(t),J=(t,e)=>new T(t,e),Y="forwards",Q="backwards",H="both",$="none",tt="normal",et="reverse",nt="alternate",rt="alternate-reverse",ot="data-px-animation-src",it="_px_animator",at="load",st="mouseOver",lt="click",ct="none",ut="pause",ft="continue",dt="reset",ht="continue",pt="pause",mt="reset",gt="reverse",vt="hold",yt="reset",kt="view",bt="scroll",At="block",xt="inline",wt="x",Ot="y",St="nearest",Mt="root",Pt="top",jt="center",_t="bottom",zt="cover",Nt="contain",Tt="entry",Et="exit",It="entry-crossing",Dt="exit-crossing",Ct="sampled",Rt="offsetPath",Lt=["duration","iterations","engine","frameRate","trigger","delay","fillMode","direction","fill","resetOnFinish","timelineSource","scroll"],Vt={native:"native",js:"js"},Wt=d(f({},Vt),{auto:"auto"});function Ut(t){return t===Wt.js?Vt.js:Vt.native}var Ft="load",Bt="pause",Xt="continue",Gt={start:"start",end:"end"},Kt={normal:"normal",alternate:"alternate"},qt="luminance",Zt="alpha",Jt="userSpaceOnUse",Yt="objectBoundingBox",Qt={translate:"translate"},Ht="clip",$t="extend",te="spacing",ee="spacingAndGlyphs",ne="align",re="stretch",oe="auto",ie="exact",ae={separate:"separate",combined:"combined"},se="textContent",le="class",ce="transform",ue="offsetDistance",fe=new Set(["type","children","animator","meta","animate","effects",se]),de={translate:"translate",rotate:"rotate",scale:"scale",origin:"origin"},he=(de.translate,de.rotate,de.scale,de.origin,"pad"),pe="reflect",me="repeat",ge={linear:"linear",radial:"radial"};function ve(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=ye.get(n);if(r)return r;const o=n,i=Lt.filter(t=>void 0!==o[t]),a=i.length?f({},o):n;for(const t of i)delete a[t];const s=function(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=ke.get(t);if(n)return n;const r=t,{timeline:o}=r,i=h(r,["timeline"]);void 0!==e.engine&&(i.engine=e.engine);void 0!==e.frameRate&&(i.frameRate=e.frameRate);if("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=f({},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=h(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 ke.set(t,i),i}(a);return ye.set(n,s),s}var ye=new WeakMap,ke=new WeakMap;function be(t){var e;if(t)return null==(e=ve(t))?void 0:e.definitions}var Ae,xe=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function we(t){if("string"!=typeof t)return;const e=xe.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}Ae=we("1.2");var Oe=W([D(),Z([C(),C(),C(),C()])]),Se=W([D(),C(),X(C()),F({pathData:D()}),J(()=>X(ln),[]),J(()=>Ie,{})]),Me=F({time:C().optional(),value:Se.optional(),easing:Oe.optional(),tangentOut:Z([C(),C()]).optional(),tangentIn:Z([C(),C()]).optional()}),Pe=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},je=t=>{var e;return null!=(e=t.value)?e:t.v},_e=t=>{var e;return null!=(e=t.easing)?e:t.e},ze=t=>t.tangentIn,Ne=t=>t.tangentOut,Te=F({segmentCount:C().optional(),repeatAt:V([Gt.start,Gt.end]).optional(),direction:V([Kt.normal,Kt.alternate]).optional()}),Ee=F({value:Se.optional(),keyframes:X(Me).optional(),loop:W([Te,R()]).optional(),autoOrient:R().optional(),alongPathMode:V([Ct,Rt]).optional()}),Ie=F({translate:Z([C(),C()]).optional(),rotate:C().optional(),skew:C().optional(),scale:Z([C(),C()]).optional(),origin:Z([C(),C()]).optional()}),De=(W([D(),Ie,F({value:Ie}),Ee]),G(Ee)),Ce=W([D(),X(W([D(),De])),De]),Re=F({start:V([at,st,lt,ct],Ft).optional(),offScreen:V([ut,ft,dt],Bt).optional(),mouseOut:V([ht,pt,mt,gt],Xt).optional(),finish:V([vt,yt]).optional(),visibilityThreshold:C().optional(),visibilityDebounce:C().optional()}),Le=F({width:C(),pathData:D()}),Ve=F({fontFamily:D(),fontStyle:D(),ascent:C(),unitsPerEm:C(),glyphs:G(Le)}),We=F({easings:G(Z([C(),C(),C(),C()])).optional(),animations:G(De).optional(),fonts:G(Ve).optional()}),Ue=F({phase:V([zt,Nt,Tt,Et,It,Dt]).optional(),fraction:C().optional()}),Fe=F({start:Ue.optional(),end:Ue.optional()}),Be=(F({kind:V([kt,bt]).optional(),axis:V([At,xt,wt,Ot]).optional(),source:V([St,Mt]).optional(),subject:D().optional(),smoothing:C().optional(),pin:R().optional(),pinAlign:V([Pt,jt,_t]).optional(),pinOffset:C().optional(),pinDistance:C().optional(),range:Fe.optional()}),F({align:V([Pt,jt,_t]).optional(),offset:C().optional(),distance:C().optional()})),Xe=V([Wt.auto,Wt.native,Wt.js]).optional(),Ge=F({type:L("time").optional(),engine:Xe,frameRate:C().optional(),duration:C().optional(),trigger:Re.optional(),delay:C().optional(),iterations:W([C(),L("infinite")]).optional(),fillMode:V([Y,Q,H,$]).optional(),direction:V([tt,et,nt,rt]).optional()}),Ke={duration:C().optional(),iterations:C().optional(),engine:Xe,frameRate:C().optional(),axis:V([At,xt,wt,Ot]).optional(),source:V([St,Mt]).optional(),subject:D().optional(),smoothing:C().optional(),pin:W([R(),Be]).optional(),range:Fe.optional()},qe=U("type",[Ge,F(f({type:L("scroll")},Ke)),F(f({type:L("view")},Ke))]),Ze=F({target:D(),animateWith:X(D())}),Je=F({timeline:qe.optional(),definitions:We.optional(),bindings:X(Ze).optional(),debugGlobalName:D().optional(),version:D().optional()}),Ye=W([D(),C(),X(C()),F({value:q()}),Ie]),Qe=W([C(),Ee,F({value:C()})]),He=W([Z([C(),C()]),Ee,F({value:Z([C(),C()])})]),$e=W([D(),Ee,F({value:D()})]),tn=F({translate:He.optional(),rotate:Qe.optional(),scale:He.optional(),skew:Qe.optional(),origin:He.optional()}),en=F({copies:C().optional(),translate:He.optional(),rotate:Qe.optional(),skew:Qe.optional(),scale:He.optional(),origin:He.optional()}),nn=F({source:D().optional(),maskType:V([qt,Zt]).optional(),maskUnits:V([Jt,Yt]).optional(),maskContentUnits:V([Jt,Yt]).optional(),x:C().optional(),y:C().optional(),width:C().optional(),height:C().optional()}),rn=F({pathData:$e.optional()}),on=F({offset:Qe.optional(),range:He.optional(),subPaths:V([ae.separate,ae.combined]).optional()}),an=F({start:C().optional(),stretch:C().optional(),timeCrop:Z([C(),C()]).optional()}),sn=F({without:V([Qt.translate]).optional(),source:D().optional(),retime:an.optional()}),ln=F({offset:C(),color:D()}),cn=W([X(ln),F({value:X(ln)}),Ee]),un=F({type:V([ge.linear,ge.radial]),start:He.optional(),end:He.optional(),center:He.optional(),radius:Qe.optional(),focal:He.optional(),stops:cn.optional(),gradientUnits:V([Jt,Yt]).optional(),spreadMethod:V([he,pe,me]).optional(),gradientTransform:D().optional()}),fn=un,dn=F({pathData:D(),pathOverflow:V([Ht,$t]).optional(),lengthAdjust:V([te,ee]).optional(),method:V([ne,re]).optional(),spacing:V([oe,ie]).optional(),startOffset:Qe.optional(),textLength:Qe.optional()}),hn=F({useGlyphs:R().optional()}),pn=F({transformBy:tn.optional(),repeater:en.optional(),maskedBy:nn.optional(),clipPath:rn.optional(),strokeTrim:on.optional(),clone:sn.optional(),fillGradient:un.optional(),strokeGradient:fn.optional(),textPath:dn.optional(),text:hn.optional()});function mn(t,e){var n;const r=!1!==(null==e?void 0:e.strict),o={errors:[],warnings:[],strict:r},i=kn.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const e of function(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!pn.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}(t,{strict:r}))i.includes(e)||i.push(e);const e=null==(n=ve(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,a)=>{var s,l;if(!t)return;const c="string"==typeof t.fontFamily?t.fontFamily:void 0,u=null!=c?c:i,f=a||"text"===t.type&&!!(null==(l=null==(s=t.effects)?void 0:s.text)?void 0:l.useGlyphs);if(f&&c&&!Object.prototype.hasOwnProperty.call(e,c)){const t=o+': glyph-mode text uses font-family "'+c+'", 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+"]",u,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=ve(t))?void 0:e.version;return void 0===n||void 0!==we(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 gn=B({type:D(),domType:D().optional(),textContent:D().optional(),id:D().optional(),meta:K().optional(),effects:pn.optional(),animate:Ce.optional(),style:G(W([D(),C()])).optional()},Ye),vn=B(d(f({},gn._shape),{children:J(()=>X(vn),[]).optional()}),Ye),yn=F({width:W([C(),D()]).optional(),height:W([C(),D()]).optional(),viewBox:D().optional(),animator:Je.optional()}),kn=B(d(f(f({},gn._shape),yn._shape),{type:L("svg"),children:X(vn).optional()}),Ye);F({v:X(X(C())),i:X(X(C())).optional(),o:X(X(C())).optional(),c:R().optional()});function bn(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,c=t.c;if(!a.length)return"";const u=[],f=a.length;u.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,c=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];!e&&i[0]===o[0]&&i[1]===o[1]&&c[0]===f[0]&&c[1]===f[1]?u.push("L"+f[0]+","+f[1]):u.push("C"+i[0]+","+i[1]+","+c[0]+","+c[1]+","+f[0]+","+f[1])}if(c&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],c=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===c[0]&&r[1]===c[1]||u.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+c[0]+","+c[1]),u.push("z")}return u.join("")}function An(t,e,n){return t+(e-t)*n}function xn(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=An(t[i]||0,e[i]||0,n);return r}function wn(t,e,n){return[An(t[0]||0,e[0]||0,n),An(t[1]||0,e[1]||0,n),An(t[2]||0,e[2]||0,n),An(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function On(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Sn(t[i],e[i],n));return o}function Sn(t,e,n){var r,o,i,a,s,l,c,u,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(xn(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(a=null==(i=e.i)?void 0:i[n])?a:h;m.push(xn(v,y,d));const k=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,b=null!=(u=null==(c=e.o)?void 0:c[n])?u:h;g.push(xn(k,b,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 Mn(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,c=0,u=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;c<u;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?c=l:u=l,l=(u+c)/2}return l}function Pn(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=Mn(e,r,t),((s*n+a)*n+i)*n;var n}}function jn(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function _n(t,e,n,r,o){const i=jn(t,e,o),a=jn(e,n,o),s=jn(n,r,o),l=jn(i,a,o),c=jn(a,s,o),u=jn(l,c,o);return{left:[t,i,l,u],right:[u,c,s,r]}}function zn(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=Mn(n,o,e),s=[n,r],l=[o,i],{left:c,right:u}=_n([0,0],s,l,[1,1],a),f=c[3][0],d=c[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[c[1][0]/f,c[1][1]/d,c[2][0]/f,c[2][1]/d]);const m=1-f,g=1-d;return m>1e-9&&Math.abs(g)>1e-9&&(p=[(u[1][0]-f)/m,(u[1][1]-d)/g,(u[2][0]-f)/m,(u[2][1]-d)/g]),{left:h,right:p}}function Nn(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Tn(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 En(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var In=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),Dn=new Set(["translate","rotate","scale","skew"]),Cn=new Set(["offset-distance","offsetDistance"]);function Rn(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,c=t.scale,u=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),c&&o.push("scale("+c[0]+","+c[1]+")"),a&&o.push("translate("+-a[0]+u+","+-a[1]+u+")"),o.join("")}var Ln=new Set(["offset-distance","offsetDistance"]),Vn=1e3;function Wn(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Un(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Fn=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 Bn(t){return Fn.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Xn(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,a=i*i,s=o*o,l=a*i,c=3*o*a,u=3*s*i,f=s*o;return[l*t[0]+c*e[0]+u*n[0]+f*r[0],l*t[1]+c*e[1]+u*n[1]+f*r[1]]}var Kn=1e-4;function qn(t,e,n,r,o){const i=Zn(t,e,n,r,o);if(0===i[0]&&0===i[1]){return Zn(t,e,n,r,o<.5?o+Kn:o-Kn)}return i}function Zn(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function Jn(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=Gn(t,e,n,r,0);a[0]=0,s[0]=0;let c=0;for(let u=1;u<i;u++){const i=u/o,f=Gn(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];c+=Math.sqrt(d*d+h*h),a[u]=i,s[u]=c,l=f}return{ts:a,ds:s}}function Yn(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,c=l>0?(e-s)/l:0;return r[a-1]+c*(r[a]-r[a-1])}function Qn(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 a,s=-1;for(;null!==(a=o.exec(t));){const t=a[1],o=i.indexOf(t);if(o<0||o<=s)return;s=o;const l=a[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)?f(f({},n),t):t,o=t[ce];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=d(f({},e),{keyframes:e.keyframes.map(t=>d(f({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),d(f({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>Dn.has(t));if(1!==i.length)return t;const a=i[0],s=t[a];if(!s||"object"!=typeof s||!Array.isArray(s.keyframes))return t;const l=d(f({},s),{keyframes:s.keyframes.map(t=>d(f({},t),{value:d(f({},n),{[a]:t.value})}))});void 0!==l.value&&(l.value=d(f({},n),{[a]:l.value}));const c=f({},t);return delete c[a],d(f({},c),{transform:l})}function Hn(t){const e=je(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 $n(t){return Pe(t)}function tr(t){return _e(t)}function er(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(ze(t)||Ne(t))return!0;return!1}var nr=new WeakMap;function rr(t,e,n,r){let o=nr.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const a=Ne(t),s=ze(e),l=[n[0]+(a?a[0]:0),n[1]+(a?a[1]:0)],c=[r[0]+(s?s[0]:0),r[1]+(s?s[1]:0)],u=Jn(n,l,c,r),f={P0:n,P1:l,P2:c,P3:r,lut:u,totalArc:u.ds[u.ds.length-1]};return o||(o=new WeakMap,nr.set(t,o)),o.set(e,f),f}var or=.5,ir=5,ar=32;function sr(t,e){var n,r,o;if(!er(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const a=!!t.autoOrient,s=null!=(n=null==e?void 0:e.flatnessTolerance)?n:or,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:ir,c=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:ar,u=[],f=Hn(i[0]);if(!f)return t;const d=a?function(t,e){const n=Hn(t),r=Hn(e);if(!n||!r)return 0;const o=rr(t,e,n,r),i=qn(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;u.push(cr($n(i[0]),dr(ur(i[0]),ur(i[0]),0,f,d,a)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=Hn(e),o=Hn(n);r&&o?(a&&t>0&&pr(u,e,n,r,o,l),gr(u,e,n,r,o,a,s,l,c)):u.push(cr($n(n),dr(ur(n),ur(n),1,null!=o?o:[0,0],void 0,a)))}const h=tr(i[i.length-1]);h&&(u[u.length-1].e=h),a&&lr(u);const p={keyframes:u};return void 0!==t.loop&&(p.loop=t.loop),p}function lr(t){let e;for(const n of t){const t=je(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 cr(t,e){return{t:t,v:e}}function ur(t){const e=je(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function fr(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function dr(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=fr(o,s,n))}return void 0!==o&&(a.rotate=o+hr(t,e,n)),a}function hr(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=fr(r,o,n);return"number"==typeof i?i:0}function pr(t,e,n,r,o,i){const a=t[t.length-1],s=je(a),l=null==s?void 0:s.rotate;if("number"!=typeof l)return;const c=ur(e),u=l-hr(c,c,0),f=rr(e,n,r,o),d=qn(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,u);if(Math.abs(p)<=i)return;const m=$n(e),g=Math.min(m+mr,(m+$n(n))/2),v=dr(ur(e),ur(e),0,r,h,!0);t.push(cr(g,v))}var mr=.05;function gr(t,e,n,r,o,i,a,s,l){const c=rr(e,n,r,o),u=$n(e),f=$n(n),d=tr(e),h=(p=d)?Pn([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=ur(e),g=ur(n),v=function(t,e,n,r,o){const i=[];vr(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),vr(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)yr(a[o],a[o+1],s,t,e,n,r,l);return s}(c,i,a,s,l),y=[];for(const t of v){const e=Yn(c.lut,t),n=Xn(c.totalArc>0?e/c.totalArc:t,0,1),r={u:Xn(h(n),0,1),p:n,pos:Gn(c.P0,c.P1,c.P2,c.P3,t)};if(i){const e=qn(c.P0,c.P1,c.P2,c.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}y.push(r)}let k=d,b=0;const A=t.length-1;for(let e=0;e<y.length;e++){const n=y[e],r=b<1?Xn((n.u-b)/(1-b),0,1):1,{left:o,right:a}=zn(k,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=u+n.u*(f-u),c=dr(m,g,n.p,n.pos,n.rotateDeg,i);t.push(cr(l,c)),k=a,b=n.u}}function vr(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),c=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-c/l;t>1e-6&&t<.999999&&o.push(t)}return}const u=l*l-4*s*c;if(u<0)return;const f=Math.sqrt(u),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function yr(t,e,n,r,o,i,a,s){const l=(t+e)/2,c=Gn(r.P0,r.P1,r.P2,r.P3,t),u=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(kr(d,c,u),kr(h,c,u),kr(p,c,u));let g=!0;if(o){const n=qn(r.P0,r.P1,r.P2,r.P3,t),o=qn(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(g=!1)}m<=i&&g||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,yr(t,l,n,r,o,i,a,s),yr(l,e,n,r,o,i,a,s))}function kr(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function br(t,e){const n=Ar(t,e);return null!=n?n:t}function Ar(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Ar(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=Qn(o,t.transform),i=n.transform;if(i&&"object"==typeof i&&er(i)){const t=sr(i,e);t!==i&&(r=d(f({},n),{transform:t}))}}if(!n&&!r)return null;const i=f({},t);return n&&(i.children=n),r&&(i.animate=r),i}var xr=1;function wr(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=>wr(t[n],e[n]))}function Or(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Sr(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Mr(t){return"string"==typeof t&&void 0!==Sr(t)}function Pr(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const e=Sr(t.pathData);return e?{paths:Or(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&Mr(e[0])){const t=[];for(const n of e){const e=Sr(n);e&&t.push(...Or(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Mr(t[0])){const e=[];for(const n of t){const t=Sr(n);t&&e.push(...Or(t))}return{paths:e}}return{paths:t}}if(Mr(t)){return{paths:Or(Sr(t))}}return t}function jr(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 _r(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 zr(t,e,n,r){var o,i;if("d"===t){return{paths:On(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}}return In.has(t)?wn(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?An(e,n,r):Dn.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?xn(e||[],n||[],r):An(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=An(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=xn(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function Nr(t,e,n,r){var o,i,a,s,l;const c=e.length-1,u=Xn(null!=(o=n.segmentCount)?o:c,1,c);let h;h=n.repeatAt===Gt.start?e.slice(0,u+1):e.slice(c-u);const p=null!=(i=e[0].t)?i:0,m=null!=(a=e[e.length-1].t)?a:0;let g,v;n.repeatAt===Gt.start?(g=0,v=p):(g=m,v=r);const y=v-g;if(y<=0)return e;const k=null!=(s=h[0].t)?s:0,b=(null!=(l=h[h.length-1].t)?l:0)-k;if(b<=0)return e;const A=h.map(t=>({relT:(t.t-k)/b,v:t.v,e:t.e,tangentIn:ze(t),tangentOut:Ne(t)})),x=Math.floor(y/b),w=y-x*b,O=w/b,S=[],M=n.repeatAt!==Gt.start,P=e[e.length-1];let j,_=!1;function z(e,n,r){var o;let i;if(n){i=[];for(let t=A.length-1;t>=0;t--)i.push({relT:1-A[t].relT,v:A[t].v,e:t>0?Nn(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else i=A;const a=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>a+1e-9){const o=i[n-1],s=r.relT-o.relT,l=(a-o.relT)/s,c=o.e?Pn(o.e)(l):l,u=zr(t,o.v,r.v,c),{left:f}=zn(o.e,l);return S.length>0&&o.relT<=a&&(S[S.length-1].e=f),void S.push({t:e+a*b,v:u,e:void 0})}const s=S.length>0?S[S.length-1]:P,l=M&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*b))<1e-9;if(l){if(wr(s.v,r.v)){S.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(j=r.e,_=!0);continue}S.length>0&&(delete s.tangentIn,delete s.tangentOut)}const c={t:e+r.relT*b+(l?xr:0),v:r.v,e:n<i.length-1?r.e:void 0};r.tangentIn&&(c.tangentIn=r.tangentIn),r.tangentOut&&(c.tangentOut=r.tangentOut),S.push(c)}}if(n.repeatAt===Gt.start){if(O>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=A.length-1;t>=0;t--)o.push({relT:1-A[t].relT,v:A[t].v,e:t>0?Nn(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else o=A;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?Pn(a.e)(o):o,l=zr(t,a.v,r.v,s),{right:c}=zn(a.e,o);S.push({t:e,v:l,e:c})}const s={t:e+(r.relT-i)*b,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),S.push(s)}}(g,n.direction===Kt.alternate&&x%2==0,O)}for(let t=0;t<x;t++){const e=x-1-t,r=n.direction===Kt.alternate&&e%2==0;z(g+w+t*b,r)}}else{for(let t=0;t<x;t++){const e=n.direction===Kt.alternate&&t%2==0;z(g+t*b,e)}if(O>1e-9){const t=n.direction===Kt.alternate&&x%2==0;z(g+x*b,t,O)}}if(n.repeatAt===Gt.start)return[...S,...e];if(_&&e.length>0){return[...e.slice(0,-1),d(f({},e[e.length-1]),{e:j}),...S]}return[...e,...S]}function Tr(t,e,n,r){var o;const i=e.keyframes||[],a=[];for(const e of i){const n=Pe(e);let i=je(e);const s=_e(e);"d"===t&&(i=Pr(i));const l=Un(t)?Bn(t):t;In.has(l)&&(i=null!=(o=En(i))?o:i);const c={t:n,v:i,e:jr(s,r)},u=ze(e),f=Ne(e);u&&(c.tangentIn=u),f&&(c.tangentOut=f),a.push(c)}a.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const s=e.loop,l=!0===s?{}:s||void 0;return l&&a.length>=2?Nr(t,a,l,n):a}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 a=Un(t)?Bn(t):t,s=In.has(a),l=i.map(e=>{var n;const r=Pe(e);let o=je(e);"d"===t&&(o=Pr(o)),s&&(o=null!=(n=En(o))?n:o);const i={t:r,v:o,e:_e(e)},a=ze(e),l=Ne(e);return a&&(i.tangentIn=a),l&&(i.tangentOut=l),i}),c={keyframes:Nr(t,l,o,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function Ir(t,e){const n=Dr(t,e);return null!=n?n:t}function Dr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Dr(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=f({},t)),r[n]=i)}}if(!n&&!r)return null;const i=f({},t);return n&&(i.children=n),r&&(i.animate=r),i}var Cr=0;function Rr(t,e=Vt.native){const n=ve(t)||{},r=be(t),o=n.duration||1e3,i=[],a=(t,n,i)=>{if(0===n.length)return null;const a=function(t,e,n,r=Vt.native){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=Tr(i,a,e,n);if(s.length>0){const t={keyframes:s};void 0!==a.autoOrient&&(t.autoOrient=a.autoOrient),void 0!==a.loop&&(t.loop=a.loop),o[i]=r===Vt.native&&"transform"===i?sr(t):t}}return o}(Qn(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(a).length?null:{id:t,animate:a}},s=function(t){var e;if(t)return null==(e=ve(t))?void 0:e.bindings}(t);if(s)for(const t of s){const e=t.target.startsWith("#")?t.target.slice(1):t.target,n=t.animateWith.map(t=>_r(t,r)).filter(t=>!!t),o=a(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_"+ ++Cr;t.id=n;const o=a(n,function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=_r(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=_r(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 Lr(t,e,n){var r,o,i,a,s;const l=e.keyframes||[];if(0===l.length)return null;const{prevKf:c,nextKf:u}=function(t,e){var n,r;const o=t.length-1;let i=t[0],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,c=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=c){i=t[s],a=t[s+1];break}e>c&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(l,n);let f=c===u?0:(d=n,h=null!=(r=c.t)?r:0,p=null!=(o=u.t)?o:0,m=0,g=1,p===h?m:m+(d-h)/(p-h)*(g-m));var d,h,p,m,g;f=Xn(f,0,1);const v=_e(c);if(v&&Array.isArray(v))try{f=Pn(v)(f)}catch(t){}let y=Un(t)?Bn(t):t,k=null;const b=null==c?void 0:c.v,A=null==u?void 0:u.v;if("d"===y){k=On(null!=(i=null==b?void 0:b.paths)?i:Array.isArray(b)?b:[],null!=(a=null==A?void 0:A.paths)?a:Array.isArray(A)?A:[],f).map(t=>bn(t)).join("")}else if(In.has(y))k=Tn(wn(b||[0,0,0,1],A||[0,0,0,1],f)),y=t;else if("stroke-dasharray"===y)k=xn(b||[],A||[],f).join(" "),y=t;else if("transform"!==y||null===b||"object"!=typeof b||Array.isArray(b))if("translate"===y){k="translate("+xn(b||[0,0],A||[0,0],f).join(",")+")",y="transform"}else if("rotate"===y){k="rotate("+An(+(b||0),+(A||0),f)+")",y="transform"}else if("scale"===y){k="scale("+xn(b||[1,1],A||[1,1],f).join(",")+")",y="transform"}else{k=An(+(b||0),+(A||0),f)}else{const t=new Set([...b?Object.keys(b):[],...A?Object.keys(A):[]]),n={};for(const e of t){const t=null==b?void 0:b[e],r=null==A?void 0:A[e];if("rotate"===e||"skew"===e)n[e]=An(+(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=xn(t||o,r||o,f);n[e]=i}}if(er(e)){const t=b.translate,r=A.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,e,n,r,o,i){const a=rr(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=e*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(n<=0)return r[0];if(n>=o[i])return r[i];let a=1,s=i;for(;a<s;){const t=a+s>>>1;o[t]<n?a=t+1:s=t}const l=o[s-1],c=o[s]-l,u=c>0?(n-l)/c:0;return r[s-1]+u*(r[s]-r[s-1])}(a.lut,o),l=Gn(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const c=qn(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(c[1],c[0])/Math.PI}}(c,u,[+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!=(s=n.rotate)?s:0))}}k=Rn(n,{withUnits:!1}),y="transform"}return Cn.has(y)&&"number"==typeof k&&(k=100*k+"%"),{k:y,v:null===k?"":""+k}}var Vr=[1,0,0,1,0,0];function Wr(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var Ur=(t,e)=>[1,0,0,1,t,e],Fr=(t,e)=>[t,0,0,e,0,0];function Br(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var Xr=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Gr=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function Kr(t){let e=Vr;t.translate&&(e=Wr(e,Ur(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=Wr(e,Ur(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=Wr(e,Br(t.rotate))),t.scale&&(e=Wr(e,Fr(t.scale[0],t.scale[1]))),n&&(e=Wr(e,Ur(-t.origin[0],-t.origin[1]))),e}function qr(t,e,n){return t+(e-t)*n}function Zr(t,e){return null==t?Vr:"string"==typeof t?function(t){let e=Vr;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=Wr(e,Ur(n[0]||0,n[1]||0)):"scale"===t?e=Wr(e,Fr(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=Wr(e,Br(n[0])):"skewX"===t?e=Wr(e,Xr(n[0])):"skewY"===t?e=Wr(e,Gr(n[0])):"matrix"===t&&(e=Wr(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?Kr(function(t,e){var n,r,o,i,a,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let c=0;for(;c<t.length-1&&(null!=(o=t[c+1].time)?o:0)<e;)c++;const u=t[c],f=t[c+1],d=(e-(null!=(i=u.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=u.time)?s:0)||1),h=u.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[qr(h.translate[0],p.translate[0],d),qr(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=qr(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[qr(h.scale[0],p.scale[0],d),qr(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?Kr(t.value):"object"!=typeof t||Array.isArray(t)?Vr:Kr(t)}var Jr=new Set(["svg","g","symbol"]),Yr=new Set(["defs","mask","clipPath","title"]);function Qr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Qr(t,e))}function Hr(t){return null==t?0:Number(t)}function $r(t){return Math.round(100*t)/100+0}function to(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",c=null!=(o=t.stroke)?o:"",u=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=$r(function(t,e,n,r){var o,i,a,s,l,c;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a:0)<r;)n++;const u=e[n],f=e[n+1],d=(r-(null!=(s=u.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(c=u.time)?c:0)||1);return qr(u.value,f.value,d)}return void 0!==e?Number(e):n}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,n)),d=t.mask?1:0,h=e.map($r).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return Hr(t.width)+","+Hr(t.height)+","+Hr(t.x)+","+Hr(t.y);case"ellipse":return Hr(t.rx)+","+Hr(t.ry)+","+Hr(t.cx)+","+Hr(t.cy);case"circle":return Hr(t.r)+","+Hr(t.cx)+","+Hr(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+c+"|sw:"+(Hr(u)||"")+"|o:"+f+"|m:"+d}function eo(t,e,n,r,o){var i;const a=t.type||"";if(Yr.has(a))return;const s=Wr(e,function(t,e){return t.animate&&t.animate.transform?Zr(t.animate.transform,e):void 0!==t.transform?Zr(t.transform,e):Vr}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=Wr(s,Ur(Hr(t.x),Hr(t.y)));return void(i?eo(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Jr.has(a)?null==(i=t.children)||i.forEach(t=>eo(t,s,n,r,o)):o.push(to(t,s,n))}function no(t,e){var n;e.add(0);(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>no(t,e))}function ro(t,e){const n=new Map;Qr(t,n);const r=[];return eo(t,Vr,e,n,r),r.sort()}function oo(t,e){const n=new Set;no(t,n),no(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=ro(t,o),i=ro(e,o),a=io(n,i),s=io(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function io(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}var ao=48,so=/[MmLlHhVvCcSsQqTtAaZz]/;function lo(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 co(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,c=0,u=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=Jn(a,t,e,r,ao);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];so.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,a=e,s=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],c=e[1],p(t,e,r)}else if("S"===g){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-c]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],c=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)];u=t[0],f=t[1];const{P1:r,P2:a}=lo([o,i],t,e);p(r,a,e)}else if("T"===g){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-u,2*i-f]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)];u=t[0],f=t[1];const{P1:r,P2:a}=lo([o,i],t,e);p(r,a,e)}else{if("A"!==g){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,c=l>0?(e-s)/l:0;return n[a-1]+c*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=Gn(o.P0,o.P1,o.P2,o.P3,a),[c,u]=qn(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(u,c)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}var uo=(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 fo(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function ho(t,e){let n="";for(let r=0;r<t.length;r++){const o=fo(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function po(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var mo=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function go(t,e,n=2){const r=[];let o;for(mo.lastIndex=0;null!==(o=mo.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=po(e,s(),s());i+=t+ho([r,o],n)}else if("C"===t){const[t,r]=po(e,s(),s()),[o,a]=po(e,s(),s()),[l,c]=po(e,s(),s());i+="C"+ho([t,r,o,a,l,c],n)}else if("Q"===t){const[t,r]=po(e,s(),s()),[o,a]=po(e,s(),s());i+="Q"+ho([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}function vo(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 yo(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(bo),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 ko(t,e,n,r){var o,i,a,s;const l=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=l(n.value));const c=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,u=f({},c||{}),d={keyframes:n.keyframes};void 0!==n.loop&&(d.loop=n.loop),void 0!==n.autoOrient&&(d.autoOrient=n.autoOrient),u[e]=d,t.animate=u;const h=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==h&&(t[e]=l(h))}function bo(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=f({},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 Ao(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}var xo=16,wo=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",se,"xml:space"],Oo=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],So=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function Mo(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function Po(t){return"string"==typeof t?t:void 0}function jo(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of So)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function _o(t,e){var n,r,o,i,a,s,l,c,u,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=Po(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Mo(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=Mo(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Mo(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(c=Mo(p("opacity")))?c:e.opacity,animate:null!=(u=d?void 0:jo(t))?u:e.animate};for(const t of Oo){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function zo(t){var e,n,r;return{fontFamily:Po(t.fontFamily),fontSize:null!=(e=Mo(t.fontSize))?e:xo,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Mo(t.letterSpacing))?n:0,wordSpacing:null!=(r=Mo(t.wordSpacing))?r:0}}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&&1!==t.opacity&&(e.opacity=t.opacity);for(const n of Oo)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function To(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 Eo(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}var Io=.6,Do="px-missing-glyph";function Co(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,i=.92*-e,a=o-r,s=-i,l=Math.max(1,.12*Math.min(a,s)),c="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(a<=2*l||s<=2*l)return c;const u=r+l,f=o-l,d=-l,h=i+l;return c+"M"+u+" "+d+"L"+u+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function Ro(t,e){var n,r,o;const{glyphs:i,create:a=uo,warnings:s}=e,l=Eo(i),c={x:null!=(n=Mo(t.x))?n:0,y:null!=(r=Mo(t.y))?r:0},u=[],f=[{start:c.x,end:c.x}];let d=0;const h=(t,e)=>{var n;const r=To(e,i,l,s),o=(null==r?void 0:r.unitsPerEm)||1e3,a=e.fontSize/o,h=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=No(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),s=null==r?void 0:r.glyphs[i];if(s&&s.pathData)u.push({glyphD:s.pathData,m:[a,0,0,a,c.x,c.y],paint:p,line:d,x:c.x,y:c.y,scale:a}),c.x+=s.width*a;else if(/\S/.test(i)){const t=s&&s.width>0?s.width:Io*o;u.push({glyphD:Co(t,h),m:[a,0,0,a,c.x,c.y],paint:p,isMissing:!0,line:d,x:c.x,y:c.y,scale:a}),c.x+=t*a}else c.x+=(s?s.width:0)*a;c.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),f[d].end=c.x}},p=(t,e)=>{var n,r,o;const i=_o(t,e),a=Mo(t.x),s=Mo(t.y);void 0!==a&&(c.x=a,d=f.length,f.push({start:c.x,end:c.x})),void 0!==s&&(c.y=s),c.x+=null!=(n=Mo(t.dx))?n:0,c.y+=null!=(r=Mo(t.dy))?r:0;const l=Po(t[se]);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=zo(t);if(t.children)for(const e of t.children)p(e,m);const g=Po(t[se]);g&&!(null==(o=t.children)?void 0:o.length)&&h(g,m);const v=Po(t.textAnchor);if("middle"===v||"end"===v)for(const t of u){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 Jo(t,Zo(u,a,s),a)}function Lo(t,e){var n,r,o,i,a;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:i,warnings:a,alongPath:s}=n,l=co(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const c=Eo(i),u=[];let f=0;const d=(t,e)=>{var n,r;const o=_o(t,e),s=Po(t[se]);if(s&&!(null==(n=t.children)?void 0:n.length)){const t=To(o,i,c,a),e=(null==t?void 0:t.unitsPerEm)||1e3,n=o.fontSize/e,l=(null!=(r=null==t?void 0:t.ascent)?r:.9*e)*n;for(let e=0;e<s.length;e++){const r=s.charAt(e),i=null==t?void 0:t.glyphs[r],a=(i?i.width:0)*n,c=a+o.letterSpacing+(" "===r?o.wordSpacing:0);u.push({advStart:f,advEnd:f+c,glyphW:a,ascent:l,fontSize:o.fontSize}),f+=c}}if(t.children)for(const e of t.children)d(e,o)};d(t,zo(t));const h=f,p=yo(null==s?void 0:s.textLength),m="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,g=m>0&&h>0?m/h:1,v=yo(null==s?void 0:s.startOffset),{along:y,perp:k}=Wo(t),b=y+("animated"===v.kind?Number(null==(o=v.keyframes[0])?void 0:o.value)||0:"static"===v.kind&&Number(v.value)||0),A=t=>({x:t.x-k*Math.sin(t.angle),y:t.y+k*Math.cos(t.angle),angle:t.angle});return u.map(t=>{const e=b+t.advStart*g,n=b+t.advEnd*g,r=A(l.sampleAtDistance(e)),o=A(l.sampleAtDistance(n)),i=l.sampleAtDistance(b+(t.advStart+t.glyphW/2)*g);return{x:r.x,y:r.y,width:t.advEnd-t.advStart,ascent:t.ascent,fontSize:t.fontSize,endX:o.x,endY:o.y,rotation:180*i.angle/Math.PI}})}(t,e.alongPath.pathD,e);const{glyphs:s,warnings:l}=e,c=Eo(s),u={x:null!=(r=Mo(t.x))?r:0,y:null!=(o=Mo(t.y))?o:0},f=[],d=[{start:u.x,end:u.x}];let p=0;const m=(t,e)=>{var n;const r=To(e,s,c,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,a=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*i;for(let n=0;n<t.length;n++){const o=t.charAt(n),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+e.letterSpacing+(" "===o?e.wordSpacing:0);f.push({x:u.x,y:u.y,width:l,ascent:a,fontSize:e.fontSize,line:p}),u.x+=l,d[p].end=u.x}},g=(t,e)=>{var n,r,o;const i=_o(t,e),a=Mo(t.x),s=Mo(t.y);void 0!==a&&(u.x=a,p=d.length,d.push({start:u.x,end:u.x})),void 0!==s&&(u.y=s),u.x+=null!=(n=Mo(t.dx))?n:0,u.y+=null!=(r=Mo(t.dy))?r:0;const l=Po(t[se]);if(l&&!(null==(o=t.children)?void 0:o.length)&&m(l,i),t.children)for(const e of t.children)g(e,i)},v=zo(t);if(t.children)for(const e of t.children){const t=f.length;if(g(e,v),f.length===t){const t=_o(e,v),n=To(t,s,c),r=(null==n?void 0:n.unitsPerEm)||1e3;f.push({x:u.x,y:u.y,width:0,ascent:(null!=(i=null==n?void 0:n.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:p})}}const y=Po(t[se]);y&&!(null==(a=t.children)?void 0:a.length)&&m(y,v);const k=Po(t.textAnchor);if("middle"===k||"end"===k)for(const t of f){const e=d[t.line].end-d[t.line].start;t.x+="middle"===k?-e/2:-e}return f.map(t=>{var e=t,{line:n}=e;return h(e,["line"])})}function Vo(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),c=Math.sin(s),u=r/2;return[n*l,n*c,-n*c,n*l,i-n*l*u-o*c,a-n*c*u+o*l]}function Wo(t){var e,n,r;return{along:(null!=(e=Mo(t.x))?e:0)+(null!=(n=Mo(t.dx))?n:0),perp:null!=(r=Mo(t.dy))?r:0}}function Uo(t,e,n,r,o,i){const{glyphs:a,create:s=uo,warnings:l}=r,c=e?co(e):null;if(!c)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const u=Eo(a),{cells:h,width:p}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,c;const u=_o(t,s),f=Po(t[se]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=To(u,e,n,r);if(t){const e=u.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=No(u);for(let a=0;a<f.length;a++){const s=f.charAt(a),l=t.glyphs[s];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(s)){const a=l&&l.width>0?l.width:Io*t.unitsPerEm,s=a*e;o.push({glyphD:Co(a,n),widthEm:a,scale:e,paint:r,isMissing:!0,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=u.letterSpacing+(" "===s?u.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,u)};return a(t,zo(t)),{cells:o,width:i}}(t,a,u,l);if(!h.length)return Jo(t,[],s);const{along:m,perp:g}=Wo(t),v=Fo(n),y=Fo(o),k=t=>t>0&&p>0?t/p:1,b="clip"===i&&!c.closed;if(v.animated||y.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(v.times,y.times),n=(t,e)=>m+v.at(e)+k(y.at(e))*t.midBase,r=v.animated?v.loop:y.loop;return Jo(t,function(t,e,n,r,o,i,a,s=0){const l=Math.max(e.totalLength/Bo,.5),c=t=>t>=0&&t<=e.totalLength,u=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=go(h.glyphD,t),m=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[Go(r-s*l,3),Go(o+s*a,3)],rotate:Go(180*i/Math.PI,3)}}},g=[],v=[],y=(t,e)=>{g.push(m(t,e)),a&&v.push({time:e,value:c(t)?1:0})};y(n(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(h,e),a=n(h,o),s=Math.min(Xo,Math.max(1,Math.ceil(Math.abs(a-i)/l)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);y(n(h,r),r)}}lr(g);const k={keyframes:g};void 0!==o&&(k.loop=o);const b={transform:k};if(h.paint.animate&&Object.assign(b,h.paint.animate),a&&v.some(t=>0===t.value)){const t={keyframes:v};void 0!==o&&(t.loop=o),b.opacity=t}u.push(i("path",d(f(f({d:p},Ko(h.paint)),qo(h.isMissing)),{animate:b}),[]))}return u}(h,c,n,e,r,s,b,g),s)}const A=k(y.at(0)),x=m+v.at(0);return Jo(t,Zo((b?h.filter(t=>{const e=x+t.midBase*A;return e>=0&&e<=c.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:Vo(c,x+t.midBase*A,t.scale,t.widthEm,g)})),s,l),s)}function Fo(t){var e;const n=yo(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 Bo=48,Xo=64;function Go(t,e){const n=c(10,e);return Math.round(t*n)/n}function Ko(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 Oo)void 0!==t[n]&&(e[n]=t[n]);return e}function qo(t){return t?{[le]:Do}:{}}function Zo(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=go(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",f(f(f({d:n},Ko(t)),qo(i)),void 0!==t.animate?{animate:f({},t.animate)}:{}),[]));return o}function Jo(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===wo.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=f({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function Yo(t,e){return e.alongPath?Uo(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Ro(t,e)}function Qo(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Qo);const e={};for(const n of Object.keys(t))e[n]=Qo(t[n]);return e}function Ho(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 $o(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function ti(t){var e;const n=$o(t.x),r=$o(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 ei(t,e){return"_lw_"+e+"_"+t.nextId++}function ni(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function ri(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>ri(t,e))}var oi=Qo;var ii=.15;function ai(t){const e=yo(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 si(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 a=t.textContent;if("string"==typeof a&&(e+=a.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var li=t=>Math.round(1e3*t)/1e3;function ci(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=co(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=ii*o,a=ai(e.startOffset),s=ai(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),c=Math.max(0,a.max+s-o),u=l>0?l+i:0,f=c>0?c+i:0;if(f<=0&&u<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(u>0){const e=d.x-Math.cos(d.angle)*u,n=d.y-Math.sin(d.angle)*u,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+li(e)+","+li(n)+"L"+li(d.x)+","+li(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"+li(t)+","+li(e)}return{d:p,startShift:u}}function ui(t,e,n){var r;if(!e||"string"!=typeof e.pathData||!e.pathData)return t;const o=ei(n,"tpath"),{d:i,startShift:a}=ci(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:si(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),fi(s,"startOffset",function(t,e){if(!e||null==t)return t;const n=yo(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=>d(f({},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,a)),fi(s,"textLength",e.textLength),t.children=[s],t}function fi(t,e,n){null!=n&&ko(t,e,yo(n),{asString:!0})}var di=6;function hi(t,e){const{problems:n}=function(t){try{return{problems:mn(t)}}catch(t){return{problems:[]}}}(t);if(!n.length)return;const r=n.slice(0,di),o=n.length-r.length;console.warn(e+": this document does not match the animation schema in "+n.length+" place"+(1===n.length?"":"s")+".\n"+r.map(t=>" - "+t).join("\n")+(o>0?"\n … and "+o+" 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.")}function pi(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=gi(r,e.origin,!0),r=mi(r,"scale",e.scale,n),r=mi(r,"skew",e.skew,n),r=mi(r,"rotate",e.rotate,n),r=gi(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=mi(r,"translate",e.translate,n):(r=gi(r,e.origin,!0),r=mi(r,"translate",e.translate,n),r=gi(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function mi(t,e,n,r){if(void 0===n)return t;const o=yo(n);if("static"===o.kind)return{type:"g",transform:{value:vo(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>Ao(t,vo(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 gi(t,e,n){if(void 0===e)return t;const r=yo(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=>Ao(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function vi(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=ni(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=>vi(t,e,n))}function yi(t,e,n,r,o){const i=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=bi(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),c=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(c.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:c};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),c=a||l,u=a&&bi((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&bi((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=ki(i.full),r=ki(o.full),a=-n[0],s=-n[1],l=r[0]-a,c=r[1]-s;if(0===l&&0===c)return{rest:t};return{translate:"translate("+l+","+c+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);c?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)?u&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){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=f({},r);delete e.translate;const n=Object.keys(e).length>0;c||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=bi(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=pi(l,s,o);let c={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(c.transform=i.transform),void 0!==i.animate&&(c.animate=i.animate),a&&(delete c.id,c=pi(c,a,o),c.id=n),c}function ki(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 bi(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 Ai(t,e,n,r){if(!e)return t;const o=ei(n,"grad"),i=function(t,e){const n={type:t.type===ge.radial?"radialGradient":"linearGradient",id:e};t.type===ge.linear?(xi(n,"x1","y1",t.start),xi(n,"x2","y2",t.end)):(xi(n,"cx","cy",t.center),function(t,e,n){const r=yo(n);if("absent"===r.kind)return;ko(t,e,r,{asString:!0})}(n,"r",t.radius),xi(n,"fx","fy",t.focal));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);return n.children=function(t){var e,n;if(!t)return[];const r=yo(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(wi):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=je(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=je(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:Oi(o,0,t))?n:{offset:t/Math.max(1,a-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 a=[],s=[];let l=!1;for(const r of e){const o=Pe(r),c=je(r),u=null!=(i=null==c?void 0:c[n])?i:Oi(e,e.indexOf(r),n);if(!u)continue;const f=_e(r),d={time:o,value:u.color};void 0!==f&&(d.easing=f),a.push(d);const h={time:o,value:u.offset};void 0!==f&&(h.easing=f),s.push(h),u.offset!==t.offset&&(l=!0)}const c={type:"stop",offset:Si(t.offset),stopColor:t.color},u={};a.length&&(u.stopColor={keyframes:a},void 0!==o&&(u.stopColor.loop=o));l&&s.length&&(u.offset={keyframes:s},void 0!==o&&(u.offset.loop=o));Object.keys(u).length&&(c.animate=u);return c}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function xi(t,e,n,r){var o,i,a;const s=yo(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},c=null!=(o=t.animate)?o:{};c[e]=l(0),c[n]=l(1),t.animate=c;const u=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(u)&&(t[e]=String(u[0]),t[n]=String(u[1]))}function wi(t){return{type:"stop",offset:Si(t.offset),stopColor:t.color}}function Oi(t,e,n){for(let r=e;r>=0;r--){const e=je(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=je(t[r]);if(null==e?void 0:e[n])return e[n]}}function Si(t){return Math.round(1e3*t)/10+"%"}function Mi(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function Pi(t,e,n,r){if(!e)return t;const o=ni(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=ei(r,"mask");let a={type:"use",href:"#"+o};if(n)a=ji(a,n,r);else if(Ti(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=Ao(t,void 0);if(Array.isArray(e.translate)&&a.push(d(f(f({},r),Ni(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(d(f({},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(d(f({},r),{value:t}))}}const c=null==o?void 0:o.loop,u=t=>{const e={keyframes:t};return void 0!==c&&(e.loop=c),e};let h=t;a.length&&(h={type:"g",animate:{transform:u(a)},children:[h]});s.length&&(h={type:"g",animate:{transform:u(s)},children:[h]});l.length&&(h={type:"g",animate:{transform:u(l)},children:[h]});return h}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,c,u,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 u=g[t];if("translate"!==u.name)continue;const f=null!=(e=u.args[0])?e:0,d=null!=(n=u.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!=(a=g[e].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)m.rotate=(null!=(s=m.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(c=t.args[0])?c: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,k,b;for(const t of g)if("translate"===t.name){const e=null!=(u=t.args[0])?u:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)k=(null!=k?k: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;b=b?[b[0]*e,b[1]*n]:[e,n]}const A={};y&&(A.translate=y);void 0!==k&&(A.rotate=k);b&&(A.scale=b);return Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}return}(t);e&&(a=ji(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||Ti(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?Ci(e,r):void 0,l=s?[...a,s]:a,c=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!c.length)return t;const u=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)u.add(e.time);for(const t of c)if(t.translateKeyframes)for(const e of t.translateKeyframes)u.add(e.time);if(!(u.size>0)){const e=Ei(l),n=Ei(c),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}const f=Array.from(u).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const e=Ii(l,t),n=Ii(c,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}function ji(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=yo(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=_i(o,"translate",e.translate,void 0,n),o=_i(o,"rotate",e.rotate,r,n),o=_i(o,"scale",e.scale,r,n),o}function _i(t,e,n,r,o){if(void 0===n)return t;const i=yo("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:vo(e,zi(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=Ao(t,vo(e,zi(e,t.value),r));return"translate"===e?f(f({},n),Ni(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function zi(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Ni(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 Ti(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Ei(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 Ii(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Di(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Di(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 Ci(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}function Ri(t,e,n){if(!e)return;const r=ni(e.source);if(!r)return void(e.without===Qt.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===Qt.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Li(t,e){const n={};return void 0!==t.translate&&(n.translate=Vi(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=Vi(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=Vi(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];return Vi(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function Vi(t,e,n=!1){const r=yo(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return("number"==typeof t||Array.isArray(t))&&!n?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?d(f({},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 Wi=!1;function Ui(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}var Fi=1;function Bi(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-Fi),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+Fi,value:0}],a=f({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function Xi(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Gi(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function Ki(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 qi(t,e,n){const r=ni(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Zi(r,e,n,new Set);if(o)if(Wi){const e=n.idMap.get(o);t.type="g",delete t.href,t.children=[e],ti(t),n.defs=n.defs.filter(t=>t!==e)}else t.href="#"+o}function Zi(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=oi(o);if(function(t,e){Ho(t,()=>ei(e,"retimed"))}(i,n),"use"===o.type?Yi(i,e.start,e.stretch):Ji(i,e.start,e.stretch),Ki(i),"use"===o.type&&o.href){const a=ni(o.href);if(a){const s=Gi(o),l=s?Xi(Ui(s),e):e,c=new Set(r);c.add(t);const u=Zi(a,l,n,c);u&&(i.href="#"+u)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=Gi(t);if("use"===t.type&&s&&t.href){const i=ni(t.href);if(i){const a=Xi(Ui(s),e),l=new Set(r);l.add(o);const c=Zi(i,a,n,l);c&&(t.href="#"+c)}Ki(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function Ji(t,e,n){var r;Yi(t,e,n),null==(r=t.children)||r.forEach(t=>Ji(t,e,n))}function Yi(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 Qi(t,e,n){if(!e)return t;const r=e.subPaths===ae.combined,o=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)i(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,c,u;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(c=t.r)?c:0):Number(null!=(u=t.ry)?u:0);if(!(r>0&&o>0))return;const f=r*da,d=o*da,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=Or(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=ua(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const e of t.subpaths)r||(a=0),e.startOffsetPx=a,a+=e.lengthPx;const l=a;if(r&&l<.001)return t;const c=yo(e.offset),u="absent"===c.kind?{kind:"static",value:0}:c,h=function(t){const e=yo(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:Pe(t),value:je(t),easing:_e(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=la(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=ca(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=ca(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),p="absent"===h.kind?{kind:"static",value:[0,1]}:h,m=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=je(n);"number"==typeof t&&e.push(t)}return e}(u),g=[m.length?Math.min(...m):0,m.length?Math.max(...m):0];if(1===o.length&&o[0].leaf===t&&1===o[0].subpaths.length){const e=o[0],n=e.subpaths[0],i=r?l:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=ea(n,e,r),s=na(e,r),l=f({},t);return delete l.effects,ia(l,"strokeDasharray",oa(i,s)),ia(l,"strokeDashoffset",oa(o,a)),ia(l,"strokeOpacity",sa(i)),l}(e.leaf,i,a,g,u,p)}const v=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?l:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...$i(t.leaf,o.subpath,i,a,g,u,p,n))}v.set(t.leaf,Hi(t.leaf,e))}const y=t=>{const e=v.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?d(f({},t),{children:t.children.map(y)}):t)};return y(t)}function Hi(t,e){const n=d(f({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function $i(t,e,n,r,o,i,a,s){const l=ea(r,n,o),c=na(n,o),u=oa(i,l),f=oa(a,c),d=sa(a),h=function(t){return{type:"path",d:t}}(bn(e));return ia(h,"strokeDasharray",f),ia(h,"strokeDashoffset",u),ia(h,"strokeOpacity",d),[h]}var ta=1;function ea(t,e,n){const[r]=ra(n);return n=>e*(-n-r+t)+ta}function na(t,e){const[n,r]=ra(e),o=r-n+1;return e=>{const n=Xn(e[0],0,1),r=Xn(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=ta;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+ta),s}}function ra(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function oa(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:Pe(t),value:e(je(t)),easing:_e(t)})),loop:t.loop}}function ia(t,e,n){n&&ko(t,e,n)}var aa=10;function sa(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(je(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,a=t<n.length-1?n[t+1]:void 0,s=Pe(r),l=e(je(r)),c=o?l&&e(je(o)):l,u=a?l&&e(je(a)):l;c&&!u?(i.push({time:s,value:0}),i.push({time:s+aa,value:1})):!c&&u&&(i.push({time:s-aa,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function la(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function ca(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 ua(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+=fa(t,r,r+1);return t.c&&e.length>1&&(n+=fa(t,e.length-1,0)),n}function fa(t,e,n){var r,o,i,a;const s=t.v,l=s[e],c=s[n],u=Jn(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:c,c);return u.ds[u.ds.length-1]}var da=.5522847498307936;function ha(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:Ut(null==(e=ve(t))?void 0:e.engine),glyphs:null==(n=be(t))?void 0:n.fonts},o=oi(t);ri(o,r.idMap),vi(o,r,()=>ei(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=ni(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=Ci(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(),ri(t,e.idMap);const n=[],r=t=>{var e;Gi(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&Gi(o)&&n++,"use"===o.type&&o.href){const t=ni(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=ni(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=Gi(t);if(!n)continue;const r=n.timeCrop;Ki(t),qi(t,Ui(n),e),r&&Bi(t,r,e)}}(t,e),t}(pa(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function pa(t,e){t.children&&(t.children=t.children.map(t=>pa(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,strokeTrim:c,clone:u,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?Uo(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?Ro(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=ui(m,h,e)),m=function(t,e,n){return Ai(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return Ai(t,e,n,"stroke")}(m,d,e),m=Qi(m,c,e),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=oi(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const c=[l];for(let t=1;t<i;t++){const r=oi(l),o=Li(e,t),i=o?pi(r,o,n):r;c.push(i)}const u={type:"g",children:c};return t.id&&(u.id=t.id),void 0!==a&&(u.transform=a),void 0!==s&&(u.animate={transform:s}),u}(m,a,e),m=Pi(m,s,i,e),m=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=ei(n,"clip"),o={type:"path"},i=yo(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=Mi(i.value):(ko(o,"d",i),void 0!==o.d&&(o.d=Mi(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(Ri(m,u,e),m=yi(m,i,r,o,e)):m=function(t,e,n,r){return Ri(t,e,r),pi(t,n,r)}(m,u,i,e),(null==u?void 0:u.retime)&&(t.effects={clone:{retime:u.retime}}),r&&e.idMap.set(r,m),m}function ma(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,c=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+c*r[0],a*t[1]+s*e[1]+l*n[1]+c*r[1]]}function ga(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=ma(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var va=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function ya(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=je(o[0]),a=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],s=[];let l=!1;for(const t of o){const n=je(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>t!==de.translate&&t!==de.origin&&t!==de.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]!==a[0]||o[1]!==a[1])return;s.push([r[0]+a[0],r[1]+a[1]])}if(!o.some(t=>ze(t)||Ne(t)))return;let c="M"+va(s[0][0])+","+va(s[0][1]);const u=[];for(let t=0;t<s.length-1;t++){const e=s[t],i=s[t+1],a=null!=(n=Ne(o[t]))?n:[0,0],l=null!=(r=ze(o[t+1]))?r:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[i[0]+l[0],i[1]+l[1]];c+="C"+va(f[0])+","+va(f[1])+","+va(d[0])+","+va(d[1])+","+va(i[0])+","+va(i[1]),u.push(ga(e,f,d,i))}const f=u.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+=u[t-1]);const e={t:Pe(o[t]),v:h/f},n=_e(o[t]);void 0!==n&&(e.e=n),d.push(e)}return{pathStr:c,distanceKfs:d,autoOrient:!!t.autoOrient,anchor:a,keyframesCarryRotate:l}}(i);if(e){const n=f({},o);delete n[ce];const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n[ue]=a;const s=t.transform;let l=s;if(s&&"object"==typeof s){const t=f({},s);delete t[de.translate],delete t[de.origin],e.keyframesCarryRotate&&delete t[de.rotate],l=Object.keys(t).length?t:void 0}r=d(f({},t),{animate:n,style:d(f({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:va(e.anchor[0])+"px "+va(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=d(f({},r),{children:t}))}return r};return e(t)}function ka(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=Aa(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=wa(t.viewBox);if(e)return[e[2],e[3]];const n=ba(t.width),r=ba(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=Oa(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},c=[...null!=(e=s.children)?e:[],l];return d(f({},s),{children:c})}function ba(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Aa(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function xa(t,e,n,r,o,i,a){var s,l,c,u;const h=Qo(e);Ho(h,o);const p="symbol"===h.type?wa(h.viewBox):void 0,m=null!=(l=null!=(s=ba(t.width))?s:null==p?void 0:p[2])?l:a[0],g=null!=(u=null!=(c=ba(t.height))?c:null==p?void 0:p[3])?u:a[1],v="symbol"===h.type?function(t,e,n,r,o){const i=wa(t.viewBox),a=d(f({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,c,u]=i,h=c>0&&u>0?Math.min(r/c,o/u):1,p=(r-c*h)/2,m=(o-u*h)/2,g=[];0===p&&0===m||g.push("translate("+p+","+m+")");1!==h&&g.push("scale("+h+")");0===s&&0===l||g.push("translate("+-s+","+-l+")");g.length&&(a.transform=g.join(""));const v=e();return n.push({type:"clipPath",id:v,children:[{type:"rect",x:s,y:l,width:c,height:u}]}),a.clipPath="url(#"+v+")",a}(h,o,i,m,g):h,y=Oa(v,n,r,o,i,a),k=d(f({},t),{type:"g",children:[y]});return delete k.href,delete k.width,delete k.height,ti(k)}function wa(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 Oa(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Aa(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return xa(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Oa(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?d(f({},t),{children:s}):t}var Sa=0;function Ma(){return"_px_"+Date.now().toString(36)+(++Sa).toString(36)+Math.random().toString(36).substring(2,6)}function Pa(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Pa(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Pa(e[t]);return n}function ja(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var _a="transform",za=new Set(["reverse","alternate-reverse"]),Na="__px_rest_";function Ta(t,e){if(void 0!==t[e])return!1;if(Dn.has(e))return!1;if(e===_a)for(const e of Dn)if(void 0!==t[e])return!1;return!0}function Ea(t,e,n){const r=Object.values(function(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Lr(r,o,e);t&&(n[t.k]=t.v)}return n}({[e]:t[e]},n));return 1===r.length&&""!==r[0]?r[0]:void 0}function Ia(t,e){const n=Pa(t),r=new Map;for(const[t,e]of Da(n))void 0===e.id&&(e.id=Na+t),r.set(String(e.id),t);const o=new Map;for(const t of Rr(n,e)){const e=r.get(t.id);void 0!==e&&o.set(e,t.animate)}return o}function Da(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 Ca(t,e,n){var r,o;let i=ha(t).root;i=ya(i);return i=Ir(i,null!=(o=null==(r=ve(i))?void 0:r.duration)?o:Vn),e===Vt.native&&(i=br(i,null==n?void 0:n.motionPath),i=ka(i),i=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(i)),i=function(t,e){var n;const r=Pa(t),o=ve(r)||{},i=+(o.duration||Vn),a=za.has(String(o.direction))?i:0,s=Da(r);if(!s.size)return r;const l=Ia(r,e),c=new Map;for(const[t,e]of l){const r=s.get(t);if(r)for(const o of Object.keys(e)){if(!Ta(r,o))continue;const i=Ea(e,o,a);void 0!==i&&(r[o]=i,c.set(t,[...null!=(n=c.get(t))?n:[],o]))}}if(c.size){const t=Ia(r,e);for(const[e,n]of c){if(JSON.stringify(t.get(e))===JSON.stringify(l.get(e)))continue;const r=s.get(e);if(r)for(const t of n)delete r[t]}}return r}(i,e),i}function Ra(t){var e;return function(t){var e;const n=Pa(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"]),a=new Set(["targetId","boundElementId"]),s=(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=Ma();r.set(t,n),e.id=n}else e.animate&&(e.id=Ma());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,c]of Object.entries(e))if("children"!==l)if("string"==typeof c)if(o.has(l)&&c.startsWith("#")){const t=c.slice(1),n=r.get(t);n&&(e[l]="#"+n)}else if(i.has(l))e[l]=ja(c,r);else if(a.has(l)||s(l,n)){const t=c.startsWith("#"),n=r.get(t?c.slice(1):c);n&&(e[l]=t?"#"+n:n)}else c.includes("url(#")&&(e[l]=ja(c,r));else if("style"===l&&"object"==typeof c&&null!==c)for(const[t,e]of Object.entries(c))"string"==typeof e&&(c[t]=ja(e,r));else"object"==typeof c&&null!==c&&t(c,l);else if(Array.isArray(c))for(const e of c)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 d(f({},t),{target:n?"#"+i:i})});n.animator=d(f({},n.animator),{bindings:t})}return n}(Ca(t,Ut(null==(e=ve(t))?void 0:e.engine)))}var La={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"},Va="https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";function Wa(t){return"PX"+t+" "+Va+"#px"+t}function Ua(t,e){const n=e?e+" ":"";return{warn:(e,r,...o)=>{const i=Wa(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=Wa(r),a=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:a}):(null==t?void 0:t.muteError)||console.error(n+e+" "+i,...o)}}}var Fa=new Set(["script","foreignobject"]),Ba=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Xa=new Set(["href","xlink:href","src"]),Ga=new Set(["mixBlendMode","isolation"]),Ka=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,qa=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Za=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Ja=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Ya(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(Ba.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Xa.has(n)&&(Ka.test(t)||qa.test(t)||function(t){const e=Za.exec(t);return!!e&&Ja.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)}var Qa="className",Ha="class",$a="domType",ts="type",es="g";function ns(t,e,n){return t?rs(t,e,n,!0,0):null}function rs(t,e,n,r,o){const i=t,{type:a,children:s,style:l}=i,c=h(i,["type","children","style"]),u=a||es;if(Fa.has(u.toLowerCase()))return(null!=n?n:Ua(void 0,"[PxAnimator]")).warn(La.document,1103,u),null;const f=c[$a];void 0!==f&&delete c[$a];const d={};let p;const m=function(t){const e={};for(const n of Object.keys(t)){const r=Wn(n);if(fe.has(r))continue;if("style"===r)continue;let o=t[n];if(In.has(r)&&Array.isArray(o))e[r]=Tn(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)Dn.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e[ce]=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[ce]=Rn(t,{withUnits:!1})}}return e}(c);for(const t of Object.keys(m)){const e=Ya(t,m[t]);void 0!==e&&(Ga.has(t)?(null!=p?p:p={})[t]=String(e):d[t===Qa?Ha:Bn(t)]=e)}if(void 0!==f&&(d[ts]=String(f)),l)for(const t of Object.keys(l))(null!=p?p:p={})[t]=String(l[t]);const g=[];s&&s.forEach((t,r)=>{const o=rs(t,e,n,!1,r);null!==o&&g.push(o)});const v=c[se],y=!g.length&&"string"==typeof v&&v?v:void 0;return e({tag:u,attrs:d,style:p,children:g,text:y,node:t,isRoot:r,index:o})}function os(t){return"scroll"===(null==t?void 0:t.timelineSource)}function is(t){return("number"==typeof(null==t?void 0:t.duration)&&t.duration>0?t.duration:Vn)*("number"==typeof(null==t?void 0:t.iterations)&&t.iterations>0?t.iterations:1)}function as(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]}}var ss="cover";function ls(t,e,n,r){var o;const[i,a]=as(null!=(o=null==t?void 0:t.phase)?o:ss,n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(a-i)}function cs(t,e,n,r){const o=n-t,i=ls(null==r?void 0:r.start,0,e,n),a=ls(null==r?void 0:r.end,1,e,n);return a<=i?o>=a?1:0:Xn((o-i)/(a-i),0,1)}function us(t,e,n){var r,o;const i=e>0?Xn(t/e,0,1):1,a="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,s="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return s<=a?i>=s?1:0:Xn((i-a)/(s-a),0,1)}function fs(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"}function ds(t){const e=new Set,n=new Set,r=[{schema:t,path:""}];for(;r.length;){const{schema:t,path:o}=r.shift(),i=I(t);switch(i.kind){case"shape":if(n.has(t))break;n.add(t);for(const t of Object.keys(i.shape)){const n=o?o+"."+t:t;e.add(n),r.push({schema:i.shape[t],path:n})}i.openValue&&r.push({schema:i.openValue,path:o+"{*}"});break;case"optional":r.push({schema:i.inner,path:o});break;case"array":r.push({schema:i.item,path:o+"[]"});break;case"lazy":r.push({schema:i.resolved,path:o});break;case"record":r.push({schema:i.value,path:o+"{*}"});break;case"union":i.members.forEach((t,e)=>r.push({schema:t,path:o+"|"+e}));break;case"discriminatedUnion":for(const t of i.members)r.push({schema:t,path:o+"|"+hs(t,i.key)})}}return[...e].sort()}function hs(t,e){const n=I(t);if("shape"!==n.kind)return"?";const r=n.shape[e];if(void 0===r)return"?";const o=I(r);return String(("optional"===o.kind?o.inner:r)._default)}function ps(t,e){const n=new Set(t),r=new Set(e);return{added:e.filter(t=>!n.has(t)).sort(),removed:t.filter(t=>!r.has(t)).sort()}}function ms(t){const e=t.added.length>0||t.removed.length>0,n=we(t.lastReleased),r=we(t.declared);if(!n||!r)return{changed:e,refuse:"Unparseable version: "+t.lastReleased+" / "+t.declared+"."};const o=n.a+"."+(n.b+1);if(!e){if(r.b===n.b&&r.a===n.a)return{changed:e};return t.steps.find(e=>e.to===t.declared)?{changed:e,requiredVersion:t.declared}:{changed:e,refuse:"The version moved to "+t.declared+" with no key change and no step explaining it."}}const i=t.removed.length?"converted":"additive",a=t.added.length+" key(s) added, "+t.removed.length+" removed";if(r.a!==n.a||r.b!==n.b+1)return{changed:e,requiredKind:i,requiredVersion:o,refuse:"The player schema changed ("+a+") but PX_WIRE_SCHEMA_VERSION is "+t.declared+". Set it to "+o+" and add the PX_WIRE_STEPS entry."};const s=t.steps.find(e=>e.to===t.declared);return s?"converted"===i&&"converted"!==s.kind?{changed:e,requiredKind:i,requiredVersion:o,refuse:"Keys were REMOVED ("+t.removed.join(", ")+"), which is never additive — the "+t.declared+" step must be `converted`, with an up()."}:{changed:e,requiredKind:i,requiredVersion:o}:{changed:e,requiredKind:i,requiredVersion:o,refuse:"No PX_WIRE_STEPS entry reaches "+t.declared+"."}}function gs(t,e,n,r){const o=[];if(!t.length)return["The release log is empty."];t[0].baseline&&t[0].version===r||o.push("The first release must be the baseline "+r+".");for(let n=1;n<t.length;n++){const r=we(t[n-1].version),i=we(t[n].version);r&&i&&i.a===r.a&&i.b===r.b+1||o.push("Release "+t[n].version+" does not follow "+t[n-1].version+" by one `b` step."),t[n].date<t[n-1].date&&o.push("Release "+t[n].version+" is dated before its predecessor.");const a=e.find(e=>e.to===t[n].version);a?t[n].removed.length&&"converted"!==a.kind&&o.push("Release "+t[n].version+" removed keys, but its step is not `converted`."):o.push("Release "+t[n].version+" has no PX_WIRE_STEPS entry.")}const i=t[t.length-1].version;return i!==n&&o.push("PX_WIRE_SCHEMA_VERSION is "+n+" but the last release record is "+i+" — a bump needs its changelog entry (run scripts/schema-release.mjs --apply)."),o}
1
+ "use strict";var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=Math.pow,c=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,f=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&c(t,n,e[n]);if(a)for(var n of a(e))l.call(e,n)&&c(t,n,e[n]);return t},d=(t,e)=>n(t,o(e)),h=(t,e)=>{var n={};for(var r in t)s.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&a)for(var r of a(t))e.indexOf(r)<0&&l.call(t,r)&&(n[r]=t[r]);return n},p={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(p,{PX_ANIM_ATTR_NAME:()=>K,PX_ANIM_SRC_ATTR_NAME:()=>G,PX_COLOR_ATTR_NAMES:()=>Pn,PX_CSS_ONLY_STYLE_PROPS:()=>Xa,PX_DEFAULT_DURATION_MS:()=>It,PX_DEFAULT_ITERATIONS:()=>Ct,PX_DISALLOWED_SVG_TAGS_LOWER:()=>Wa,PX_LOOP_JUMP_SHIFT_MS:()=>gr,PX_PCT_BASED_ATTR_NAMES:()=>zn,PX_STYLE_ATTR_NAMES:()=>Tn,PX_TEXT_CONTENT_ATTR:()=>$t,PX_TRANSFORM_FN_NAMES:()=>_n,PX_UNKNOWN_KEY_ERROR:()=>m,bezierToSvgPath:()=>pn,camelCaseToKebabWordIfNeeded:()=>Rn,clamp:()=>Ln,composeTransformParts:()=>Dn,createDiagnostics:()=>Va,createPathSampler:()=>oo,cubicBezier:()=>An,deepClone:()=>xa,diffFieldUniverse:()=>hs,diffInEffect:()=>$r,extendedPathForBrowser:()=>oi,generateUniqueId:()=>Aa,interpolateValue:()=>jr,isScrollTimeline:()=>rs,kebabToCamelCaseWord:()=>En,keyframeEasing:()=>Ae,keyframeValue:()=>ke,layoutGlyphTextChars:()=>To,materializeGlyphText:()=>Go,materializeGlyphTextAlongPath:()=>Co,materializeMotionPathInPropAnim:()=>er,mergeStaticTransformIntoAnimDef:()=>Gn,planSchemaRelease:()=>ps,prepareDocumentForRender:()=>Ca,releaseLogProblems:()=>ms,renderPxTree:()=>es,reportDocumentDiagnostics:()=>li,reverseEasing:()=>On,sanitizeAttributeValue:()=>Ya,schemaFieldUniverse:()=>fs,scrollOffsetProgress:()=>us,scrollPhaseInterval:()=>is,scrollResolveAxis:()=>cs,scrollTotalDurationMs:()=>os,scrollViewProgress:()=>ls,splitEasing:()=>jn,subdivideCubicBezier:()=>wn,toRGBA:()=>Sn}),module.exports=(t=p,((t,n,o,a)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of i(n))s.call(t,l)||l===o||e(t,l,{get:()=>n[l],enumerable:!(a=r(n,l))||a.enumerable});return t})(e({},"__esModule",{value:!0}),t));var m="unexpected extra key";function g(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var v=class{constructor(t){this._statesDefault=t}_canSanitize(t){return this.isValid(t)}absentDefault(){return this._default}optional(){return new y(this)}},y=class extends v{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)}},b=class extends v{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(g(null!=n?n:[])+": expected string, got "+typeof t),!1)}},k=class extends v{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(g(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},A=class extends v{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(g(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},x=class extends v{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(g(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},w=class extends v{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(g(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},j=class extends v{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=g(null!=n?n:[]);let a;e.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let s=-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>s||u===s&&a&&o.errors.length<a.length)&&(s=u,a=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(a&&s>i.length)for(const t of a.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))}},O=class extends v{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(g(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 S(t){const e={};for(const n of Object.keys(t))t[n]._statesDefault&&(e[n]=t[n].absentDefault());return Object.freeze(e)}var M=class extends v{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=S(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(g(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(g(o)+": "+m),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},P=class extends v{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=S(t)}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=f({},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(g(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)}},_=class extends v{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(g(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)}},z=class extends v{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(g(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)}},D=class extends v{constructor(){super(!1),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},N=class extends v{constructor(){super(!1),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(g(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},T=class extends v{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)}},E=class extends v{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(g(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function I(t){var e;const n=t;switch(n._kind){case"union":return{kind:"union",members:n.schemas};case"discriminatedUnion":return{kind:"discriminatedUnion",key:n._key,members:n._schemas};case"record":return{kind:"record",value:n.value};case"tuple":return{kind:"tuple",items:n.schemas}}return"_shape"in n?{kind:"shape",shape:n._shape,openValue:n._openSchema}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.resolved=n.fn()}:{kind:"leaf"}}var C={string:function(t){return void 0===t?new b("",!1):new b(t,!0)},number:function(t){return void 0===t?new k(0,!1):new k(t,!0)},boolean:function(t){return void 0===t?new A(!1,!1):new A(t,!0)},literal:t=>new x(t),enum:function(t,e){return void 0===e?new w(t,void 0,!1):new w(t,e,!0)},union:function(t,e){return void 0===e?new j(t,void 0,!1):new j(t,e,!0)},discriminatedUnion:(t,e)=>new O(t,e),object:t=>new M(t),openObject:(t,e)=>new P(t,e),extendedObject:(t,e)=>new M(f(f({},t._shape),e)),array:t=>new _(t),record:t=>new z(t),any:()=>new D,defined:()=>new N,tuple:t=>new E(t),lazy:(t,e)=>new T(t,e)},R="forwards",L="backwards",U="both",V="none",W="normal",F="reverse",B="alternate",X="alternate-reverse",G="data-px-animation-src",K="_px_animator",q="load",Z="mouseOver",Y="click",J="none",Q="pause",H="continue",$="reset",tt="continue",et="pause",nt="reset",rt="reverse",ot="hold",it="reset",at="view",st="scroll",lt="block",ut="inline",ct="x",ft="y",dt="nearest",ht="root",pt="top",mt="center",gt="bottom",vt="cover",yt="contain",bt="entry",kt="exit",At="entry-crossing",xt="exit-crossing",wt="sampled",jt="offsetPath",Ot=["duration","iterations","engine","frameRate","trigger","delay","fillMode","direction","fill","resetOnFinish","timelineSource","scroll"],St={native:"native",js:"js"},Mt=d(f({},St),{auto:"auto"});function Pt(t){return t===Mt.js?St.js:St.native}var _t="load",zt="pause",Dt="continue",Nt=.5,Tt=150,Et="hold",It=1e3,Ct=1,Rt={start:"start",end:"end"},Lt={normal:"normal",alternate:"alternate"},Ut="luminance",Vt="alpha",Wt="userSpaceOnUse",Ft="objectBoundingBox",Bt={translate:"translate"},Xt="clip",Gt="extend",Kt="spacing",qt="spacingAndGlyphs",Zt="align",Yt="stretch",Jt="auto",Qt="exact",Ht={separate:"separate",combined:"combined"},$t="textContent",te="class",ee="transform",ne="offsetDistance",re=new Set(["type","children","animator","meta","animate","effects",$t]),oe={translate:"translate",rotate:"rotate",scale:"scale",origin:"origin"},ie=(oe.translate,oe.rotate,oe.scale,oe.origin,"pad"),ae="reflect",se="repeat",le={linear:"linear",radial:"radial"};function ue(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=ce.get(n);if(r)return r;const o=n,i=Ot.filter(t=>void 0!==o[t]),a=i.length?f({},o):n;for(const t of i)delete a[t];const s=function(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=fe.get(t);if(n)return n;const r=t,{timeline:o}=r,i=h(r,["timeline"]);void 0!==e.engine&&(i.engine=e.engine);void 0!==e.frameRate&&(i.frameRate=e.frameRate);if("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=f({},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=h(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 fe.set(t,i),i}(a);return ce.set(n,s),s}var ce=new WeakMap,fe=new WeakMap;function de(t){var e;if(t)return null==(e=ue(t))?void 0:e.definitions}var he,pe=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function me(t){if("string"!=typeof t)return;const e=pe.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}he=me("1.2");var ge=C.union([C.string(),C.tuple([C.number(),C.number(),C.number(),C.number()])]),ve=C.union([C.string(),C.number(),C.array(C.number()),C.object({pathData:C.string()}),C.lazy(()=>C.array(en),[]),C.lazy(()=>Se,{})]),ye=C.object({time:C.number().optional(),value:ve.optional(),easing:ge.optional(),tangentOut:C.tuple([C.number(),C.number()]).optional(),tangentIn:C.tuple([C.number(),C.number()]).optional()}),be=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},ke=t=>{var e;return null!=(e=t.value)?e:t.v},Ae=t=>{var e;return null!=(e=t.easing)?e:t.e},xe=t=>t.tangentIn,we=t=>t.tangentOut,je=C.object({segmentCount:C.number().optional(),repeatAt:C.enum([Rt.start,Rt.end],Rt.end).optional(),direction:C.enum([Lt.normal,Lt.alternate],Lt.normal).optional()}),Oe=C.object({value:ve.optional(),keyframes:C.array(ye).optional(),loop:C.union([je,C.boolean()]).optional(),autoOrient:C.boolean().optional(),alongPathMode:C.enum([wt,jt],wt).optional()}),Se=C.object({translate:C.tuple([C.number(),C.number()]).optional(),rotate:C.number().optional(),skew:C.number().optional(),scale:C.tuple([C.number(),C.number()]).optional(),origin:C.tuple([C.number(),C.number()]).optional()}),Me=(C.union([C.string(),Se,C.object({value:Se}),Oe]),C.record(Oe)),Pe=C.union([C.string(),C.array(C.union([C.string(),Me])),Me]),_e=C.object({start:C.enum([q,Z,Y,J],_t).optional(),offScreen:C.enum([Q,H,$],zt).optional(),mouseOut:C.enum([tt,et,nt,rt],Dt).optional(),finish:C.enum([ot,it],Et).optional(),visibilityThreshold:C.number(Nt).optional(),visibilityDebounce:C.number(Tt).optional()}),ze=C.object({width:C.number(),pathData:C.string()}),De=C.object({fontFamily:C.string(),fontStyle:C.string(),ascent:C.number(),unitsPerEm:C.number(),glyphs:C.record(ze)}),Ne=C.object({easings:C.record(C.tuple([C.number(),C.number(),C.number(),C.number()])).optional(),animations:C.record(Me).optional(),fonts:C.record(De).optional()}),Te=C.object({phase:C.enum([vt,yt,bt,kt,At,xt],vt).optional(),fraction:C.number().optional()}),Ee=C.object({start:Te.optional(),end:Te.optional()}),Ie=(C.object({kind:C.enum([at,st],at).optional(),axis:C.enum([lt,ut,ct,ft],lt).optional(),source:C.enum([dt,ht],dt).optional(),subject:C.string().optional(),smoothing:C.number().optional(),pin:C.boolean(!1).optional(),pinAlign:C.enum([pt,mt,gt],pt).optional(),pinOffset:C.number().optional(),pinDistance:C.number().optional(),range:Ee.optional()}),C.object({align:C.enum([pt,mt,gt],pt).optional(),offset:C.number().optional(),distance:C.number().optional()})),Ce=C.enum([Mt.auto,Mt.native,Mt.js],Mt.auto).optional(),Re=C.object({type:C.literal("time").optional(),engine:Ce,frameRate:C.number().optional(),duration:C.number(It).optional(),trigger:_e.optional(),delay:C.number(0).optional(),iterations:C.union([C.number(Ct),C.literal("infinite")],Ct).optional(),fillMode:C.enum([R,L,U,V],R).optional(),direction:C.enum([W,F,B,X],W).optional()}),Le={duration:C.number().optional(),iterations:C.number().optional(),engine:Ce,frameRate:C.number().optional(),axis:C.enum([lt,ut,ct,ft],lt).optional(),source:C.enum([dt,ht],dt).optional(),subject:C.string().optional(),smoothing:C.number().optional(),pin:C.union([C.boolean(),Ie]).optional(),range:Ee.optional()},Ue=C.object(f({type:C.literal("scroll")},Le)),Ve=C.object(f({type:C.literal("view")},Le)),We=C.discriminatedUnion("type",[Re,Ue,Ve]),Fe=C.object({target:C.string(),animateWith:C.array(C.string())}),Be=C.object({timeline:We.optional(),definitions:Ne.optional(),bindings:C.array(Fe).optional(),debugGlobalName:C.string().optional(),version:C.string().optional()}),Xe=C.union([C.string(),C.number(),C.array(C.number()),C.object({value:C.defined()}),Se]),Ge=C.union([C.number(),Oe,C.object({value:C.number()})]),Ke=C.union([C.tuple([C.number(),C.number()]),Oe,C.object({value:C.tuple([C.number(),C.number()])})]),qe=C.union([C.string(),Oe,C.object({value:C.string()})]),Ze=C.object({translate:Ke.optional(),rotate:Ge.optional(),scale:Ke.optional(),skew:Ge.optional(),origin:Ke.optional()}),Ye=C.object({copies:C.number().optional(),translate:Ke.optional(),rotate:Ge.optional(),skew:Ge.optional(),scale:Ke.optional(),origin:Ke.optional()}),Je=C.object({source:C.string().optional(),maskType:C.enum([Ut,Vt],Ut).optional(),maskUnits:C.enum([Wt,Ft],Ft).optional(),maskContentUnits:C.enum([Wt,Ft],Wt).optional(),x:C.number().optional(),y:C.number().optional(),width:C.number().optional(),height:C.number().optional()}),Qe=C.object({pathData:qe.optional()}),He=C.object({offset:Ge.optional(),range:Ke.optional(),subPaths:C.enum([Ht.separate,Ht.combined],Ht.separate).optional()}),$e=C.object({start:C.number().optional(),stretch:C.number().optional(),timeCrop:C.tuple([C.number(),C.number()]).optional()}),tn=C.object({without:C.enum([Bt.translate]).optional(),source:C.string().optional(),retime:$e.optional()}),en=C.object({offset:C.number(),color:C.string()}),nn=C.union([C.array(en),C.object({value:C.array(en)}),Oe]),rn=C.object({type:C.enum([le.linear,le.radial]),start:Ke.optional(),end:Ke.optional(),center:Ke.optional(),radius:Ge.optional(),focal:Ke.optional(),stops:nn.optional(),gradientUnits:C.enum([Wt,Ft],Ft).optional(),spreadMethod:C.enum([ie,ae,se],ie).optional(),gradientTransform:C.string().optional()}),on=rn,an=C.object({pathData:C.string(),pathOverflow:C.enum([Xt,Gt],Gt).optional(),lengthAdjust:C.enum([Kt,qt],Kt).optional(),method:C.enum([Zt,Yt],Zt).optional(),spacing:C.enum([Jt,Qt],Qt).optional(),startOffset:Ge.optional(),textLength:Ge.optional()}),sn=C.object({useGlyphs:C.boolean().optional()}),ln=C.object({transformBy:Ze.optional(),repeater:Ye.optional(),maskedBy:Je.optional(),clipPath:Qe.optional(),strokeTrim:He.optional(),clone:tn.optional(),fillGradient:rn.optional(),strokeGradient:on.optional(),textPath:an.optional(),text:sn.optional()});function un(t,e){var n;const r=!1!==(null==e?void 0:e.strict),o={errors:[],warnings:[],strict:r},i=hn.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const e of function(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!ln.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}(t,{strict:r}))i.includes(e)||i.push(e);const e=null==(n=ue(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,a)=>{var s,l;if(!t)return;const u="string"==typeof t.fontFamily?t.fontFamily:void 0,c=null!=u?u:i,f=a||"text"===t.type&&!!(null==(l=null==(s=t.effects)?void 0:s.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=ue(t))?void 0:e.version;return void 0===n||void 0!==me(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 cn=C.openObject({type:C.string(),domType:C.string().optional(),textContent:C.string().optional(),id:C.string().optional(),meta:C.any().optional(),effects:ln.optional(),animate:Pe.optional(),style:C.record(C.union([C.string(),C.number()])).optional()},Xe),fn=C.openObject(d(f({},cn._shape),{children:C.lazy(()=>C.array(fn),[]).optional()}),Xe),dn=C.object({width:C.union([C.number(),C.string()]).optional(),height:C.union([C.number(),C.string()]).optional(),viewBox:C.string().optional(),animator:Be.optional()}),hn=C.openObject(d(f(f({},cn._shape),dn._shape),{type:C.literal("svg"),children:C.array(fn).optional()}),Xe);C.object({v:C.array(C.array(C.number())),i:C.array(C.array(C.number())).optional(),o:C.array(C.array(C.number())).optional(),c:C.boolean().optional()});function pn(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,u=t.c;if(!a.length)return"";const c=[],f=a.length;c.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];!e&&i[0]===o[0]&&i[1]===o[1]&&u[0]===f[0]&&u[1]===f[1]?c.push("L"+f[0]+","+f[1]):c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],u=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function mn(t,e,n){return t+(e-t)*n}function gn(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=mn(t[i]||0,e[i]||0,n);return r}function vn(t,e,n){return[mn(t[0]||0,e[0]||0,n),mn(t[1]||0,e[1]||0,n),mn(t[2]||0,e[2]||0,n),mn(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function yn(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(bn(t[i],e[i],n));return o}function bn(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],g=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(gn(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(a=null==(i=e.i)?void 0:i[n])?a:h;m.push(gn(v,y,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;g.push(gn(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 kn(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function An(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=kn(e,r,t),((s*n+a)*n+i)*n;var n}}function xn(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function wn(t,e,n,r,o){const i=xn(t,e,o),a=xn(e,n,o),s=xn(n,r,o),l=xn(i,a,o),u=xn(a,s,o),c=xn(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}function jn(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=kn(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=wn([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,g=1-d;return m>1e-9&&Math.abs(g)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/g,(c[2][0]-f)/m,(c[2][1]-d)/g]),{left:h,right:p}}function On(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Sn(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 Mn(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var Pn=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),_n=new Set(["translate","rotate","scale","skew"]),zn=new Set(["offset-distance","offsetDistance"]);function Dn(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),a&&o.push("translate("+-a[0]+c+","+-a[1]+c+")"),o.join("")}function Nn(t){var e,n;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let a,s=-1;for(;null!==(a=o.exec(t));){const t=a[1],o=i.indexOf(t);if(o<0||o<=s)return;s=o;const l=a[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 Tn=new Set(["offset-distance","offsetDistance"]);function En(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function In(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Cn=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 Rn(t){return Cn.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ln(t,e,n){return Math.max(e,Math.min(t,n))}function Un(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var Vn=1e-4;function Wn(t,e,n,r,o){const i=Fn(t,e,n,r,o);if(0===i[0]&&0===i[1]){return Fn(t,e,n,r,o<.5?o+Vn:o-Vn)}return i}function Fn(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function Bn(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=Un(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=Un(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}function Xn(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}function Gn(t,e){if(!t)return t;const n=e&&"object"==typeof e&&!Array.isArray(e)?e:Nn(e);if(!n||!Object.keys(n).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?f(f({},n),t):t,o=t[ee];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=d(f({},e),{keyframes:e.keyframes.map(t=>d(f({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),d(f({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>_n.has(t));if(1!==i.length)return t;const a=i[0],s=t[a];if(!s||"object"!=typeof s||!Array.isArray(s.keyframes))return t;const l=d(f({},s),{keyframes:s.keyframes.map(t=>d(f({},t),{value:d(f({},n),{[a]:t.value})}))});void 0!==l.value&&(l.value=d(f({},n),{[a]:l.value}));const u=f({},t);return delete u[a],d(f({},u),{transform:l})}function Kn(t){const e=ke(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 qn(t){return be(t)}function Zn(t){return Ae(t)}function Yn(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(xe(t)||we(t))return!0;return!1}var Jn=new WeakMap;function Qn(t,e,n,r){let o=Jn.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const a=we(t),s=xe(e),l=[n[0]+(a?a[0]:0),n[1]+(a?a[1]:0)],u=[r[0]+(s?s[0]:0),r[1]+(s?s[1]:0)],c=Bn(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,Jn.set(t,o)),o.set(e,f),f}var Hn=.5,$n=5,tr=32;function er(t,e){var n,r,o;if(!Yn(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const a=!!t.autoOrient,s=null!=(n=null==e?void 0:e.flatnessTolerance)?n:Hn,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:$n,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:tr,c=[],f=Kn(i[0]);if(!f)return t;const d=a?function(t,e){const n=Kn(t),r=Kn(e);if(!n||!r)return 0;const o=Qn(t,e,n,r),i=Wn(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(rr(qn(i[0]),ar(or(i[0]),or(i[0]),0,f,d,a)));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?(a&&t>0&&lr(c,e,n,r,o,l),cr(c,e,n,r,o,a,s,l,u)):c.push(rr(qn(n),ar(or(n),or(n),1,null!=o?o:[0,0],void 0,a)))}const h=Zn(i[i.length-1]);h&&(c[c.length-1].e=h),a&&nr(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function nr(t){let e;for(const n of t){const t=ke(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 rr(t,e){return{t:t,v:e}}function or(t){const e=ke(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function ir(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function ar(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=ir(o,s,n))}return void 0!==o&&(a.rotate=o+sr(t,e,n)),a}function sr(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=ir(r,o,n);return"number"==typeof i?i:0}function lr(t,e,n,r,o,i){const a=t[t.length-1],s=ke(a),l=null==s?void 0:s.rotate;if("number"!=typeof l)return;const u=or(e),c=l-sr(u,u,0),f=Qn(e,n,r,o),d=Wn(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=qn(e),g=Math.min(m+ur,(m+qn(n))/2),v=ar(or(e),or(e),0,r,h,!0);t.push(rr(g,v))}var ur=.05;function cr(t,e,n,r,o,i,a,s,l){const u=Qn(e,n,r,o),c=qn(e),f=qn(n),d=Zn(e),h=(p=d)?An([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=or(e),g=or(n),v=function(t,e,n,r,o){const i=[];fr(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),fr(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)dr(a[o],a[o+1],s,t,e,n,r,l);return s}(u,i,a,s,l),y=[];for(const t of v){const e=Xn(u.lut,t),n=Ln(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Ln(h(n),0,1),p:n,pos:Un(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=Wn(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?Ln((n.u-k)/(1-k),0,1):1,{left:o,right:a}=jn(b,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=ar(m,g,n.p,n.pos,n.rotateDeg,i);t.push(rr(l,u)),b=a,k=n.u}}function fr(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),u=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function dr(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=Un(r.P0,r.P1,r.P2,r.P3,t),c=Un(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=Un(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=Un(r.P0,r.P1,r.P2,r.P3,l),p=Un(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(hr(d,u,c),hr(h,u,c),hr(p,u,c));let g=!0;if(o){const n=Wn(r.P0,r.P1,r.P2,r.P3,t),o=Wn(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(g=!1)}m<=i&&g||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,dr(t,l,n,r,o,i,a,s),dr(l,e,n,r,o,i,a,s))}function hr(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function pr(t,e){const n=mr(t,e);return null!=n?n:t}function mr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=mr(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=Gn(o,t.transform),i=n.transform;if(i&&"object"==typeof i&&Yn(i)){const t=er(i,e);t!==i&&(r=d(f({},n),{transform:t}))}}if(!n&&!r)return null;const i=f({},t);return n&&(i.children=n),r&&(i.animate=r),i}var gr=1;function vr(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=>vr(t[n],e[n]))}function yr(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function br(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function kr(t){return"string"==typeof t&&void 0!==br(t)}function Ar(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const e=br(t.pathData);return e?{paths:yr(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&kr(e[0])){const t=[];for(const n of e){const e=br(n);e&&t.push(...yr(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&kr(t[0])){const e=[];for(const n of t){const t=br(n);t&&e.push(...yr(t))}return{paths:e}}return{paths:t}}if(kr(t)){return{paths:yr(br(t))}}return t}function xr(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 wr(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 jr(t,e,n,r){var o,i;if("d"===t){return{paths:yn(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}}return Pn.has(t)?vn(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?mn(e,n,r):_n.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?gn(e||[],n||[],r):mn(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=mn(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=gn(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function Or(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=Ln(null!=(o=n.segmentCount)?o:u,1,u);let h;h=n.repeatAt===Rt.start?e.slice(0,c+1):e.slice(u-c);const p=null!=(i=e[0].t)?i:0,m=null!=(a=e[e.length-1].t)?a:0;let g,v;n.repeatAt===Rt.start?(g=0,v=p):(g=m,v=r);const y=v-g;if(y<=0)return e;const b=null!=(s=h[0].t)?s:0,k=(null!=(l=h[h.length-1].t)?l:0)-b;if(k<=0)return e;const A=h.map(t=>({relT:(t.t-b)/k,v:t.v,e:t.e,tangentIn:xe(t),tangentOut:we(t)})),x=Math.floor(y/k),w=y-x*k,j=w/k,O=[],S=n.repeatAt!==Rt.start,M=e[e.length-1];let P,_=!1;function z(e,n,r){var o;let i;if(n){i=[];for(let t=A.length-1;t>=0;t--)i.push({relT:1-A[t].relT,v:A[t].v,e:t>0?On(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else i=A;const a=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>a+1e-9){const o=i[n-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?An(o.e)(l):l,c=jr(t,o.v,r.v,u),{left:f}=jn(o.e,l);return O.length>0&&o.relT<=a&&(O[O.length-1].e=f),void O.push({t:e+a*k,v:c,e:void 0})}const s=O.length>0?O[O.length-1]:M,l=S&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*k))<1e-9;if(l){if(vr(s.v,r.v)){O.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(P=r.e,_=!0);continue}O.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:e+r.relT*k+(l?gr: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===Rt.start){if(j>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=A.length-1;t>=0;t--)o.push({relT:1-A[t].relT,v:A[t].v,e:t>0?On(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else o=A;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?An(a.e)(o):o,l=jr(t,a.v,r.v,s),{right:u}=jn(a.e,o);O.push({t:e,v:l,e:u})}const s={t:e+(r.relT-i)*k,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),O.push(s)}}(g,n.direction===Lt.alternate&&x%2==0,j)}for(let t=0;t<x;t++){const e=x-1-t,r=n.direction===Lt.alternate&&e%2==0;z(g+w+t*k,r)}}else{for(let t=0;t<x;t++){const e=n.direction===Lt.alternate&&t%2==0;z(g+t*k,e)}if(j>1e-9){const t=n.direction===Lt.alternate&&x%2==0;z(g+x*k,t,j)}}if(n.repeatAt===Rt.start)return[...O,...e];if(_&&e.length>0){return[...e.slice(0,-1),d(f({},e[e.length-1]),{e:P}),...O]}return[...e,...O]}function Sr(t,e,n,r){var o;const i=e.keyframes||[],a=[];for(const e of i){const n=be(e);let i=ke(e);const s=Ae(e);"d"===t&&(i=Ar(i));const l=In(t)?Rn(t):t;Pn.has(l)&&(i=null!=(o=Mn(i))?o:i);const u={t:n,v:i,e:xr(s,r)},c=xe(e),f=we(e);c&&(u.tangentIn=c),f&&(u.tangentOut=f),a.push(u)}a.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const s=e.loop,l=!0===s?{}:s||void 0;return l&&a.length>=2?Or(t,a,l,n):a}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 a=In(t)?Rn(t):t,s=Pn.has(a),l=i.map(e=>{var n;const r=be(e);let o=ke(e);"d"===t&&(o=Ar(o)),s&&(o=null!=(n=Mn(o))?n:o);const i={t:r,v:o,e:Ae(e)},a=xe(e),l=we(e);return a&&(i.tangentIn=a),l&&(i.tangentOut=l),i}),u={keyframes:Or(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function Pr(t,e){const n=_r(t,e);return null!=n?n:t}function _r(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=_r(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=f({},t)),r[n]=i)}}if(!n&&!r)return null;const i=f({},t);return n&&(i.children=n),r&&(i.animate=r),i}var zr=0;function Dr(t,e=St.native){const n=ue(t)||{},r=de(t),o=n.duration||1e3,i=[],a=(t,n,i)=>{if(0===n.length)return null;const a=function(t,e,n,r=St.native){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=Sr(i,a,e,n);if(s.length>0){const t={keyframes:s};void 0!==a.autoOrient&&(t.autoOrient=a.autoOrient),void 0!==a.loop&&(t.loop=a.loop),o[i]=r===St.native&&"transform"===i?er(t):t}}return o}(Gn(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(a).length?null:{id:t,animate:a}},s=function(t){var e;if(t)return null==(e=ue(t))?void 0:e.bindings}(t);if(s)for(const t of s){const e=t.target.startsWith("#")?t.target.slice(1):t.target,n=t.animateWith.map(t=>wr(t,r)).filter(t=>!!t),o=a(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_"+ ++zr;t.id=n;const o=a(n,function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=wr(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=wr(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 Nr(t,e,n){var r,o,i,a,s;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],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){i=t[s],a=t[s+1];break}e>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(l,n);let f=u===c?0:(d=n,h=null!=(r=u.t)?r:0,p=null!=(o=c.t)?o:0,m=0,g=1,p===h?m:m+(d-h)/(p-h)*(g-m));var d,h,p,m,g;f=Ln(f,0,1);const v=Ae(u);if(v&&Array.isArray(v))try{f=An(v)(f)}catch(t){}let y=In(t)?Rn(t):t,b=null;const k=null==u?void 0:u.v,A=null==c?void 0:c.v;if("d"===y){b=yn(null!=(i=null==k?void 0:k.paths)?i:Array.isArray(k)?k:[],null!=(a=null==A?void 0:A.paths)?a:Array.isArray(A)?A:[],f).map(t=>pn(t)).join("")}else if(Pn.has(y))b=Sn(vn(k||[0,0,0,1],A||[0,0,0,1],f)),y=t;else if("stroke-dasharray"===y)b=gn(k||[],A||[],f).join(" "),y=t;else if("transform"!==y||null===k||"object"!=typeof k||Array.isArray(k))if("translate"===y){b="translate("+gn(k||[0,0],A||[0,0],f).join(",")+")",y="transform"}else if("rotate"===y){b="rotate("+mn(+(k||0),+(A||0),f)+")",y="transform"}else if("scale"===y){b="scale("+gn(k||[1,1],A||[1,1],f).join(",")+")",y="transform"}else{b=mn(+(k||0),+(A||0),f)}else{const t=new Set([...k?Object.keys(k):[],...A?Object.keys(A):[]]),n={};for(const e of t){const t=null==k?void 0:k[e],r=null==A?void 0:A[e];if("rotate"===e||"skew"===e)n[e]=mn(+(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=gn(t||o,r||o,f);n[e]=i}}if(Yn(e)){const t=k.translate,r=A.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,e,n,r,o,i){const a=Qn(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=e*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(n<=0)return r[0];if(n>=o[i])return r[i];let a=1,s=i;for(;a<s;){const t=a+s>>>1;o[t]<n?a=t+1:s=t}const l=o[s-1],u=o[s]-l,c=u>0?(n-l)/u:0;return r[s-1]+c*(r[s]-r[s-1])}(a.lut,o),l=Un(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=Wn(a.P0,a.P1,a.P2,a.P3,s);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!=(s=n.rotate)?s:0))}}b=Dn(n,{withUnits:!1}),y="transform"}return zn.has(y)&&"number"==typeof b&&(b=100*b+"%"),{k:y,v:null===b?"":""+b}}function Tr(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Nr(r,o,e);t&&(n[t.k]=t.v)}return n}var Er=[1,0,0,1,0,0];function Ir(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var Cr=(t,e)=>[1,0,0,1,t,e],Rr=(t,e)=>[t,0,0,e,0,0];function Lr(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var Ur=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Vr=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function Wr(t){let e=Er;t.translate&&(e=Ir(e,Cr(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=Ir(e,Cr(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=Ir(e,Lr(t.rotate))),t.scale&&(e=Ir(e,Rr(t.scale[0],t.scale[1]))),n&&(e=Ir(e,Cr(-t.origin[0],-t.origin[1]))),e}function Fr(t,e,n){return t+(e-t)*n}function Br(t,e){return null==t?Er:"string"==typeof t?function(t){let e=Er;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=Ir(e,Cr(n[0]||0,n[1]||0)):"scale"===t?e=Ir(e,Rr(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=Ir(e,Lr(n[0])):"skewX"===t?e=Ir(e,Ur(n[0])):"skewY"===t?e=Ir(e,Vr(n[0])):"matrix"===t&&(e=Ir(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?Wr(function(t,e){var n,r,o,i,a,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let u=0;for(;u<t.length-1&&(null!=(o=t[u+1].time)?o:0)<e;)u++;const c=t[u],f=t[u+1],d=(e-(null!=(i=c.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[Fr(h.translate[0],p.translate[0],d),Fr(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=Fr(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[Fr(h.scale[0],p.scale[0],d),Fr(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?Wr(t.value):"object"!=typeof t||Array.isArray(t)?Er:Wr(t)}var Xr=new Set(["svg","g","symbol"]),Gr=new Set(["defs","mask","clipPath","title"]);function Kr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Kr(t,e))}function qr(t){return null==t?0:Number(t)}function Zr(t){return Math.round(100*t)/100+0}function Yr(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=Zr(function(t,e,n,r){var o,i,a,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a:0)<r;)n++;const c=e[n],f=e[n+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return Fr(c.value,f.value,d)}return void 0!==e?Number(e):n}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,n)),d=t.mask?1:0,h=e.map(Zr).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return qr(t.width)+","+qr(t.height)+","+qr(t.x)+","+qr(t.y);case"ellipse":return qr(t.rx)+","+qr(t.ry)+","+qr(t.cx)+","+qr(t.cy);case"circle":return qr(t.r)+","+qr(t.cx)+","+qr(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(qr(c)||"")+"|o:"+f+"|m:"+d}function Jr(t,e,n,r,o){var i;const a=t.type||"";if(Gr.has(a))return;const s=Ir(e,function(t,e){return t.animate&&t.animate.transform?Br(t.animate.transform,e):void 0!==t.transform?Br(t.transform,e):Er}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=Ir(s,Cr(qr(t.x),qr(t.y)));return void(i?Jr(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Xr.has(a)?null==(i=t.children)||i.forEach(t=>Jr(t,s,n,r,o)):o.push(Yr(t,s,n))}function Qr(t,e){var n;e.add(0);(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>Qr(t,e))}function Hr(t,e){const n=new Map;Kr(t,n);const r=[];return Jr(t,Er,e,n,r),r.sort()}function $r(t,e){const n=new Set;Qr(t,n),Qr(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=Hr(t,o),i=Hr(e,o),a=to(n,i),s=to(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function to(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}var eo=48,no=/[MmLlHhVvCcSsQqTtAaZz]/;function ro(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 oo(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=Bn(a,t,e,r,eo);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];no.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,a=e,s=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:a}=ro([o,i],t,e);p(r,a,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:a}=ro([o,i],t,e);p(r,a,e)}else{if("A"!==g){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=Un(o.P0,o.P1,o.P2,o.P3,a),[u,c]=Wn(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}var io=(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 ao(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function so(t,e){let n="";for(let r=0;r<t.length;r++){const o=ao(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function lo(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var uo=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function co(t,e,n=2){const r=[];let o;for(uo.lastIndex=0;null!==(o=uo.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=lo(e,s(),s());i+=t+so([r,o],n)}else if("C"===t){const[t,r]=lo(e,s(),s()),[o,a]=lo(e,s(),s()),[l,u]=lo(e,s(),s());i+="C"+so([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=lo(e,s(),s()),[o,a]=lo(e,s(),s());i+="Q"+so([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}function fo(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 ho(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(mo),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 po(t,e,n,r){var o,i,a,s;const l=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=l(n.value));const u=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,c=f({},u||{}),d={keyframes:n.keyframes};void 0!==n.loop&&(d.loop=n.loop),void 0!==n.autoOrient&&(d.autoOrient=n.autoOrient),c[e]=d,t.animate=c;const h=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==h&&(t[e]=l(h))}function mo(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=f({},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 go(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}var vo=16,yo=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",$t,"xml:space"],bo=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],ko=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function Ao(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function xo(t){return"string"==typeof t?t:void 0}function wo(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of ko)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function jo(t,e){var n,r,o,i,a,s,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=xo(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Ao(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=Ao(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Ao(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=Ao(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:wo(t))?c:e.animate};for(const t of bo){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:xo(t.fontFamily),fontSize:null!=(e=Ao(t.fontSize))?e:vo,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Ao(t.letterSpacing))?n:0,wordSpacing:null!=(r=Ao(t.wordSpacing))?r:0}}function So(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 bo)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function Mo(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 Po(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}var _o=.6,zo="px-missing-glyph";function Do(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,i=.92*-e,a=o-r,s=-i,l=Math.max(1,.12*Math.min(a,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(a<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=i+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function No(t,e){var n,r,o;const{glyphs:i,create:a=io,warnings:s}=e,l=Po(i),u={x:null!=(n=Ao(t.x))?n:0,y:null!=(r=Ao(t.y))?r:0},c=[],f=[{start:u.x,end:u.x}];let d=0;const h=(t,e)=>{var n;const r=Mo(e,i,l,s),o=(null==r?void 0:r.unitsPerEm)||1e3,a=e.fontSize/o,h=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=So(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),s=null==r?void 0:r.glyphs[i];if(s&&s.pathData)c.push({glyphD:s.pathData,m:[a,0,0,a,u.x,u.y],paint:p,line:d,x:u.x,y:u.y,scale:a}),u.x+=s.width*a;else if(/\S/.test(i)){const t=s&&s.width>0?s.width:_o*o;c.push({glyphD:Do(t,h),m:[a,0,0,a,u.x,u.y],paint:p,isMissing:!0,line:d,x:u.x,y:u.y,scale:a}),u.x+=t*a}else u.x+=(s?s.width:0)*a;u.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),f[d].end=u.x}},p=(t,e)=>{var n,r,o;const i=jo(t,e),a=Ao(t.x),s=Ao(t.y);void 0!==a&&(u.x=a,d=f.length,f.push({start:u.x,end:u.x})),void 0!==s&&(u.y=s),u.x+=null!=(n=Ao(t.dx))?n:0,u.y+=null!=(r=Ao(t.dy))?r:0;const l=xo(t[$t]);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 g=xo(t[$t]);g&&!(null==(o=t.children)?void 0:o.length)&&h(g,m);const v=xo(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 Xo(t,Bo(c,a,s),a)}function To(t,e){var n,r,o,i,a;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:i,warnings:a,alongPath:s}=n,l=oo(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=Po(i),c=[];let f=0;const d=(t,e)=>{var n,r;const o=jo(t,e),s=xo(t[$t]);if(s&&!(null==(n=t.children)?void 0:n.length)){const t=Mo(o,i,u,a),e=(null==t?void 0:t.unitsPerEm)||1e3,n=o.fontSize/e,l=(null!=(r=null==t?void 0:t.ascent)?r:.9*e)*n;for(let e=0;e<s.length;e++){const r=s.charAt(e),i=null==t?void 0:t.glyphs[r],a=(i?i.width:0)*n,u=a+o.letterSpacing+(" "===r?o.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:a,ascent:l,fontSize:o.fontSize}),f+=u}}if(t.children)for(const e of t.children)d(e,o)};d(t,Oo(t));const h=f,p=ho(null==s?void 0:s.textLength),m="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,g=m>0&&h>0?m/h:1,v=ho(null==s?void 0:s.startOffset),{along:y,perp:b}=Io(t),k=y+("animated"===v.kind?Number(null==(o=v.keyframes[0])?void 0:o.value)||0:"static"===v.kind&&Number(v.value)||0),A=t=>({x:t.x-b*Math.sin(t.angle),y:t.y+b*Math.cos(t.angle),angle:t.angle});return c.map(t=>{const e=k+t.advStart*g,n=k+t.advEnd*g,r=A(l.sampleAtDistance(e)),o=A(l.sampleAtDistance(n)),i=l.sampleAtDistance(k+(t.advStart+t.glyphW/2)*g);return{x:r.x,y:r.y,width:t.advEnd-t.advStart,ascent:t.ascent,fontSize:t.fontSize,endX:o.x,endY:o.y,rotation:180*i.angle/Math.PI}})}(t,e.alongPath.pathD,e);const{glyphs:s,warnings:l}=e,u=Po(s),c={x:null!=(r=Ao(t.x))?r:0,y:null!=(o=Ao(t.y))?o:0},f=[],d=[{start:c.x,end:c.x}];let p=0;const m=(t,e)=>{var n;const r=Mo(e,s,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,a=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*i;for(let n=0;n<t.length;n++){const o=t.charAt(n),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+e.letterSpacing+(" "===o?e.wordSpacing:0);f.push({x:c.x,y:c.y,width:l,ascent:a,fontSize:e.fontSize,line:p}),c.x+=l,d[p].end=c.x}},g=(t,e)=>{var n,r,o;const i=jo(t,e),a=Ao(t.x),s=Ao(t.y);void 0!==a&&(c.x=a,p=d.length,d.push({start:c.x,end:c.x})),void 0!==s&&(c.y=s),c.x+=null!=(n=Ao(t.dx))?n:0,c.y+=null!=(r=Ao(t.dy))?r:0;const l=xo(t[$t]);if(l&&!(null==(o=t.children)?void 0:o.length)&&m(l,i),t.children)for(const e of t.children)g(e,i)},v=Oo(t);if(t.children)for(const e of t.children){const t=f.length;if(g(e,v),f.length===t){const t=jo(e,v),n=Mo(t,s,u),r=(null==n?void 0:n.unitsPerEm)||1e3;f.push({x:c.x,y:c.y,width:0,ascent:(null!=(i=null==n?void 0:n.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:p})}}const y=xo(t[$t]);y&&!(null==(a=t.children)?void 0:a.length)&&m(y,v);const b=xo(t.textAnchor);if("middle"===b||"end"===b)for(const t of f){const e=d[t.line].end-d[t.line].start;t.x+="middle"===b?-e/2:-e}return f.map(t=>{var e=t,{line:n}=e;return h(e,["line"])})}function Eo(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,a-n*u*c+o*l]}function Io(t){var e,n,r;return{along:(null!=(e=Ao(t.x))?e:0)+(null!=(n=Ao(t.dx))?n:0),perp:null!=(r=Ao(t.dy))?r:0}}function Co(t,e,n,r,o,i){const{glyphs:a,create:s=io,warnings:l}=r,u=e?oo(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=Po(a),{cells:h,width:p}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u;const c=jo(t,s),f=xo(t[$t]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=Mo(c,e,n,r);if(t){const e=c.fontSize/t.unitsPerEm,n=null!=(u=t.ascent)?u:.9*t.unitsPerEm,r=So(c);for(let a=0;a<f.length;a++){const s=f.charAt(a),l=t.glyphs[s];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(s)){const a=l&&l.width>0?l.width:_o*t.unitsPerEm,s=a*e;o.push({glyphD:Do(a,n),widthEm:a,scale:e,paint:r,isMissing:!0,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=c.letterSpacing+(" "===s?c.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,c)};return a(t,Oo(t)),{cells:o,width:i}}(t,a,c,l);if(!h.length)return Xo(t,[],s);const{along:m,perp:g}=Io(t),v=Ro(n),y=Ro(o),b=t=>t>0&&p>0?t/p:1,k="clip"===i&&!u.closed;if(v.animated||y.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(v.times,y.times),n=(t,e)=>m+v.at(e)+b(y.at(e))*t.midBase,r=v.animated?v.loop:y.loop;return Xo(t,function(t,e,n,r,o,i,a,s=0){const l=Math.max(e.totalLength/Lo,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=co(h.glyphD,t),m=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[Vo(r-s*l,3),Vo(o+s*a,3)],rotate:Vo(180*i/Math.PI,3)}}},g=[],v=[],y=(t,e)=>{g.push(m(t,e)),a&&v.push({time:e,value:u(t)?1:0})};y(n(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(h,e),a=n(h,o),s=Math.min(Uo,Math.max(1,Math.ceil(Math.abs(a-i)/l)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);y(n(h,r),r)}}nr(g);const b={keyframes:g};void 0!==o&&(b.loop=o);const k={transform:b};if(h.paint.animate&&Object.assign(k,h.paint.animate),a&&v.some(t=>0===t.value)){const t={keyframes:v};void 0!==o&&(t.loop=o),k.opacity=t}c.push(i("path",d(f(f({d:p},Wo(h.paint)),Fo(h.isMissing)),{animate:k}),[]))}return c}(h,u,n,e,r,s,k,g),s)}const A=b(y.at(0)),x=m+v.at(0);return Xo(t,Bo((k?h.filter(t=>{const e=x+t.midBase*A;return e>=0&&e<=u.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:Eo(u,x+t.midBase*A,t.scale,t.widthEm,g)})),s,l),s)}function Ro(t){var e;const n=ho(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 Lo=48,Uo=64;function Vo(t,e){const n=u(10,e);return Math.round(t*n)/n}function Wo(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 bo)void 0!==t[n]&&(e[n]=t[n]);return e}function Fo(t){return t?{[te]:zo}:{}}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=co(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",f(f(f({d:n},Wo(t)),Fo(i)),void 0!==t.animate?{animate:f({},t.animate)}:{}),[]));return o}function Xo(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===yo.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=f({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function Go(t,e){return e.alongPath?Co(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):No(t,e)}function Ko(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Ko);const e={};for(const n of Object.keys(t))e[n]=Ko(t[n]);return e}function qo(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 Zo(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Yo(t){var e;const n=Zo(t.x),r=Zo(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 Jo(t,e){return"_lw_"+e+"_"+t.nextId++}function Qo(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Ho(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Ho(t,e))}var $o=Ko;var ti=.15;function ei(t){const e=ho(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 ni(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 a=t.textContent;if("string"==typeof a&&(e+=a.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var ri=t=>Math.round(1e3*t)/1e3;function oi(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=oo(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=ti*o,a=ei(e.startOffset),s=ei(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),u=Math.max(0,a.max+s-o),c=l>0?l+i:0,f=u>0?u+i:0;if(f<=0&&c<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(c>0){const e=d.x-Math.cos(d.angle)*c,n=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+ri(e)+","+ri(n)+"L"+ri(d.x)+","+ri(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"+ri(t)+","+ri(e)}return{d:p,startShift:c}}function ii(t,e,n){var r;if(!e||"string"!=typeof e.pathData||!e.pathData)return t;const o=Jo(n,"tpath"),{d:i,startShift:a}=oi(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:ni(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),ai(s,"startOffset",function(t,e){if(!e||null==t)return t;const n=ho(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=>d(f({},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,a)),ai(s,"textLength",e.textLength),t.children=[s],t}function ai(t,e,n){null!=n&&po(t,e,ho(n),{asString:!0})}var si=6;function li(t,e){const{problems:n}=function(t){try{return{problems:un(t)}}catch(t){return{problems:[]}}}(t);if(!n.length)return;const r=n.slice(0,si),o=n.length-r.length;console.warn(e+": this document does not match the animation schema in "+n.length+" place"+(1===n.length?"":"s")+".\n"+r.map(t=>" - "+t).join("\n")+(o>0?"\n … and "+o+" 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.")}function ui(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=fi(r,e.origin,!0),r=ci(r,"scale",e.scale,n),r=ci(r,"skew",e.skew,n),r=ci(r,"rotate",e.rotate,n),r=fi(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=ci(r,"translate",e.translate,n):(r=fi(r,e.origin,!0),r=ci(r,"translate",e.translate,n),r=fi(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function ci(t,e,n,r){if(void 0===n)return t;const o=ho(n);if("static"===o.kind)return{type:"g",transform:{value:fo(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>go(t,fo(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 fi(t,e,n){if(void 0===e)return t;const r=ho(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=>go(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function di(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=Qo(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=>di(t,e,n))}function hi(t,e,n,r,o){const i=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=mi(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&mi((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&mi((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=pi(i.full),r=pi(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);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: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=f({},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:a,inner:s}=function(t){if(!t)return{};const e=mi(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=ui(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(u.transform=i.transform),void 0!==i.animate&&(u.animate=i.animate),a&&(delete u.id,u=ui(u,a,o),u.id=n),u}function pi(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 mi(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 gi(t,e,n,r){if(!e)return t;const o=Jo(n,"grad"),i=function(t,e){const n={type:t.type===le.radial?"radialGradient":"linearGradient",id:e};t.type===le.linear?(vi(n,"x1","y1",t.start),vi(n,"x2","y2",t.end)):(vi(n,"cx","cy",t.center),function(t,e,n){const r=ho(n);if("absent"===r.kind)return;po(t,e,r,{asString:!0})}(n,"r",t.radius),vi(n,"fx","fy",t.focal));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);return n.children=function(t){var e,n;if(!t)return[];const r=ho(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(yi):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=ke(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=ke(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:bi(o,0,t))?n:{offset:t/Math.max(1,a-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 a=[],s=[];let l=!1;for(const r of e){const o=be(r),u=ke(r),c=null!=(i=null==u?void 0:u[n])?i:bi(e,e.indexOf(r),n);if(!c)continue;const f=Ae(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),a.push(d);const h={time:o,value:c.offset};void 0!==f&&(h.easing=f),s.push(h),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:ki(t.offset),stopColor:t.color},c={};a.length&&(c.stopColor={keyframes:a},void 0!==o&&(c.stopColor.loop=o));l&&s.length&&(c.offset={keyframes:s},void 0!==o&&(c.offset.loop=o));Object.keys(c).length&&(u.animate=c);return u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function vi(t,e,n,r){var o,i,a;const s=ho(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function yi(t){return{type:"stop",offset:ki(t.offset),stopColor:t.color}}function bi(t,e,n){for(let r=e;r>=0;r--){const e=ke(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=ke(t[r]);if(null==e?void 0:e[n])return e[n]}}function ki(t){return Math.round(1e3*t)/10+"%"}function Ai(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function xi(t,e,n,r){if(!e)return t;const o=Qo(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=Jo(r,"mask");let a={type:"use",href:"#"+o};if(n)a=wi(a,n,r);else if(Mi(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=go(t,void 0);if(Array.isArray(e.translate)&&a.push(d(f(f({},r),Si(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(d(f({},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(d(f({},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 h=t;a.length&&(h={type:"g",animate:{transform:c(a)},children:[h]});s.length&&(h={type:"g",animate:{transform:c(s)},children:[h]});l.length&&(h={type:"g",animate:{transform:c(l)},children:[h]});return h}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const 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!=(a=g[e].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)m.rotate=(null!=(s=m.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;for(const t of 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={};y&&(A.translate=y);void 0!==b&&(A.rotate=b);k&&(A.scale=k);return Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}return}(t);e&&(a=wi(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||Mi(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?Di(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=Pi(l),n=Pi(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}const f=Array.from(c).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const e=_i(l,t),n=_i(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}function wi(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=ho(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=ji(o,"translate",e.translate,void 0,n),o=ji(o,"rotate",e.rotate,r,n),o=ji(o,"scale",e.scale,r,n),o}function ji(t,e,n,r,o){if(void 0===n)return t;const i=ho("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:fo(e,Oi(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=go(t,fo(e,Oi(e,t.value),r));return"translate"===e?f(f({},n),Si(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Oi(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Si(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 Mi(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Pi(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 _i(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=zi(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function zi(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 Di(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}function Ni(t,e,n){if(!e)return;const r=Qo(e.source);if(!r)return void(e.without===Bt.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===Bt.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Ti(t,e){const n={};return void 0!==t.translate&&(n.translate=Ei(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=Ei(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=Ei(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];return Ei(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function Ei(t,e,n=!1){const r=ho(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return("number"==typeof t||Array.isArray(t))&&!n?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?d(f({},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 Ii=!1;function Ci(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}var Ri=1;function Li(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-Ri),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+Ri,value:0}],a=f({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function Ui(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Vi(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function Wi(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 Fi(t,e,n){const r=Qo(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Bi(r,e,n,new Set);if(o)if(Ii){const e=n.idMap.get(o);t.type="g",delete t.href,t.children=[e],Yo(t),n.defs=n.defs.filter(t=>t!==e)}else t.href="#"+o}function Bi(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=$o(o);if(function(t,e){qo(t,()=>Jo(e,"retimed"))}(i,n),"use"===o.type?Gi(i,e.start,e.stretch):Xi(i,e.start,e.stretch),Wi(i),"use"===o.type&&o.href){const a=Qo(o.href);if(a){const s=Vi(o),l=s?Ui(Ci(s),e):e,u=new Set(r);u.add(t);const c=Bi(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=Vi(t);if("use"===t.type&&s&&t.href){const i=Qo(t.href);if(i){const a=Ui(Ci(s),e),l=new Set(r);l.add(o);const u=Bi(i,a,n,l);u&&(t.href="#"+u)}Wi(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function Xi(t,e,n){var r;Gi(t,e,n),null==(r=t.children)||r.forEach(t=>Xi(t,e,n))}function Gi(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 Ki(t,e,n){if(!e)return t;const r=e.subPaths===Ht.combined,o=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)i(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*sa,d=o*sa,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=yr(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=ia(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const e of t.subpaths)r||(a=0),e.startOffsetPx=a,a+=e.lengthPx;const l=a;if(r&&l<.001)return t;const u=ho(e.offset),c="absent"===u.kind?{kind:"static",value:0}:u,h=function(t){const e=ho(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:be(t),value:ke(t),easing:Ae(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=ra(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=oa(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=oa(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),p="absent"===h.kind?{kind:"static",value:[0,1]}:h,m=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=ke(n);"number"==typeof t&&e.push(t)}return e}(c),g=[m.length?Math.min(...m):0,m.length?Math.max(...m):0];if(1===o.length&&o[0].leaf===t&&1===o[0].subpaths.length){const e=o[0],n=e.subpaths[0],i=r?l:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=Ji(n,e,r),s=Qi(e,r),l=f({},t);return delete l.effects,ta(l,"strokeDasharray",$i(i,s)),ta(l,"strokeDashoffset",$i(o,a)),ta(l,"strokeOpacity",na(i)),l}(e.leaf,i,a,g,c,p)}const v=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?l:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...Zi(t.leaf,o.subpath,i,a,g,c,p,n))}v.set(t.leaf,qi(t.leaf,e))}const y=t=>{const e=v.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?d(f({},t),{children:t.children.map(y)}):t)};return y(t)}function qi(t,e){const n=d(f({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Zi(t,e,n,r,o,i,a,s){const l=Ji(r,n,o),u=Qi(n,o),c=$i(i,l),f=$i(a,u),d=na(a),h=function(t){return{type:"path",d:t}}(pn(e));return ta(h,"strokeDasharray",f),ta(h,"strokeDashoffset",c),ta(h,"strokeOpacity",d),[h]}var Yi=1;function Ji(t,e,n){const[r]=Hi(n);return n=>e*(-n-r+t)+Yi}function Qi(t,e){const[n,r]=Hi(e),o=r-n+1;return e=>{const n=Ln(e[0],0,1),r=Ln(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=Yi;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+Yi),s}}function Hi(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function $i(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:be(t),value:e(ke(t)),easing:Ae(t)})),loop:t.loop}}function ta(t,e,n){n&&po(t,e,n)}var ea=10;function na(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(ke(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,a=t<n.length-1?n[t+1]:void 0,s=be(r),l=e(ke(r)),u=o?l&&e(ke(o)):l,c=a?l&&e(ke(a)):l;u&&!c?(i.push({time:s,value:0}),i.push({time:s+ea,value:1})):!u&&c&&(i.push({time:s-ea,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function ra(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function oa(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 ia(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+=aa(t,r,r+1);return t.c&&e.length>1&&(n+=aa(t,e.length-1,0)),n}function aa(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=Bn(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:u,u);return c.ds[c.ds.length-1]}var sa=.5522847498307936;function la(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:Pt(null==(e=ue(t))?void 0:e.engine),glyphs:null==(n=de(t))?void 0:n.fonts},o=$o(t);Ho(o,r.idMap),di(o,r,()=>Jo(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=Qo(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=Di(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(),Ho(t,e.idMap);const n=[],r=t=>{var e;Vi(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&Vi(o)&&n++,"use"===o.type&&o.href){const t=Qo(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=Qo(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=Vi(t);if(!n)continue;const r=n.timeCrop;Wi(t),Fi(t,Ci(n),e),r&&Li(t,r,e)}}(t,e),t}(ua(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function ua(t,e){t.children&&(t.children=t.children.map(t=>ua(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,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?Co(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?No(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=ii(m,h,e)),m=function(t,e,n){return gi(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return gi(t,e,n,"stroke")}(m,d,e),m=Ki(m,u,e),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=$o(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const r=$o(l),o=Ti(e,t),i=o?ui(r,o,n):r;u.push(i)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(m,a,e),m=xi(m,s,i,e),m=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=Jo(n,"clip"),o={type:"path"},i=ho(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=Ai(i.value):(po(o,"d",i),void 0!==o.d&&(o.d=Ai(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(Ni(m,c,e),m=hi(m,i,r,o,e)):m=function(t,e,n,r){return Ni(t,e,r),ui(t,n,r)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}function ca(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function fa(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=ca(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var da=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function ha(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=ke(o[0]),a=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],s=[];let l=!1;for(const t of o){const n=ke(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>t!==oe.translate&&t!==oe.origin&&t!==oe.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]!==a[0]||o[1]!==a[1])return;s.push([r[0]+a[0],r[1]+a[1]])}if(!o.some(t=>xe(t)||we(t)))return;let u="M"+da(s[0][0])+","+da(s[0][1]);const c=[];for(let t=0;t<s.length-1;t++){const e=s[t],i=s[t+1],a=null!=(n=we(o[t]))?n:[0,0],l=null!=(r=xe(o[t+1]))?r:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[i[0]+l[0],i[1]+l[1]];u+="C"+da(f[0])+","+da(f[1])+","+da(d[0])+","+da(d[1])+","+da(i[0])+","+da(i[1]),c.push(fa(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:be(o[t]),v:h/f},n=Ae(o[t]);void 0!==n&&(e.e=n),d.push(e)}return{pathStr:u,distanceKfs:d,autoOrient:!!t.autoOrient,anchor:a,keyframesCarryRotate:l}}(i);if(e){const n=f({},o);delete n[ee];const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n[ne]=a;const s=t.transform;let l=s;if(s&&"object"==typeof s){const t=f({},s);delete t[oe.translate],delete t[oe.origin],e.keyframesCarryRotate&&delete t[oe.rotate],l=Object.keys(t).length?t:void 0}r=d(f({},t),{animate:n,style:d(f({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:da(e.anchor[0])+"px "+da(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=d(f({},r),{children:t}))}return r};return e(t)}function pa(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=ga(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=ya(t.viewBox);if(e)return[e[2],e[3]];const n=ma(t.width),r=ma(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=ba(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return d(f({},s),{children:u})}function ma(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function ga(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function va(t,e,n,r,o,i,a){var s,l,u,c;const h=Ko(e);qo(h,o);const p="symbol"===h.type?ya(h.viewBox):void 0,m=null!=(l=null!=(s=ma(t.width))?s:null==p?void 0:p[2])?l:a[0],g=null!=(c=null!=(u=ma(t.height))?u:null==p?void 0:p[3])?c:a[1],v="symbol"===h.type?function(t,e,n,r,o){const i=ya(t.viewBox),a=d(f({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,h=u>0&&c>0?Math.min(r/u,o/c):1,p=(r-u*h)/2,m=(o-c*h)/2,g=[];0===p&&0===m||g.push("translate("+p+","+m+")");1!==h&&g.push("scale("+h+")");0===s&&0===l||g.push("translate("+-s+","+-l+")");g.length&&(a.transform=g.join(""));const v=e();return n.push({type:"clipPath",id:v,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+v+")",a}(h,o,i,m,g):h,y=ba(v,n,r,o,i,a),b=d(f({},t),{type:"g",children:[y]});return delete b.href,delete b.width,delete b.height,Yo(b)}function ya(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 ba(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=ga(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return va(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=ba(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?d(f({},t),{children:s}):t}var ka=0;function Aa(){return"_px_"+Date.now().toString(36)+(++ka).toString(36)+Math.random().toString(36).substring(2,6)}function xa(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>xa(t));const e=t,n={};for(const t of Object.keys(e))n[t]=xa(e[t]);return n}function wa(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var ja="transform",Oa=new Set(["reverse","alternate-reverse"]),Sa=[0,.25,.5,.75,1],Ma="__px_rest_";function Pa(t,e){return void 0===t[e]&&(e!==ja||_a(t))}function _a(t){if(void 0!==t[ja])return!1;for(const e of _n)if(void 0!==t[e])return!1;return!0}function za(t,e,n){const r=Object.values(Tr({[e]:t[e]},n));return 1===r.length&&""!==r[0]?r[0]:void 0}function Da(t,e){const n={};for(const e of Object.keys(t))_n.has(e)&&(n[e]=t[e]);const r=Tr(n,e)[ja];if(!r)return;const o=Nn(r.replace(/(px|deg)\b/g,""));return o&&Object.keys(o).length?o:void 0}function Na(t,e,n){if(!t||!e)return t===e;const r=(t,e)=>JSON.stringify(Tr(t,e)).replace(/\s+/g,"");return Sa.every(o=>r(t,o*n)===r(e,o*n))}function Ta(t,e){const n=xa(t),r=new Map;for(const[t,e]of Ea(n))void 0===e.id&&(e.id=Ma+t),r.set(String(e.id),t);const o=new Map;for(const t of Dr(n,e)){const e=r.get(t.id);void 0!==e&&o.set(e,t.animate)}return o}function Ea(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 Ia(t,e,n){var r,o;let i=la(t).root;i=ha(i);return i=Pr(i,null!=(o=null==(r=ue(i))?void 0:r.duration)?o:It),e===St.native&&(i=pr(i,null==n?void 0:n.motionPath),i=pa(i),i=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(i)),i=function(t,e){var n,r;const o=xa(t),i=ue(o)||{},a=+(i.duration||It),s=Oa.has(String(i.direction))?a:0,l=Ea(o);if(!l.size)return o;const u=Ta(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(_n.has(r))continue;if(!Pa(o,r))continue;const i=za(e,r,s);void 0!==i&&(o[r]=i,c.set(t,[...null!=(n=c.get(t))?n:[],r]))}if(i.some(t=>_n.has(t))&&_a(o)){const n=Da(e,s);n&&(o[ja]=n,c.set(t,[...null!=(r=c.get(t))?r:[],ja]))}}if(c.size){const t=Ta(o,e);for(const[e,n]of c){if(Na(u.get(e),t.get(e),a))continue;const r=l.get(e);if(r)for(const t of n)delete r[t]}}return o}(i,e),i}function Ca(t){var e;return function(t){var e;const n=xa(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"]),a=new Set(["targetId","boundElementId"]),s=(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=Aa();r.set(t,n),e.id=n}else e.animate&&(e.id=Aa());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]=wa(u,r);else if(a.has(l)||s(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]=wa(u,r));else if("style"===l&&"object"==typeof u&&null!==u)for(const[t,e]of Object.entries(u))"string"==typeof e&&(u[t]=wa(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 d(f({},t),{target:n?"#"+i:i})});n.animator=d(f({},n.animator),{bindings:t})}return n}(Ia(t,Pt(null==(e=ue(t))?void 0:e.engine)))}var Ra={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"},La="https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";function Ua(t){return"PX"+t+" "+La+"#px"+t}function Va(t,e){const n=e?e+" ":"";return{warn:(e,r,...o)=>{const i=Ua(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=Ua(r),a=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:a}):(null==t?void 0:t.muteError)||console.error(n+e+" "+i,...o)}}}var Wa=new Set(["script","foreignobject"]),Fa=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Ba=new Set(["href","xlink:href","src"]),Xa=new Set(["mixBlendMode","isolation"]),Ga=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Ka=/^data:image\/svg\+xml(?:;[^,]*)?,/i,qa=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Za=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Ya(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(Fa.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Ba.has(n)&&(Ga.test(t)||Ka.test(t)||function(t){const e=qa.exec(t);return!!e&&Za.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)}var Ja="className",Qa="class",Ha="domType",$a="type",ts="g";function es(t,e,n){return t?ns(t,e,n,!0,0):null}function ns(t,e,n,r,o){const i=t,{type:a,children:s,style:l}=i,u=h(i,["type","children","style"]),c=a||ts;if(Wa.has(c.toLowerCase()))return(null!=n?n:Va(void 0,"[PxAnimator]")).warn(Ra.document,1103,c),null;const f=u[Ha];void 0!==f&&delete u[Ha];const d={};let p;const m=function(t){const e={};for(const n of Object.keys(t)){const r=En(n);if(re.has(r))continue;if("style"===r)continue;let o=t[n];if(Pn.has(r)&&Array.isArray(o))e[r]=Sn(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)_n.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e[ee]=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[ee]=Dn(t,{withUnits:!1})}}return e}(u);for(const t of Object.keys(m)){const e=Ya(t,m[t]);void 0!==e&&(Xa.has(t)?(null!=p?p:p={})[t]=String(e):d[t===Ja?Qa:Rn(t)]=e)}if(void 0!==f&&(d[$a]=String(f)),l)for(const t of Object.keys(l))(null!=p?p:p={})[t]=String(l[t]);const g=[];s&&s.forEach((t,r)=>{const o=ns(t,e,n,!1,r);null!==o&&g.push(o)});const v=u[$t],y=!g.length&&"string"==typeof v&&v?v:void 0;return e({tag:c,attrs:d,style:p,children:g,text:y,node:t,isRoot:r,index:o})}function rs(t){return"scroll"===(null==t?void 0:t.timelineSource)}function os(t){return("number"==typeof(null==t?void 0:t.duration)&&t.duration>0?t.duration:It)*("number"==typeof(null==t?void 0:t.iterations)&&t.iterations>0?t.iterations:1)}function is(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]}}var as="cover";function ss(t,e,n,r){var o;const[i,a]=is(null!=(o=null==t?void 0:t.phase)?o:as,n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(a-i)}function ls(t,e,n,r){const o=n-t,i=ss(null==r?void 0:r.start,0,e,n),a=ss(null==r?void 0:r.end,1,e,n);return a<=i?o>=a?1:0:Ln((o-i)/(a-i),0,1)}function us(t,e,n){var r,o;const i=e>0?Ln(t/e,0,1):1,a="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,s="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return s<=a?i>=s?1:0:Ln((i-a)/(s-a),0,1)}function cs(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"}function fs(t){const e=new Set,n=new Set,r=[{schema:t,path:""}];for(;r.length;){const{schema:t,path:o}=r.shift(),i=I(t);switch(i.kind){case"shape":if(n.has(t))break;n.add(t);for(const t of Object.keys(i.shape)){const n=o?o+"."+t:t;e.add(n),r.push({schema:i.shape[t],path:n})}i.openValue&&r.push({schema:i.openValue,path:o+"{*}"});break;case"optional":r.push({schema:i.inner,path:o});break;case"array":r.push({schema:i.item,path:o+"[]"});break;case"lazy":r.push({schema:i.resolved,path:o});break;case"record":r.push({schema:i.value,path:o+"{*}"});break;case"union":i.members.forEach((t,e)=>r.push({schema:t,path:o+"|"+e}));break;case"discriminatedUnion":for(const t of i.members)r.push({schema:t,path:o+"|"+ds(t,i.key)})}}return[...e].sort()}function ds(t,e){const n=I(t);if("shape"!==n.kind)return"?";const r=n.shape[e];if(void 0===r)return"?";const o=I(r);return String(("optional"===o.kind?o.inner:r)._default)}function hs(t,e){const n=new Set(t),r=new Set(e);return{added:e.filter(t=>!n.has(t)).sort(),removed:t.filter(t=>!r.has(t)).sort()}}function ps(t){const e=t.added.length>0||t.removed.length>0,n=me(t.lastReleased),r=me(t.declared);if(!n||!r)return{changed:e,refuse:"Unparseable version: "+t.lastReleased+" / "+t.declared+"."};const o=n.a+"."+(n.b+1);if(!e){if(r.b===n.b&&r.a===n.a)return{changed:e};return t.steps.find(e=>e.to===t.declared)?{changed:e,requiredVersion:t.declared}:{changed:e,refuse:"The version moved to "+t.declared+" with no key change and no step explaining it."}}const i=t.removed.length?"converted":"additive",a=t.added.length+" key(s) added, "+t.removed.length+" removed";if(r.a!==n.a||r.b!==n.b+1)return{changed:e,requiredKind:i,requiredVersion:o,refuse:"The player schema changed ("+a+") but PX_WIRE_SCHEMA_VERSION is "+t.declared+". Set it to "+o+" and add the PX_WIRE_STEPS entry."};const s=t.steps.find(e=>e.to===t.declared);return s?"converted"===i&&"converted"!==s.kind?{changed:e,requiredKind:i,requiredVersion:o,refuse:"Keys were REMOVED ("+t.removed.join(", ")+"), which is never additive — the "+t.declared+" step must be `converted`, with an up()."}:{changed:e,requiredKind:i,requiredVersion:o}:{changed:e,requiredKind:i,requiredVersion:o,refuse:"No PX_WIRE_STEPS entry reaches "+t.declared+"."}}function ms(t,e,n,r){const o=[];if(!t.length)return["The release log is empty."];t[0].baseline&&t[0].version===r||o.push("The first release must be the baseline "+r+".");for(let n=1;n<t.length;n++){const r=me(t[n-1].version),i=me(t[n].version);r&&i&&i.a===r.a&&i.b===r.b+1||o.push("Release "+t[n].version+" does not follow "+t[n-1].version+" by one `b` step."),t[n].date<t[n-1].date&&o.push("Release "+t[n].version+" is dated before its predecessor.");const a=e.find(e=>e.to===t[n].version);a?t[n].removed.length&&"converted"!==a.kind&&o.push("Release "+t[n].version+" removed keys, but its step is not `converted`."):o.push("Release "+t[n].version+" has no PX_WIRE_STEPS entry.")}const i=t[t.length-1].version;return i!==n&&o.push("PX_WIRE_SCHEMA_VERSION is "+n+" but the last release record is "+i+" — a bump needs its changelog entry (run scripts/schema-release.mjs --apply)."),o}