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