@pixodesk/svg-animator-web 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,s=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&i(t,n,e[n]);if(r)for(var n of r(e))a.call(e,n)&&i(t,n,e[n]);return t},l=(t,r)=>e(t,n(r));function u(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function c(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};if(void 0!==e.value)return{kind:"static",value:e.value}}return{kind:"static",value:t}}function f(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 d(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=h(r,"skew",e.skew,n),r=m(r,e.origin,!0),r=h(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=h(r,"rotate",e.rotate,n),r=m(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=h(r,"translate",e.translate,n):(r=m(r,e.origin,!0),r=h(r,"translate",e.translate,n),r=m(r,e.origin,!1)),r}function h(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=c(n);return"static"!==e.kind?(r.warnings.push("transformation.skew: only static skew is supported"),t):{type:"g",transform:"skewX("+e.value[0]+")skewY("+e.value[1]+")",children:[t]}}const o=c(n);if("static"===o.kind)return{type:"g",transform:{value:u(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>f(t,u(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),{type:"g",animate:{transform:n},children:[t]}}return t}function m(t,e,n){if(void 0===e)return t;const r=c(e),o=t=>n?[-t[0],-t[1]]:t;return"absent"===r.kind?t:"static"===r.kind?0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]}:"animated"===r.kind?{type:"g",animate:{transform:{keyframes:r.keyframes.map(t=>f(t,{translate:o(t.value)}))}},children:[t]}:t}function p(t,e,n){var r,o,a;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.ref)?void 0:o.type)){const r=t.effects.ref.baseId;"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(a=t.children)||a.forEach(t=>p(t,e,n))}function y(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=g(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),a.animate={transform:r};const o=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),l=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&&!o||(r.origin=e.origin);const a={value:r};return void 0!==t.time&&(a.time=t.time),void 0!==t.easing&&(a.easing=t.easing),a});l.every(t=>0===Object.keys(t.value).length)?(delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate):t.animate.transform={keyframes:l},i=!0}}const l=void 0!==(null==e?void 0:e.translate),u=i||l,c=i&&g((null==(r=t.animate)?void 0:r.transform)||void 0)||i&&g((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=v(a.full),r=v(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=g(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=d(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=d(u,i,o),u.id=n),u}function v(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 g(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 b(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var k=class{_canSanitize(t){return this.isValid(t)}optional(){return new A(this)}},A=class extends k{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)}},w=class extends k{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(b(null!=n?n:[])+": expected string, got "+typeof t),!1)}},j=class extends k{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(b(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},O=class extends k{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(b(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},x=class extends k{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(b(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},P=class extends k{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(b(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},S=class extends k{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(b(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))}},M=class extends k{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(b(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)}},_=class extends k{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(b(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(b(o)+": unexpected extra key"),o.pop(),a=!1);return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},I=class extends k{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=s({},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(b(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)}},z=class extends k{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(b(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)}},C=class extends k{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(b(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)}},N=class extends k{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},E=class extends k{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)}},T=class extends k{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(b(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 U(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function V(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 R={string:(t="")=>new w(t),number:(t=0)=>new j(t),boolean:(t=!1)=>new O(t),literal:t=>new x(t),enum:(t,e)=>new P(t,e),union:(t,e)=>new S(t,e),discriminatedUnion:(t,e)=>new M(t,e),object:t=>new _(t),openObject:(t,e)=>new I(t,e),extendedObject:(t,e)=>new _(s(s({},t._shape),e)),array:t=>new z(t),record:t=>new C(t),any:()=>new N,tuple:t=>new T(t),lazy:(t,e)=>new E(t,e)},F="data-px-animation-src",L="_px_animator",D={auto:"auto",webapi:"webapi",frames:"frames"},B={webapi:D.webapi,frames:D.frames},W="text",q="textContent",K=new Set(["type","children","animator","meta","animate",W,q]),X=R.union([R.string(),R.tuple([R.number(),R.number(),R.number(),R.number()])]),Y=(R.union([R.string(),R.number(),R.array(R.number()),R.lazy(()=>$,{}),R.object({path:R.string()}),R.lazy(()=>R.object({paths:R.array(Mt)}),{paths:[]})]),R.object({time:R.number().optional(),t:R.number().optional(),value:R.any().optional(),v:R.any().optional(),easing:X.optional(),e:X.optional(),tangentOut:R.tuple([R.number(),R.number()]).optional(),to:R.tuple([R.number(),R.number()]).optional(),tangentIn:R.tuple([R.number(),R.number()]).optional(),ti:R.tuple([R.number(),R.number()]).optional(),selected:R.boolean().optional()})),Z=R.object({segmentCount:R.number().optional(),before:R.boolean().optional(),alternate:R.boolean().optional()}),G=R.object({keyframes:R.array(Y).optional(),kfs:R.array(Y).optional(),loop:R.union([Z,R.boolean()]).optional(),autoOrient:R.boolean().optional()}),J=["translate","rotate","scale","origin"],$=R.object({translate:R.tuple([R.number(),R.number()]).optional(),rotate:R.number().optional(),scale:R.tuple([R.number(),R.number()]).optional(),origin:R.tuple([R.number(),R.number()]).optional()}),H=R.union([R.string(),R.object({value:$}),G]),Q=R.record(G),tt=R.union([R.string(),R.array(R.union([R.string(),Q])),Q]),et=R.object({startOn:R.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:R.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:R.number().optional()}),nt=R.object({easings:R.record(R.tuple([R.number(),R.number(),R.number(),R.number()])).optional(),animations:R.record(Q).optional(),styles:R.record(R.any()).optional()}),rt=R.object({mode:R.enum([D.auto,D.webapi,D.frames]).optional(),duration:R.number().optional(),delay:R.number().optional(),iterations:R.union([R.number(),R.literal("infinite")]).optional(),fill:R.enum(["forwards","backwards","both","none"]).optional(),direction:R.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:R.number().optional(),trigger:et.optional(),definitions:nt.optional(),animate:R.record(tt).optional(),debug:R.boolean().optional(),debugInstName:R.string().optional()}),ot=R.object({id:R.string(),animate:tt}),at=R.union([R.string(),R.number(),R.object({value:R.any()}),G]),it=R.union([R.number(),R.object({value:R.number()}),R.object({keyframes:R.array(Y),autoOrient:R.boolean().optional()})]),st=R.union([R.tuple([R.number(),R.number()]),R.object({value:R.tuple([R.number(),R.number()])}),R.object({keyframes:R.array(Y),autoOrient:R.boolean().optional()})]),lt=R.object({translate:st.optional(),rotate:it.optional(),scale:st.optional(),skew:st.optional(),origin:st.optional()}),ut=R.object({copies:R.number().optional(),translate:st.optional(),rotate:it.optional(),scale:st.optional(),origin:st.optional()}),ct=R.object({href:R.string().optional(),maskType:R.string().optional(),maskUnits:R.string().optional(),maskContentUnits:R.string().optional()}),ft=R.object({offset:it.optional(),range:st.optional(),trimAllAsOne:R.boolean().optional()}),dt=R.object({baseId:R.string().optional(),start:R.number().optional(),stretch:R.number().optional(),timeCrop:R.tuple([R.number(),R.number()]).optional()}),ht=R.object({baseId:R.string().optional(),type:R.string().optional()}),mt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},pt={pad:"pad",reflect:"reflect",repeat:"repeat"},yt={linear:"linear",radial:"radial"},vt=R.object({offset:R.number(),color:R.string()}),gt=R.union([R.array(vt),R.object({value:R.array(vt)}),R.object({keyframes:R.array(Y)})]),bt=R.object({type:R.enum([yt.linear,yt.radial]),p1:R.tuple([R.number(),R.number()]).optional(),p2:R.tuple([R.number(),R.number()]).optional(),c:R.tuple([R.number(),R.number()]).optional(),r:R.number().optional(),fp:R.tuple([R.number(),R.number()]).optional(),stops:gt.optional(),gradientUnits:R.string().optional(),spreadMethod:R.string().optional(),gradientTransform:R.string().optional()}),kt=bt,At=R.object({href:R.string(),lengthAdjust:R.string().optional(),method:R.string().optional(),spacing:R.string().optional(),startOffset:it.optional(),textLength:it.optional()}),wt=R.object({transformation:lt.optional(),repeater:ut.optional(),maskedBy:ct.optional(),trimPath:ft.optional(),retime:dt.optional(),isCombinedShape:R.boolean().optional(),ref:ht.optional(),fillGradient:bt.optional(),strokeGradient:kt.optional(),textAlongPath:At.optional()});function jt(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!wt.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 Ot=R.openObject({type:R.string(),id:R.string().optional(),meta:R.any().optional(),effects:wt.optional(),animate:tt.optional(),style:R.union([R.string(),R.record(R.union([R.string(),R.number()]))]).optional()},at),xt=R.openObject(l(s({},Ot._shape),{children:R.lazy(()=>R.array(xt),[]).optional()}),at),Pt=R.object({width:R.number().optional(),height:R.number().optional(),viewBox:R.string().optional(),animator:rt.optional()}),St=R.openObject(l(s(s({},Ot._shape),Pt._shape),{type:R.literal("svg"),children:R.array(xt).optional()}),at),Mt=R.object({v:R.array(R.array(R.number())),i:R.array(R.array(R.number())).optional(),o:R.array(R.array(R.number())).optional(),c:R.boolean().optional()});function _t(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function It(t){const e=St.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function zt(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 Ct(t){var e;if(t)return null==(e=zt(t))?void 0:e.definitions}function Nt(t){var e;if(!t)return;const n=null==(e=zt(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Et(t){return null==t?void 0:t.children}function Tt(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Tt);const e={};for(const n of Object.keys(t))e[n]=Tt(t[n]);return e}function Ut(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 Vt(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Rt(t){var e;const n=Vt(t.x),r=Vt(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 Ft(t,e){return"_lw_"+e+"_"+t.nextId++}function Lt(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Dt(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Dt(t,e))}var Bt=Tt;function Wt(t,e,n,r){if(!e)return t;const o=Ft(n,"grad"),a=function(t,e){const n={type:t.type===yt.radial?"radialGradient":"linearGradient",id:e};t.type===yt.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);return n.children=function(t){var e,n,r,o;if(!t)return[];if(Array.isArray(t))return t.map(qt);if("object"==typeof t&&Array.isArray(t.value))return t.value.map(qt);const a=t.keyframes;if(!Array.isArray(a)||!a.length)return[];let i=0;for(const t of a){const n=null!=(e=t.value)?e:t.v;Array.isArray(n)&&n.length>i&&(i=n.length)}if(!i)return[];const s=null!=(n=a[0].value)?n:a[0].v,l=[];for(let t=0;t<i;t++){const e=null!=(o=null!=(r=null==s?void 0:s[t])?r:Kt(a,0,t))?o:{offset:t/Math.max(1,i-1),color:"#000000"};l.push({offset:e.offset,color:e.color})}return l.map((t,e)=>function(t,e,n){var r,o,a,i,s;const l=[],u=[];let c=!1;for(const f of e){const d=null!=(o=null!=(r=f.time)?r:f.t)?o:0,h=null!=(a=f.value)?a:f.v,m=null!=(i=null==h?void 0:h[n])?i:Kt(e,e.indexOf(f),n);if(!m)continue;const p=null!=(s=f.easing)?s:f.e,y={time:d,value:m.color};void 0!==p&&(y.easing=p),l.push(y);const v={time:d,value:m.offset};void 0!==p&&(v.easing=p),u.push(v),m.offset!==t.offset&&(c=!0)}const f={type:"stop",offset:Xt(t.offset),stopColor:t.color},d={};l.length&&(d.stopColor={keyframes:l});c&&u.length&&(d.offset={keyframes:u});Object.keys(d).length&&(f.animate=d);return f}(t,a,e))}(t.stops),n}(e,o);return n.defs.push(a),t[r]="url(#"+o+")",t}function qt(t){return{type:"stop",offset:Xt(t.offset),stopColor:t.color}}function Kt(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 Xt(t){return Math.round(1e3*t)/10+"%"}function Yt(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=Ft(r,"mask");let a={type:"use",href:"#"+e.href};if(n)a=Zt(a,n,r);else if($t(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=[],u=[],c=[];for(const t of a){const e=(null!=(n=t.value)?n:t.v)||{},r=f(t,void 0);if(Array.isArray(e.translate)&&i.push(l(s({},r),{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]]),u.push(l(s({},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(l(s({},r),{value:t}))}}let d=t;i.length&&(d={type:"g",animate:{transform:{keyframes:i}},children:[d]});u.length&&(d={type:"g",animate:{transform:{keyframes:u}},children:[d]});c.length&&(d={type:"g",animate:{transform:{keyframes: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,d,h;const m=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let p;const y=[];for(;null!==(p=m.exec(t));){const t=p[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);y.push({name:p[1],args:t})}if(!y.length)return;const v=y[y.length-1];if("translate"===v.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,d=null!=(n=c.args[1])?n:0,h=null!=(r=v.args[0])?r:0,m=null!=(o=v.args[1])?o:0;if(h!==-f||m!==-d)continue;const p={};p.origin=[f,d];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;p.translate=p.translate?[p.translate[0]+t,p.translate[1]+n]:[t,n]}for(let e=t+1;e<y.length-1;e++){const t=y[e];if("rotate"===t.name)p.rotate=(null!=(s=p.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;p.scale=p.scale?[p.scale[0]*e,p.scale[1]*n]:[e,n]}}return p}let g,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;g=g?[g[0]+e,g[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={};g&&(A.translate=g);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=Zt(a,e,r))}const i=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||$t(t))}(t);a=function(t,e,n,r,o){const a=r.idMap.get(n),i=r.maskAncestorChains.get(e)||[],s=o?ee(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=Ht(l),n=Ht(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=Qt(l,t),n=Qt(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,e.href,r,i);const u={type:"mask",id:o,children:[a]};return e.maskType&&(u.maskType=e.maskType),e.maskUnits&&(u.maskUnits=e.maskUnits),e.maskContentUnits&&(u.maskContentUnits=e.maskContentUnits),r.defs.push(u),t.mask="url(#"+o+")",t}function Zt(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=c(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=Gt(o,"translate",e.translate,void 0,n),o=Gt(o,"rotate",e.rotate,r,n),o=Gt(o,"scale",e.scale,r,n),o}function Gt(t,e,n,r,o){if(void 0===n)return t;const a=c("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);return"static"===a.kind?{type:"g",transform:{value:u(e,Jt(e,a.value),r)},children:[t]}:"animated"===a.kind?{type:"g",animate:{transform:{keyframes:a.keyframes.map(t=>f(t,u(e,Jt(e,t.value),r)))}},children:[t]}:t}function Jt(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function $t(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Ht(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 Qt(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=te(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function te(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 ee(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}function ne(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 l(s({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?l(s({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return l(s({},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 l(s({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?l(s({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return l(s({},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 l(s({},e),{keyframes:e.keyframes.map(t=>t&&void 0!==t.value?l(s({},t),{value:r(t.value)}):t)});if(void 0!==e.value)return l(s({},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 re(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function oe(t,e,n){const r=Lt(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=ae(r,e,n,new Set);o&&(t.href="#"+o)}function ae(t,e,n,r){var o,a;if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const i=n.idMap.get(t);if(!i)return void n.warnings.push('retime: target "'+t+'" not found');const s=Bt(i);if(function(t,e){Ut(t,()=>Ft(e,"retimed"))}(s,n),"use"===i.type?se(s,e.start,e.stretch):ie(s,e.start,e.stretch),(null==(o=s.effects)?void 0:o.retime)&&(delete s.effects.retime,0===Object.keys(s.effects).length&&delete s.effects),"use"===i.type&&i.href){const o=Lt(i.href);if(o){const c=null==(a=i.effects)?void 0:a.retime,f=c?(l=re(c),{start:(u=e).start+u.stretch*l.start,stretch:u.stretch*l.stretch}):e,d=new Set(r);d.add(t);const h=ae(o,f,n,d);h&&(s.href="#"+h)}}var l,u;return n.defs.push(s),"string"==typeof s.id&&n.idMap.set(s.id,s),"string"==typeof s.id?s.id:void 0}function ie(t,e,n){var r;se(t,e,n),null==(r=t.children)||r.forEach(t=>ie(t,e,n))}function se(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function le(t,e,n){if(null!=n)if("number"!=typeof n){if("object"==typeof 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=s({},n||{});return o[e]={keyframes:r.keyframes},void(t.animate=o)}if("number"==typeof r.value)return void(t[e]=String(r.value))}}else t[e]=String(n)}function ue(t){var e,n,r,o;const a=t.v,i=t.i,s=t.o,l=t.c;if(!a.length)return"";const u=[],c=a.length;u.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<c;t++){const r=a[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==i?void 0:i[t])?n:a[t],c=a[t];o[0]===r[0]&&o[1]===r[1]&&l[0]===c[0]&&l[1]===c[1]?u.push("L"+c[0]+","+c[1]):u.push("C"+o[0]+","+o[1]+","+l[0]+","+l[1]+","+c[0]+","+c[1])}if(l&&c>0){const t=a[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==i?void 0:i[0])?o:a[0],l=a[0];e[0]===t[0]&&e[1]===t[1]&&n[0]===l[0]&&n[1]===l[1]||u.push("C"+e[0]+","+e[1]+","+n[0]+","+n[1]+","+l[0]+","+l[1]),u.push("z")}return u.join("")}function ce(t,e,n){return t+(e-t)*n}function fe(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let a=0;a<o;a++)r[a]=ce(t[a]||0,e[a]||0,n);return r}function de(t,e,n){return[ce(t[0]||0,e[0]||0,n),ce(t[1]||0,e[1]||0,n),ce(t[2]||0,e[2]||0,n),ce(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function he(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let a=0;a<r;a++)o.push(me(t[a],e[a],n));return o}function me(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),m=[],p=[],y=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];m.push(fe(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(i=null==(a=e.i)?void 0:a[n])?i:h;p.push(fe(v,g,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;y.push(fe(b,k,d))}return{v:m,i:p.length?p:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:e.c}}function pe(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 ye(t){const[e,n,r,o]=t,a=3*n,i=3*(o-n)-a,s=1-a-i;return function(t){return n=pe(e,r,t),((s*n+i)*n+a)*n;var n}}function ve(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function ge(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=pe(n,o,e),s=[n,r],l=[o,a],{left:u,right:c}=function(t,e,n,r,o){const a=ve(t,e,o),i=ve(e,n,o),s=ve(n,r,o),l=ve(a,i,o),u=ve(i,s,o),c=ve(l,u,o);return{left:[t,a,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],i),f=u[3][0],d=u[3][1];let h,m;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 p=1-f,y=1-d;return p>1e-9&&Math.abs(y)>1e-9&&(m=[(c[1][0]-f)/p,(c[1][1]-d)/y,(c[2][0]-f)/p,(c[2][1]-d)/y]),{left:h,right:m}}function be(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function ke(t){const e=Math.round(255*t[0]),n=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+e+","+n+","+r+","+t[3]+")":"rgb("+e+","+n+","+r+")"}function Ae(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),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 we=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),je=new Set(["translate","rotate","scale","skew"]),Oe=new Set(["offset-distance","offsetDistance"]);function xe(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.scale,u=r?"px":"",c=r?"deg":"";return a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),i&&o.push("translate("+-i[0]+u+","+-i[1]+u+")"),o.join("")}var Pe=new Set(["offset-distance","offsetDistance"]);function Se(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Me(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var _e=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function Ie(t){return _e.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function ze(t,e,n){return Math.max(e,Math.min(t,n))}function Ce(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 Ee(t,e,n,r,o){const a=Te(t,e,n,r,o);if(0===a[0]&&0===a[1]){return Te(t,e,n,r,o<.5?o+Ne:o-Ne)}return a}function Te(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 Ue(t,e,n,r,o=100){const a=o+1,i=new Float64Array(a),s=new Float64Array(a);let l=Ce(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=Ce(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 Ve(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])}function Re(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 Fe(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function Le(t){var e;return null!=(e=t.easing)?e:t.e}function De(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 Be=new WeakMap;function We(t,e,n,r){var o,a;const i=Be.get(t);if(i)return i;const s=null!=(o=t.tangentOut)?o:t.to,l=null!=(a=e.tangentIn)?a:e.ti,u=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],c=[r[0]+(l?l[0]:0),r[1]+(l?l[1]:0)],f=Ue(n,u,c,r),d={P0:n,P1:u,P2:c,P3:r,lut:f,totalArc:f.ds[f.ds.length-1]};return Be.set(t,d),d}function qe(t,e,n,r,o,a){const i=We(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=Ce(i.P0,i.P1,i.P2,i.P3,s);if(!a)return{translate:l};const u=Ee(i.P0,i.P1,i.P2,i.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Ke(t,e){var n,r,o,a;if(!De(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=Re(i[0]);if(!d)return t;const h=s?function(t,e){const n=Re(t),r=Re(e);if(!n||!r)return 0;const o=We(t,e,n,r),a=Ee(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(Xe(Fe(i[0]),Ge(Ye(i[0]),Ye(i[0]),0,d,h,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=Re(e),o=Re(n);r&&o?(s&&t>0&&Je(f,e,n,r,o,u),$e(f,e,n,r,o,s,l,u,c)):f.push(Xe(Fe(n),Ge(Ye(n),Ye(n),1,null!=o?o:[0,0],void 0,s)))}const m=Le(i[i.length-1]);m&&(f[f.length-1].e=m),s&&function(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}}(f);const p={kfs:f};return void 0!==t.loop&&(p.loop=t.loop),p}function Xe(t,e){return{t:t,v:e}}function Ye(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Ze(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 Ge(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]=Ze(o,s,n))}return void 0!==o&&(i.rotate=o),i}function Je(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=We(e,n,r,o),f=Ee(c.P0,c.P1,c.P2,c.P3,0),d=180*Math.atan2(f[1],f[0])/Math.PI,h=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(d,u);if(Math.abs(h)<=a)return;const m=Ge(Ye(e),Ye(e),0,r,d,!0);t.push(Xe(Fe(e),m))}function $e(t,e,n,r,o,a,i,s,l){const u=We(e,n,r,o),c=Fe(e),f=Fe(n),d=Le(e),h=(m=d)?ye([m[1],m[0],m[3],m[2]]):t=>t;var m;const p=Ye(e),y=Ye(n),v=function(t,e,n,r,o){const a=[];He(t.P0[0],t.P1[0],t.P2[0],t.P3[0],a),He(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++)Qe(i[o],i[o+1],s,t,e,n,r,l);return s}(u,a,i,s,l),g=[];for(const t of v){const e=Ve(u.lut,t),n=ze(u.totalArc>0?e/u.totalArc:t,0,1),r={u:ze(h(n),0,1),p:n,pos:Ce(u.P0,u.P1,u.P2,u.P3,t)};if(a){const e=Ee(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}g.push(r)}let b=d,k=0;const A=t.length-1;for(let e=0;e<g.length;e++){const n=g[e],r=k<1?ze((n.u-k)/(1-k),0,1):1,{left:o,right:i}=ge(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=Ge(p,y,n.p,n.pos,n.rotateDeg,a);t.push(Xe(l,u)),b=i,k=n.u}}function He(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 Qe(t,e,n,r,o,a,i,s){const l=(t+e)/2,u=Ce(r.P0,r.P1,r.P2,r.P3,t),c=Ce(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=Ce(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=Ce(r.P0,r.P1,r.P2,r.P3,l),m=Ce(r.P0,r.P1,r.P2,r.P3,t+.75*f),p=Math.max(tn(d,u,c),tn(h,u,c),tn(m,u,c));let y=!0;if(o){const n=Ee(r.P0,r.P1,r.P2,r.P3,t),o=Ee(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)}p<=a&&y||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,Qe(t,l,n,r,o,a,i,s),Qe(l,e,n,r,o,a,i,s))}function tn(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 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,n=t.transform;if(n&&"object"==typeof n&&De(n)){const o=Ke(n,e);o!==n&&(r=l(s({},t),{transform:o}))}}if(!n&&!r)return null;const a=s({},t);return n&&(a.children=n),r&&(a.animate=r),a}function rn(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 on(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function an(t){return"string"==typeof t&&void 0!==on(t)}function sn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=on(t.path);return e?{paths:rn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&an(e[0])){const t=[];for(const n of e){const e=on(n);e&&t.push(...rn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&an(t[0])){const e=[];for(const n of t){const t=on(n);t&&e.push(...rn(t))}return{paths:e}}return{paths:t}}if(an(t)){return{paths:rn(on(t))}}return t}function ln(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 un(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 cn(t,e,n,r){var o,a;if("d"===t){return{paths:he(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 we.has(t)?de(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?ce(e,n,r):je.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?fe(e||[],n||[],r):ce(+(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)o[a]=ce(+(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]=fe(r||t,i||t,n)}else o[a]=null!=i?i:r}return o}(e,n,r)}function fn(t,e,n,r){var o,a,i,s,l;const u=e.length-1,c=ze(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 m,p;n.before?(m=0,p=d):(m=h,p=r);const y=p-m;if(y<=0)return e;const v=null!=(s=f[0].t)?s:0,g=(null!=(l=f[f.length-1].t)?l:0)-v;if(g<=0)return e;const b=f.map(t=>{var e,n;return{relT:(t.t-v)/g,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/g),A=(y-k*g)/g,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?be(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?ye(i.e)(l):l,c=cn(t,i.v,r.v,u),{left:f}=ge(i.e,l);return w.length>0&&i.relT<=a&&(w[w.length-1].e=f),void w.push({t:e+a*g,v:c,e:void 0})}const i={t:e+r.relT*g,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)}}for(let t=0;t<k;t++){const e=n.before?k-1-t:t,r=!!n.alternate&&e%2==0;j(m+t*g,r)}if(A>1e-9){const t=!!n.alternate&&k%2==0;j(m+k*g,t,A)}return n.before?[...w,...e]:[...e,...w]}function dn(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=sn(f));const m=Me(t)?Ie(t):t;we.has(m)&&(f=null!=(l=Ae(f))?l:f);const p={t:n,v:f,e:ln(h,r)},y=null!=(u=e.tangentIn)?u:e.ti,v=null!=(c=e.tangentOut)?c:e.to;y&&(p.tangentIn=y),v&&(p.tangentOut=v),d.push(p)}d.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const h=e.loop,m=!0===h?{}:h||void 0;return m&&d.length>=2?fn(t,d,m,n):d}function hn(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=Me(t)?Ie(t):t,l=we.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=sn(d)),l&&(d=null!=(o=Ae(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:fn(t,u,a,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function mn(t,e){const n=pn(t,e);return null!=n?n:t}function pn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=pn(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=hn(n,o,e);a!==o&&(r||(r=s({},t)),r[n]=a)}}if(!n&&!r)return null;const a=s({},t);return n&&(a.children=n),r&&(a.animate=r),a}var yn=0;function vn(t,e=B.webapi){const n=zt(t)||{},r=Ct(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=un(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=un(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=B.webapi){const o={};for(const[a,i]of Object.entries(t)){const t=dn(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===B.webapi&&"transform"===a?Ke(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=Nt(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_"+ ++yn;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 gn(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;let o=t[0],a=t[t.length-1];for(let i=0;i<t.length-1;i++){const s=null!=(n=t[i].t)?n:0,l=null!=(r=t[i+1].t)?r:0;if(s<=e&&e<=l){o=t[i],a=t[i+1];break}}return{prevKf:o,nextKf:a}}(c,n);let h=f===d?0:(m=n,p=null!=(r=f.t)?r:0,y=null!=(o=d.t)?o:0,v=0,g=1,y===p?v:v+(m-p)/(y-p)*(g-v));var m,p,y,v,g;h=ze(h,0,1);const b=null!=(a=f.e)?a:f.easing;if(b&&Array.isArray(b))try{h=ye(b)(h)}catch(t){}let k=Me(t)?Ie(t):t,A=null;const w=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,j=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===k){A=he(null!=(l=null==w?void 0:w.paths)?l:Array.isArray(w)?w:[],null!=(u=null==j?void 0:j.paths)?u:Array.isArray(j)?j:[],h).map(t=>ue(t)).join("")}else if(we.has(k))A=ke(de(w||[0,0,0,1],j||[0,0,0,1],h)),k=t;else if("stroke-dasharray"===k)A=fe(w||[],j||[],h).join(" "),k=t;else if("transform"!==k||null===w||"object"!=typeof w||Array.isArray(w))if("translate"===k){A="translate("+fe(w||[0,0],j||[0,0],h).join(",")+")",k="transform"}else if("rotate"===k){A="rotate("+ce(+(w||0),+(j||0),h)+")",k="transform"}else if("scale"===k){A="scale("+fe(w||[1,1],j||[1,1],h).join(",")+")",k="transform"}else{A=ce(+(w||0),+(j||0),h)}else{const t=new Set([...w?Object.keys(w):[],...j?Object.keys(j):[]]),n={};for(const e of t){const t=null==w?void 0:w[e],r=null==j?void 0:j[e];if("rotate"===e)n.rotate=ce(+(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=fe(t||o,r||o,h);n[e]=a}}if(De(e)){const t=w.translate,r=j.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=qe(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=xe(n,{withUnits:!1}),k="transform"}return Oe.has(k)&&"number"==typeof A&&(A=100*A+"%"),{k:k,v:null===A?"":""+A}}function bn(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=gn(r,o,e);t&&(n[t.k]=t.v)}return n}function kn(t,e,n,r){if(!e)return t;const o=!!e.trimAllAsOne,a=[];let i=0;const u=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)u(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o;if("rect"!==t.type)return;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"}(t);if(void 0===e)return;const n=rn(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){o||(i=0);const e=Cn(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:i}),i+=e}a.push(r)};if(u(t),!a.length)return t;const f=i;if(o&&f<.001)return t;const d=c(e.offset),h="absent"===d.kind?{kind:"static",value:0}:d,m=function(t){const e=c(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=In(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=zn(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=zn(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:a}}(e.range),p="absent"===m.kind?{kind:"static",value:[0,1]}:m,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}(h),v=[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=On(n,e,r),l=xn(e,r),u=s({},t);return delete u.effects,Mn(u,"strokeDasharray",Sn(a,l)),Mn(u,"strokeDashoffset",Sn(o,i)),Mn(u,"strokeOpacity",_n(a)),u}(e.leaf,r,i,v,h,p)}const g=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(...wn(t.leaf,n.subpath,a,i,v,h,p,r))}g.set(t.leaf,An(t.leaf,e))}const b=t=>{const e=g.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?l(s({},t),{children:t.children.map(b)}):t)};return b(t)}function An(t,e){const n=l(s({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function wn(t,e,n,r,o,a,i,s){const l=On(r,n,o),u=xn(n,o),c=Sn(a,l),f=Sn(i,u),d=_n(i),h=function(t){return{type:"path",d:t}}(ue(e));return Mn(h,"strokeDasharray",f),Mn(h,"strokeDashoffset",c),Mn(h,"strokeOpacity",d),[h]}var jn=1;function On(t,e,n){const[r]=Pn(n);return n=>e*(-n-r+t)+jn}function xn(t,e){const[n,r]=Pn(e),o=r-n+1;return e=>{const n=ze(e[0],0,1),r=ze(e[1],0,1),a=Math.min(n,r),i=Math.max(n,r),s=[0];let l=jn;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+jn),s}}function Pn(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Sn(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}})}}function Mn(t,e,n){if(!n)return;if("static"===n.kind)return void(t[e]=n.value);const r=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,o=s({},r||{});o[e]={keyframes:n.keyframes},t.animate=o}function _n(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),m=u?h&&s(null!=(a=u.value)?a:u.v):h,p=c?h&&s(null!=(i=c.value)?i:c.v):h;m&&!p?(f.push({time:d,value:0}),f.push({time:d+1,value:1})):!m&&p&&(f.push({time:d-1,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function In(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 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 Cn(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+=Nn(t,r,r+1);return t.c&&e.length>1&&(n+=Nn(t,e.length-1,0)),n}function Nn(t,e,n){var r,o,a,i;const s=t.v,l=s[e],u=s[n],c=Ue(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]}function En(t){const e={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map},n=Bt(t);Dt(n,e.idMap),p(n,e,()=>Ft(e,"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=ee(t,e),a=n?[...r,n]:r;for(const e of t.children)o(e,a)}};o(t,[])}(n,e);const r=function(t,e){return function(t,e){var n;e.idMap.clear(),Dt(t,e.idMap);const r=[],o=t=>{var e,n;(null==(e=t.effects)?void 0:e.retime)&&r.push(t),null==(n=t.children)||n.forEach(o)};o(t);for(const t of r){const r=null==(n=t.effects)?void 0:n.retime;r&&(delete t.effects.retime,0===Object.keys(t.effects).length&&delete t.effects,oe(t,re(r),e))}}(t,e),t}(Tn(n,e),e);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(r,e.defs),{root:r,defs:e.defs,warnings:e.warnings,errors:e.errors}}function Tn(t,e){t.children&&(t.children=t.children.map(t=>Tn(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,trimPath:l,retime:u,ref:c,fillGradient:f,strokeGradient:h,textAlongPath:m}=null!=n?n:{};null==n||n.isCombinedShape;n&&delete t.effects;let p=t;return p=function(t,e){var n;if(!e)return t;const r={type:"textPath",href:"string"!=typeof e.href||e.href.startsWith("#")?e.href:"#"+e.href,children:null!=(n=t.children)?n:[]};return void 0!==e.lengthAdjust&&(r.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(r.method=e.method),void 0!==e.spacing&&(r.spacing=e.spacing),le(r,"startOffset",e.startOffset),le(r,"textLength",e.textLength),t.children=[r],t}(p,m),p=function(t,e,n){return Wt(t,e,n,"fill")}(p,f,e),p=function(t,e,n){return Wt(t,e,n,"stroke")}(p,h,e),p=kn(p,l,0,e),p=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=Bt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate);const u=[l];for(let t=1;t<a;t++){const r=Bt(l),o=ne(e,t),a=o?d(r,o,n):r;u.push(a)}const c={type:"g",children:u};return void 0!==i&&(c.transform=i),void 0!==s&&(c.animate={transform:s}),c}(p,i,e),p=Yt(p,s,a,e),p=o?y(p,a,r,o,e):function(t,e,n,r){if(e){const n=e.baseId;if(n){const o="content"===e.type&&r.contentRefInnerIds.get(n)||n;t.href="#"+o}else r.errors.push("ref: missing baseId")}return d(t,n,r)}(p,c,a,e),u&&(t.effects={retime:u}),r&&e.idMap.set(r,p),p}function Un(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=Vn(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=[],i=Fn(t,n,r,()=>"_lw_use_mat_"+ ++o,a);if(0===a.length)return i;const u={type:"defs",children:a},c=[...null!=(e=i.children)?e:[],u];return l(s({},i),{children:c})}function Vn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Rn(t,e,n,r,o,a){const i=Tt(e);Ut(i,o);const u="symbol"===i.type?function(t,e,n){const r=function(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]]}(t.viewBox),o=l(s({},t),{type:"g"});if(delete o.viewBox,delete o.preserveAspectRatio,delete o.width,delete o.height,!r)return o;const[a,i,u,c]=r;0===a&&0===i||(o.transform="translate("+-a+","+-i+")");const f=e();return n.push({type:"clipPath",id:f,children:[{type:"rect",x:a,y:i,width:u,height:c}]}),o.clipPath="url(#"+f+")",o}(i,o,a):i,c=Fn(u,n,r,o,a),f=l(s({},t),{type:"g",children:[c]});return delete f.href,Rt(f)}function Fn(t,e,n,r,o){if("use"===t.type&&"string"==typeof t.href){const a=Vn(t.href);if(a&&n.has(a)){const i=e.get(a);if(i)return Rn(t,i,e,n,r,o)}}if(!t.children)return t;let a=!1;const i=t.children.map(t=>{const i=Fn(t,e,n,r,o);return i!==t&&(a=!0),i});return a?l(s({},t),{children:i}):t}function Ln(t,e,n){var r,o;let a=En(t).root;return a=mn(a,null!=(o=null==(r=zt(a))?void 0:r.duration)?o:1e3),e===B.webapi&&(a=en(a,null==n?void 0:n.motionPath),a=Un(a)),a}var Dn=new Set(["script","foreignobject"]),Bn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Wn=new Set(["href","xlink:href","src"]),qn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i;function Kn(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(Bn.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Wn.has(n)&&qn.test(t))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or base64 raster data: URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function Xn(t){const e={};for(const n of Object.keys(t)){const r=Se(n);if(K.has(r))continue;if("style"===r)continue;let o=t[n];we.has(r)&&Array.isArray(o)?e[r]=ke(o):"transform"===r&&null!==o&&"object"==typeof o&&!Array.isArray(o)&&o.value&&"object"==typeof o.value?e.transform=xe(o.value,{withUnits:!1}):je.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 Yn(t,e){if(!t)return null;const n=t,{type:i,children:s,style:l}=n,u=((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})(n,["type","children","style"]),c=Ct(t)||e,f=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(l,c);let d;if(s)for(const t of s){const e=Yn(t,c);e&&(d||(d=[]),d.push(e))}return function(t,e,n,r,o){if(Dn.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const a=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e){const n=Kn(t,e[t]);void 0!==n&&a.setAttribute(Ie(t),n)}if(n)for(const t in n)a.style[t]=String(n[t]);if(r)for(const t of r)a.appendChild(t);return o&&(a.textContent=o),a}(i||"g",Xn(u),f,d,u[W]||u[q])}function Zn(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,a=t.getRootElement();if(!a)return console.warn("setupAnimationTriggers: No root element found for animation."),t;const i=()=>{t.play()},s=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":t.play()}};switch(n){case"load":{const t=()=>i();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>i(),e=()=>s();a.addEventListener("mouseenter",t),a.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?s():i()};a.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?i():s()})},{threshold:o}).observe(a);break}return t}function Gn(t){return"#"+t}function Jn(t,e,n){const r=zt(t)||{},o=vn(t,B.frames),a=r.iterations;let i=1;"number"==typeof a&&(i=a||1),"infinite"===a&&(i=1/0),i<1&&(i=1);const s=+(r.duration||1e3),l=s&&i?s*(i===1/0?1/0:i):s?(null!=i?i:1)*s:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,h=0,m=1,p=!1;const y=r.frameRate,v=y&&y>0?1e3/y:0;let g=0;const b=()=>{const t=h?(Date.now()-h)*m:0;let e=d+t;return Number.isFinite(l)&&e>l&&(e=l),e<0&&(e=0),e};function k(t){let n=function(){const e=s>0?s:1;let n=0,r=0;if(s>0){t=ze(t,0,i*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,i-1);n=ze((t-r*e)/e,0,1)}else n=t;const o=u||"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 o||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=bn(r,n*s);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}r.delay&&k(b());const A=()=>!!f&&(!!e.isConnected()&&!(Number.isFinite(l)&&b()>=l)),w=t=>{null!==c&&(cancelAnimationFrame(c),c=null),(t||A())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var t;if(!e.isConnected())return void j();const r=b();if(v>0){const t=Date.now();if(g&&t-g<v)return;g=t}if(l&&Number.isFinite(l)&&r>=l)return k(l),p||(p=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)),void j();k(r)})(),w()}))},j=()=>{f&&(d=b(),h=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),k(d))},O={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>A(),play:()=>{var t;f||(Number.isFinite(l)&&d>=l&&(d=0,p=!1),f=!0,h=Date.now(),w(!0)),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;j(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;j(),d=0,h=0,f=!1,p=!1,k(d),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;d=Number.isFinite(l)?l:b(),h=0,f=!1,k(d),t&&!p&&(p=!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");const e=b();m=t,d=e,f&&(h=Date.now())},getCurrentTime:()=>b(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(l)&&t>l&&(t=l),d=t,f&&(h=Date.now()),k(b())},destroy:()=>{O.cancel()}};return O}function $n(t,e,n,r){const o=zt(t)||{};if(!r)if(t.id){const e=Gn(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");let a=Jn(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=Ie(r);const a=Gn(n),i=(null==t?void 0:t.querySelectorAll(a))||document.querySelectorAll(a);0!==i.length||e.has(a)||(e.add(a),console.warn('setAttribute: No elements found for selector "'+a+'"'));for(let t=0;t<i.length;t++){const e=i[t];e.setAttribute(r,o),Pe.has(r)&&(e.style[r]=o)}}};return n}(r),n);return a=l(s({},a),{getRootElement:()=>r||null}),o.trigger&&Zn(a,o.trigger),a}function Hn(t,e,n,r){var o,a;let i=null!=(o=t.v)?o:t.value;const s=null!=(a=t.e)?a:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;return we.has(n)&&Array.isArray(i)?u=ke(i):"transform"!==n||null===i||"object"!=typeof i||Array.isArray(i)?je.has(n)?(Array.isArray(i)&&("translate"===n&&(i=i.map(t=>t+"px")),i=i.join(",")),"rotate"===n&&(i+="deg"),u=n+"("+i+")",c="transform"):u=""+i:(u=xe(i,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=Se(c),l[c]=u,l}function Qn(t,e,n){var r,o,a,i,u;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(a=n.t)?a:0)-h),r=d.e?ye(d.e)(e):e,{right:o}=ge(d.e,e);c.push({t:0,v:cn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(i=r.t)?i:0)<=n){const e=null!=(u=r.t)?u:0,o=(n-e)/(h-e),a=r.e?ye(r.e)(o):o,{left:i}=ge(r.e,o);c.length>0&&(c[c.length-1]=l(s({},c[c.length-1]),{e:i})),c.push({t:n,v:cn(t,r.v,d.v,a),e:void 0})}break}c.push(d)}return c}function tr(t,e,n){var r;const o=new Map;for(const[a,i]of Object.entries(t)){const t=n.duration||1,u=Qn(a,i.kfs||i.keyframes||[],t),c=[];for(let n=0;n<u.length;n++){const o=u[n],i=Hn(o,ze((null!=(r=o.t)?r:0)/t,0,1),a,e);0===n&&(i.offset||0)>0&&c.push(l(s({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(l(s({},c[c.length-1]),{offset:1})),c.length>0&&o.set(a,c)}return o}function er(t,e,n,r){var o;const a=zt(t)||{};if(!n)if(t.id){const e=Gn(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=vn(t,B.webapi),s=[],l=a.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;(null==i?void 0:i.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const i=Gn(t.id),l=(null==n?void 0:n.querySelectorAll(i))||document.querySelectorAll(i);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+i+'"');const f=tr(r,c,a),d=a.delay&&a.delay>0?a.delay:void 0,h=a.delay&&a.delay<0&&a.duration?-a.delay%a.duration:void 0,m={duration:a.duration,delay:d,fill:null!=(o=a.fill)?o:"forwards",direction:a.direction,iterations:u};for(let t=0;t<l.length;t++){const n=l[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(n,t,m),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;return null==(t=e.onFinish)?void 0:t.call(e)}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;return null==(t=e.onRemove)?void 0:t.call(e)}),h&&(o.currentTime=h),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const f={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;s.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;s.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;s.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of s)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(s.forEach(e=>e.playbackRate=t),f),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=s[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{s.forEach(e=>{e.currentTime=t})},destroy:()=>{f.cancel(),s.splice(0,s.length)}};return a.trigger&&Zn(f,a.trigger),f}var nr=0;function rr(){return"_px_"+Date.now().toString(36)+(++nr).toString(36)+Math.random().toString(36).substring(2,6)}function or(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>or(t));const e=t,n={};for(const t of Object.keys(e))n[t]=or(e[t]);return n}function ar(t){var e,n;const r=or(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"]),u=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=rr();o.set(t,n),e.id=n}else e.animate&&(e.id=rr());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]=ir(r,o);else if(u.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=ir(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=ir(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=l(s({},r.animator),{animate:t})}return r}function ir(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function sr(t,e,n,r){const o=jt(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);const a=zt(t)||{};a.debug=!0;t=Ln(t,a.mode===D.frames?B.frames:B.webapi);let i=null;if(r&&t.children){t=ar(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=Yn(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=zt(t)||{};let a;return a=o.mode===D.frames?$n(t,e,n,r):er(t,n,r,o.mode===D.webapi)||$n(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=a),a}(t,e,n,i)}var lr="data";function ur(t){const{src:e,data:n,adapter:r,callbacks:o,container:a}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return sr(n,r,o,a);let i=null;return fetch(e).then(t=>t.json()).then(t=>{_t(t)?i=sr(t,r,o,a):console.error("Invalid animation document format")}),{isReady:()=>!!i,getRootElement:()=>i?i.getRootElement():null,isPlaying:()=>(null==i?void 0:i.isPlaying())||!1,play:()=>{null==i||i.play()},pause:()=>{null==i||i.pause()},cancel:()=>{null==i||i.cancel()},finish:()=>{null==i||i.finish()},setPlaybackRate:t=>{null==i||i.setPlaybackRate(t)},getCurrentTime:()=>(null==i?void 0:i.getCurrentTime())||0,setCurrentTime:t=>{null==i||i.setCurrentTime(t)},destroy:()=>{null==i||i.destroy()}}}function cr(){const t=document.querySelectorAll("["+F+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[L]){const t=n.getAttribute(F);t&&(n[L]=ur({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=cr,window.createAnimator=ur,window.setupAnimationTriggers=Zn);var fr=[1,0,0,1,0,0];function dr(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 hr=(t,e)=>[1,0,0,1,t,e],mr=(t,e)=>[t,0,0,e,0,0];function pr(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var yr=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],vr=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function gr(t){let e=fr;t.translate&&(e=dr(e,hr(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=dr(e,hr(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=dr(e,pr(t.rotate))),t.scale&&(e=dr(e,mr(t.scale[0],t.scale[1]))),n&&(e=dr(e,hr(-t.origin[0],-t.origin[1]))),e}function br(t,e,n){return t+(e-t)*n}function kr(t,e){return null==t?fr:"string"==typeof t?function(t){let e=fr;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=dr(e,hr(n[0]||0,n[1]||0)):"scale"===t?e=dr(e,mr(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=dr(e,pr(n[0])):"skewX"===t?e=dr(e,yr(n[0])):"skewY"===t?e=dr(e,vr(n[0])):"matrix"===t&&(e=dr(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?gr(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||{},m=f.value||{},p={};return h.translate&&m.translate?p.translate=[br(h.translate[0],m.translate[0],d),br(h.translate[1],m.translate[1],d)]:p.translate=h.translate||m.translate,void 0!==h.rotate&&void 0!==m.rotate?p.rotate=br(h.rotate,m.rotate,d):p.rotate=null!=(l=h.rotate)?l:m.rotate,h.scale&&m.scale?p.scale=[br(h.scale[0],m.scale[0],d),br(h.scale[1],m.scale[1],d)]:p.scale=h.scale||m.scale,p.origin=h.origin||m.origin,p}(t.keyframes,e)):t.value?gr(t.value):fr}var Ar=new Set(["svg","g","symbol"]),wr=new Set(["defs","mask","clipPath","title"]);function jr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>jr(t,e))}function Or(t){return null==t?0:Number(t)}function xr(t){return Math.round(100*t)/100+0}function Pr(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=xr(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 br(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(xr).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return Or(t.width)+","+Or(t.height)+","+Or(t.x)+","+Or(t.y);case"ellipse":return Or(t.rx)+","+Or(t.ry)+","+Or(t.cx)+","+Or(t.cy);case"circle":return Or(t.r)+","+Or(t.cx)+","+Or(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(Or(c)||"")+"|o:"+f+"|m:"+d}function Sr(t,e,n,r,o){var a;const i=t.type||"";if(wr.has(i))return;const s=dr(e,function(t,e){return t.animate&&t.animate.transform?kr(t.animate.transform,e):void 0!==t.transform?kr(t.transform,e):fr}(t,n));if("use"===i){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",a=r.get(e),i=dr(s,hr(Or(t.x),Or(t.y)));return void(a?Sr(a,i,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Ar.has(i)?null==(a=t.children)||a.forEach(t=>Sr(t,s,n,r,o)):o.push(Pr(t,s,n))}function Mr(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=>Mr(t,e))}function _r(t,e){const n=new Map;jr(t,n);const r=[];return Sr(t,fr,e,n,r),r.sort()}function Ir(t,e){const n=new Set;Mr(t,n),Mr(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=_r(t,o),a=_r(e,o),i=zr(n,a),s=zr(a,n);(i.length||s.length)&&r.push({time:o,onlyInA:i,onlyInB:s})}return r}function zr(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{we as COLOUR_ATTR_NAMES,lr as PX_ANIMATOR_DATA_KEY,L as PX_ANIM_ATTR_NAME,F as PX_ANIM_SRC_ATTR_NAME,J as PX_TRANSFORM_PART_KEYS,St as PxAnimatedSvgDocumentSchema,Q as PxAnimationDefinitionSchema,rt as PxAnimatorConfigSchema,B as PxAnimatorEngine,D as PxAnimatorMode,at as PxAttrValueSchema,Mt as PxBezierPathSchema,ot as PxBindingSchema,nt as PxDefsSchema,X as PxEasingOrRefSchema,wt as PxEffectsSchema,tt as PxElementAnimationSchema,bt as PxFillGradientEffectSchema,pt as PxGradientSpreadMethod,vt as PxGradientStopSchema,yt as PxGradientType,mt as PxGradientUnits,Y as PxKeyframeSchema,Z as PxLoopSchema,ct as PxMaskedByEffectSchema,Ot as PxNodeBase,xt as PxNodeSchema,G as PxPropertyAnimationSchema,ht as PxRefEffectSchema,ut as PxRepeaterEffectSchema,dt as PxRetimeEffectSchema,kt as PxStrokeGradientEffectSchema,Pt as PxSvgNodeExtra,At as PxTextAlongPathEffectSchema,$ as PxTransformPartsSchema,H as PxTransformValueSchema,lt as PxTransformationEffectSchema,et as PxTriggerSchema,ft as PxTrimPathEffectSchema,Pe as STYLE_ATTR_NAMES,je as TRANSFORM_FN_NAMES,En as applyPlayerEffects,bn as calcAnimationValues,Ie as camelCaseToKebabWordIfNeeded,Mr as collectSampleTimes,ur as createAnimator,sr as createAnimatorImpl,Jn as createBasicFrameLoopAnimator,$n as createFrameLoopAnimator,er as createWebApiAnimator,V as describeSchema,Ir as diffInEffect,qe as evaluateMotionPathSegment,ar as generateNewIds,zt as getAnimatorConfig,Nt as getBindings,Et as getChildren,Ct as getDefs,Xn as getNormalizedProps,_t as isPxElementFileFormat,It as isPxElementFileFormatDeep,cr as loadTagAnimators,Ln as materialiseAllInTree,Un as materialiseAnimatedUseInstances,hn as materialiseInternalLoopsInPropAnim,mn as materialiseInternalLoopsInTree,Ke as materialiseMotionPathInPropAnim,en as materialiseMotionPathsInTree,vn as normalizeDocument,De as propAnimIsMotionPath,R as px,Yn as renderNode,U as schemaKeys,Zn as setupAnimationTriggers,ke as toRGBA,jt as validateNodeEffects,_r 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=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,s=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&i(t,n,e[n]);if(r)for(var n of r(e))a.call(e,n)&&i(t,n,e[n]);return t},l=(t,r)=>e(t,n(r));function u(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function c(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 f(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 d(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=h(r,"skew",e.skew,n),r=p(r,e.origin,!0),r=h(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=h(r,"rotate",e.rotate,n),r=p(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=h(r,"translate",e.translate,n):(r=p(r,e.origin,!0),r=h(r,"translate",e.translate,n),r=p(r,e.origin,!1)),r}function h(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=c(n);return"static"!==e.kind?(r.warnings.push("transformation.skew: only static skew is supported"),t):{type:"g",transform:"skewX("+e.value[0]+")skewY("+e.value[1]+")",children:[t]}}const o=c(n);if("static"===o.kind)return{type:"g",transform:{value:u(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>f(t,u(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 p(t,e,n){if(void 0===e)return t;const r=c(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=>f(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function m(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=>m(t,e,n))}function v(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=g(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&&g((null==(r=t.animate)?void 0:r.transform)||void 0)||i&&g((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=y(a.full),r=y(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=g(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=d(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=d(u,i,o),u.id=n),u}function y(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 g(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 b(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var k=class{_canSanitize(t){return this.isValid(t)}optional(){return new A(this)}},A=class extends k{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)}},w=class extends k{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(b(null!=n?n:[])+": expected string, got "+typeof t),!1)}},j=class extends k{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(b(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},O=class extends k{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(b(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},x=class extends k{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(b(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},P=class extends k{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(b(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},S=class extends k{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(b(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))}},M=class extends k{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(b(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)}},_=class extends k{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(b(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(b(o)+": unexpected extra key"),o.pop(),a=!1);return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},I=class extends k{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=s({},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(b(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)}},z=class extends k{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(b(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)}},C=class extends k{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(b(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)}},T=class extends k{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},N=class extends k{constructor(t,e){super(),this.fn=t,this._default=e,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,e,n){return this.schema.isValid(t,e,n)}_canSanitize(t){return this.schema._canSanitize(t)}},E=class extends k{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(b(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 U(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function V(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 R={string:(t="")=>new w(t),number:(t=0)=>new j(t),boolean:(t=!1)=>new O(t),literal:t=>new x(t),enum:(t,e)=>new P(t,e),union:(t,e)=>new S(t,e),discriminatedUnion:(t,e)=>new M(t,e),object:t=>new _(t),openObject:(t,e)=>new I(t,e),extendedObject:(t,e)=>new _(s(s({},t._shape),e)),array:t=>new z(t),record:t=>new C(t),any:()=>new T,tuple:t=>new E(t),lazy:(t,e)=>new N(t,e)},F="data-px-animation-src",D="_px_animator",L={auto:"auto",webapi:"webapi",frames:"frames"},B={webapi:L.webapi,frames:L.frames},W="text",q="textContent",K=new Set(["type","children","animator","meta","animate",W,q]),G=R.union([R.string(),R.tuple([R.number(),R.number(),R.number(),R.number()])]),Z=(R.union([R.string(),R.number(),R.array(R.number()),R.lazy(()=>$,{}),R.object({path:R.string()}),R.lazy(()=>R.object({paths:R.array(Mt)}),{paths:[]})]),R.object({time:R.number().optional(),t:R.number().optional(),value:R.any().optional(),v:R.any().optional(),easing:G.optional(),e:G.optional(),tangentOut:R.tuple([R.number(),R.number()]).optional(),to:R.tuple([R.number(),R.number()]).optional(),tangentIn:R.tuple([R.number(),R.number()]).optional(),ti:R.tuple([R.number(),R.number()]).optional(),selected:R.boolean().optional()})),X=R.object({segmentCount:R.number().optional(),before:R.boolean().optional(),alternate:R.boolean().optional()}),Y=R.object({keyframes:R.array(Z).optional(),kfs:R.array(Z).optional(),loop:R.union([X,R.boolean()]).optional(),autoOrient:R.boolean().optional()}),J=["translate","rotate","scale","origin"],$=R.object({translate:R.tuple([R.number(),R.number()]).optional(),rotate:R.number().optional(),scale:R.tuple([R.number(),R.number()]).optional(),origin:R.tuple([R.number(),R.number()]).optional()}),H=R.union([R.string(),R.object({value:$}),Y]),Q=R.record(Y),tt=R.union([R.string(),R.array(R.union([R.string(),Q])),Q]),et=R.object({startOn:R.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:R.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:R.number().optional()}),nt=R.object({easings:R.record(R.tuple([R.number(),R.number(),R.number(),R.number()])).optional(),animations:R.record(Q).optional(),styles:R.record(R.any()).optional()}),rt=R.object({mode:R.enum([L.auto,L.webapi,L.frames]).optional(),duration:R.number().optional(),delay:R.number().optional(),iterations:R.union([R.number(),R.literal("infinite")]).optional(),fill:R.enum(["forwards","backwards","both","none"]).optional(),direction:R.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:R.number().optional(),trigger:et.optional(),definitions:nt.optional(),animate:R.record(tt).optional(),debug:R.boolean().optional(),debugInstName:R.string().optional()}),ot=R.object({id:R.string(),animate:tt}),at=R.union([R.string(),R.number(),R.object({value:R.any()}),Y]),it=R.union([R.number(),R.object({value:R.number()}),R.object({keyframes:R.array(Z),autoOrient:R.boolean().optional()})]),st=R.union([R.tuple([R.number(),R.number()]),R.object({value:R.tuple([R.number(),R.number()])}),R.object({keyframes:R.array(Z),autoOrient:R.boolean().optional()})]),lt=R.object({translate:st.optional(),rotate:it.optional(),scale:st.optional(),skew:st.optional(),origin:st.optional()}),ut=R.object({copies:R.number().optional(),translate:st.optional(),rotate:it.optional(),scale:st.optional(),origin:st.optional()}),ct=R.object({href:R.string().optional(),maskType:R.string().optional(),maskUnits:R.string().optional(),maskContentUnits:R.string().optional()}),ft=R.object({offset:it.optional(),range:st.optional(),trimAllAsOne:R.boolean().optional()}),dt=R.object({baseId:R.string().optional(),start:R.number().optional(),stretch:R.number().optional(),timeCrop:R.tuple([R.number(),R.number()]).optional()}),ht=R.object({type:R.string().optional(),baseId:R.string().optional(),retime:dt.optional()}),pt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},mt={pad:"pad",reflect:"reflect",repeat:"repeat"},vt={linear:"linear",radial:"radial"},yt=R.object({offset:R.number(),color:R.string()}),gt=R.union([R.array(yt),R.object({value:R.array(yt)}),R.object({keyframes:R.array(Z)})]),bt=R.object({type:R.enum([vt.linear,vt.radial]),p1:R.tuple([R.number(),R.number()]).optional(),p2:R.tuple([R.number(),R.number()]).optional(),c:R.tuple([R.number(),R.number()]).optional(),r:R.number().optional(),fp:R.tuple([R.number(),R.number()]).optional(),stops:gt.optional(),gradientUnits:R.string().optional(),spreadMethod:R.string().optional(),gradientTransform:R.string().optional()}),kt=bt,At=R.object({href:R.string(),lengthAdjust:R.string().optional(),method:R.string().optional(),spacing:R.string().optional(),startOffset:it.optional(),textLength:it.optional()}),wt=R.object({transformation:lt.optional(),repeater:ut.optional(),maskedBy:ct.optional(),trimPath:ft.optional(),clone:ht.optional(),isCombinedShape:R.boolean().optional(),fillGradient:bt.optional(),strokeGradient:kt.optional(),textAlongPath:At.optional()});function jt(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!wt.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 Ot=R.openObject({type:R.string(),id:R.string().optional(),meta:R.any().optional(),effects:wt.optional(),animate:tt.optional(),style:R.union([R.string(),R.record(R.union([R.string(),R.number()]))]).optional()},at),xt=R.openObject(l(s({},Ot._shape),{children:R.lazy(()=>R.array(xt),[]).optional()}),at),Pt=R.object({width:R.number().optional(),height:R.number().optional(),viewBox:R.string().optional(),animator:rt.optional()}),St=R.openObject(l(s(s({},Ot._shape),Pt._shape),{type:R.literal("svg"),children:R.array(xt).optional()}),at),Mt=R.object({v:R.array(R.array(R.number())),i:R.array(R.array(R.number())).optional(),o:R.array(R.array(R.number())).optional(),c:R.boolean().optional()});function _t(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function It(t){const e=St.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function zt(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 Ct(t){var e;if(t)return null==(e=zt(t))?void 0:e.definitions}function Tt(t){var e;if(!t)return;const n=null==(e=zt(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Nt(t){return null==t?void 0:t.children}function Et(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Et);const e={};for(const n of Object.keys(t))e[n]=Et(t[n]);return e}function Ut(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 Vt(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Rt(t){var e;const n=Vt(t.x),r=Vt(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 Ft(t,e){return"_lw_"+e+"_"+t.nextId++}function Dt(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Lt(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Lt(t,e))}var Bt=Et;function Wt(t,e,n,r){if(!e)return t;const o=Ft(n,"grad"),a=function(t,e){const n={type:t.type===vt.radial?"radialGradient":"linearGradient",id:e};t.type===vt.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);return n.children=function(t){var e,n,r,o;if(!t)return[];if(Array.isArray(t))return t.map(qt);if("object"==typeof t&&Array.isArray(t.value))return t.value.map(qt);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:Kt(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:Kt(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 y={time:o,value:p.offset};void 0!==m&&(y.easing=m),f.push(y),p.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:Gt(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}function qt(t){return{type:"stop",offset:Gt(t.offset),stopColor:t.color}}function Kt(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 Gt(t){return Math.round(1e3*t)/10+"%"}function Zt(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=Ft(r,"mask");let a={type:"use",href:"#"+e.href};if(n)a=Xt(a,n,r);else if($t(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=[],u=[],c=[];for(const t of a){const e=(null!=(n=t.value)?n:t.v)||{},r=f(t,void 0);if(Array.isArray(e.translate)&&i.push(l(s({},r),{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]]),u.push(l(s({},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(l(s({},r),{value:t}))}}const d=null==o?void 0:o.loop,h=t=>{const e={keyframes:t};return void 0!==d&&(e.loop=d),e};let p=t;i.length&&(p={type:"g",animate:{transform:h(i)},children:[p]});u.length&&(p={type:"g",animate:{transform:h(u)},children:[p]});c.length&&(p={type:"g",animate:{transform:h(c)},children:[p]});return p}(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 y=v[v.length-1];if("translate"===y.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=y.args[0])?r:0,p=null!=(o=y.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 g,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;g=g?[g[0]+e,g[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={};g&&(A.translate=g);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=Xt(a,e,r))}const i=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||$t(t))}(t);a=function(t,e,n,r,o){const a=r.idMap.get(n),i=r.maskAncestorChains.get(e)||[],s=o?ee(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=Ht(l),n=Ht(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=Qt(l,t),n=Qt(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,e.href,r,i);const u={type:"mask",id:o,children:[a]};return e.maskType&&(u.maskType=e.maskType),e.maskUnits&&(u.maskUnits=e.maskUnits),e.maskContentUnits&&(u.maskContentUnits=e.maskContentUnits),r.defs.push(u),t.mask="url(#"+o+")",t}function Xt(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=c(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=Yt(o,"translate",e.translate,void 0,n),o=Yt(o,"rotate",e.rotate,r,n),o=Yt(o,"scale",e.scale,r,n),o}function Yt(t,e,n,r,o){if(void 0===n)return t;const a=c("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===a.kind)return{type:"g",transform:{value:u(e,Jt(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>f(t,u(e,Jt(e,t.value),r)))};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Jt(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function $t(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Ht(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 Qt(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=te(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function te(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 ee(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 ne="content";function re(t,e,n){if(!e)return;const r=e.baseId;if(!r)return void(e.type===ne&&n.errors.push("clone: content ref missing baseId"));const o=e.type===ne&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function oe(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 l(s({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?l(s({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return l(s({},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 l(s({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?l(s({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return l(s({},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 l(s({},e),{keyframes:e.keyframes.map(t=>t&&void 0!==t.value?l(s({},t),{value:r(t.value)}):t)});if(void 0!==e.value)return l(s({},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 ae(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function ie(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function se(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function le(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 ue(t,e,n){const r=Dt(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=ce(r,e,n,new Set);o&&(t.href="#"+o)}function ce(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=Bt(o);if(function(t,e){Ut(t,()=>Ft(e,"retimed"))}(a,n),"use"===o.type?de(a,e.start,e.stretch):fe(a,e.start,e.stretch),le(a),"use"===o.type&&o.href){const i=Dt(o.href);if(i){const s=se(o),l=s?ie(ae(s),e):e,u=new Set(r);u.add(t);const c=ce(i,l,n,u);c&&(a.href="#"+c)}}else!function(t,e,n,r,o){const a=t=>{var i;const s=se(t);if("use"===t.type&&s&&t.href){const a=Dt(t.href);if(a){const i=ie(ae(s),e),l=new Set(r);l.add(o);const u=ce(a,i,n,l);u&&(t.href="#"+u)}le(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 fe(t,e,n){var r;de(t,e,n),null==(r=t.children)||r.forEach(t=>fe(t,e,n))}function de(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function he(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=s({},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)}function pe(t){var e,n,r,o;const a=t.v,i=t.i,s=t.o,l=t.c;if(!a.length)return"";const u=[],c=a.length;u.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<c;t++){const r=a[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==i?void 0:i[t])?n:a[t],c=a[t];o[0]===r[0]&&o[1]===r[1]&&l[0]===c[0]&&l[1]===c[1]?u.push("L"+c[0]+","+c[1]):u.push("C"+o[0]+","+o[1]+","+l[0]+","+l[1]+","+c[0]+","+c[1])}if(l&&c>0){const t=a[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==i?void 0:i[0])?o:a[0],l=a[0];e[0]===t[0]&&e[1]===t[1]&&n[0]===l[0]&&n[1]===l[1]||u.push("C"+e[0]+","+e[1]+","+n[0]+","+n[1]+","+l[0]+","+l[1]),u.push("z")}return u.join("")}function me(t,e,n){return t+(e-t)*n}function ve(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let a=0;a<o;a++)r[a]=me(t[a]||0,e[a]||0,n);return r}function ye(t,e,n){return[me(t[0]||0,e[0]||0,n),me(t[1]||0,e[1]||0,n),me(t[2]||0,e[2]||0,n),me(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function ge(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let a=0;a<r;a++)o.push(be(t[a],e[a],n));return o}function be(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(ve(f,h,d));const y=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(i=null==(a=e.i)?void 0:a[n])?i:h;m.push(ve(y,g,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(ve(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 ke(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 Ae(t){const[e,n,r,o]=t,a=3*n,i=3*(o-n)-a,s=1-a-i;return function(t){return n=ke(e,r,t),((s*n+i)*n+a)*n;var n}}function we(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function je(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=ke(n,o,e),s=[n,r],l=[o,a],{left:u,right:c}=function(t,e,n,r,o){const a=we(t,e,o),i=we(e,n,o),s=we(n,r,o),l=we(a,i,o),u=we(i,s,o),c=we(l,u,o);return{left:[t,a,l,c],right:[c,u,s,r]}}([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 Oe(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function xe(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 Pe(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 Se=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),Me=new Set(["translate","rotate","scale","skew"]),_e=new Set(["offset-distance","offsetDistance"]);function Ie(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.scale,u=r?"px":"",c=r?"deg":"";return a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),i&&o.push("translate("+-i[0]+u+","+-i[1]+u+")"),o.join("")}var ze=new Set(["offset-distance","offsetDistance"]);function Ce(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Te(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Ne=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function Ee(t){return Ne.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ue(t,e,n){return Math.max(e,Math.min(t,n))}function Ve(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 Fe(t,e,n,r,o){const a=De(t,e,n,r,o);if(0===a[0]&&0===a[1]){return De(t,e,n,r,o<.5?o+Re:o-Re)}return a}function De(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 Le(t,e,n,r,o=100){const a=o+1,i=new Float64Array(a),s=new Float64Array(a);let l=Ve(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=Ve(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 Be(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])}function We(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 qe(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function Ke(t){var e;return null!=(e=t.easing)?e:t.e}function Ge(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 Ze=new WeakMap;function Xe(t,e,n,r){var o,a;const i=Ze.get(t);if(i)return i;const s=null!=(o=t.tangentOut)?o:t.to,l=null!=(a=e.tangentIn)?a:e.ti,u=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],c=[r[0]+(l?l[0]:0),r[1]+(l?l[1]:0)],f=Le(n,u,c,r),d={P0:n,P1:u,P2:c,P3:r,lut:f,totalArc:f.ds[f.ds.length-1]};return Ze.set(t,d),d}function Ye(t,e,n,r,o,a){const i=Xe(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=Ve(i.P0,i.P1,i.P2,i.P3,s);if(!a)return{translate:l};const u=Fe(i.P0,i.P1,i.P2,i.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Je(t,e){var n,r,o,a;if(!Ge(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=We(i[0]);if(!d)return t;const h=s?function(t,e){const n=We(t),r=We(e);if(!n||!r)return 0;const o=Xe(t,e,n,r),a=Fe(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($e(qe(i[0]),tn(He(i[0]),He(i[0]),0,d,h,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=We(e),o=We(n);r&&o?(s&&t>0&&en(f,e,n,r,o,u),nn(f,e,n,r,o,s,l,u,c)):f.push($e(qe(n),tn(He(n),He(n),1,null!=o?o:[0,0],void 0,s)))}const p=Ke(i[i.length-1]);p&&(f[f.length-1].e=p),s&&function(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}}(f);const m={kfs:f};return void 0!==t.loop&&(m.loop=t.loop),m}function $e(t,e){return{t:t,v:e}}function He(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Qe(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 tn(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]=Qe(o,s,n))}return void 0!==o&&(i.rotate=o),i}function en(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=Xe(e,n,r,o),f=Fe(c.P0,c.P1,c.P2,c.P3,0),d=180*Math.atan2(f[1],f[0])/Math.PI,h=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(d,u);if(Math.abs(h)<=a)return;const p=tn(He(e),He(e),0,r,d,!0);t.push($e(qe(e),p))}function nn(t,e,n,r,o,a,i,s,l){const u=Xe(e,n,r,o),c=qe(e),f=qe(n),d=Ke(e),h=(p=d)?Ae([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=He(e),v=He(n),y=function(t,e,n,r,o){const a=[];rn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],a),rn(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++)on(i[o],i[o+1],s,t,e,n,r,l);return s}(u,a,i,s,l),g=[];for(const t of y){const e=Be(u.lut,t),n=Ue(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Ue(h(n),0,1),p:n,pos:Ve(u.P0,u.P1,u.P2,u.P3,t)};if(a){const e=Fe(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}g.push(r)}let b=d,k=0;const A=t.length-1;for(let e=0;e<g.length;e++){const n=g[e],r=k<1?Ue((n.u-k)/(1-k),0,1):1,{left:o,right:i}=je(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=tn(m,v,n.p,n.pos,n.rotateDeg,a);t.push($e(l,u)),b=i,k=n.u}}function rn(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 on(t,e,n,r,o,a,i,s){const l=(t+e)/2,u=Ve(r.P0,r.P1,r.P2,r.P3,t),c=Ve(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=Ve(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=Ve(r.P0,r.P1,r.P2,r.P3,l),p=Ve(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(an(d,u,c),an(h,u,c),an(p,u,c));let v=!0;if(o){const n=Fe(r.P0,r.P1,r.P2,r.P3,t),o=Fe(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,on(t,l,n,r,o,a,i,s),on(l,e,n,r,o,a,i,s))}function an(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 sn(t,e){const n=ln(t,e);return null!=n?n:t}function ln(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=ln(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,n=t.transform;if(n&&"object"==typeof n&&Ge(n)){const o=Je(n,e);o!==n&&(r=l(s({},t),{transform:o}))}}if(!n&&!r)return null;const a=s({},t);return n&&(a.children=n),r&&(a.animate=r),a}function un(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 cn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function fn(t){return"string"==typeof t&&void 0!==cn(t)}function dn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=cn(t.path);return e?{paths:un(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&fn(e[0])){const t=[];for(const n of e){const e=cn(n);e&&t.push(...un(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&fn(t[0])){const e=[];for(const n of t){const t=cn(n);t&&e.push(...un(t))}return{paths:e}}return{paths:t}}if(fn(t)){return{paths:un(cn(t))}}return t}function hn(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 pn(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 mn(t,e,n,r){var o,a;if("d"===t){return{paths:ge(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 Se.has(t)?ye(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?me(e,n,r):Me.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?ve(e||[],n||[],r):me(+(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)o[a]=me(+(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]=ve(r||t,i||t,n)}else o[a]=null!=i?i:r}return o}(e,n,r)}function vn(t,e,n,r){var o,a,i,s,l;const u=e.length-1,c=Ue(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 y=null!=(s=f[0].t)?s:0,g=(null!=(l=f[f.length-1].t)?l:0)-y;if(g<=0)return e;const b=f.map(t=>{var e,n;return{relT:(t.t-y)/g,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/g),A=v-k*g,w=A/g,j=[];function O(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?Oe(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?Ae(i.e)(l):l,c=mn(t,i.v,r.v,u),{left:f}=je(i.e,l);return j.length>0&&i.relT<=a&&(j[j.length-1].e=f),void j.push({t:e+a*g,v:c,e:void 0})}const i={t:e+r.relT*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(i.tangentIn=r.tangentIn),r.tangentOut&&(i.tangentOut=r.tangentOut),j.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?Oe(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?Ae(i.e)(o):o,l=mn(t,i.v,r.v,s),{right:u}=je(i.e,o);j.push({t:e,v:l,e:u})}const s={t:e+(r.relT-a)*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),j.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;O(p+A+t*g,r)}}else{for(let t=0;t<k;t++){const e=!!n.alternate&&t%2==0;O(p+t*g,e)}if(w>1e-9){const t=!!n.alternate&&k%2==0;O(p+k*g,t,w)}}return n.before?[...j,...e]:[...e,...j]}function yn(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=dn(f));const p=Te(t)?Ee(t):t;Se.has(p)&&(f=null!=(l=Pe(f))?l:f);const m={t:n,v:f,e:hn(h,r)},v=null!=(u=e.tangentIn)?u:e.ti,y=null!=(c=e.tangentOut)?c:e.to;v&&(m.tangentIn=v),y&&(m.tangentOut=y),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?vn(t,d,p,n):d}function gn(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=Te(t)?Ee(t):t,l=Se.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=dn(d)),l&&(d=null!=(o=Pe(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:vn(t,u,a,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function bn(t,e){const n=kn(t,e);return null!=n?n:t}function kn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=kn(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=gn(n,o,e);a!==o&&(r||(r=s({},t)),r[n]=a)}}if(!n&&!r)return null;const a=s({},t);return n&&(a.children=n),r&&(a.animate=r),a}var An=0;function wn(t,e=B.webapi){const n=zt(t)||{},r=Ct(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=pn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=pn(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=B.webapi){const o={};for(const[a,i]of Object.entries(t)){const t=yn(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===B.webapi&&"transform"===a?Je(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=Tt(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_"+ ++An;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 jn(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;let o=t[0],a=t[t.length-1];for(let i=0;i<t.length-1;i++){const s=null!=(n=t[i].t)?n:0,l=null!=(r=t[i+1].t)?r:0;if(s<=e&&e<=l){o=t[i],a=t[i+1];break}}return{prevKf:o,nextKf:a}}(c,n);let h=f===d?0:(p=n,m=null!=(r=f.t)?r:0,v=null!=(o=d.t)?o:0,y=0,g=1,v===m?y:y+(p-m)/(v-m)*(g-y));var p,m,v,y,g;h=Ue(h,0,1);const b=null!=(a=f.e)?a:f.easing;if(b&&Array.isArray(b))try{h=Ae(b)(h)}catch(t){}let k=Te(t)?Ee(t):t,A=null;const w=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,j=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===k){A=ge(null!=(l=null==w?void 0:w.paths)?l:Array.isArray(w)?w:[],null!=(u=null==j?void 0:j.paths)?u:Array.isArray(j)?j:[],h).map(t=>pe(t)).join("")}else if(Se.has(k))A=xe(ye(w||[0,0,0,1],j||[0,0,0,1],h)),k=t;else if("stroke-dasharray"===k)A=ve(w||[],j||[],h).join(" "),k=t;else if("transform"!==k||null===w||"object"!=typeof w||Array.isArray(w))if("translate"===k){A="translate("+ve(w||[0,0],j||[0,0],h).join(",")+")",k="transform"}else if("rotate"===k){A="rotate("+me(+(w||0),+(j||0),h)+")",k="transform"}else if("scale"===k){A="scale("+ve(w||[1,1],j||[1,1],h).join(",")+")",k="transform"}else{A=me(+(w||0),+(j||0),h)}else{const t=new Set([...w?Object.keys(w):[],...j?Object.keys(j):[]]),n={};for(const e of t){const t=null==w?void 0:w[e],r=null==j?void 0:j[e];if("rotate"===e)n.rotate=me(+(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=ve(t||o,r||o,h);n[e]=a}}if(Ge(e)){const t=w.translate,r=j.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Ye(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=Ie(n,{withUnits:!1}),k="transform"}return _e.has(k)&&"number"==typeof A&&(A=100*A+"%"),{k:k,v:null===A?"":""+A}}function On(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=jn(r,o,e);t&&(n[t.k]=t.v)}return n}function xn(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;if("rect"!==t.type)return;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"}(t);if(void 0===e)return;const n=un(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=Rn(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}a.push(r)};if(i(t),!a.length)return t;let u=0;const f=o?[...a].reverse():a;for(const t of f)for(const e of t.subpaths)o||(u=0),e.startOffsetPx=u,u+=e.lengthPx;const d=u;if(o&&d<.001)return t;const h=c(e.offset),p="absent"===h.kind?{kind:"static",value:0}:h,m=function(t){const e=c(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=Un(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=Vn(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=Vn(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:a}}(e.range),v="absent"===m.kind?{kind:"static",value:[0,1]}:m,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}(p),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?d:n.lengthPx;if(r<.001)return t;const i=o?n.startOffsetPx/r:0;return function(t,e,n,r,o,a){const i=_n(n,e,r),l=In(e,r),u=s({},t);return delete u.effects,Tn(u,"strokeDasharray",Cn(a,l)),Tn(u,"strokeDashoffset",Cn(o,i)),Tn(u,"strokeOpacity",En(a)),u}(e.leaf,r,i,g,p,v)}const b=new Map;for(const t of a){const e=[];for(const n of t.subpaths){const a=o?d:n.lengthPx;if(a<.001)continue;const i=o?n.startOffsetPx/a:0;e.push(...Sn(t.leaf,n.subpath,a,i,g,p,v,r))}b.set(t.leaf,Pn(t.leaf,e))}const k=t=>{const e=b.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?l(s({},t),{children:t.children.map(k)}):t)};return k(t)}function Pn(t,e){const n=l(s({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Sn(t,e,n,r,o,a,i,s){const l=_n(r,n,o),u=In(n,o),c=Cn(a,l),f=Cn(i,u),d=En(i),h=function(t){return{type:"path",d:t}}(pe(e));return Tn(h,"strokeDasharray",f),Tn(h,"strokeDashoffset",c),Tn(h,"strokeOpacity",d),[h]}var Mn=1;function _n(t,e,n){const[r]=zn(n);return n=>e*(-n-r+t)+Mn}function In(t,e){const[n,r]=zn(e),o=r-n+1;return e=>{const n=Ue(e[0],0,1),r=Ue(e[1],0,1),a=Math.min(n,r),i=Math.max(n,r),s=[0];let l=Mn;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+Mn),s}}function zn(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Cn(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 Tn(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=s({},a||{}),l={keyframes:n.keyframes};void 0!==n.loop&&(l.loop=n.loop),i[e]=l,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 Nn=10;function En(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+Nn,value:1})):!p&&m&&(f.push({time:d-Nn,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function Un(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 Vn(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 Rn(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+=Fn(t,r,r+1);return t.c&&e.length>1&&(n+=Fn(t,e.length-1,0)),n}function Fn(t,e,n){var r,o,a,i;const s=t.v,l=s[e],u=s[n],c=Le(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]}function Dn(t){var e;const n={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=zt(t))?void 0:e.mode)===L.frames?B.frames:B.webapi},r=Bt(t);Lt(r,n.idMap),m(r,n,()=>Ft(n,"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=ee(t,e),a=n?[...r,n]:r;for(const e of t.children)o(e,a)}};o(t,[])}(r,n);const o=function(t,e){return function(t,e){e.idMap.clear(),Lt(t,e.idMap);const n=[],r=t=>{var e;se(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);for(const t of n){const n=se(t);n&&(le(t),ue(t,ae(n),e))}}(t,e),t}(Ln(r,n),n);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(o,n.defs),{root:o,defs:n.defs,warnings:n.warnings,errors:n.errors}}function Ln(t,e){t.children&&(t.children=t.children.map(t=>Ln(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,trimPath:l,clone:u,fillGradient:c,strokeGradient:f,textAlongPath:h}=null!=n?n:{};null==n||n.isCombinedShape;n&&delete t.effects;let p=t;return p=function(t,e){var n;if(!e)return t;const r={type:"textPath",href:"string"!=typeof e.href||e.href.startsWith("#")?e.href:"#"+e.href,children:null!=(n=t.children)?n:[]};return void 0!==e.lengthAdjust&&(r.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(r.method=e.method),void 0!==e.spacing&&(r.spacing=e.spacing),he(r,"startOffset",e.startOffset),he(r,"textLength",e.textLength),t.children=[r],t}(p,h),p=function(t,e,n){return Wt(t,e,n,"fill")}(p,c,e),p=function(t,e,n){return Wt(t,e,n,"stroke")}(p,f,e),p=xn(p,l,0,e),p=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=Bt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate);const u=[l];for(let t=1;t<a;t++){const r=Bt(l),o=oe(e,t),a=o?d(r,o,n):r;u.push(a)}const c={type:"g",children:u};return void 0!==i&&(c.transform=i),void 0!==s&&(c.animate={transform:s}),c}(p,i,e),p=Zt(p,s,a,e),o?(re(p,u,e),p=v(p,a,r,o,e)):p=function(t,e,n,r){return re(t,e,r),d(t,n,r)}(p,u,a,e),(null==u?void 0:u.retime)&&(t.effects={clone:{retime:u.retime}}),r&&e.idMap.set(r,p),p}function Bn(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=qn(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=Wn(t.width),r=Wn(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),i=[],u=Zn(t,n,r,()=>"_lw_use_mat_"+ ++o,i,a);if(0===i.length)return u;const c={type:"defs",children:i},f=[...null!=(e=u.children)?e:[],c];return l(s({},u),{children:f})}function Wn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function qn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Kn(t,e,n,r,o,a,i){var u,c,f,d;const h=Et(e);Ut(h,o);const p="symbol"===h.type?Gn(h.viewBox):void 0,m=null!=(c=null!=(u=Wn(t.width))?u:null==p?void 0:p[2])?c:i[0],v=null!=(d=null!=(f=Wn(t.height))?f:null==p?void 0:p[3])?d:i[1],y="symbol"===h.type?function(t,e,n,r,o){const a=Gn(t.viewBox),i=l(s({},t),{type:"g"});if(delete i.viewBox,delete i.preserveAspectRatio,delete i.width,delete i.height,!a)return i;const[u,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===u&&0===c||v.push("translate("+-u+","+-c+")");v.length&&(i.transform=v.join(""));const y=e();return n.push({type:"clipPath",id:y,children:[{type:"rect",x:u,y:c,width:f,height:d}]}),i.clipPath="url(#"+y+")",i}(h,o,a,m,v):h,g=Zn(y,n,r,o,a,i),b=l(s({},t),{type:"g",children:[g]});return delete b.href,delete b.width,delete b.height,Rt(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 Zn(t,e,n,r,o,a){if("use"===t.type&&"string"==typeof t.href){const i=qn(t.href);if(i&&n.has(i)){const s=e.get(i);if(s)return Kn(t,s,e,n,r,o,a)}}if(!t.children)return t;let i=!1;const u=t.children.map(t=>{const s=Zn(t,e,n,r,o,a);return s!==t&&(i=!0),s});return i?l(s({},t),{children:u}):t}function Xn(t,e,n){var r,o;let a=Dn(t).root;return a=bn(a,null!=(o=null==(r=zt(a))?void 0:r.duration)?o:1e3),e===B.webapi&&(a=sn(a,null==n?void 0:n.motionPath),a=Bn(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}var Yn=new Set(["script","foreignobject"]),Jn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),$n=new Set(["href","xlink:href","src"]),Hn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Qn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,tr=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,er=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function nr(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(Jn.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||$n.has(n)&&(Hn.test(t)||Qn.test(t)||function(t){const e=tr.exec(t);return!!e&&er.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 rr(t){const e={};for(const n of Object.keys(t)){const r=Ce(n);if(K.has(r))continue;if("style"===r)continue;let o=t[n];Se.has(r)&&Array.isArray(o)?e[r]=xe(o):"transform"===r&&null!==o&&"object"==typeof o&&!Array.isArray(o)&&o.value&&"object"==typeof o.value?e.transform=Ie(o.value,{withUnits:!1}):Me.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 or(t,e){if(!t)return null;const n=t,{type:i,children:s,style:l}=n,u=((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})(n,["type","children","style"]),c=Ct(t)||e,f=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(l,c);let d;if(s)for(const t of s){const e=or(t,c);e&&(d||(d=[]),d.push(e))}return function(t,e,n,r,o){if(Yn.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const a=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e){const n=nr(t,e[t]);void 0!==n&&a.setAttribute(Ee(t),n)}if(n)for(const t in n)a.style[t]=String(n[t]);if(r)for(const t of r)a.appendChild(t);return o&&(a.textContent=o),a}(i||"g",rr(u),f,d,u[W]||u[q])}function ar(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,a=t.getRootElement();if(!a)return console.warn("setupAnimationTriggers: No root element found for animation."),t;const i=()=>{t.play()},s=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":t.play()}};switch(n){case"load":{const t=()=>i();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>i(),e=()=>s();a.addEventListener("mouseenter",t),a.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?s():i()};a.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?i():s()})},{threshold:o}).observe(a);break}return t}function ir(t){return"#"+t}function sr(t,e,n){const r=zt(t)||{},o=wn(t,B.frames),a=r.iterations;let i=1;"number"==typeof a&&(i=a||1),"infinite"===a&&(i=1/0),i<1&&(i=1);const s=+(r.duration||1e3),l=s&&i?s*(i===1/0?1/0:i):s?(null!=i?i:1)*s:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,h=0,p=1,m=!1;const v=r.frameRate,y=v&&v>0?1e3/v:0;let g=0;const b=()=>{const t=h?(Date.now()-h)*p:0;let e=d+t;return Number.isFinite(l)&&e>l&&(e=l),e<0&&(e=0),e};function k(t){let n=function(){const e=s>0?s:1;let n=0,r=0;if(s>0){t=Ue(t,0,i*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,i-1);n=Ue((t-r*e)/e,0,1)}else n=t;const o=u||"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 o||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=On(r,n*s);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}r.delay&&k(b());const A=()=>!!f&&(!!e.isConnected()&&!(Number.isFinite(l)&&b()>=l)),w=t=>{null!==c&&(cancelAnimationFrame(c),c=null),(t||A())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var t;if(!e.isConnected())return void j();const r=b();if(y>0){const t=Date.now();if(g&&t-g<y)return;g=t}if(l&&Number.isFinite(l)&&r>=l)return k(l),m||(m=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)),void j();k(r)})(),w()}))},j=()=>{f&&(d=b(),h=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),k(d))},O={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>A(),play:()=>{var t;f||(Number.isFinite(l)&&d>=l&&(d=0,m=!1),f=!0,h=Date.now(),w(!0)),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;j(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;j(),d=0,h=0,f=!1,m=!1,k(d),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;d=Number.isFinite(l)?l:b(),h=0,f=!1,k(d),t&&!m&&(m=!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");const e=b();p=t,d=e,f&&(h=Date.now())},getCurrentTime:()=>b(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(l)&&t>l&&(t=l),d=t,f&&(h=Date.now()),k(b())},destroy:()=>{O.cancel()}};return O}function lr(t,e,n,r){const o=zt(t)||{};if(!r)if(t.id){const e=ir(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");let a=sr(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=Ee(r);const a=ir(n),i=(null==t?void 0:t.querySelectorAll(a))||document.querySelectorAll(a);0!==i.length||e.has(a)||(e.add(a),console.warn('setAttribute: No elements found for selector "'+a+'"'));for(let t=0;t<i.length;t++){const e=i[t];e.setAttribute(r,o),ze.has(r)&&(e.style[r]=o)}}};return n}(r),n);return a=l(s({},a),{getRootElement:()=>r||null}),o.trigger&&ar(a,o.trigger),a}function ur(t,e,n,r){var o,a;let i=null!=(o=t.v)?o:t.value;const s=null!=(a=t.e)?a:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;return Se.has(n)&&Array.isArray(i)?u=xe(i):"transform"!==n||null===i||"object"!=typeof i||Array.isArray(i)?Me.has(n)?(Array.isArray(i)&&("translate"===n&&(i=i.map(t=>t+"px")),i=i.join(",")),"rotate"===n&&(i+="deg"),u=n+"("+i+")",c="transform"):u=""+i:(u=Ie(i,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=Ce(c),l[c]=u,l}function cr(t,e,n){var r,o,a,i,u;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(a=n.t)?a:0)-h),r=d.e?Ae(d.e)(e):e,{right:o}=je(d.e,e);c.push({t:0,v:mn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(i=r.t)?i:0)<=n){const e=null!=(u=r.t)?u:0,o=(n-e)/(h-e),a=r.e?Ae(r.e)(o):o,{left:i}=je(r.e,o);c.length>0&&(c[c.length-1]=l(s({},c[c.length-1]),{e:i})),c.push({t:n,v:mn(t,r.v,d.v,a),e:void 0})}break}c.push(d)}return c}function fr(t,e,n){var r;const o=new Map;for(const[a,i]of Object.entries(t)){const t=n.duration||1,u=cr(a,i.kfs||i.keyframes||[],t),c=[];for(let n=0;n<u.length;n++){const o=u[n],i=ur(o,Ue((null!=(r=o.t)?r:0)/t,0,1),a,e);0===n&&(i.offset||0)>0&&c.push(l(s({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(l(s({},c[c.length-1]),{offset:1})),c.length>0&&o.set(a,c)}return o}function dr(t,e,n,r){var o;const a=zt(t)||{};if(!n)if(t.id){const e=ir(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=wn(t,B.webapi),s=[],l=a.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;(null==i?void 0:i.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const i=ir(t.id),l=(null==n?void 0:n.querySelectorAll(i))||document.querySelectorAll(i);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+i+'"');const f=fr(r,c,a),d=a.delay&&a.delay>0?a.delay:void 0,h=a.delay&&a.delay<0&&a.duration?-a.delay%a.duration:void 0,p={duration:a.duration,delay:d,fill:null!=(o=a.fill)?o:"forwards",direction:a.direction,iterations:u};for(let t=0;t<l.length;t++){const n=l[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(n,t,p),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;return null==(t=e.onFinish)?void 0:t.call(e)}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;return null==(t=e.onRemove)?void 0:t.call(e)}),h&&(o.currentTime=h),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const f={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;s.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;s.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;s.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of s)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(s.forEach(e=>e.playbackRate=t),f),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=s[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{s.forEach(e=>{e.currentTime=t})},destroy:()=>{f.cancel(),s.splice(0,s.length)}};return a.trigger&&ar(f,a.trigger),f}var hr=0;function pr(){return"_px_"+Date.now().toString(36)+(++hr).toString(36)+Math.random().toString(36).substring(2,6)}function mr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>mr(t));const e=t,n={};for(const t of Object.keys(e))n[t]=mr(e[t]);return n}function vr(t){var e,n;const r=mr(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"]),u=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=pr();o.set(t,n),e.id=n}else e.animate&&(e.id=pr());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]=yr(r,o);else if(u.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=yr(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=yr(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=l(s({},r.animator),{animate:t})}return r}function yr(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function gr(t,e,n,r){const o=jt(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);const a=zt(t)||{};a.debug=!0;t=Xn(t,a.mode===L.frames?B.frames:B.webapi);let i=null;if(r&&t.children){t=vr(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=or(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=zt(t)||{};let a;return a=o.mode===L.frames?lr(t,e,n,r):dr(t,n,r,o.mode===L.webapi)||lr(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=a),a}(t,e,n,i)}var br="data";function kr(t){const{src:e,data:n,adapter:r,callbacks:o,container:a}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return gr(n,r,o,a);let i=null;return fetch(e).then(t=>t.json()).then(t=>{_t(t)?i=gr(t,r,o,a):console.error("Invalid animation document format")}),{isReady:()=>!!i,getRootElement:()=>i?i.getRootElement():null,isPlaying:()=>(null==i?void 0:i.isPlaying())||!1,play:()=>{null==i||i.play()},pause:()=>{null==i||i.pause()},cancel:()=>{null==i||i.cancel()},finish:()=>{null==i||i.finish()},setPlaybackRate:t=>{null==i||i.setPlaybackRate(t)},getCurrentTime:()=>(null==i?void 0:i.getCurrentTime())||0,setCurrentTime:t=>{null==i||i.setCurrentTime(t)},destroy:()=>{null==i||i.destroy()}}}function Ar(){const t=document.querySelectorAll("["+F+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[D]){const t=n.getAttribute(F);t&&(n[D]=kr({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=Ar,window.createAnimator=kr,window.setupAnimationTriggers=ar);var wr=[1,0,0,1,0,0];function jr(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 Or=(t,e)=>[1,0,0,1,t,e],xr=(t,e)=>[t,0,0,e,0,0];function Pr(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var Sr=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Mr=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function _r(t){let e=wr;t.translate&&(e=jr(e,Or(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=jr(e,Or(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=jr(e,Pr(t.rotate))),t.scale&&(e=jr(e,xr(t.scale[0],t.scale[1]))),n&&(e=jr(e,Or(-t.origin[0],-t.origin[1]))),e}function Ir(t,e,n){return t+(e-t)*n}function zr(t,e){return null==t?wr:"string"==typeof t?function(t){let e=wr;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=jr(e,Or(n[0]||0,n[1]||0)):"scale"===t?e=jr(e,xr(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=jr(e,Pr(n[0])):"skewX"===t?e=jr(e,Sr(n[0])):"skewY"===t?e=jr(e,Mr(n[0])):"matrix"===t&&(e=jr(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?_r(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=[Ir(h.translate[0],p.translate[0],d),Ir(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=Ir(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[Ir(h.scale[0],p.scale[0],d),Ir(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?_r(t.value):wr}var Cr=new Set(["svg","g","symbol"]),Tr=new Set(["defs","mask","clipPath","title"]);function Nr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Nr(t,e))}function Er(t){return null==t?0:Number(t)}function Ur(t){return Math.round(100*t)/100+0}function Vr(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=Ur(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 Ir(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(Ur).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return Er(t.width)+","+Er(t.height)+","+Er(t.x)+","+Er(t.y);case"ellipse":return Er(t.rx)+","+Er(t.ry)+","+Er(t.cx)+","+Er(t.cy);case"circle":return Er(t.r)+","+Er(t.cx)+","+Er(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(Er(c)||"")+"|o:"+f+"|m:"+d}function Rr(t,e,n,r,o){var a;const i=t.type||"";if(Tr.has(i))return;const s=jr(e,function(t,e){return t.animate&&t.animate.transform?zr(t.animate.transform,e):void 0!==t.transform?zr(t.transform,e):wr}(t,n));if("use"===i){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",a=r.get(e),i=jr(s,Or(Er(t.x),Er(t.y)));return void(a?Rr(a,i,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Cr.has(i)?null==(a=t.children)||a.forEach(t=>Rr(t,s,n,r,o)):o.push(Vr(t,s,n))}function Fr(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=>Fr(t,e))}function Dr(t,e){const n=new Map;Nr(t,n);const r=[];return Rr(t,wr,e,n,r),r.sort()}function Lr(t,e){const n=new Set;Fr(t,n),Fr(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=Dr(t,o),a=Dr(e,o),i=Br(n,a),s=Br(a,n);(i.length||s.length)&&r.push({time:o,onlyInA:i,onlyInB:s})}return r}function Br(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}export{Se as COLOUR_ATTR_NAMES,br as PX_ANIMATOR_DATA_KEY,D as PX_ANIM_ATTR_NAME,F as PX_ANIM_SRC_ATTR_NAME,J as PX_TRANSFORM_PART_KEYS,St as PxAnimatedSvgDocumentSchema,Q as PxAnimationDefinitionSchema,rt as PxAnimatorConfigSchema,B as PxAnimatorEngine,L as PxAnimatorMode,at as PxAttrValueSchema,Mt as PxBezierPathSchema,ot as PxBindingSchema,ht as PxCloneEffectSchema,nt as PxDefsSchema,G as PxEasingOrRefSchema,wt as PxEffectsSchema,tt as PxElementAnimationSchema,bt as PxFillGradientEffectSchema,mt as PxGradientSpreadMethod,yt as PxGradientStopSchema,vt as PxGradientType,pt as PxGradientUnits,Z as PxKeyframeSchema,X as PxLoopSchema,ct as PxMaskedByEffectSchema,Ot as PxNodeBase,xt as PxNodeSchema,Y as PxPropertyAnimationSchema,ut as PxRepeaterEffectSchema,dt as PxRetimeEffectSchema,kt as PxStrokeGradientEffectSchema,Pt as PxSvgNodeExtra,At as PxTextAlongPathEffectSchema,$ as PxTransformPartsSchema,H as PxTransformValueSchema,lt as PxTransformationEffectSchema,et as PxTriggerSchema,ft as PxTrimPathEffectSchema,ze as STYLE_ATTR_NAMES,Me as TRANSFORM_FN_NAMES,Dn as applyPlayerEffects,On as calcAnimationValues,Ee as camelCaseToKebabWordIfNeeded,Fr as collectSampleTimes,kr as createAnimator,gr as createAnimatorImpl,sr as createBasicFrameLoopAnimator,lr as createFrameLoopAnimator,dr as createWebApiAnimator,V as describeSchema,Lr as diffInEffect,Ye as evaluateMotionPathSegment,vr as generateNewIds,zt as getAnimatorConfig,Tt as getBindings,Nt as getChildren,Ct as getDefs,rr as getNormalizedProps,_t as isPxElementFileFormat,It as isPxElementFileFormatDeep,Ar as loadTagAnimators,Xn as materialiseAllInTree,Bn as materialiseAnimatedUseInstances,gn as materialiseInternalLoopsInPropAnim,bn as materialiseInternalLoopsInTree,Je as materialiseMotionPathInPropAnim,sn as materialiseMotionPathsInTree,wn as normalizeDocument,Ge as propAnimIsMotionPath,R as px,or as renderNode,U as schemaKeys,ar as setupAnimationTriggers,xe as toRGBA,jt as validateNodeEffects,Dr as visualModelAt};