@pixodesk/svg-animator-core 1.0.44 → 1.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&s(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&s(t,n,e[n]);return t},u=(t,r)=>e(t,n(r)),c=(t,e)=>{var n={};for(var a in t)o.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&r)for(var a of r(t))e.indexOf(a)<0&&i.call(t,a)&&(n[a]=t[a]);return n},f="unexpected extra key";function d(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var h=class{constructor(t){this._statesDefault=t}_canSanitize(t){return this.isValid(t)}absentDefault(){return this._default}optional(){return new p(this)}},p=class extends h{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)}},m=class extends h{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(d(null!=n?n:[])+": expected string, got "+typeof t),!1)}},g=class extends h{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(d(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},v=class extends h{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(d(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},y=class extends h{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(d(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},b=class extends h{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(d(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},k=class extends h{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=d(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))}},A=class extends h{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(d(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 w(t){const e={};for(const n of Object.keys(t))t[n]._statesDefault&&(e[n]=t[n].absentDefault());return Object.freeze(e)}var x=class extends h{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=w(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(d(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(d(o)+": "+f),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},j=class extends h{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=w(t)}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=l({},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(d(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)}},O=class extends h{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(d(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)}},S=class extends h{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(d(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)}},M=class extends h{constructor(){super(!1),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},P=class extends h{constructor(){super(!1),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(d(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},_=class extends h{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)}},z=class extends h{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(d(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 D(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function N(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 I,T={string:function(t){return void 0===t?new m("",!1):new m(t,!0)},number:function(t){return void 0===t?new g(0,!1):new g(t,!0)},boolean:function(t){return void 0===t?new v(!1,!1):new v(t,!0)},literal:t=>new y(t),enum:function(t,e){return void 0===e?new b(t,void 0,!1):new b(t,e,!0)},union:function(t,e){return void 0===e?new k(t,void 0,!1):new k(t,e,!0)},discriminatedUnion:(t,e)=>new A(t,e),object:t=>new x(t),openObject:(t,e)=>new j(t,e),extendedObject:(t,e)=>new x(l(l({},t._shape),e)),array:t=>new O(t),record:t=>new S(t),any:()=>new M,defined:()=>new P,tuple:t=>new z(t),lazy:(t,e)=>new _(t,e)},C="1.2",E="version",U="animator",R=(t=>(t.unstamped="unstamped",t.same="same",t.older="older",t.newer="newer",t.otherGeneration="otherGeneration",t))(R||{}),B=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function F(t){if("string"!=typeof t)return;const e=B.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}function L(t){return t.a+"."+t.b+"."+t.c}var V=null!=(I=F("1.2"))?I:{a:1,b:1,c:0};function W(t){if(!t||"object"!=typeof t)return;const e=G(t,U);if(e)return e;const n=G(t,"meta");return n?G(n,U):void 0}function G(t,e){const n=t[e];return n&&"object"==typeof n&&!Array.isArray(n)?n:void 0}function Z(t){const e=W(t);return e?F(e[E]):void 0}function K(t,e,n){return t?t.a!==e.a?"otherGeneration":t.b!==e.b?t.b>e.b?"newer":"older":n&&t.c!==e.c?t.c>e.c?"newer":"older":"same":"unstamped"}function J(t,e,n,r){if(!e)return;const o=r?"player":"editor",i="written for schema "+L(e)+", this "+o+" reads "+L(n);switch(t){case"newer":return"This file is "+i+". Update the "+o+" to open it fully.";case"older":return"This file is "+i+". Saving it from this "+o+" rewrites it in the current format.";case"otherGeneration":return"This file is "+i+" — a different format generation, which no conversion bridges. Open it in a "+o+" of that generation, or accept this document without the parts named above.";default:return}}var X=(t=>(t.additive="additive",t.converted="converted",t))(X||{}),q="1.1",Q=[{from:"1.1",to:"1.2",reason:"The trigger block became two axes: `start` says what STARTS an animation, `offScreen` + `visibilityThreshold` + `visibilityDebounce` say whether it may RUN. `scrollIntoView` is no longer a start value — it is what `start: 'load'` behind the default gate already means — and `outAction` split into `offScreen` (scroll) and `mouseOut` (hover), because one field meant three things.",kind:"converted",up:function(t){const e=t.animator;if(!e||"object"!=typeof e)return;const n=e.timeline,r=(n&&"object"==typeof n?n:e).trigger;if(!r||"object"!=typeof r)return;const o=r,i=o.startOn,a=o.outAction;delete o.startOn,delete o.outAction,"scrollIntoView"===i?void 0!==a&&(o.offScreen=a):("programmatic"===i?o.start="none":void 0!==i&&(o.start=i),"mouseOver"===i&&void 0!==a&&(o.mouseOut=a),void 0===o.offScreen&&(o.offScreen="continue"));void 0!==o.scrollIntoViewThreshold&&(o.visibilityThreshold=o.scrollIntoViewThreshold,delete o.scrollIntoViewThreshold);void 0!==o.finishAction&&(o.finish=o.finishAction,delete o.finishAction)}}];function Y(t,e){const n=Z(t),r=K(n,e.target,e.readerReadsEditorPart);if(!n||"older"!==r)return{doc:t,from:n,relation:r,applied:[],advice:J(r,n,e.target,!e.readerReadsEditorPart)};const o=[];for(const t of e.steps){const r=F(t.to);r&&("older"===K(n,r,e.readerReadsEditorPart)&&t.up&&o.push(t))}if(!o.length||!t||"object"!=typeof t)return{doc:t,from:n,relation:r,applied:[]};const i=$(t),a=[];for(const t of o)try{t.up(i),a.push(t)}catch(t){break}return a.length?(tt(i,e.target,e.readerReadsEditorPart),{doc:i,from:n,relation:r,applied:a}):{doc:t,from:n,relation:r,applied:[]}}function H(t){return Y(t,{steps:Q,target:V,readerReadsEditorPart:!1})}function $(t){const e=globalThis.structuredClone;return e?e(t):JSON.parse(JSON.stringify(t))}function tt(t,e,n){const r=W(t);if(!r)return;const o=F(r[E]);r[E]=L({a:e.a,b:e.b,c:n?e.c:o?o.c:0})}function et(t,e){return function(t,e){const n=Z(t);if(!n)return{ok:!1,blocking:[],reason:"The document carries no version, so there is nothing to convert down from."};const r=K(n,e.target,e.readerReadsEditorPart);if("otherGeneration"===r)return{ok:!1,blocking:[],reason:"Schema "+L(n)+" and "+L(e.target)+" are different generations; no conversion bridges them."};if("newer"!==r)return{ok:!0,doc:t,applied:[]};const o=[];for(const t of e.steps){const r=F(t.to);r&&"newer"===K(r,e.target,e.readerReadsEditorPart)&&"newer"!==K(r,n,e.readerReadsEditorPart)&&o.push(t)}o.reverse();const i=o.filter(t=>"converted"===t.kind&&!t.down);if(i.length)return{ok:!1,blocking:i,reason:"Cannot convert down to "+L(e.target)+": "+i.map(t=>t.from+" → "+t.to+" ("+t.reason+")").join("; ")+" cannot be undone."};const a=$(t),s=[];for(const t of o)if(t.down)try{t.down(a),s.push(t)}catch(e){return{ok:!1,blocking:[t],reason:"Undoing "+t.from+" → "+t.to+" failed: "+String(e)}}return tt(a,e.target,e.readerReadsEditorPart),{ok:!0,doc:a,applied:s}}(t,{steps:Q,target:e,readerReadsEditorPart:!1})}var nt={forwards:"forwards",backwards:"backwards",both:"both",none:"none"},rt={normal:"normal",reverse:"reverse",alternate:"alternate",alternateReverse:"alternate-reverse"},ot="data-px-animation-src",it="_px_animator",at={load:"load",mouseOver:"mouseOver",click:"click",none:"none"},st={pause:"pause",continue:"continue",reset:"reset"},lt={continue:"continue",pause:"pause",reset:"reset",reverse:"reverse"},ut={hold:"hold",reset:"reset"},ct={view:"view",scroll:"scroll"},ft={block:"block",inline:"inline",x:"x",y:"y"},dt={nearest:"nearest",root:"root"},ht={top:"top",center:"center",bottom:"bottom"},pt={cover:"cover",contain:"contain",entry:"entry",exit:"exit",entryCrossing:"entry-crossing",exitCrossing:"exit-crossing"},mt={sampled:"sampled",offsetPath:"offsetPath"},gt=["duration","iterations","engine","frameRate"],vt=["trigger","delay","fillMode","direction"],yt=[...gt,...vt,"fill","resetOnFinish","timelineSource","scroll"],bt={native:"native",js:"js"},kt=u(l({},bt),{auto:"auto"});function At(t){return t===kt.js?bt.js:bt.native}function wt(t){return t===kt.native}function xt(t){return t!==kt.js}var jt={start:"load",offScreen:"pause",mouseOut:"continue",visibilityThreshold:.5,visibilityDebounce:150,finish:"hold"},Ot=1e3,St=1,Mt={static:"static",fixedTime:"fixedTime",play:"play",autoplay:"autoplay"};function Pt(t){const e=void 0!==t.progress||void 0!==t.time,n=void 0!==t.play||void 0!==t.pause,r=!!t.autoplay,o=[],i=(t,e,n)=>t+" and "+e+" were both set — "+n+" wins, "+(n===t?e:t)+" is ignored.";return e?(n&&o.push(i("progress/time","play/pause","progress/time")),r&&o.push(i("progress/time","autoplay","progress/time")),{mode:Mt.fixedTime,warnings:o}):n?(r&&o.push(i("play/pause","autoplay","play/pause")),{mode:Mt.play,warnings:o}):r?{mode:Mt.autoplay,warnings:o}:{mode:Mt.static,warnings:o}}function _t(t){return t!==Mt.autoplay}function zt(t){var e,n,r,o,i;return{start:null!=(e=null==t?void 0:t.start)?e:jt.start,offScreen:null!=(n=null==t?void 0:t.offScreen)?n:jt.offScreen,mouseOut:null!=(r=null==t?void 0:t.mouseOut)?r:jt.mouseOut,visibilityThreshold:null!=(o=null==t?void 0:t.visibilityThreshold)?o:jt.visibilityThreshold,visibilityDebounce:null!=(i=null==t?void 0:t.visibilityDebounce)?i:jt.visibilityDebounce}}var Dt={start:"start",end:"end"},Nt={normal:"normal",alternate:"alternate"},It={luminance:"luminance",alpha:"alpha"},Tt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},Ct={translate:"translate"},Et={clip:"clip",extend:"extend"},Ut={spacing:"spacing",spacingAndGlyphs:"spacingAndGlyphs"},Rt={align:"align",stretch:"stretch"},Bt={auto:"auto",exact:"exact"},Ft={separate:"separate",combined:"combined"},Lt="textContent",Vt="class",Wt="transform",Gt=new Set(["type","children","animator","meta","animate","effects",Lt]),Zt="translate",Kt="rotate",Jt="origin",Xt=[Zt,Kt,"scale",Jt],qt={pad:"pad",reflect:"reflect",repeat:"repeat"},Qt={linear:"linear",radial:"radial"};function Yt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function Ht(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=$t.get(n);if(r)return r;const o=n,i=yt.filter(t=>void 0!==o[t]),a=i.length?l({},o):n;for(const t of i)delete a[t];const s=ee(a);return $t.set(n,s),s}var $t=new WeakMap,te=new WeakMap;function ee(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=te.get(t);if(n)return n;const r=t,{timeline:o}=r,i=c(r,["timeline"]);if(void 0!==e.engine&&(i.engine=e.engine),void 0!==e.frameRate&&(i.frameRate=e.frameRate),"scroll"===e.type||"view"===e.type){i.timelineSource="scroll",void 0!==e.duration&&(i.duration=e.duration),void 0!==e.iterations&&(i.iterations=e.iterations);const t=l({},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=c(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 te.set(t,i),i}function ne(t){if(!t||void 0!==t.timeline)return t;const e=t,{timelineSource:n,scroll:r,trigger:o,delay:i,iterations:a,direction:s,fill:f,resetOnFinish:d,duration:h,engine:p,frameRate:m}=e,g=c(e,["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","engine","frameRate"]);if("scroll"===n){const t={type:(v=null==r?void 0:r.kind,"scroll"===v?"scroll":"view")};if(void 0!==p&&(t.engine=p),void 0!==m&&(t.frameRate=m),void 0!==h&&(t.duration=h),"number"==typeof a&&(t.iterations=a),r){void 0!==r.axis&&(t.axis=r.axis),void 0!==r.source&&(t.source=r.source),void 0!==r.subject&&(t.subject=r.subject),void 0!==r.smoothing&&(t.smoothing=r.smoothing),void 0!==r.range&&(t.range=r.range);void 0!==r.pinAlign||void 0!==r.pinOffset||void 0!==r.pinDistance?t.pin=l(l(l({},void 0!==r.pinAlign?{align:r.pinAlign}:{}),void 0!==r.pinOffset?{offset:r.pinOffset}:{}),void 0!==r.pinDistance?{distance:r.pinDistance}:{}):void 0!==r.pin&&(t.pin=r.pin)}return u(l({},g),{timeline:t})}var v;const y={};if(void 0!==p&&(y.engine=p),void 0!==m&&(y.frameRate=m),void 0!==h&&(y.duration=h),void 0!==o||d){const t=l({},o||{});d&&(t.finish="reset"),y.trigger=t}return void 0!==i&&(y.delay=i),void 0!==a&&(y.iterations=a),void 0!==s&&(y.direction=s),void 0!==f&&(y.fillMode=f),Object.keys(y).length>0?u(l({},g),{timeline:y}):g}function re(t){var e;if(t)return null==(e=Ht(t))?void 0:e.definitions}function oe(t){var e;if(t)return null==(e=Ht(t))?void 0:e.bindings}function ie(t){return null==t?void 0:t.children}var ae=T.union([T.string(),T.tuple([T.number(),T.number(),T.number(),T.number()])]),se=T.union([T.string(),T.number(),T.array(T.number()),T.object({pathData:T.string()}),T.lazy(()=>T.array(Je),[]),T.lazy(()=>ge,{})]),le=T.object({time:T.number().optional(),value:se.optional(),easing:ae.optional(),tangentOut:T.tuple([T.number(),T.number()]).optional(),tangentIn:T.tuple([T.number(),T.number()]).optional()}),ue=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},ce=t=>{var e;return null!=(e=t.value)?e:t.v},fe=t=>{var e;return null!=(e=t.easing)?e:t.e},de=t=>t.tangentIn,he=t=>t.tangentOut,pe=T.object({segmentCount:T.number().optional(),repeatAt:T.enum([Dt.start,Dt.end],Dt.end).optional(),direction:T.enum([Nt.normal,Nt.alternate],Nt.normal).optional()}),me=T.object({value:se.optional(),keyframes:T.array(le).optional(),loop:T.union([pe,T.boolean()]).optional(),autoOrient:T.boolean().optional(),alongPathMode:T.enum([mt.sampled,mt.offsetPath],mt.sampled).optional()}),ge=T.object({translate:T.tuple([T.number(),T.number()]).optional(),rotate:T.number().optional(),skew:T.number().optional(),scale:T.tuple([T.number(),T.number()]).optional(),origin:T.tuple([T.number(),T.number()]).optional()}),ve=T.union([T.string(),ge,T.object({value:ge}),me]),ye=T.record(me),be=T.union([T.string(),T.array(T.union([T.string(),ye])),ye]),ke=T.object({start:T.enum([at.load,at.mouseOver,at.click,at.none],jt.start).optional(),offScreen:T.enum([st.pause,st.continue,st.reset],jt.offScreen).optional(),mouseOut:T.enum([lt.continue,lt.pause,lt.reset,lt.reverse],jt.mouseOut).optional(),finish:T.enum([ut.hold,ut.reset],jt.finish).optional(),visibilityThreshold:T.number(jt.visibilityThreshold).optional(),visibilityDebounce:T.number(jt.visibilityDebounce).optional()}),Ae=T.object({width:T.number(),pathData:T.string()}),we=T.object({fontFamily:T.string(),fontStyle:T.string(),ascent:T.number(),unitsPerEm:T.number(),glyphs:T.record(Ae)}),xe=T.object({easings:T.record(T.tuple([T.number(),T.number(),T.number(),T.number()])).optional(),animations:T.record(ye).optional(),fonts:T.record(we).optional()}),je=T.object({phase:T.enum([pt.cover,pt.contain,pt.entry,pt.exit,pt.entryCrossing,pt.exitCrossing],pt.cover).optional(),fraction:T.number().optional()}),Oe=T.object({start:je.optional(),end:je.optional()}),Se=T.object({kind:T.enum([ct.view,ct.scroll],ct.view).optional(),axis:T.enum([ft.block,ft.inline,ft.x,ft.y],ft.block).optional(),source:T.enum([dt.nearest,dt.root],dt.nearest).optional(),subject:T.string().optional(),smoothing:T.number().optional(),pin:T.boolean(!1).optional(),pinAlign:T.enum([ht.top,ht.center,ht.bottom],ht.top).optional(),pinOffset:T.number().optional(),pinDistance:T.number().optional(),range:Oe.optional()}),Me=T.object({align:T.enum([ht.top,ht.center,ht.bottom],ht.top).optional(),offset:T.number().optional(),distance:T.number().optional()}),Pe=T.enum([kt.auto,kt.native,kt.js],kt.auto).optional(),_e=T.object({type:T.literal("time").optional(),engine:Pe,frameRate:T.number().optional(),duration:T.number(Ot).optional(),trigger:ke.optional(),delay:T.number(0).optional(),iterations:T.union([T.number(1),T.literal("infinite")],1).optional(),fillMode:T.enum([nt.forwards,nt.backwards,nt.both,nt.none],nt.forwards).optional(),direction:T.enum([rt.normal,rt.reverse,rt.alternate,rt.alternateReverse],rt.normal).optional()}),ze={duration:T.number().optional(),iterations:T.number().optional(),engine:Pe,frameRate:T.number().optional(),axis:T.enum([ft.block,ft.inline,ft.x,ft.y],ft.block).optional(),source:T.enum([dt.nearest,dt.root],dt.nearest).optional(),subject:T.string().optional(),smoothing:T.number().optional(),pin:T.union([T.boolean(),Me]).optional(),range:Oe.optional()},De=T.object(l({type:T.literal("scroll")},ze)),Ne=T.object(l({type:T.literal("view")},ze)),Ie=T.discriminatedUnion("type",[_e,De,Ne]),Te=T.object({target:T.string(),animateWith:T.array(T.string())}),Ce=T.object({timeline:Ie.optional(),definitions:xe.optional(),bindings:T.array(Te).optional(),debugGlobalName:T.string().optional(),version:T.string().optional()}),Ee=T.union([T.string(),T.number(),T.array(T.number()),T.object({value:T.defined()}),ge]),Ue=T.union([T.number(),me,T.object({value:T.number()})]),Re=T.union([T.tuple([T.number(),T.number()]),me,T.object({value:T.tuple([T.number(),T.number()])})]),Be=T.union([T.string(),me,T.object({value:T.string()})]),Fe=T.object({translate:Re.optional(),rotate:Ue.optional(),scale:Re.optional(),skew:Ue.optional(),origin:Re.optional()}),Le=T.object({copies:T.number().optional(),translate:Re.optional(),rotate:Ue.optional(),skew:Ue.optional(),scale:Re.optional(),origin:Re.optional()}),Ve=T.object({source:T.string().optional(),maskType:T.enum([It.luminance,It.alpha],It.luminance).optional(),maskUnits:T.enum([Tt.userSpaceOnUse,Tt.objectBoundingBox],Tt.objectBoundingBox).optional(),maskContentUnits:T.enum([Tt.userSpaceOnUse,Tt.objectBoundingBox],Tt.userSpaceOnUse).optional(),x:T.number().optional(),y:T.number().optional(),width:T.number().optional(),height:T.number().optional()}),We=T.object({pathData:Be.optional()}),Ge=T.object({offset:Ue.optional(),range:Re.optional(),subPaths:T.enum([Ft.separate,Ft.combined],Ft.separate).optional()}),Ze=T.object({start:T.number().optional(),stretch:T.number().optional(),timeCrop:T.tuple([T.number(),T.number()]).optional()}),Ke=T.object({without:T.enum([Ct.translate]).optional(),source:T.string().optional(),retime:Ze.optional()}),Je=T.object({offset:T.number(),color:T.string()}),Xe=T.union([T.array(Je),T.object({value:T.array(Je)}),me]),qe=T.object({type:T.enum([Qt.linear,Qt.radial]),start:Re.optional(),end:Re.optional(),center:Re.optional(),radius:Ue.optional(),focal:Re.optional(),stops:Xe.optional(),gradientUnits:T.enum([Tt.userSpaceOnUse,Tt.objectBoundingBox],Tt.objectBoundingBox).optional(),spreadMethod:T.enum([qt.pad,qt.reflect,qt.repeat],qt.pad).optional(),gradientTransform:T.string().optional()}),Qe=qe,Ye=T.object({pathData:T.string(),pathOverflow:T.enum([Et.clip,Et.extend],Et.extend).optional(),lengthAdjust:T.enum([Ut.spacing,Ut.spacingAndGlyphs],Ut.spacing).optional(),method:T.enum([Rt.align,Rt.stretch],Rt.align).optional(),spacing:T.enum([Bt.auto,Bt.exact],Bt.exact).optional(),startOffset:Ue.optional(),textLength:Ue.optional()}),He=T.object({useGlyphs:T.boolean().optional()}),$e=T.object({transformBy:Fe.optional(),repeater:Le.optional(),maskedBy:Ve.optional(),clipPath:We.optional(),strokeTrim:Ge.optional(),clone:Ke.optional(),fillGradient:qe.optional(),strokeGradient:Qe.optional(),textPath:Ye.optional(),text:He.optional()});function tn(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!$e.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}function en(t,e){var n;const r=!1!==(null==e?void 0:e.strict),o={errors:[],warnings:[],strict:r},i=an.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const e of tn(t,{strict:r}))i.includes(e)||i.push(e);const e=null==(n=Ht(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=Ht(t))?void 0:e.version;return void 0===n||void 0!==F(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 nn=T.openObject({type:T.string(),domType:T.string().optional(),textContent:T.string().optional(),id:T.string().optional(),meta:T.any().optional(),effects:$e.optional(),animate:be.optional(),style:T.record(T.union([T.string(),T.number()])).optional()},Ee),rn=T.openObject(u(l({},nn._shape),{children:T.lazy(()=>T.array(rn),[]).optional()}),Ee),on=T.object({width:T.union([T.number(),T.string()]).optional(),height:T.union([T.number(),T.string()]).optional(),viewBox:T.string().optional(),animator:Ce.optional()}),an=T.openObject(u(l(l({},nn._shape),on._shape),{type:T.literal("svg"),children:T.array(rn).optional()}),Ee),sn=T.object({v:T.array(T.array(T.number())),i:T.array(T.array(T.number())).optional(),o:T.array(T.array(T.number())).optional(),c:T.boolean().optional()});function ln(t){const e=en(t,{strict:!1});return{valid:0===e.length,errors:e}}var un=0;function cn(){return"_px_"+Date.now().toString(36)+(++un).toString(36)+Math.random().toString(36).substring(2,6)}function fn(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>fn(t));const e=t,n={};for(const t of Object.keys(e))n[t]=fn(e[t]);return n}function dn(t){var e;const n=fn(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=cn();r.set(t,n),e.id=n}else e.animate&&(e.id=cn());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]=hn(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]=hn(u,r));else if("style"===l&&"object"==typeof u&&null!==u)for(const[t,e]of Object.entries(u))"string"==typeof e&&(u[t]=hn(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 c=null==(e=n.animator)?void 0:e.bindings;if(Array.isArray(c)){const t=c.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 u(l({},t),{target:n?"#"+i:i})});n.animator=u(l({},n.animator),{bindings:t})}return n}function hn(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}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 wn(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function xn(t,e,n,r,o){const i=wn(t,e,o),a=wn(e,n,o),s=wn(n,r,o),l=wn(i,a,o),u=wn(a,s,o),c=wn(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}=xn([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 In=new Set(["offset-distance","offsetDistance"]);function Tn(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Cn(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var En=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 Un(t){return En.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Rn(t,e,n){return Math.max(e,Math.min(t,n))}function Bn(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 Fn=1e-4;function Ln(t,e,n,r,o){const i=Vn(t,e,n,r,o);if(0===i[0]&&0===i[1]){return Vn(t,e,n,r,o<.5?o+Fn:o-Fn)}return i}function Vn(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 Wn(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=Bn(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=Bn(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 Gn(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}var Zn=new Set(["script","foreignobject"]),Kn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Jn=new Set(["href","xlink:href","src"]),Xn=new Set(["mixBlendMode","isolation"]),qn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Qn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Yn=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Hn=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function $n(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(Kn.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Jn.has(n)&&(qn.test(t)||Qn.test(t)||function(t){const e=Yn.exec(t);return!!e&&Hn.some(t=>e[1].startsWith(t))}(t)))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or data:image/… URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function tr(t){const e={};for(const n of Object.keys(t)){const r=Tn(n);if(Gt.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[Wt]=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[Wt]=Dn(t,{withUnits:!1})}}return e}function er(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)?l(l({},n),t):t,o=t[Wt];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=u(l({},e),{keyframes:e.keyframes.map(t=>u(l({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),u(l({},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 c=u(l({},s),{keyframes:s.keyframes.map(t=>u(l({},t),{value:u(l({},n),{[a]:t.value})}))});void 0!==c.value&&(c.value=u(l({},n),{[a]:c.value}));const f=l({},t);return delete f[a],u(l({},f),{transform:c})}function nr(t){const e=ce(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 rr(t){return ue(t)}function or(t){return fe(t)}function ir(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(de(t)||he(t))return!0;return!1}var ar=new WeakMap;function sr(t,e,n,r){let o=ar.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const a=he(t),s=de(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=Wn(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,ar.set(t,o)),o.set(e,f),f}function lr(t,e){var n,r,o;if(!ir(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:.5,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:5,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:32,c=[],f=nr(i[0]);if(!f)return t;const d=a?function(t,e){const n=nr(t),r=nr(e);if(!n||!r)return 0;const o=sr(t,e,n,r),i=Ln(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(cr(rr(i[0]),hr(fr(i[0]),fr(i[0]),0,f,d,a)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=nr(e),o=nr(n);r&&o?(a&&t>0&&mr(c,e,n,r,o,l),vr(c,e,n,r,o,a,s,l,u)):c.push(cr(rr(n),hr(fr(n),fr(n),1,null!=o?o:[0,0],void 0,a)))}const h=or(i[i.length-1]);h&&(c[c.length-1].e=h),a&&ur(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function ur(t){let e;for(const n of t){const t=ce(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 fr(t){const e=ce(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function dr(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 hr(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]=dr(o,s,n))}return void 0!==o&&(a.rotate=o+pr(t,e,n)),a}function pr(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=dr(r,o,n);return"number"==typeof i?i:0}function mr(t,e,n,r,o,i){const a=t[t.length-1],s=ce(a),l=null==s?void 0:s.rotate;if("number"!=typeof l)return;const u=fr(e),c=l-pr(u,u,0),f=sr(e,n,r,o),d=Ln(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=rr(e),g=Math.min(m+gr,(m+rr(n))/2),v=hr(fr(e),fr(e),0,r,h,!0);t.push(cr(g,v))}var gr=.05;function vr(t,e,n,r,o,i,a,s,l){const u=sr(e,n,r,o),c=rr(e),f=rr(n),d=or(e),h=(p=d)?An([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=fr(e),g=fr(n),v=function(t,e,n,r,o){const i=[];yr(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),yr(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++)br(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=Gn(u.lut,t),n=Rn(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Rn(h(n),0,1),p:n,pos:Bn(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=Ln(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?Rn((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=hr(m,g,n.p,n.pos,n.rotateDeg,i);t.push(cr(l,u)),b=a,k=n.u}}function yr(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 br(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=Bn(r.P0,r.P1,r.P2,r.P3,t),c=Bn(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=Bn(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=Bn(r.P0,r.P1,r.P2,r.P3,l),p=Bn(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(kr(d,u,c),kr(h,u,c),kr(p,u,c));let g=!0;if(o){const n=Ln(r.P0,r.P1,r.P2,r.P3,t),o=Ln(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,br(t,l,n,r,o,i,a,s),br(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 Ar(t,e){const n=wr(t,e);return null!=n?n:t}function wr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=wr(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=er(o,t.transform),i=n.transform;if(i&&"object"==typeof i&&ir(i)){const t=lr(i,e);t!==i&&(r=u(l({},n),{transform:t}))}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var xr=1;function jr(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=>jr(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 _r(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 zr(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Dr(t,e,n,r){var o,i;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 Nr(t,e,n,r){var o,i,a,s,c;const f=e.length-1,d=Rn(null!=(o=n.segmentCount)?o:f,1,f);let h;h=n.repeatAt===Dt.start?e.slice(0,d+1):e.slice(f-d);const p=null!=(i=e[0].t)?i:0,m=null!=(a=e[e.length-1].t)?a:0;let g,v;n.repeatAt===Dt.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!=(c=h[h.length-1].t)?c:0)-b;if(k<=0)return e;const A=h.map(t=>({relT:(t.t-b)/k,v:t.v,e:t.e,tangentIn:de(t),tangentOut:he(t)})),w=Math.floor(y/k),x=y-w*k,j=x/k,O=[],S=n.repeatAt!==Dt.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=Dr(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(jr(s.v,r.v)){O.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(P=r.e,_=!0);continue}O.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:e+r.relT*k+(l?1:0),v:r.v,e:n<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),O.push(u)}}if(n.repeatAt===Dt.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=Dr(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===Nt.alternate&&w%2==0,j)}for(let t=0;t<w;t++){const e=w-1-t,r=n.direction===Nt.alternate&&e%2==0;z(g+x+t*k,r)}}else{for(let t=0;t<w;t++){const e=n.direction===Nt.alternate&&t%2==0;z(g+t*k,e)}if(j>1e-9){const t=n.direction===Nt.alternate&&w%2==0;z(g+w*k,t,j)}}if(n.repeatAt===Dt.start)return[...O,...e];if(_&&e.length>0){return[...e.slice(0,-1),u(l({},e[e.length-1]),{e:P}),...O]}return[...e,...O]}function Ir(t,e,n,r){var o;const i=e.keyframes||[],a=[];for(const e of i){const n=ue(e);let i=ce(e);const s=fe(e);"d"===t&&(i=Pr(i));const l=Cn(t)?Un(t):t;Pn.has(l)&&(i=null!=(o=Mn(i))?o:i);const u={t:n,v:i,e:_r(s,r)},c=de(e),f=he(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?Nr(t,a,l,n):a}function Tr(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=Cn(t)?Un(t):t,s=Pn.has(a),l=i.map(e=>{var n;const r=ue(e);let o=ce(e);"d"===t&&(o=Pr(o)),s&&(o=null!=(n=Mn(o))?n:o);const i={t:r,v:o,e:fe(e)},a=de(e),l=he(e);return a&&(i.tangentIn=a),l&&(i.tangentOut=l),i}),u={keyframes:Nr(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function Cr(t,e){const n=Er(t,e);return null!=n?n:t}function Er(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Er(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=Tr(n,o,e);i!==o&&(r||(r=l({},t)),r[n]=i)}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var Ur=0;function Rr(t,e=bt.native){const n=Ht(t)||{},r=re(t),o=n.duration||1e3,i=[],a=(t,n,i)=>{if(0===n.length)return null;const a=function(t,e,n,r=bt.native){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=Ir(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===bt.native&&"transform"===i?lr(t):t}}return o}(er(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=oe(t);if(s)for(const t of s){const e=t.target.startsWith("#")?t.target.slice(1):t.target,n=t.animateWith.map(t=>zr(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_"+ ++Ur;t.id=n;const o=a(n,function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=zr(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=zr(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 Br(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=Rn(f,0,1);const v=fe(u);if(v&&Array.isArray(v))try{f=An(v)(f)}catch(t){}let y=Cn(t)?Un(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(ir(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=sr(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=Bn(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=Ln(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 Fr(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Br(r,o,e);t&&(n[t.k]=t.v)}return n}var Lr=/[MmLlHhVvCcSsQqTtAaZz]/;function Vr(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 Wr(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=Wn(a,t,e,r,48);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];Lr.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}=Vr([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}=Vr([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]=Bn(o.P0,o.P1,o.P2,o.P3,a),[u,c]=Ln(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}function Gr(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 Zr(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(Jr),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 Kr(t,e,n,r){var o,i,a,s;const u=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=u(n.value));const c=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,f=l({},c||{}),d={keyframes:n.keyframes};void 0!==n.loop&&(d.loop=n.loop),void 0!==n.autoOrient&&(d.autoOrient=n.autoOrient),f[e]=d,t.animate=f;const h=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==h&&(t[e]=u(h))}function Jr(t){if(!t||"object"!=typeof t)return t;const e=t;if(void 0===e.t&&void 0===e.v&&void 0===e.e&&void 0===e.to&&void 0===e.ti)return t;const n=l({},e);return void 0===n.time&&void 0!==e.t&&(n.time=e.t),void 0===n.value&&void 0!==e.v&&(n.value=e.v),void 0===n.easing&&void 0!==e.e&&(n.easing=e.e),void 0===n.tangentOut&&void 0!==e.to&&(n.tangentOut=e.to),void 0===n.tangentIn&&void 0!==e.ti&&(n.tangentIn=e.ti),n}function Xr(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function qr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(qr);const e={};for(const n of Object.keys(t))e[n]=qr(t[n]);return e}function Qr(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 Yr(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Hr(t){var e;const n=Yr(t.x),r=Yr(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 $r(t,e){return"_lw_"+e+"_"+t.nextId++}function to(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function eo(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>eo(t,e))}var no=qr;function ro(t){const e=Zr(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 oo(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 io=t=>Math.round(1e3*t)/1e3;function ao(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Wr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=ro(e.startOffset),s=ro(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"+io(e)+","+io(n)+"L"+io(d.x)+","+io(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"+io(t)+","+io(e)}return{d:p,startShift:c}}function so(t,e,n){var r;if(!e||"string"!=typeof e.pathData||!e.pathData)return t;const o=$r(n,"tpath"),{d:i,startShift:a}=ao(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:oo(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),lo(s,"startOffset",function(t,e){if(!e||null==t)return t;const n=Zr(t);if("absent"===n.kind)return t;if("static"===n.kind)return"number"==typeof t?n.value+e:{value:n.value+e};const r={keyframes:n.keyframes.map(t=>u(l({},t),{value:(Number(t.value)||0)+e}))};return void 0!==n.loop&&(r.loop=n.loop),void 0!==n.autoOrient&&(r.autoOrient=n.autoOrient),void 0!==n.base&&(r.value=n.base+e),r}(e.startOffset,a)),lo(s,"textLength",e.textLength),t.children=[s],t}function lo(t,e,n){null!=n&&Kr(t,e,Zr(n),{asString:!0})}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 co(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function fo(t,e){let n="";for(let r=0;r<t.length;r++){const o=co(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function ho(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var po=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function mo(t,e,n=2){const r=[];let o;for(po.lastIndex=0;null!==(o=po.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]=ho(e,s(),s());i+=t+fo([r,o],n)}else if("C"===t){const[t,r]=ho(e,s(),s()),[o,a]=ho(e,s(),s()),[l,u]=ho(e,s(),s());i+="C"+fo([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=ho(e,s(),s()),[o,a]=ho(e,s(),s());i+="Q"+fo([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var go=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",Lt,"xml:space"],vo=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],yo=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function bo(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function ko(t){return"string"==typeof t?t:void 0}function Ao(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of yo)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function wo(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=ko(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=bo(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=bo(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=bo(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=bo(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:Ao(t))?c:e.animate};for(const t of vo){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function xo(t){var e,n,r;return{fontFamily:ko(t.fontFamily),fontSize:null!=(e=bo(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=bo(t.letterSpacing))?n:0,wordSpacing:null!=(r=bo(t.wordSpacing))?r:0}}function jo(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 vo)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function Oo(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 So(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function Mo(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 Po(t,e){var n,r,o;const{glyphs:i,create:a=uo,warnings:s}=e,l=So(i),u={x:null!=(n=bo(t.x))?n:0,y:null!=(r=bo(t.y))?r:0},c=[],f=[{start:u.x,end:u.x}];let d=0;const h=(t,e)=>{var n;const r=Oo(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=jo(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:.6*o;c.push({glyphD:Mo(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=wo(t,e),a=bo(t.x),s=bo(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=bo(t.dx))?n:0,u.y+=null!=(r=bo(t.dy))?r:0;const l=ko(t[Lt]);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=xo(t);if(t.children)for(const e of t.children)p(e,m);const g=ko(t[Lt]);g&&!(null==(o=t.children)?void 0:o.length)&&h(g,m);const v=ko(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 Fo(t,Bo(c,a,s),a)}function _o(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=Wr(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=So(i),c=[];let f=0;const d=(t,e)=>{var n,r;const o=wo(t,e),s=ko(t[Lt]);if(s&&!(null==(n=t.children)?void 0:n.length)){const t=Oo(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,xo(t));const h=f,p=Zr(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=Zr(null==s?void 0:s.startOffset),{along:y,perp:b}=Do(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=So(s),f={x:null!=(r=bo(t.x))?r:0,y:null!=(o=bo(t.y))?o:0},d=[],h=[{start:f.x,end:f.x}];let p=0;const m=(t,e)=>{var n;const r=Oo(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);d.push({x:f.x,y:f.y,width:l,ascent:a,fontSize:e.fontSize,line:p}),f.x+=l,h[p].end=f.x}},g=(t,e)=>{var n,r,o;const i=wo(t,e),a=bo(t.x),s=bo(t.y);void 0!==a&&(f.x=a,p=h.length,h.push({start:f.x,end:f.x})),void 0!==s&&(f.y=s),f.x+=null!=(n=bo(t.dx))?n:0,f.y+=null!=(r=bo(t.dy))?r:0;const l=ko(t[Lt]);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=xo(t);if(t.children)for(const e of t.children){const t=d.length;if(g(e,v),d.length===t){const t=wo(e,v),n=Oo(t,s,u),r=(null==n?void 0:n.unitsPerEm)||1e3;d.push({x:f.x,y:f.y,width:0,ascent:(null!=(i=null==n?void 0:n.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:p})}}const y=ko(t[Lt]);y&&!(null==(a=t.children)?void 0:a.length)&&m(y,v);const b=ko(t.textAnchor);if("middle"===b||"end"===b)for(const t of d){const e=h[t.line].end-h[t.line].start;t.x+="middle"===b?-e/2:-e}return d.map(t=>{var e=t,{line:n}=e;return c(e,["line"])})}function zo(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 Do(t){var e,n,r;return{along:(null!=(e=bo(t.x))?e:0)+(null!=(n=bo(t.dx))?n:0),perp:null!=(r=bo(t.dy))?r:0}}function No(t,e,n,r,o,i){const{glyphs:a,create:s=uo,warnings:c}=r,f=e?Wr(e):null;if(!f)return null==c||c.push("textGlyphs: unparsable along-path geometry"),null;const d=So(a),{cells:h,width:p}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u;const c=wo(t,s),f=ko(t[Lt]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=Oo(c,e,n,r);if(t){const e=c.fontSize/t.unitsPerEm,n=null!=(u=t.ascent)?u:.9*t.unitsPerEm,r=jo(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:.6*t.unitsPerEm,s=a*e;o.push({glyphD:Mo(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,xo(t)),{cells:o,width:i}}(t,a,d,c);if(!h.length)return Fo(t,[],s);const{along:m,perp:g}=Do(t),v=Io(n),y=Io(o),b=t=>t>0&&p>0?t/p:1,k="clip"===i&&!f.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 Fo(t,function(t,e,n,r,o,i,a,s=0){const c=Math.max(e.totalLength/To,.5),f=t=>t>=0&&t<=e.totalLength,d=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=mo(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:[Eo(r-s*l,3),Eo(o+s*a,3)],rotate:Eo(180*i/Math.PI,3)}}},g=[],v=[],y=(t,e)=>{g.push(m(t,e)),a&&v.push({time:e,value:f(t)?1:0})};y(n(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(h,e),a=n(h,o),s=Math.min(Co,Math.max(1,Math.ceil(Math.abs(a-i)/c)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);y(n(h,r),r)}}ur(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}d.push(i("path",u(l(l({d:p},Uo(h.paint)),Ro(h.isMissing)),{animate:k}),[]))}return d}(h,f,n,e,r,s,k,g),s)}const A=b(y.at(0)),w=m+v.at(0);return Fo(t,Bo((k?h.filter(t=>{const e=w+t.midBase*A;return e>=0&&e<=f.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:zo(f,w+t.midBase*A,t.scale,t.widthEm,g)})),s,c),s)}function Io(t){var e;const n=Zr(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 To=48,Co=64;function Eo(t,e){const n=a(10,e);return Math.round(t*n)/n}function Uo(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 vo)void 0!==t[n]&&(e[n]=t[n]);return e}function Ro(t){return t?{[Vt]:"px-missing-glyph"}:{}}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=mo(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",l(l(l({d:n},Uo(t)),Ro(i)),void 0!==t.animate?{animate:l({},t.animate)}:{}),[]));return o}function Fo(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===go.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=l({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function Lo(t,e){return e.alongPath?No(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Po(t,e)}function Vo(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=Go(r,e.origin,!0),r=Wo(r,"scale",e.scale,n),r=Wo(r,"skew",e.skew,n),r=Wo(r,"rotate",e.rotate,n),r=Go(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=Wo(r,"translate",e.translate,n):(r=Go(r,e.origin,!0),r=Wo(r,"translate",e.translate,n),r=Go(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function Wo(t,e,n,r){if(void 0===n)return t;const o=Zr(n);if("static"===o.kind)return{type:"g",transform:{value:Gr(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>Xr(t,Gr(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 Go(t,e,n){if(void 0===e)return t;const r=Zr(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=>Xr(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function Zo(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=to(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=>Zo(t,e,n))}function Ko(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=Xo(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const u=void 0!==(null==e?void 0:e.translate),c=a||u,f=a&&Xo((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&Xo((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=Jo(i.full),r=Jo(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);c?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)?f&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=l({},r);delete e.translate;const n=Object.keys(e).length>0;c||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=Xo(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let u=t;u=Vo(u,s,o);let c={type:"g",id:n,children:[{type:"g",id:r,children:[u]}]};return void 0!==i.transform&&(c.transform=i.transform),void 0!==i.animate&&(c.animate=i.animate),a&&(delete c.id,c=Vo(c,a,o),c.id=n),c}function Jo(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 Xo(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 qo(t,e,n,r){if(!e)return t;const o=$r(n,"grad"),i=function(t,e){const n={type:t.type===Qt.radial?"radialGradient":"linearGradient",id:e};t.type===Qt.linear?(Qo(n,"x1","y1",t.start),Qo(n,"x2","y2",t.end)):(Qo(n,"cx","cy",t.center),function(t,e,n){const r=Zr(n);if("absent"===r.kind)return;Kr(t,e,r,{asString:!0})}(n,"r",t.radius),Qo(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=Zr(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(Yo):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=ce(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=ce(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:Ho(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=ue(r),u=ce(r),c=null!=(i=null==u?void 0:u[n])?i:Ho(e,e.indexOf(r),n);if(!c)continue;const f=fe(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:$o(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 Qo(t,e,n,r){var o,i,a;const s=Zr(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 Yo(t){return{type:"stop",offset:$o(t.offset),stopColor:t.color}}function Ho(t,e,n){for(let r=e;r>=0;r--){const e=ce(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=ce(t[r]);if(null==e?void 0:e[n])return e[n]}}function $o(t){return Math.round(1e3*t)/10+"%"}function ti(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function ei(t,e,n,r){if(!e)return t;const o=to(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=$r(r,"mask");let a={type:"use",href:"#"+o};if(n)a=ni(a,n,r);else if(ai(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],c=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=Xr(t,void 0);if(Array.isArray(e.translate)&&a.push(u(l(l({},r),ii(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(u(l({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),c.push(u(l({},r),{value:t}))}}const f=null==o?void 0:o.loop,d=t=>{const e={keyframes:t};return void 0!==f&&(e.loop=f),e};let h=t;a.length&&(h={type:"g",animate:{transform:d(a)},children:[h]});s.length&&(h={type:"g",animate:{transform:d(s)},children:[h]});c.length&&(h={type:"g",animate:{transform:d(c)},children:[h]});return h}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const 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=ni(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||ai(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,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=si(l),n=si(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=li(l,t),n=li(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const c={type:"mask",id:i,children:[a]};return e.maskType&&(c.maskType=e.maskType),e.maskUnits&&(c.maskUnits=e.maskUnits),e.maskContentUnits&&(c.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(c.x=String(e.x)),void 0!==e.y&&(c.y=String(e.y)),void 0!==e.width&&(c.width=String(e.width)),void 0!==e.height&&(c.height=String(e.height)),r.defs.push(c),t.mask="url(#"+i+")",t}function ni(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=Zr(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=ri(o,"translate",e.translate,void 0,n),o=ri(o,"rotate",e.rotate,r,n),o=ri(o,"scale",e.scale,r,n),o}function ri(t,e,n,r,o){if(void 0===n)return t;const i=Zr("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:Gr(e,oi(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=Xr(t,Gr(e,oi(e,t.value),r));return"translate"===e?l(l({},n),ii(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 ii(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 ai(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function si(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 li(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=ui(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function ui(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 fi(t,e,n){if(!e)return;const r=to(e.source);if(!r)return void(e.without===Ct.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===Ct.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function di(t,e){const n={};return void 0!==t.translate&&(n.translate=hi(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=hi(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=hi(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 hi(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function hi(t,e,n=!1){const r=Zr(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return("number"==typeof t||Array.isArray(t))&&!n?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?u(l({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}function pi(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function mi(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-1),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+1,value:0}],a=l({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function gi(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 yi(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 bi(t,e,n){const r=to(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=ki(r,e,n,new Set);o&&(t.href="#"+o)}function ki(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=no(o);if(function(t,e){Qr(t,()=>$r(e,"retimed"))}(i,n),"use"===o.type?wi(i,e.start,e.stretch):Ai(i,e.start,e.stretch),yi(i),"use"===o.type&&o.href){const a=to(o.href);if(a){const s=vi(o),l=s?gi(pi(s),e):e,u=new Set(r);u.add(t);const c=ki(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=to(t.href);if(i){const a=gi(pi(s),e),l=new Set(r);l.add(o);const u=ki(i,a,n,l);u&&(t.href="#"+u)}yi(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 Ai(t,e,n){var r;wi(t,e,n),null==(r=t.children)||r.forEach(t=>Ai(t,e,n))}function wi(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 xi(t,e,n){if(!e)return t;const r=e.subPaths===Ft.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*Ri,d=o*Ri,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=Ei(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const e of t.subpaths)r||(a=0),e.startOffsetPx=a,a+=e.lengthPx;const c=a;if(r&&c<.001)return t;const f=Zr(e.offset),d="absent"===f.kind?{kind:"static",value:0}:f,h=function(t){const e=Zr(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:ue(t),value:ce(t),easing:fe(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=Ti(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=Ci(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=Ci(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=ce(n);"number"==typeof t&&e.push(t)}return e}(d),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?c:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=Mi(n,e,r),s=Pi(e,r),u=l({},t);return delete u.effects,Di(u,"strokeDasharray",zi(i,s)),Di(u,"strokeDashoffset",zi(o,a)),Di(u,"strokeOpacity",Ii(i)),u}(e.leaf,i,a,g,d,p)}const v=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?c:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...Oi(t.leaf,o.subpath,i,a,g,d,p,n))}v.set(t.leaf,ji(t.leaf,e))}const y=t=>{const e=v.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?u(l({},t),{children:t.children.map(y)}):t)};return y(t)}function ji(t,e){const n=u(l({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Oi(t,e,n,r,o,i,a,s){const l=Mi(r,n,o),u=Pi(n,o),c=zi(i,l),f=zi(a,u),d=Ii(a),h=function(t){return{type:"path",d:t}}(pn(e));return Di(h,"strokeDasharray",f),Di(h,"strokeDashoffset",c),Di(h,"strokeOpacity",d),[h]}var Si=1;function Mi(t,e,n){const[r]=_i(n);return n=>e*(-n-r+t)+Si}function Pi(t,e){const[n,r]=_i(e),o=r-n+1;return e=>{const n=Rn(e[0],0,1),r=Rn(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=Si;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+Si),s}}function _i(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function zi(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:ue(t),value:e(ce(t)),easing:fe(t)})),loop:t.loop}}function Di(t,e,n){n&&Kr(t,e,n)}var Ni=10;function Ii(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(ce(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=ue(r),l=e(ce(r)),u=o?l&&e(ce(o)):l,c=a?l&&e(ce(a)):l;u&&!c?(i.push({time:s,value:0}),i.push({time:s+Ni,value:1})):!u&&c&&(i.push({time:s-Ni,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function Ti(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 Ci(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 Ei(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+=Ui(t,r,r+1);return t.c&&e.length>1&&(n+=Ui(t,e.length-1,0)),n}function Ui(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=Wn(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 Ri=.5522847498307936;function Bi(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:At(null==(e=Ht(t))?void 0:e.engine),glyphs:null==(n=re(t))?void 0:n.fonts},o=no(t);eo(o,r.idMap),Zo(o,r,()=>$r(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=to(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(),eo(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=to(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=to(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;yi(t),bi(t,pi(n),e),r&&mi(t,r,e)}}(t,e),t}(Fi(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 Fi(t,e){t.children&&(t.children=t.children.map(t=>Fi(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?No(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?Po(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=so(m,h,e)),m=function(t,e,n){return qo(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return qo(t,e,n,"stroke")}(m,d,e),m=xi(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=no(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=no(l),o=di(e,t),i=o?Vo(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=ei(m,s,i,e),m=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=$r(n,"clip"),o={type:"path"},i=Zr(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=ti(i.value):(Kr(o,"d",i),void 0!==o.d&&(o.d=ti(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(fi(m,c,e),m=Ko(m,i,r,o,e)):m=function(t,e,n,r){return fi(t,e,r),Vo(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 Li(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 Vi(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Li(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Wi=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function Gi(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=ce(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=ce(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>t!==Zt&&t!==Jt&&t!==Kt))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=>de(t)||he(t)))return;let u="M"+Wi(s[0][0])+","+Wi(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=he(o[t]))?n:[0,0],l=null!=(r=de(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"+Wi(f[0])+","+Wi(f[1])+","+Wi(d[0])+","+Wi(d[1])+","+Wi(i[0])+","+Wi(i[1]),c.push(Vi(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:ue(o[t]),v:h/f},n=fe(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=l({},o);delete n[Wt];const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n.offsetDistance=a;const s=t.transform;let c=s;if(s&&"object"==typeof s){const t=l({},s);delete t[Zt],delete t[Jt],e.keyframesCarryRotate&&delete t[Kt],c=Object.keys(t).length?t:void 0}r=u(l({},t),{animate:n,style:u(l({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:Wi(e.anchor[0])+"px "+Wi(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==c?r.transform=c:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=u(l({},r),{children:t}))}return r};return e(t)}function Zi(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=Ji(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=qi(t.viewBox);if(e)return[e[2],e[3]];const n=Ki(t.width),r=Ki(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=Qi(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const c={type:"defs",children:a},f=[...null!=(e=s.children)?e:[],c];return u(l({},s),{children:f})}function Ki(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Ji(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Xi(t,e,n,r,o,i,a){var s,c,f,d;const h=qr(e);Qr(h,o);const p="symbol"===h.type?qi(h.viewBox):void 0,m=null!=(c=null!=(s=Ki(t.width))?s:null==p?void 0:p[2])?c:a[0],g=null!=(d=null!=(f=Ki(t.height))?f:null==p?void 0:p[3])?d:a[1],v="symbol"===h.type?function(t,e,n,r,o){const i=qi(t.viewBox),a=u(l({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,c,f,d]=i,h=f>0&&d>0?Math.min(r/f,o/d):1,p=(r-f*h)/2,m=(o-d*h)/2,g=[];0===p&&0===m||g.push("translate("+p+","+m+")");1!==h&&g.push("scale("+h+")");0===s&&0===c||g.push("translate("+-s+","+-c+")");g.length&&(a.transform=g.join(""));const v=e();return n.push({type:"clipPath",id:v,children:[{type:"rect",x:s,y:c,width:f,height:d}]}),a.clipPath="url(#"+v+")",a}(h,o,i,m,g):h,y=Qi(v,n,r,o,i,a),b=u(l({},t),{type:"g",children:[y]});return delete b.href,delete b.width,delete b.height,Hr(b)}function qi(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 Qi(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Ji(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return Xi(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Qi(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?u(l({},t),{children:s}):t}var Yi="transform",Hi=new Set(["reverse","alternate-reverse"]),$i=[0,.25,.5,.75,1];function ta(t,e){return void 0===t[e]&&(e!==Yi||ea(t))}function ea(t){if(void 0!==t[Yi])return!1;for(const e of _n)if(void 0!==t[e])return!1;return!0}function na(t,e,n){const r=Object.values(Fr({[e]:t[e]},n));return 1===r.length&&""!==r[0]?r[0]:void 0}function ra(t,e){const n={};for(const e of Object.keys(t))_n.has(e)&&(n[e]=t[e]);const r=Fr(n,e)[Yi];if(!r)return;const o=Nn(r.replace(/(px|deg)\b/g,""));return o&&Object.keys(o).length?o:void 0}function oa(t,e,n){if(!t||!e)return t===e;const r=(t,e)=>JSON.stringify(Fr(t,e)).replace(/\s+/g,"");return $i.every(o=>r(t,o*n)===r(e,o*n))}function ia(t,e){const n=fn(t),r=new Map;for(const[t,e]of aa(n))void 0===e.id&&(e.id="__px_rest_"+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 aa(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 sa(t,e,n){var r,o;let i=Bi(t).root;i=Gi(i);return i=Cr(i,null!=(o=null==(r=Ht(i))?void 0:r.duration)?o:Ot),e===bt.native&&(i=Ar(i,null==n?void 0:n.motionPath),i=Zi(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=fn(t),i=Ht(o)||{},a=+(i.duration||Ot),s=Hi.has(String(i.direction))?a:0,l=aa(o);if(!l.size)return o;const u=ia(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(!ta(o,r))continue;const i=na(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))&&ea(o)){const n=ra(e,s);n&&(o[Yi]=n,c.set(t,[...null!=(r=c.get(t))?r:[],Yi]))}}if(c.size){const t=ia(o,e);for(const[e,n]of c){if(oa(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 la(t){var e;return dn(sa(t,At(null==(e=Ht(t))?void 0:e.engine)))}var ua=(t=>(t[t.buildFailed=1001]="buildFailed",t[t.invalidDocumentAtSrc=1002]="invalidDocumentAtSrc",t[t.loadFailed=1003]="loadFailed",t[t.animationBuildFailed=1004]="animationBuildFailed",t[t.effectsShape=1101]="effectsShape",t[t.timelineOverrideIgnored=1102]="timelineOverrideIgnored",t[t.blockedTag=1103]="blockedTag",t[t.unsupportedAnimatedAttrs=1104]="unsupportedAnimatedAttrs",t[t.noBindings=1105]="noBindings",t[t.unresolvedBinding=1106]="unresolvedBinding",t[t.triggersNoRoot=1201]="triggersNoRoot",t[t.noRootForSelector=1202]="noRootForSelector",t[t.noRootElement=1203]="noRootElement",t[t.noElementsForSelector=1206]="noElementsForSelector",t[t.setAttributeNoElement=1207]="setAttributeNoElement",t[t.scrollSmoothingNeedsOwnDriver=1301]="scrollSmoothingNeedsOwnDriver",t[t.scrollNativeUnavailable=1302]="scrollNativeUnavailable",t[t.scrollSubjectInvalid=1303]="scrollSubjectInvalid",t[t.scrollSubjectNoMatch=1304]="scrollSubjectNoMatch",t[t.scrollNoRootToObserve=1305]="scrollNoRootToObserve",t[t.scrollTriggerIgnored=1306]="scrollTriggerIgnored",t[t.rateRejected=1401]="rateRejected",t[t.controlPropsConflict=1501]="controlPropsConflict",t[t.rnCompileFailed=1601]="rnCompileFailed",t[t.rnRenderFailed=1602]="rnRenderFailed",t[t.rnBoundaryCaught=1603]="rnBoundaryCaught",t[t.rnUnsupported=1604]="rnUnsupported",t))(ua||{}),ca={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"};function fa(t){return"PX"+t+" https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md#px"+t}function da(t,e){const n=e?e+" ":"";return{warn:(e,r,...o)=>{const i=fa(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=fa(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)}}}function ha(t){try{return{problems:en(t)}}catch(t){return{problems:[]}}}function pa(t,e){const{problems:n}=ha(t);if(!n.length)return;const r=n.slice(0,6),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.")}export{l as __spreadValues,u as __spreadProps,c as __objRest,f as PX_UNKNOWN_KEY_ERROR,D as schemaKeys,N as describeSchema,T as px,C as PX_WIRE_SCHEMA_VERSION,E as PX_WIRE_VERSION_KEY,R as PxWireVersionRelation,F as parseWireVersion,L as formatWireVersion,V as PX_WIRE_VERSION,Z as readWireVersion,K as compareWireVersion,J as wireVersionAdvice,X as PxWireStepKind,q as PX_WIRE_BASELINE_VERSION,Q as PX_WIRE_STEPS,Y as applyWireSteps,H as convertWireDocument,et as downgradeWireDocument,nt as PxFillMode,rt as PxPlaybackDirection,ot as PX_ANIM_SRC_ATTR_NAME,it as PX_ANIM_ATTR_NAME,at as PxTriggerStart,st as PxOffScreenAction,lt as PxMouseOutAction,ut as PxFinishAction,ct as PxScrollKind,ft as PxScrollAxis,dt as PxScrollSource,ht as PxPinAlign,pt as PxScrollPhase,mt as PxAlongPathMode,gt as PX_TIMELINE_SHARED_KEYS,vt as PX_TIME_ONLY_TIMELINE_KEYS,bt as PxTimelineEngine,kt as PxTimelineEngineSetting,At as resolveTimelineEngine,wt as isNativeForced,xt as mayUseNativeScrollTimeline,jt as PX_TRIGGER_DEFAULTS,Ot as PX_DEFAULT_DURATION_MS,St as PX_DEFAULT_ITERATIONS,Mt as PxControlMode,Pt as resolveControlMode,_t as controlModeTakesOverTrigger,zt as resolveTrigger,Dt as PxLoopRepeatAt,Nt as PxLoopDirection,It as PxMaskType,Tt as PxUnits,Ct as PxCloneWithout,Et as PxPathOverflow,Ut as PxLengthAdjust,Rt as PxTextPathMethod,Bt as PxTextPathSpacing,Ft as PxStrokeTrimSubPaths,Lt as PX_TEXT_CONTENT_ATTR,Xt as PX_TRANSFORM_PART_KEYS,qt as PxGradientSpreadMethod,Qt as PxGradientType,Yt as isPxDocument,Ht as getAnimatorConfig,ee as flattenAnimatorTimeline,ne as nestAnimatorTimeline,re as getDefinitions,oe as getBindings,ie as getChildren,se as PxKeyframeValueSchema,le as PxKeyframeSchema,ce as keyframeValue,fe as keyframeEasing,pe as PxLoopSchema,me as PxPropertyAnimationSchema,ge as PxTransformPartsSchema,ve as PxTransformValueSchema,be as PxElementAnimationSchema,ke as PxTriggerSchema,xe as PxDefinitionsSchema,je as PxScrollRangePointSchema,Oe as PxScrollRangeSchema,Se as PxScrollSchema,_e as PxTimeTimelineSchema,Ie as PxTimelineSchema,Ce as PxAnimatorConfigSchema,Ee as PxAttrValueSchema,Fe as PxTransformByEffectSchema,Le as PxRepeaterEffectSchema,Ve as PxMaskedByEffectSchema,We as PxClipPathEffectSchema,Ge as PxStrokeTrimEffectSchema,Ze as PxRetimeEffectSchema,Ke as PxCloneEffectSchema,Je as PxGradientStopSchema,qe as PxFillGradientEffectSchema,Ye as PxTextPathEffectSchema,He as PxTextEffectSchema,$e as PxEffectsSchema,tn as validateNodeEffects,en as validateDocument,nn as PxNodeBaseSchema,rn as PxNodeSchema,on as PxSvgNodeRootSchema,an as PxAnimatedSvgDocumentSchema,sn as PxBezierPathSchema,ln as isValidPxDocument,cn as generateUniqueId,fn as deepClone,dn as generateNewIds,pn as bezierToSvgPath,An as cubicBezier,xn as subdivideCubicBezier,jn as splitEasing,On as reverseEasing,Sn as toRGBA,Pn as PX_COLOR_ATTR_NAMES,_n as PX_TRANSFORM_FN_NAMES,zn as PX_PCT_BASED_ATTR_NAMES,Dn as composeTransformParts,In as PX_STYLE_ATTR_NAMES,Tn as kebabToCamelCaseWord,Un as camelCaseToKebabWordIfNeeded,Rn as clamp,Zn as PX_DISALLOWED_SVG_TAGS_LOWER,Xn as PX_CSS_ONLY_STYLE_PROPS,$n as sanitizeAttributeValue,tr as toDomProps,er as mergeStaticTransformIntoAnimDef,lr as materializeMotionPathInPropAnim,xr as PX_LOOP_JUMP_SHIFT_MS,Dr as interpolateValue,Rr as normalizeBindings,Fr as calcAnimationValues,Wr as createPathSampler,ao as extendedPathForBrowser,_o as layoutGlyphTextChars,No as materializeGlyphTextAlongPath,Lo as materializeGlyphText,Bi as materializeNodeEffects,sa as materializeAllInTree,la as prepareDocumentForRender,ua as PxDiagnosticCode,ca as PxDiagnosticKind,da as createDiagnostics,ha as diagnoseDocument,pa as reportDocumentDiagnostics};