@pixodesk/svg-animator-core 1.0.41 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{PxDocumentDiagnostic-COGEjBbg.d.cts → PxDocumentDiagnostic-n8yiyL0k.d.cts} +259 -84
- package/dist/{PxDocumentDiagnostic-COGEjBbg.d.ts → PxDocumentDiagnostic-n8yiyL0k.d.ts} +259 -84
- package/dist/{chunk-L6GJ6Y2M.js → chunk-EFQLDGFY.js} +90 -38
- package/dist/chunk-EFQLDGFY.js.map +1 -0
- package/dist/chunk-YWBPS6E4.min.js +1 -0
- package/dist/index.cjs +115 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +44 -9
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/internal.cjs +39 -29
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +1 -1
- package/dist/internal.min.cjs +1 -1
- package/dist/internal.min.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7ZO7PQKZ.min.js +0 -1
- package/dist/chunk-L6GJ6Y2M.js.map +0 -1
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OFFSET_DISTANCE_ATTR as t,PX_DEFAULT_DURATION_MS as e,PX_TIMELINE_SHARED_KEYS as n,PX_TIME_ONLY_TIMELINE_KEYS as r,PX_TRANSFORM_PART_KEYS as o,PX_TRIGGER_DEFAULTS as i,PX_WIRE_BASELINE_VERSION as a,PX_WIRE_SCHEMA_VERSION as s,PX_WIRE_STEPS as l,PX_WIRE_VERSION as u,PX_WIRE_VERSION_KEY as f,PxAlongPathMode as c,PxAnimatedSvgDocumentSchema as d,PxAnimatorConfigSchema as m,PxAttrValueSchema as h,PxBezierPathSchema as v,PxClipPathEffectSchema as g,PxCloneEffectSchema as p,PxCloneWithout as y,PxControlMode as k,PxDefinitionsSchema as b,PxDiagnosticKind as w,PxEffectsSchema as A,PxElementAnimationSchema as O,PxFillGradientEffectSchema as j,PxFillMode as x,PxFinishAction as M,PxGradientSpreadMethod as N,PxGradientStopSchema as F,PxGradientType as P,PxKeyframeSchema as S,PxKeyframeValueSchema as C,PxLengthAdjust as D,PxLoopDirection as I,PxLoopRepeatAt as R,PxLoopSchema as T,PxMaskType as B,PxMaskedByEffectSchema as K,PxNodeBaseSchema as E,PxNodeSchema as U,PxOutAction as z,PxPathOverflow as G,PxPinAlign as L,PxPlaybackDirection as Z,PxPropertyAnimationSchema as _,PxRepeaterEffectSchema as W,PxRetimeEffectSchema as X,PxScrollAxis as Y,PxScrollKind as q,PxScrollPhase as J,PxScrollRangePointSchema as Q,PxScrollRangeSchema as H,PxScrollSchema as V,PxScrollSource as $,PxStartOn as tt,PxStrokeTrimEffectSchema as et,PxStrokeTrimSubPaths as nt,PxSvgNodeRootSchema as rt,PxTextEffectSchema as ot,PxTextPathEffectSchema as it,PxTextPathMethod as at,PxTextPathSpacing as st,PxTimelineEngine as lt,PxTimelineEngineSetting as ut,PxTimelineSchema as ft,PxTransformByEffectSchema as ct,PxTransformPartsSchema as dt,PxTransformValueSchema as mt,PxTriggerSchema as ht,PxUnits as vt,PxWireStepKind as gt,PxWireVersionRelation as pt,TRANSFORM_ATTR as yt,TRANSFORM_PART as kt,__spreadProps as bt,__spreadValues as wt,applyTextGlyphsAlongPath as At,applyTextGlyphsEffect as Ot,applyTextPathEffect as jt,applyUseOffsetToG as xt,applyWireSteps as Mt,bezier2D_arcLengthLUT as Nt,bezierToSvgPath as Ft,calcAnimationValues as Pt,clamp as St,clone as Ct,compareWireVersion as Dt,controlModeTakesOverTrigger as It,convertWireDocument as Rt,deepClonePxNode as Tt,describeSchema as Bt,diagnoseDocument as Kt,downgradeWireDocument as Et,flattenAnimatorTimeline as Ut,formatWireVersion as zt,genId as Gt,generateNewIds as Lt,getAnimatorConfig as Zt,getBindings as _t,getChildren as Wt,getDefinitions as Xt,indexById as Yt,isNativeForced as qt,isPxDocument as Jt,isValidPxDocument as Qt,keyframeEasing as Ht,keyframeTangentIn as Vt,keyframeTangentOut as $t,keyframeTime as te,keyframeValue as ee,keyframeWith as ne,materializeInternalLoopsInTree as re,materializeMotionPathsInTree as oe,mayUseNativeScrollTimeline as ie,nestAnimatorTimeline as ae,normalizeBindings as se,parseSvgPathToBezier as le,parseWireVersion as ue,partsRecord as fe,px as ce,readAnimatable as de,readStaticOrigin as me,readWireVersion as he,regenerateIdsAndRewriteRefs as ve,regenerateIdsInClone as ge,resolveControlMode as pe,resolveTimelineEngine as ye,resolveTrigger as ke,schemaKeys as be,spliceDefs as we,stripHash as Ae,toDomProps as Oe,validateDocument as je,validateNodeEffects as xe,wireVersionAdvice as Me,writeAnimatableChannel as Ne}from"./chunk-7ZO7PQKZ.min.js";function Fe(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=Se(r,e.origin,!0),r=Pe(r,"scale",e.scale,n),r=Pe(r,"skew",e.skew,n),r=Pe(r,"rotate",e.rotate,n),r=Se(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=Pe(r,"translate",e.translate,n):(r=Se(r,e.origin,!0),r=Pe(r,"translate",e.translate,n),r=Se(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function Pe(t,e,n,r){if(void 0===n)return t;const o=de(n);if("static"===o.kind)return{type:"g",transform:{value:fe(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>ne(t,fe(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 Se(t,e,n){if(void 0===e)return t;const r=de(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=>ne(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function Ce(t,e,n){var r,o,i;if("use"===t.type&&"translate"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.without)){const r=Ae(t.effects.clone.source);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>Ce(t,e,n))}function De(t,e,n,r,o){const i=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=Re(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,f=a&&Re((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&Re((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=Ie(i.full),r=Ie(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)?f&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=wt({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=Re(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=Fe(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(u.transform=i.transform),void 0!==i.animate&&(u.animate=i.animate),a&&(delete u.id,u=Fe(u,a,o),u.id=n),u}function Ie(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 Re(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 Te(t,e,n,r){if(!e)return t;const o=Gt(n,"grad"),i=function(t,e){const n={type:t.type===P.radial?"radialGradient":"linearGradient",id:e};t.type===P.linear?(Be(n,"x1","y1",t.start),Be(n,"x2","y2",t.end)):(Be(n,"cx","cy",t.center),function(t,e,n){const r=de(n);if("absent"===r.kind)return;Ne(t,e,r,{asString:!0})}(n,"r",t.radius),Be(n,"fx","fy",t.focal));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);return n.children=function(t){var e,n;if(!t)return[];const r=de(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(Ke):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=ee(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=ee(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:Ee(o,0,t))?n:{offset:t/Math.max(1,a-1),color:"#000000"};l.push({offset:r.offset,color:r.color})}return l.map((t,e)=>function(t,e,n,r,o){var i;const a=[],s=[];let l=!1;for(const r of e){const o=te(r),u=ee(r),f=null!=(i=null==u?void 0:u[n])?i:Ee(e,e.indexOf(r),n);if(!f)continue;const c=Ht(r),d={time:o,value:f.color};void 0!==c&&(d.easing=c),a.push(d);const m={time:o,value:f.offset};void 0!==c&&(m.easing=c),s.push(m),f.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:Ue(t.offset),stopColor:t.color},f={};a.length&&(f.stopColor={keyframes:a},void 0!==o&&(f.stopColor.loop=o));l&&s.length&&(f.offset={keyframes:s},void 0!==o&&(f.offset.loop=o));Object.keys(f).length&&(u.animate=f);return u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function Be(t,e,n,r){var o,i,a;const s=de(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const f=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(f)&&(t[e]=String(f[0]),t[n]=String(f[1]))}function Ke(t){return{type:"stop",offset:Ue(t.offset),stopColor:t.color}}function Ee(t,e,n){for(let r=e;r>=0;r--){const e=ee(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=ee(t[r]);if(null==e?void 0:e[n])return e[n]}}function Ue(t){return Math.round(1e3*t)/10+"%"}function ze(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function Ge(t,e,n,r){if(!e)return t;const o=Ae(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=Gt(r,"mask");let a={type:"use",href:"#"+o};if(n)a=Le(a,n,r);else if(Xe(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=ne(t,void 0);if(Array.isArray(e.translate)&&a.push(bt(wt(wt({},r),We(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(bt(wt({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(bt(wt({},r),{value:t}))}}const u=null==o?void 0:o.loop,f=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let c=t;a.length&&(c={type:"g",animate:{transform:f(a)},children:[c]});s.length&&(c={type:"g",animate:{transform:f(s)},children:[c]});l.length&&(c={type:"g",animate:{transform:f(l)},children:[c]});return c}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,f,c,d,m;const h=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let v;const g=[];for(;null!==(v=h.exec(t));){const t=v[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:v[1],args:t})}if(!g.length)return;const p=g[g.length-1];if("translate"===p.name)for(let t=g.length-2;t>=0;t--){const f=g[t];if("translate"!==f.name)continue;const c=null!=(e=f.args[0])?e:0,d=null!=(n=f.args[1])?n:0,m=null!=(r=p.args[0])?r:0,h=null!=(o=p.args[1])?o:0;if(m!==-c||h!==-d)continue;const v={};v.origin=[c,d];for(let e=0;e<t;e++)if("translate"===g[e].name){const t=null!=(i=g[e].args[0])?i:0,n=null!=(a=g[e].args[1])?a:0;v.translate=v.translate?[v.translate[0]+t,v.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)v.rotate=(null!=(s=v.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;v.scale=v.scale?[v.scale[0]*e,v.scale[1]*n]:[e,n]}}return v}let y,k,b;for(const t of g)if("translate"===t.name){const e=null!=(f=t.args[0])?f:0,n=null!=(c=t.args[1])?c:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)k=(null!=k?k:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(m=t.args[0])?m:1,n=t.args.length>1?t.args[1]:e;b=b?[b[0]*e,b[1]*n]:[e,n]}const w={};y&&(w.translate=y);void 0!==k&&(w.rotate=k);b&&(w.scale=b);return Object.keys(w).length?w:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}return}(t);e&&(a=Le(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||Xe(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?Qe(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const f=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)f.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)f.add(e.time);if(!(f.size>0)){const e=Ye(l),n=Ye(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 c=Array.from(f).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:c.map(t=>{const e=qe(l,t),n=qe(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}function Le(t,e,n){if(!e)return t;const r=me(e.origin,n);let o=t;return o=Ze(o,"translate",e.translate,void 0,n),o=Ze(o,"rotate",e.rotate,r,n),o=Ze(o,"scale",e.scale,r,n),o}function Ze(t,e,n,r,o){if(void 0===n)return t;const i="scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n,a=de(i);if("static"===a.kind)return{type:"g",transform:{value:fe(e,_e(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>{const n=ne(t,fe(e,_e(e,t.value),r));return"translate"===e?wt(wt({},n),We(t)):n})};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function _e(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function We(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function Xe(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Ye(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 qe(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Je(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Je(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function Qe(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}function He(t,e,n){if(!e)return;const r=Ae(e.source);if(!r)return void(e.without===y.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===y.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Ve(t,e){const n={};return void 0!==t.translate&&(n.translate=$e(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=$e(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=$e(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];return $e(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function $e(t,e,n=!1){const r=de(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return("number"==typeof t||Array.isArray(t))&&!n?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?bt(wt({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}function tn(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function en(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-1),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+1,value:0}],a=wt({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function nn(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function rn(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function on(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 an(t,e,n){const r=Ae(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=sn(r,e,n,new Set);o&&(t.href="#"+o)}function sn(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=Ct(o);if(ge(i,n),"use"===o.type?un(i,e.start,e.stretch):ln(i,e.start,e.stretch),on(i),"use"===o.type&&o.href){const a=Ae(o.href);if(a){const s=rn(o),l=s?nn(tn(s),e):e,u=new Set(r);u.add(t);const f=sn(a,l,n,u);f&&(i.href="#"+f)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=rn(t);if("use"===t.type&&s&&t.href){const i=Ae(t.href);if(i){const a=nn(tn(s),e),l=new Set(r);l.add(o);const u=sn(i,a,n,l);u&&(t.href="#"+u)}on(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function ln(t,e,n){var r;un(t,e,n),null==(r=t.children)||r.forEach(t=>ln(t,e,n))}function un(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 fn(t,e,n){if(!e)return t;const r=e.subPaths===nt.combined,o=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)i(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,f;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(f=t.ry)?f:0);if(!(r>0&&o>0))return;const c=r*xn,d=o*xn,m=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+m(e+r,n+d,e+c,n+o,e,n+o)+m(e-c,n+o,e-r,n+d,e-r,n)+m(e-r,n-d,e-c,n-o,e,n-o)+m(e+c,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=le(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=On(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const e of t.subpaths)r||(a=0),e.startOffsetPx=a,a+=e.lengthPx;const l=a;if(r&&l<.001)return t;const u=de(e.offset),f="absent"===u.kind?{kind:"static",value:0}:u,c=function(t){const e=de(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:te(t),value:ee(t),easing:Ht(t)}));if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=wn(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=An(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=An(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),d="absent"===c.kind?{kind:"static",value:[0,1]}:c,m=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=ee(n);"number"==typeof t&&e.push(t)}return e}(f),h=[m.length?Math.min(...m):0,m.length?Math.max(...m):0];if(1===o.length&&o[0].leaf===t&&1===o[0].subpaths.length){const e=o[0],n=e.subpaths[0],i=r?l:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=hn(n,e,r),s=vn(e,r),l=wt({},t);return delete l.effects,yn(l,"strokeDasharray",pn(i,s)),yn(l,"strokeDashoffset",pn(o,a)),yn(l,"strokeOpacity",bn(i)),l}(e.leaf,i,a,h,f,d)}const v=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?l:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...dn(t.leaf,o.subpath,i,a,h,f,d,n))}v.set(t.leaf,cn(t.leaf,e))}const g=t=>{const e=v.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?bt(wt({},t),{children:t.children.map(g)}):t)};return g(t)}function cn(t,e){const n=bt(wt({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function dn(t,e,n,r,o,i,a,s){const l=hn(r,n,o),u=vn(n,o),f=pn(i,l),c=pn(a,u),d=bn(a),m=function(t){return{type:"path",d:t}}(Ft(e));return yn(m,"strokeDasharray",c),yn(m,"strokeDashoffset",f),yn(m,"strokeOpacity",d),[m]}var mn=1;function hn(t,e,n){const[r]=gn(n);return n=>e*(-n-r+t)+mn}function vn(t,e){const[n,r]=gn(e),o=r-n+1;return e=>{const n=St(e[0],0,1),r=St(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=mn;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+mn),s}}function gn(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function pn(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:te(t),value:e(ee(t)),easing:Ht(t)})),loop:t.loop}}function yn(t,e,n){n&&Ne(t,e,n)}var kn=10;function bn(t){const e=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return e(t.value)?{kind:"static",value:0}:void 0;const n=t.keyframes;let r=!1,o=!0;for(const t of n)e(ee(t))?r=!0:o=!1;if(!r)return;if(o)return{kind:"static",value:0};const i=[];for(let t=0;t<n.length;t++){const r=n[t],o=t>0?n[t-1]:void 0,a=t<n.length-1?n[t+1]:void 0,s=te(r),l=e(ee(r)),u=o?l&&e(ee(o)):l,f=a?l&&e(ee(a)):l;u&&!f?(i.push({time:s,value:0}),i.push({time:s+kn,value:1})):!u&&f&&(i.push({time:s-kn,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function wn(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function An(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function On(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+=jn(t,r,r+1);return t.c&&e.length>1&&(n+=jn(t,e.length-1,0)),n}function jn(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],f=null!=(o=null==(r=t.o)?void 0:r[e])?o:l,c=null!=(a=null==(i=t.i)?void 0:i[n])?a:u,d=Nt(l,f,c,u);return d.ds[d.ds.length-1]}var xn=.5522847498307936;function Mn(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:ye(null==(e=Zt(t))?void 0:e.engine),glyphs:null==(n=Xt(t))?void 0:n.fonts},o=Ct(t);Yt(o,r.idMap),Ce(o,r,()=>Gt(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=Ae(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=Qe(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),Yt(t,e.idMap);const n=[],r=t=>{var e;rn(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&rn(o)&&n++,"use"===o.type&&o.href){const t=Ae(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=Ae(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=rn(t);if(!n)continue;const r=n.timeCrop;on(t),an(t,tn(n),e),r&&en(t,r,e)}}(t,e),t}(Nn(o,r),r);return we(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function Nn(t,e){t.children&&(t.children=t.children.map(t=>Nn(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,strokeTrim:u,clone:f,fillGradient:c,strokeGradient:d,textPath:m,text:h}=null!=n?n:{};n&&delete t.effects;let v=t,g=!1;if(null==h?void 0:h.useGlyphs)if(m){const t="string"==typeof m.pathData?m.pathData:void 0,n=At(v,e,t,m.startOffset,m.textLength,m.pathOverflow);n&&(v=n,g=!0)}else v=Ot(v,h,e),g=!0;return g||(v=jt(v,m,e)),v=function(t,e,n){return Te(t,e,n,"fill")}(v,c,e),v=function(t,e,n){return Te(t,e,n,"stroke")}(v,d,e),v=fn(v,u,e),v=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Ct(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const r=Ct(l),o=Ve(e,t),i=o?Fe(r,o,n):r;u.push(i)}const f={type:"g",children:u};return t.id&&(f.id=t.id),void 0!==a&&(f.transform=a),void 0!==s&&(f.animate={transform:s}),f}(v,a,e),v=Ge(v,s,i,e),v=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=Gt(n,"clip"),o={type:"path"},i=de(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=ze(i.value):(Ne(o,"d",i),void 0!==o.d&&(o.d=ze(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(v,l,e),o?(He(v,f,e),v=De(v,i,r,o,e)):v=function(t,e,n,r){return He(t,e,r),Fe(t,n,r)}(v,f,i,e),(null==f?void 0:f.retime)&&(t.effects={clone:{retime:f.retime}}),r&&e.idMap.set(r,v),v}function Fn(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function Pn(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Fn(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Sn=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function Cn(e){const n=e=>{var r;let o=e;const i=e.animate,a=null==i?void 0:i.transform;if(a){const n=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=ee(o[0]),a=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],s=[];for(const t of o){const n=ee(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(e=null==n?void 0:n.origin)?e:[0,0];if(o[0]!==a[0]||o[1]!==a[1])return;s.push([r[0]+a[0],r[1]+a[1]])}if(!o.some(t=>Vt(t)||$t(t)))return;let l="M"+Sn(s[0][0])+","+Sn(s[0][1]);const u=[];for(let t=0;t<s.length-1;t++){const e=s[t],i=s[t+1],a=null!=(n=$t(o[t]))?n:[0,0],f=null!=(r=Vt(o[t+1]))?r:[0,0],c=[e[0]+a[0],e[1]+a[1]],d=[i[0]+f[0],i[1]+f[1]];l+="C"+Sn(c[0])+","+Sn(c[1])+","+Sn(d[0])+","+Sn(d[1])+","+Sn(i[0])+","+Sn(i[1]),u.push(Pn(e,c,d,i))}const f=u.reduce((t,e)=>t+e,0);if(!(f>0))return;const c=[];let d=0;for(let t=0;t<o.length;t++){t>0&&(d+=u[t-1]);const e={t:te(o[t]),v:d/f},n=Ht(o[t]);void 0!==n&&(e.e=n),c.push(e)}return{pathStr:l,distanceKfs:c,autoOrient:!!t.autoOrient,anchor:a}}(a);if(n){const r=wt({},i);delete r[yt];const s={keyframes:n.distanceKfs};void 0!==a.loop&&(s.loop=a.loop),r[t]=s;const l=e.transform;let u=l;if(l&&"object"==typeof l){const t=wt({},l);delete t[kt.translate],delete t[kt.origin],u=Object.keys(t).length?t:void 0}o=bt(wt({},e),{animate:r,style:bt(wt({},e.style),{offsetPath:"path('"+n.pathStr+"')",offsetAnchor:Sn(n.anchor[0])+"px "+Sn(n.anchor[1])+"px",offsetRotate:n.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==u?o.transform=u:delete o.transform}}if(null==(r=o.children)?void 0:r.length){const t=o.children.map(n);t.some((t,e)=>t!==o.children[e])&&(o=bt(wt({},o),{children:t}))}return o};return n(e)}function Dn(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=Rn(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=Bn(t.viewBox);if(e)return[e[2],e[3]];const n=In(t.width),r=In(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=Kn(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return bt(wt({},s),{children:u})}function In(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Rn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Tn(t,e,n,r,o,i,a){var s,l,u,f;const c=Tt(e);ve(c,o);const d="symbol"===c.type?Bn(c.viewBox):void 0,m=null!=(l=null!=(s=In(t.width))?s:null==d?void 0:d[2])?l:a[0],h=null!=(f=null!=(u=In(t.height))?u:null==d?void 0:d[3])?f:a[1],v="symbol"===c.type?function(t,e,n,r,o){const i=Bn(t.viewBox),a=bt(wt({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,f]=i,c=u>0&&f>0?Math.min(r/u,o/f):1,d=(r-u*c)/2,m=(o-f*c)/2,h=[];0===d&&0===m||h.push("translate("+d+","+m+")");1!==c&&h.push("scale("+c+")");0===s&&0===l||h.push("translate("+-s+","+-l+")");h.length&&(a.transform=h.join(""));const v=e();return n.push({type:"clipPath",id:v,children:[{type:"rect",x:s,y:l,width:u,height:f}]}),a.clipPath="url(#"+v+")",a}(c,o,i,m,h):c,g=Kn(v,n,r,o,i,a),p=bt(wt({},t),{type:"g",children:[g]});return delete p.href,delete p.width,delete p.height,xt(p)}function Bn(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 Kn(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Rn(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return Tn(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Kn(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?bt(wt({},t),{children:s}):t}function En(t,n,r){var o,i;let a=Mn(t).root;a=Cn(a);const s=null!=(i=null==(o=Zt(a))?void 0:o.duration)?i:e;return a=re(a,s),n===lt.native&&(a=oe(a,null==r?void 0:r.motionPath),a=Dn(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 Un="setPlaybackRate: rate must be finite and non-zero";function zn(t){return Number.isFinite(t)&&0!==t}function Gn(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}function Ln(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function Zn(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function _n(t,e,n){const r=Ln(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function Wn(t,e,n){const r=Ln(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function Xn(t,e=Date.now){let n=0,r=0,o=!1,i=1;const a=()=>Zn(o?n+(e()-r)*i:n,t);return{now:a,isRunning:()=>o,start:(s,l)=>{n=Zn(null!=l?l:a(),t),i=zn(s)?s:1,r=e(),o=!0},stop:()=>{n=a(),r=0,o=!1},seek:i=>{n=Zn(i,t),o&&(r=e())}}}function Yn(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function qn(t,n,r){var o;const i=Zt(t)||{},a=se(t,lt.js),s=i.iterations;let l=1;"number"==typeof s&&(l=s||1),"infinite"===s&&(l=1/0),l<1&&(l=1);const u=+(i.duration||e),f=u&&l?u*(l===1/0?1/0:l):u?(null!=l?l:1)*u:0,c=i.direction||"normal",d=null!=(o=i.fill)?o:"forwards",m="forwards"===d||"both"===d,h="backwards"===d||"both"===d;let v=null,g=!1,p=-(i.delay||0),y=0,k=1,b=!1;const w=i.frameRate,A=w&&w>0?1e3/w:0;let O=0;const j=()=>{const t=y?(Date.now()-y)*k:0;return p+t},x=()=>{let t=j();return Number.isFinite(f)&&t>f&&(t=f),t<0&&(t=0),t};function M(t){let e=function(){const e=u>0?u:1;let n=0,r=0;if(u>0){t=St(t,0,l*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,l-1);n=St((t-r*e)/e,0,1)}else n=t;const o=c||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=Pt(r,e*u);for(const[e,r]of Object.entries(o))n.setAttribute(t.id,e,r)}}i.delay&&(i.delay<0?M(x()):h&&M(0));const N=()=>!!g&&(!!n.isConnected()&&(k<0?j()>0:!(Number.isFinite(f)&&x()>=f))),F=t=>{null!==v&&(Yn(v),v=null),(t||N())&&(v=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{v=null,(()=>{var t,e;if(!n.isConnected())return void P();const o=x(),i=j();if(i<0&&k>0)h&&M(0);else{if(k<0&&i<=0)return P(),M(0),void(b||(b=!0,null==(t=null==r?void 0:r.onFinish)||t.call(r)));if(k>0&&f&&Number.isFinite(f)&&o>=f)return P(),M(m?f:0),void(b||(b=!0,null==(e=null==r?void 0:r.onFinish)||e.call(r)));if(A>0){const t=Date.now();if(O&&t-O<A)return;O=t}M(o)}})(),F()}))},P=()=>{if(!g)return;let t=j();Number.isFinite(f)&&t>f&&(t=f),p=t,y=0,g=!1,null!==v&&(Yn(v),v=null),t>=0?M(t):h&&M(0)},S={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>N(),play:()=>{var t;(()=>{if(!g){if(k>=0)Number.isFinite(f)&&p>=f&&(p=0);else if(p<=0){if(!Number.isFinite(f))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");p=f}b=!1,g=!0,y=Date.now(),F(!0)}})(),null==(t=null==r?void 0:r.onPlay)||t.call(r)},pause:()=>{var t;P(),null==(t=null==r?void 0:r.onPause)||t.call(r)},cancel:()=>{var t;P(),p=0,y=0,g=!1,b=!1,M(p),null==(t=null==r?void 0:r.onCancel)||t.call(r)},finish:()=>{((t=!0)=>{var e;p=Number.isFinite(f)?f:x(),y=0,g=!1,null!==v&&(Yn(v),v=null),M(m?p:0),t&&!b&&(b=!0,null==(e=null==r?void 0:r.onFinish)||e.call(r))})(!0)},setPlaybackRate:t=>{if(!zn(t))return void console.warn(Un);let e=j();Number.isFinite(f)&&e>f&&(e=f),t<0!=k<0&&(b=!1),k=t,p=e,g&&(y=Date.now())},getCurrentTime:()=>x(),setCurrentTime:t=>{t=Zn(t,f),p=t,g&&(y=Date.now()),(!Number.isFinite(f)||t<f)&&(b=!1),M(x())},getCurrentProgress:()=>_n(x(),u,l),setCurrentProgress:t=>{S.setCurrentTime(Wn(t,u,l))},destroy:()=>{var t;S.cancel(),null==(t=null==r?void 0:r.onRemove)||t.call(r)}};return S}var Jn=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],Qn=["definitions","bindings"],Hn=t=>!!t&&"object"==typeof t&&!Array.isArray(t);function Vn(t,e){const n=Hn(t)?wt({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?Hn(r)?n[t]=Vn(n[t],r):n[t]=r:delete n[t]}return n}function $n(t,e,o){const i=Hn(a=t)&&"string"==typeof a.type?a.type:"time";var a;const s=Hn(e)&&"string"==typeof e.type?String(e.type):i;let l;if(s!==i){const r={};if(Hn(t))for(const e of n)void 0!==t[e]&&(r[e]=t[e]);l=Vn(r,e)}else l=Vn(t,e);if("scroll"===(u=s)||"view"===u){for(const t of r)void 0!==l[t]&&(o("animator.timeline."+t+": no slot on a '"+s+"' timeline — dropped"),delete l[t]);"infinite"===l.iterations&&(o("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete l.iterations)}var u;return l}function tr(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("timeline override: not valid JSON — ignored",t),n=void 0}else n=null!=t?t:void 0;const{duration:r,delay:o,iterations:i,startOn:a}=e;if(void 0===r&&void 0===o&&void 0===i&&void 0===a)return void 0===n?void 0:{timeline:n};const s=Hn(n)?wt({},n):{};return void 0!==r&&(s.duration=r),void 0!==o&&(s.delay=o),void 0!==i&&(s.iterations=i),void 0!==a&&(s.trigger=bt(wt({},s.trigger),{startOn:a})),{timeline:s}}function er(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!Hn(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=Hn(t)?Jn.filter(e=>void 0!==t[e]):[];o.length&&r("animator: the base carries the flat runtime spelling ("+o.join(", ")+"); the patch merges the wire spelling only");const i=Hn(t)?wt({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?Hn(n)?i[t]=Vn(i[t],n):i[t]=n:i.timeline=Hn(n)?$n(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}function nr(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetTimeline);if(!(t&&void 0!==e&&(i||null!==e&&Hn(e)&&Object.keys(e).length)))return{doc:t,warnings:[]};const a=t,s=Hn(a.animator),l=!s&&Hn(null==(r=a.meta)?void 0:r.animator),u=s?a.animator:l?a.meta.animator:void 0,f=[];s&&Hn(null==(o=a.meta)?void 0:o.animator)&&f.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let c=u;if(i){const t={};for(const e of Qn)Hn(u)&&void 0!==u[e]&&(t[e]=u[e]);c=t}const d=er(c,null!=e?e:{});return f.push(...d.warnings),d.config===u?{doc:t,warnings:f}:l?{doc:bt(wt({},a),{meta:bt(wt({},a.meta),{animator:d.config})}),warnings:f}:{doc:bt(wt({},a),{animator:d.config}),warnings:f}}export{Un as PX_RATE_REJECTED,o as PX_TRANSFORM_PART_KEYS,i as PX_TRIGGER_DEFAULTS,a as PX_WIRE_BASELINE_VERSION,s as PX_WIRE_SCHEMA_VERSION,l as PX_WIRE_STEPS,u as PX_WIRE_VERSION,f as PX_WIRE_VERSION_KEY,c as PxAlongPathMode,d as PxAnimatedSvgDocumentSchema,m as PxAnimatorConfigSchema,h as PxAttrValueSchema,v as PxBezierPathSchema,g as PxClipPathEffectSchema,p as PxCloneEffectSchema,y as PxCloneWithout,k as PxControlMode,b as PxDefinitionsSchema,w as PxDiagnosticKind,A as PxEffectsSchema,O as PxElementAnimationSchema,j as PxFillGradientEffectSchema,x as PxFillMode,M as PxFinishAction,N as PxGradientSpreadMethod,F as PxGradientStopSchema,P as PxGradientType,S as PxKeyframeSchema,C as PxKeyframeValueSchema,D as PxLengthAdjust,I as PxLoopDirection,R as PxLoopRepeatAt,T as PxLoopSchema,B as PxMaskType,K as PxMaskedByEffectSchema,E as PxNodeBaseSchema,U as PxNodeSchema,z as PxOutAction,G as PxPathOverflow,L as PxPinAlign,Z as PxPlaybackDirection,_ as PxPropertyAnimationSchema,W as PxRepeaterEffectSchema,X as PxRetimeEffectSchema,Y as PxScrollAxis,q as PxScrollKind,J as PxScrollPhase,Q as PxScrollRangePointSchema,H as PxScrollRangeSchema,V as PxScrollSchema,$ as PxScrollSource,tt as PxStartOn,et as PxStrokeTrimEffectSchema,nt as PxStrokeTrimSubPaths,rt as PxSvgNodeRootSchema,ot as PxTextEffectSchema,it as PxTextPathEffectSchema,at as PxTextPathMethod,st as PxTextPathSpacing,lt as PxTimelineEngine,ut as PxTimelineEngineSetting,ft as PxTimelineSchema,ct as PxTransformByEffectSchema,dt as PxTransformPartsSchema,mt as PxTransformValueSchema,ht as PxTriggerSchema,vt as PxUnits,gt as PxWireStepKind,pt as PxWireVersionRelation,nr as applyAnimatorConfig,Mt as applyWireSteps,Pt as calcAnimationValues,Zn as clampSeekMs,Dt as compareWireVersion,It as controlModeTakesOverTrigger,Rt as convertWireDocument,qn as createAdapterAnimator,Xn as createRunClock,Bt as describeSchema,Kt as diagnoseDocument,Et as downgradeWireDocument,Ut as flattenAnimatorTimeline,tr as foldTimelineOverride,zt as formatWireVersion,Lt as generateNewIds,Zt as getAnimatorConfig,_t as getBindings,Wt as getChildren,Xt as getDefinitions,qt as isNativeForced,Jt as isPxDocument,zn as isValidPlaybackRate,Qt as isValidPxDocument,En as materializeAllInTree,Mn as materializeNodeEffects,ie as mayUseNativeScrollTimeline,er as mergeAnimatorConfig,ae as nestAnimatorTimeline,se as normalizeBindings,ue as parseWireVersion,Ln as progressSpanMs,Wn as progressToTimeMs,ce as px,he as readWireVersion,pe as resolveControlMode,ye as resolveTimelineEngine,ke as resolveTrigger,be as schemaKeys,Gn as seekCeilingMs,_n as timeToProgress,Oe as toDomProps,je as validateDocument,xe as validateNodeEffects,Me as wireVersionAdvice};
|
|
1
|
+
import{OFFSET_DISTANCE_ATTR as t,PX_DEFAULT_DURATION_MS as e,PX_TIMELINE_SHARED_KEYS as n,PX_TIME_ONLY_TIMELINE_KEYS as r,PX_TRANSFORM_PART_KEYS as o,PX_TRIGGER_DEFAULTS as i,PX_WIRE_BASELINE_VERSION as a,PX_WIRE_SCHEMA_VERSION as s,PX_WIRE_STEPS as l,PX_WIRE_VERSION as u,PX_WIRE_VERSION_KEY as c,PxAlongPathMode as f,PxAnimatedSvgDocumentSchema as d,PxAnimatorConfigSchema as m,PxAttrValueSchema as v,PxBezierPathSchema as h,PxClipPathEffectSchema as g,PxCloneEffectSchema as p,PxCloneWithout as y,PxControlMode as k,PxDefinitionsSchema as b,PxDiagnosticKind as A,PxEffectsSchema as w,PxElementAnimationSchema as j,PxFillGradientEffectSchema as O,PxFillMode as x,PxFinishAction as N,PxGradientSpreadMethod as M,PxGradientStopSchema as F,PxGradientType as S,PxKeyframeSchema as C,PxKeyframeValueSchema as P,PxLengthAdjust as R,PxLoopDirection as I,PxLoopRepeatAt as D,PxLoopSchema as B,PxMaskType as T,PxMaskedByEffectSchema as E,PxMouseOutAction as U,PxNodeBaseSchema as K,PxNodeSchema as z,PxOffScreenAction as G,PxPathOverflow as L,PxPinAlign as W,PxPlaybackDirection as Y,PxPropertyAnimationSchema as _,PxRepeaterEffectSchema as X,PxRetimeEffectSchema as q,PxScrollAxis as J,PxScrollKind as Z,PxScrollPhase as H,PxScrollRangePointSchema as Q,PxScrollRangeSchema as V,PxScrollSchema as $,PxScrollSource as tt,PxStrokeTrimEffectSchema as et,PxStrokeTrimSubPaths as nt,PxSvgNodeRootSchema as rt,PxTextEffectSchema as ot,PxTextPathEffectSchema as it,PxTextPathMethod as at,PxTextPathSpacing as st,PxTimelineEngine as lt,PxTimelineEngineSetting as ut,PxTimelineSchema as ct,PxTransformByEffectSchema as ft,PxTransformPartsSchema as dt,PxTransformValueSchema as mt,PxTriggerSchema as vt,PxTriggerStart as ht,PxUnits as gt,PxWireStepKind as pt,PxWireVersionRelation as yt,TRANSFORM_ATTR as kt,TRANSFORM_PART as bt,__spreadProps as At,__spreadValues as wt,applyTextGlyphsAlongPath as jt,applyTextGlyphsEffect as Ot,applyTextPathEffect as xt,applyUseOffsetToG as Nt,applyWireSteps as Mt,bezier2D_arcLengthLUT as Ft,bezierToSvgPath as St,calcAnimationValues as Ct,clamp as Pt,clone as Rt,compareWireVersion as It,controlModeTakesOverTrigger as Dt,convertWireDocument as Bt,deepClonePxNode as Tt,describeSchema as Et,diagnoseDocument as Ut,downgradeWireDocument as Kt,flattenAnimatorTimeline as zt,formatWireVersion as Gt,genId as Lt,generateNewIds as Wt,getAnimatorConfig as Yt,getBindings as _t,getChildren as Xt,getDefinitions as qt,indexById as Jt,isNativeForced as Zt,isPxDocument as Ht,isValidPxDocument as Qt,keyframeEasing as Vt,keyframeTangentIn as $t,keyframeTangentOut as te,keyframeTime as ee,keyframeValue as ne,keyframeWith as re,materializeInternalLoopsInTree as oe,materializeMotionPathsInTree as ie,mayUseNativeScrollTimeline as ae,nestAnimatorTimeline as se,normalizeBindings as le,parseSvgPathToBezier as ue,parseWireVersion as ce,partsRecord as fe,px as de,readAnimatable as me,readStaticOrigin as ve,readWireVersion as he,regenerateIdsAndRewriteRefs as ge,regenerateIdsInClone as pe,resolveControlMode as ye,resolveTimelineEngine as ke,resolveTrigger as be,schemaKeys as Ae,spliceDefs as we,stripHash as je,toDomProps as Oe,validateDocument as xe,validateNodeEffects as Ne,wireVersionAdvice as Me,writeAnimatableChannel as Fe}from"./chunk-YWBPS6E4.min.js";function Se(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=Pe(r,e.origin,!0),r=Ce(r,"scale",e.scale,n),r=Ce(r,"skew",e.skew,n),r=Ce(r,"rotate",e.rotate,n),r=Pe(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=Ce(r,"translate",e.translate,n):(r=Pe(r,e.origin,!0),r=Ce(r,"translate",e.translate,n),r=Pe(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function Ce(t,e,n,r){if(void 0===n)return t;const o=me(n);if("static"===o.kind)return{type:"g",transform:{value:fe(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>re(t,fe(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 Pe(t,e,n){if(void 0===e)return t;const r=me(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=>re(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function Re(t,e,n){var r,o,i;if("use"===t.type&&"translate"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.without)){const r=je(t.effects.clone.source);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>Re(t,e,n))}function Ie(t,e,n,r,o){const i=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=Be(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&Be((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&Be((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=De(i.full),r=De(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)?c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=wt({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=Be(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=Se(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(u.transform=i.transform),void 0!==i.animate&&(u.animate=i.animate),a&&(delete u.id,u=Se(u,a,o),u.id=n),u}function De(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 Be(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 Te(t,e,n,r){if(!e)return t;const o=Lt(n,"grad"),i=function(t,e){const n={type:t.type===S.radial?"radialGradient":"linearGradient",id:e};t.type===S.linear?(Ee(n,"x1","y1",t.start),Ee(n,"x2","y2",t.end)):(Ee(n,"cx","cy",t.center),function(t,e,n){const r=me(n);if("absent"===r.kind)return;Fe(t,e,r,{asString:!0})}(n,"r",t.radius),Ee(n,"fx","fy",t.focal));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);return n.children=function(t){var e,n;if(!t)return[];const r=me(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(Ue):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=ne(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=ne(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:Ke(o,0,t))?n:{offset:t/Math.max(1,a-1),color:"#000000"};l.push({offset:r.offset,color:r.color})}return l.map((t,e)=>function(t,e,n,r,o){var i;const a=[],s=[];let l=!1;for(const r of e){const o=ee(r),u=ne(r),c=null!=(i=null==u?void 0:u[n])?i:Ke(e,e.indexOf(r),n);if(!c)continue;const f=Vt(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),a.push(d);const m={time:o,value:c.offset};void 0!==f&&(m.easing=f),s.push(m),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:ze(t.offset),stopColor:t.color},c={};a.length&&(c.stopColor={keyframes:a},void 0!==o&&(c.stopColor.loop=o));l&&s.length&&(c.offset={keyframes:s},void 0!==o&&(c.offset.loop=o));Object.keys(c).length&&(u.animate=c);return u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function Ee(t,e,n,r){var o,i,a;const s=me(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function Ue(t){return{type:"stop",offset:ze(t.offset),stopColor:t.color}}function Ke(t,e,n){for(let r=e;r>=0;r--){const e=ne(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=ne(t[r]);if(null==e?void 0:e[n])return e[n]}}function ze(t){return Math.round(1e3*t)/10+"%"}function Ge(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function Le(t,e,n,r){if(!e)return t;const o=je(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=Lt(r,"mask");let a={type:"use",href:"#"+o};if(n)a=We(a,n,r);else if(qe(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=re(t,void 0);if(Array.isArray(e.translate)&&a.push(At(wt(wt({},r),Xe(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(At(wt({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(At(wt({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]});s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]});l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]});return f}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,m;const v=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let h;const g=[];for(;null!==(h=v.exec(t));){const t=h[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:h[1],args:t})}if(!g.length)return;const p=g[g.length-1];if("translate"===p.name)for(let t=g.length-2;t>=0;t--){const c=g[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,m=null!=(r=p.args[0])?r:0,v=null!=(o=p.args[1])?o:0;if(m!==-f||v!==-d)continue;const h={};h.origin=[f,d];for(let e=0;e<t;e++)if("translate"===g[e].name){const t=null!=(i=g[e].args[0])?i:0,n=null!=(a=g[e].args[1])?a:0;h.translate=h.translate?[h.translate[0]+t,h.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)h.rotate=(null!=(s=h.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;h.scale=h.scale?[h.scale[0]*e,h.scale[1]*n]:[e,n]}}return h}let y,k,b;for(const t of g)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)k=(null!=k?k:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(m=t.args[0])?m:1,n=t.args.length>1?t.args[1]:e;b=b?[b[0]*e,b[1]*n]:[e,n]}const A={};y&&(A.translate=y);void 0!==k&&(A.rotate=k);b&&(A.scale=b);return Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}return}(t);e&&(a=We(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||qe(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?Qe(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=Je(l),n=Je(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=Ze(l,t),n=Ze(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}function We(t,e,n){if(!e)return t;const r=ve(e.origin,n);let o=t;return o=Ye(o,"translate",e.translate,void 0,n),o=Ye(o,"rotate",e.rotate,r,n),o=Ye(o,"scale",e.scale,r,n),o}function Ye(t,e,n,r,o){if(void 0===n)return t;const i="scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n,a=me(i);if("static"===a.kind)return{type:"g",transform:{value:fe(e,_e(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>{const n=re(t,fe(e,_e(e,t.value),r));return"translate"===e?wt(wt({},n),Xe(t)):n})};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function _e(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Xe(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function qe(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Je(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 Ze(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=He(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function He(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function Qe(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}function Ve(t,e,n){if(!e)return;const r=je(e.source);if(!r)return void(e.without===y.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===y.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function $e(t,e){const n={};return void 0!==t.translate&&(n.translate=tn(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=tn(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=tn(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];return tn(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function tn(t,e,n=!1){const r=me(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return("number"==typeof t||Array.isArray(t))&&!n?o:{value:o}}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?At(wt({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}function en(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function nn(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-1),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+1,value:0}],a=wt({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function rn(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function on(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function an(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 sn(t,e,n){const r=je(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=ln(r,e,n,new Set);o&&(t.href="#"+o)}function ln(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=Rt(o);if(pe(i,n),"use"===o.type?cn(i,e.start,e.stretch):un(i,e.start,e.stretch),an(i),"use"===o.type&&o.href){const a=je(o.href);if(a){const s=on(o),l=s?rn(en(s),e):e,u=new Set(r);u.add(t);const c=ln(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=on(t);if("use"===t.type&&s&&t.href){const i=je(t.href);if(i){const a=rn(en(s),e),l=new Set(r);l.add(o);const u=ln(i,a,n,l);u&&(t.href="#"+u)}an(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function un(t,e,n){var r;cn(t,e,n),null==(r=t.children)||r.forEach(t=>un(t,e,n))}function cn(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 fn(t,e,n){if(!e)return t;const r=e.subPaths===nt.combined,o=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)i(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*Nn,d=o*Nn,m=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+m(e+r,n+d,e+f,n+o,e,n+o)+m(e-f,n+o,e-r,n+d,e-r,n)+m(e-r,n-d,e-f,n-o,e,n-o)+m(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=ue(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=On(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}o.push(r)};if(i(t),!o.length)return t;let a=0;const s=r?[...o].reverse():o;for(const t of s)for(const e of t.subpaths)r||(a=0),e.startOffsetPx=a,a+=e.lengthPx;const l=a;if(r&&l<.001)return t;const u=me(e.offset),c="absent"===u.kind?{kind:"static",value:0}:u,f=function(t){const e=me(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:ee(t),value:ne(t),easing:Vt(t)}));if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=wn(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=jn(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=jn(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),d="absent"===f.kind?{kind:"static",value:[0,1]}:f,m=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=ne(n);"number"==typeof t&&e.push(t)}return e}(c),v=[m.length?Math.min(...m):0,m.length?Math.max(...m):0];if(1===o.length&&o[0].leaf===t&&1===o[0].subpaths.length){const e=o[0],n=e.subpaths[0],i=r?l:n.lengthPx;if(i<.001)return t;const a=r?n.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=hn(n,e,r),s=gn(e,r),l=wt({},t);return delete l.effects,kn(l,"strokeDasharray",yn(i,s)),kn(l,"strokeDashoffset",yn(o,a)),kn(l,"strokeOpacity",An(i)),l}(e.leaf,i,a,v,c,d)}const h=new Map;for(const t of o){const e=[];for(const o of t.subpaths){const i=r?l:o.lengthPx;if(i<.001)continue;const a=r?o.startOffsetPx/i:0;e.push(...mn(t.leaf,o.subpath,i,a,v,c,d,n))}h.set(t.leaf,dn(t.leaf,e))}const g=t=>{const e=h.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?At(wt({},t),{children:t.children.map(g)}):t)};return g(t)}function dn(t,e){const n=At(wt({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function mn(t,e,n,r,o,i,a,s){const l=hn(r,n,o),u=gn(n,o),c=yn(i,l),f=yn(a,u),d=An(a),m=function(t){return{type:"path",d:t}}(St(e));return kn(m,"strokeDasharray",f),kn(m,"strokeDashoffset",c),kn(m,"strokeOpacity",d),[m]}var vn=1;function hn(t,e,n){const[r]=pn(n);return n=>e*(-n-r+t)+vn}function gn(t,e){const[n,r]=pn(e),o=r-n+1;return e=>{const n=Pt(e[0],0,1),r=Pt(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=vn;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+vn),s}}function pn(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function yn(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:ee(t),value:e(ne(t)),easing:Vt(t)})),loop:t.loop}}function kn(t,e,n){n&&Fe(t,e,n)}var bn=10;function An(t){const e=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return e(t.value)?{kind:"static",value:0}:void 0;const n=t.keyframes;let r=!1,o=!0;for(const t of n)e(ne(t))?r=!0:o=!1;if(!r)return;if(o)return{kind:"static",value:0};const i=[];for(let t=0;t<n.length;t++){const r=n[t],o=t>0?n[t-1]:void 0,a=t<n.length-1?n[t+1]:void 0,s=ee(r),l=e(ne(r)),u=o?l&&e(ne(o)):l,c=a?l&&e(ne(a)):l;u&&!c?(i.push({time:s,value:0}),i.push({time:s+bn,value:1})):!u&&c&&(i.push({time:s-bn,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function wn(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function jn(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function On(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+=xn(t,r,r+1);return t.c&&e.length>1&&(n+=xn(t,e.length-1,0)),n}function xn(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=null!=(o=null==(r=t.o)?void 0:r[e])?o:l,f=null!=(a=null==(i=t.i)?void 0:i[n])?a:u,d=Ft(l,c,f,u);return d.ds[d.ds.length-1]}var Nn=.5522847498307936;function Mn(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:ke(null==(e=Yt(t))?void 0:e.engine),glyphs:null==(n=qt(t))?void 0:n.fonts},o=Rt(t);Jt(o,r.idMap),Re(o,r,()=>Lt(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=je(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=Qe(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),Jt(t,e.idMap);const n=[],r=t=>{var e;on(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&on(o)&&n++,"use"===o.type&&o.href){const t=je(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=je(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=on(t);if(!n)continue;const r=n.timeCrop;an(t),sn(t,en(n),e),r&&nn(t,r,e)}}(t,e),t}(Fn(o,r),r);return we(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function Fn(t,e){t.children&&(t.children=t.children.map(t=>Fn(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,strokeTrim:u,clone:c,fillGradient:f,strokeGradient:d,textPath:m,text:v}=null!=n?n:{};n&&delete t.effects;let h=t,g=!1;if(null==v?void 0:v.useGlyphs)if(m){const t="string"==typeof m.pathData?m.pathData:void 0,n=jt(h,e,t,m.startOffset,m.textLength,m.pathOverflow);n&&(h=n,g=!0)}else h=Ot(h,v,e),g=!0;return g||(h=xt(h,m,e)),h=function(t,e,n){return Te(t,e,n,"fill")}(h,f,e),h=function(t,e,n){return Te(t,e,n,"stroke")}(h,d,e),h=fn(h,u,e),h=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Rt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const r=Rt(l),o=$e(e,t),i=o?Se(r,o,n):r;u.push(i)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(h,a,e),h=Le(h,s,i,e),h=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=Lt(n,"clip"),o={type:"path"},i=me(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=Ge(i.value):(Fe(o,"d",i),void 0!==o.d&&(o.d=Ge(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(h,l,e),o?(Ve(h,c,e),h=Ie(h,i,r,o,e)):h=function(t,e,n,r){return Ve(t,e,r),Se(t,n,r)}(h,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,h),h}function Sn(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function Cn(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=Sn(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var Pn=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function Rn(e){const n=e=>{var r;let o=e;const i=e.animate,a=null==i?void 0:i.transform;if(a){const n=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=ne(o[0]),a=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],s=[];for(const t of o){const n=ne(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(e=null==n?void 0:n.origin)?e:[0,0];if(o[0]!==a[0]||o[1]!==a[1])return;s.push([r[0]+a[0],r[1]+a[1]])}if(!o.some(t=>$t(t)||te(t)))return;let l="M"+Pn(s[0][0])+","+Pn(s[0][1]);const u=[];for(let t=0;t<s.length-1;t++){const e=s[t],i=s[t+1],a=null!=(n=te(o[t]))?n:[0,0],c=null!=(r=$t(o[t+1]))?r:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[i[0]+c[0],i[1]+c[1]];l+="C"+Pn(f[0])+","+Pn(f[1])+","+Pn(d[0])+","+Pn(d[1])+","+Pn(i[0])+","+Pn(i[1]),u.push(Cn(e,f,d,i))}const c=u.reduce((t,e)=>t+e,0);if(!(c>0))return;const f=[];let d=0;for(let t=0;t<o.length;t++){t>0&&(d+=u[t-1]);const e={t:ee(o[t]),v:d/c},n=Vt(o[t]);void 0!==n&&(e.e=n),f.push(e)}return{pathStr:l,distanceKfs:f,autoOrient:!!t.autoOrient,anchor:a}}(a);if(n){const r=wt({},i);delete r[kt];const s={keyframes:n.distanceKfs};void 0!==a.loop&&(s.loop=a.loop),r[t]=s;const l=e.transform;let u=l;if(l&&"object"==typeof l){const t=wt({},l);delete t[bt.translate],delete t[bt.origin],u=Object.keys(t).length?t:void 0}o=At(wt({},e),{animate:r,style:At(wt({},e.style),{offsetPath:"path('"+n.pathStr+"')",offsetAnchor:Pn(n.anchor[0])+"px "+Pn(n.anchor[1])+"px",offsetRotate:n.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==u?o.transform=u:delete o.transform}}if(null==(r=o.children)?void 0:r.length){const t=o.children.map(n);t.some((t,e)=>t!==o.children[e])&&(o=At(wt({},o),{children:t}))}return o};return n(e)}function In(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=Bn(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=En(t.viewBox);if(e)return[e[2],e[3]];const n=Dn(t.width),r=Dn(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=Un(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return At(wt({},s),{children:u})}function Dn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Bn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function Tn(t,e,n,r,o,i,a){var s,l,u,c;const f=Tt(e);ge(f,o);const d="symbol"===f.type?En(f.viewBox):void 0,m=null!=(l=null!=(s=Dn(t.width))?s:null==d?void 0:d[2])?l:a[0],v=null!=(c=null!=(u=Dn(t.height))?u:null==d?void 0:d[3])?c:a[1],h="symbol"===f.type?function(t,e,n,r,o){const i=En(t.viewBox),a=At(wt({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,m=(o-c*f)/2,v=[];0===d&&0===m||v.push("translate("+d+","+m+")");1!==f&&v.push("scale("+f+")");0===s&&0===l||v.push("translate("+-s+","+-l+")");v.length&&(a.transform=v.join(""));const h=e();return n.push({type:"clipPath",id:h,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+h+")",a}(f,o,i,m,v):f,g=Un(h,n,r,o,i,a),p=At(wt({},t),{type:"g",children:[g]});return delete p.href,delete p.width,delete p.height,Nt(p)}function En(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 Un(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Bn(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return Tn(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Un(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?At(wt({},t),{children:s}):t}function Kn(t,n,r){var o,i;let a=Mn(t).root;a=Rn(a);const s=null!=(i=null==(o=Yt(a))?void 0:o.duration)?i:e;return a=oe(a,s),n===lt.native&&(a=ie(a,null==r?void 0:r.motionPath),a=In(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 zn="setPlaybackRate: rate must be finite and non-zero";function Gn(t){return Number.isFinite(t)&&0!==t}function Ln(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}function Wn(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function Yn(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function _n(t,e,n){const r=Wn(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function Xn(t,e,n){const r=Wn(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function qn(t,e=Date.now){let n=0,r=0,o=!1,i=1;const a=()=>Yn(o?n+(e()-r)*i:n,t);return{now:a,isRunning:()=>o,start:(s,l)=>{n=Yn(null!=l?l:a(),t),i=Gn(s)?s:1,r=e(),o=!0},stop:()=>{n=a(),r=0,o=!1},seek:i=>{n=Yn(i,t),o&&(r=e())}}}function Jn(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function Zn(t,n,r){var o;const i=Yt(t)||{},a=le(t,lt.js),s=i.iterations;let l=1;"number"==typeof s&&(l=s||1),"infinite"===s&&(l=1/0),l<1&&(l=1);const u=+(i.duration||e),c=u&&l?u*(l===1/0?1/0:l):u?(null!=l?l:1)*u:0,f=i.direction||"normal",d=null!=(o=i.fill)?o:"forwards",m="forwards"===d||"both"===d,v="backwards"===d||"both"===d;let h=null,g=!1,p=-(i.delay||0),y=0,k=1,b=!1;const A=i.frameRate,w=A&&A>0?1e3/A:0;let j=0;const O=()=>{const t=y?(Date.now()-y)*k:0;return p+t},x=()=>{let t=O();return Number.isFinite(c)&&t>c&&(t=c),t<0&&(t=0),t};function N(t){let e=function(){const e=u>0?u:1;let n=0,r=0;if(u>0){t=Pt(t,0,l*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,l-1);n=Pt((t-r*e)/e,0,1)}else n=t;const o=f||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=Ct(r,e*u);for(const[e,r]of Object.entries(o))n.setAttribute(t.id,e,r)}}i.delay&&(i.delay<0?N(x()):v&&N(0));const M=()=>!!g&&(!!n.isConnected()&&(k<0?O()>0:!(Number.isFinite(c)&&x()>=c))),F=t=>{null!==h&&(Jn(h),h=null),(t||M())&&(h=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{h=null,(()=>{var t,e;if(!n.isConnected())return void S();const o=x(),i=O();if(i<0&&k>0)v&&N(0);else{if(k<0&&i<=0)return S(),N(0),void(b||(b=!0,null==(t=null==r?void 0:r.onFinish)||t.call(r)));if(k>0&&c&&Number.isFinite(c)&&o>=c)return S(),N(m?c:0),void(b||(b=!0,null==(e=null==r?void 0:r.onFinish)||e.call(r)));if(w>0){const t=Date.now();if(j&&t-j<w)return;j=t}N(o)}})(),F()}))},S=()=>{if(!g)return;let t=O();Number.isFinite(c)&&t>c&&(t=c),p=t,y=0,g=!1,null!==h&&(Jn(h),h=null),t>=0?N(t):v&&N(0)},C={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>M(),play:()=>{var t;(()=>{if(!g){if(k>=0)Number.isFinite(c)&&p>=c&&(p=0);else if(p<=0){if(!Number.isFinite(c))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");p=c}b=!1,g=!0,y=Date.now(),F(!0)}})(),null==(t=null==r?void 0:r.onPlay)||t.call(r)},pause:()=>{var t;S(),null==(t=null==r?void 0:r.onPause)||t.call(r)},cancel:()=>{var t;S(),p=0,y=0,g=!1,b=!1,N(p),null==(t=null==r?void 0:r.onCancel)||t.call(r)},finish:()=>{((t=!0)=>{var e;p=Number.isFinite(c)?c:x(),y=0,g=!1,null!==h&&(Jn(h),h=null),N(m?p:0),t&&!b&&(b=!0,null==(e=null==r?void 0:r.onFinish)||e.call(r))})(!0)},setPlaybackRate:t=>{if(!Gn(t))return void console.warn(zn);let e=O();Number.isFinite(c)&&e>c&&(e=c),t<0!=k<0&&(b=!1),k=t,p=e,g&&(y=Date.now())},getCurrentTime:()=>x(),setCurrentTime:t=>{t=Yn(t,c),p=t,g&&(y=Date.now()),(!Number.isFinite(c)||t<c)&&(b=!1),N(x())},getCurrentProgress:()=>_n(x(),u,l),setCurrentProgress:t=>{C.setCurrentTime(Xn(t,u,l))},destroy:()=>{var t;C.cancel(),null==(t=null==r?void 0:r.onRemove)||t.call(r)}};return C}var Hn=(t=>(t[t.buildFailed=1001]="buildFailed",t[t.invalidDocumentAtSrc=1002]="invalidDocumentAtSrc",t[t.loadFailed=1003]="loadFailed",t[t.animationBuildFailed=1004]="animationBuildFailed",t[t.effectsShape=1101]="effectsShape",t[t.timelineOverrideIgnored=1102]="timelineOverrideIgnored",t[t.blockedTag=1103]="blockedTag",t[t.unsupportedAnimatedAttrs=1104]="unsupportedAnimatedAttrs",t[t.noBindings=1105]="noBindings",t[t.unresolvedBinding=1106]="unresolvedBinding",t[t.triggersNoRoot=1201]="triggersNoRoot",t[t.noRootForSelector=1202]="noRootForSelector",t[t.noRootElement=1203]="noRootElement",t[t.noElementsForSelector=1206]="noElementsForSelector",t[t.setAttributeNoElement=1207]="setAttributeNoElement",t[t.scrollSmoothingNeedsOwnDriver=1301]="scrollSmoothingNeedsOwnDriver",t[t.scrollNativeUnavailable=1302]="scrollNativeUnavailable",t[t.scrollSubjectInvalid=1303]="scrollSubjectInvalid",t[t.scrollSubjectNoMatch=1304]="scrollSubjectNoMatch",t[t.scrollNoRootToObserve=1305]="scrollNoRootToObserve",t[t.scrollTriggerIgnored=1306]="scrollTriggerIgnored",t[t.rateRejected=1401]="rateRejected",t[t.controlPropsConflict=1501]="controlPropsConflict",t[t.rnCompileFailed=1601]="rnCompileFailed",t[t.rnRenderFailed=1602]="rnRenderFailed",t[t.rnBoundaryCaught=1603]="rnBoundaryCaught",t[t.rnUnsupported=1604]="rnUnsupported",t))(Hn||{}),Qn=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],Vn=["definitions","bindings"],$n=t=>!!t&&"object"==typeof t&&!Array.isArray(t);function tr(t,e){const n=$n(t)?wt({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?$n(r)?n[t]=tr(n[t],r):n[t]=r:delete n[t]}return n}function er(t,e,o){const i=$n(a=t)&&"string"==typeof a.type?a.type:"time";var a;const s=$n(e)&&"string"==typeof e.type?String(e.type):i;let l;if(s!==i){const r={};if($n(t))for(const e of n)void 0!==t[e]&&(r[e]=t[e]);l=tr(r,e)}else l=tr(t,e);if("scroll"===(u=s)||"view"===u){for(const t of r)void 0!==l[t]&&(o("animator.timeline."+t+": no slot on a '"+s+"' timeline — dropped"),delete l[t]);"infinite"===l.iterations&&(o("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete l.iterations)}var u;return l}function nr(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("timeline override: not valid JSON — ignored",t),n=void 0}else n=null!=t?t:void 0;const{duration:r,delay:o,iterations:i,start:a}=e;if(void 0===r&&void 0===o&&void 0===i&&void 0===a)return void 0===n?void 0:{timeline:n};const s=$n(n)?wt({},n):{};return void 0!==r&&(s.duration=r),void 0!==o&&(s.delay=o),void 0!==i&&(s.iterations=i),void 0!==a&&(s.trigger=At(wt({},s.trigger),{start:a})),{timeline:s}}function rr(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!$n(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=$n(t)?Qn.filter(e=>void 0!==t[e]):[];o.length&&r("animator: the base carries the flat runtime spelling ("+o.join(", ")+"); the patch merges the wire spelling only");const i=$n(t)?wt({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?$n(n)?i[t]=tr(i[t],n):i[t]=n:i.timeline=$n(n)?er(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}function or(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetTimeline);if(!(t&&void 0!==e&&(i||null!==e&&$n(e)&&Object.keys(e).length)))return{doc:t,warnings:[]};const a=t,s=$n(a.animator),l=!s&&$n(null==(r=a.meta)?void 0:r.animator),u=s?a.animator:l?a.meta.animator:void 0,c=[];s&&$n(null==(o=a.meta)?void 0:o.animator)&&c.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let f=u;if(i){const t={};for(const e of Vn)$n(u)&&void 0!==u[e]&&(t[e]=u[e]);f=t}const d=rr(f,null!=e?e:{});return c.push(...d.warnings),d.config===u?{doc:t,warnings:c}:l?{doc:At(wt({},a),{meta:At(wt({},a.meta),{animator:d.config})}),warnings:c}:{doc:At(wt({},a),{animator:d.config}),warnings:c}}export{zn as PX_RATE_REJECTED,o as PX_TRANSFORM_PART_KEYS,i as PX_TRIGGER_DEFAULTS,a as PX_WIRE_BASELINE_VERSION,s as PX_WIRE_SCHEMA_VERSION,l as PX_WIRE_STEPS,u as PX_WIRE_VERSION,c as PX_WIRE_VERSION_KEY,f as PxAlongPathMode,d as PxAnimatedSvgDocumentSchema,m as PxAnimatorConfigSchema,v as PxAttrValueSchema,h as PxBezierPathSchema,g as PxClipPathEffectSchema,p as PxCloneEffectSchema,y as PxCloneWithout,k as PxControlMode,b as PxDefinitionsSchema,Hn as PxDiagnosticCode,A as PxDiagnosticKind,w as PxEffectsSchema,j as PxElementAnimationSchema,O as PxFillGradientEffectSchema,x as PxFillMode,N as PxFinishAction,M as PxGradientSpreadMethod,F as PxGradientStopSchema,S as PxGradientType,C as PxKeyframeSchema,P as PxKeyframeValueSchema,R as PxLengthAdjust,I as PxLoopDirection,D as PxLoopRepeatAt,B as PxLoopSchema,T as PxMaskType,E as PxMaskedByEffectSchema,U as PxMouseOutAction,K as PxNodeBaseSchema,z as PxNodeSchema,G as PxOffScreenAction,L as PxPathOverflow,W as PxPinAlign,Y as PxPlaybackDirection,_ as PxPropertyAnimationSchema,X as PxRepeaterEffectSchema,q as PxRetimeEffectSchema,J as PxScrollAxis,Z as PxScrollKind,H as PxScrollPhase,Q as PxScrollRangePointSchema,V as PxScrollRangeSchema,$ as PxScrollSchema,tt as PxScrollSource,et as PxStrokeTrimEffectSchema,nt as PxStrokeTrimSubPaths,rt as PxSvgNodeRootSchema,ot as PxTextEffectSchema,it as PxTextPathEffectSchema,at as PxTextPathMethod,st as PxTextPathSpacing,lt as PxTimelineEngine,ut as PxTimelineEngineSetting,ct as PxTimelineSchema,ft as PxTransformByEffectSchema,dt as PxTransformPartsSchema,mt as PxTransformValueSchema,vt as PxTriggerSchema,ht as PxTriggerStart,gt as PxUnits,pt as PxWireStepKind,yt as PxWireVersionRelation,or as applyAnimatorConfig,Mt as applyWireSteps,Ct as calcAnimationValues,Yn as clampSeekMs,It as compareWireVersion,Dt as controlModeTakesOverTrigger,Bt as convertWireDocument,Zn as createAdapterAnimator,qn as createRunClock,Et as describeSchema,Ut as diagnoseDocument,Kt as downgradeWireDocument,zt as flattenAnimatorTimeline,nr as foldTimelineOverride,Gt as formatWireVersion,Wt as generateNewIds,Yt as getAnimatorConfig,_t as getBindings,Xt as getChildren,qt as getDefinitions,Zt as isNativeForced,Ht as isPxDocument,Gn as isValidPlaybackRate,Qt as isValidPxDocument,Kn as materializeAllInTree,Mn as materializeNodeEffects,ae as mayUseNativeScrollTimeline,rr as mergeAnimatorConfig,se as nestAnimatorTimeline,le as normalizeBindings,ce as parseWireVersion,Wn as progressSpanMs,Xn as progressToTimeMs,de as px,he as readWireVersion,ye as resolveControlMode,ke as resolveTimelineEngine,be as resolveTrigger,Ae as schemaKeys,Ln as seekCeilingMs,_n as timeToProgress,Oe as toDomProps,xe as validateDocument,Ne as validateNodeEffects,Me as wireVersionAdvice};
|
package/dist/internal.cjs
CHANGED
|
@@ -642,14 +642,18 @@ var PxPlaybackDirection = {
|
|
|
642
642
|
};
|
|
643
643
|
var PX_ANIM_SRC_ATTR_NAME = "data-px-animation-src";
|
|
644
644
|
var PX_ANIM_ATTR_NAME = "_px_animator";
|
|
645
|
-
var
|
|
645
|
+
var PxTriggerStart = {
|
|
646
646
|
load: "load",
|
|
647
647
|
mouseOver: "mouseOver",
|
|
648
648
|
click: "click",
|
|
649
|
-
|
|
650
|
-
|
|
649
|
+
none: "none"
|
|
650
|
+
};
|
|
651
|
+
var PxOffScreenAction = {
|
|
652
|
+
pause: "pause",
|
|
653
|
+
continue: "continue",
|
|
654
|
+
reset: "reset"
|
|
651
655
|
};
|
|
652
|
-
var
|
|
656
|
+
var PxMouseOutAction = {
|
|
653
657
|
continue: "continue",
|
|
654
658
|
pause: "pause",
|
|
655
659
|
reset: "reset",
|
|
@@ -708,9 +712,11 @@ var PxTimelineEngineSetting = __spreadProps(__spreadValues({}, PxTimelineEngine)
|
|
|
708
712
|
auto: "auto"
|
|
709
713
|
});
|
|
710
714
|
var PX_TRIGGER_DEFAULTS = {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
715
|
+
start: "load",
|
|
716
|
+
offScreen: "pause",
|
|
717
|
+
mouseOut: "continue",
|
|
718
|
+
visibilityThreshold: 0.5,
|
|
719
|
+
visibilityDebounce: 150
|
|
714
720
|
};
|
|
715
721
|
var PxLoopRepeatAt = {
|
|
716
722
|
/** Segment from the START; the repetition runs BEFORE the first keyframe
|
|
@@ -829,9 +835,9 @@ function flattenAnimatorTimeline(cfg) {
|
|
|
829
835
|
} else {
|
|
830
836
|
if (timeline.duration !== void 0) flat.duration = timeline.duration;
|
|
831
837
|
if (timeline.trigger !== void 0) {
|
|
832
|
-
const _b = timeline.trigger, {
|
|
838
|
+
const _b = timeline.trigger, { finish } = _b, restTrigger = __objRest(_b, ["finish"]);
|
|
833
839
|
if (Object.keys(restTrigger).length) flat.trigger = restTrigger;
|
|
834
|
-
if (
|
|
840
|
+
if (finish !== void 0) flat.resetOnFinish = finish === "reset";
|
|
835
841
|
}
|
|
836
842
|
if (timeline.delay !== void 0) flat.delay = timeline.delay;
|
|
837
843
|
if (timeline.iterations !== void 0) flat.iterations = timeline.iterations;
|
|
@@ -843,7 +849,7 @@ function flattenAnimatorTimeline(cfg) {
|
|
|
843
849
|
}
|
|
844
850
|
|
|
845
851
|
// src/version/PxSchemaVersion.ts
|
|
846
|
-
var PX_WIRE_SCHEMA_VERSION = "1.
|
|
852
|
+
var PX_WIRE_SCHEMA_VERSION = "1.2";
|
|
847
853
|
|
|
848
854
|
// src/version/PxWireVersion.ts
|
|
849
855
|
var VERSION_RE = /^(\d+)\.(\d+)(?:\.(\d+))?$/;
|
|
@@ -936,13 +942,15 @@ var PxElementAnimationSchema = implementsInterface()(px.union([
|
|
|
936
942
|
PxAnimationDefinitionSchema
|
|
937
943
|
]));
|
|
938
944
|
var PxTriggerSchema = implementsInterface()(px.object({
|
|
939
|
-
|
|
940
|
-
|
|
945
|
+
start: px.enum([PxTriggerStart.load, PxTriggerStart.mouseOver, PxTriggerStart.click, PxTriggerStart.none], PX_TRIGGER_DEFAULTS.start).optional(),
|
|
946
|
+
offScreen: px.enum([PxOffScreenAction.pause, PxOffScreenAction.continue, PxOffScreenAction.reset], PX_TRIGGER_DEFAULTS.offScreen).optional(),
|
|
947
|
+
mouseOut: px.enum([PxMouseOutAction.continue, PxMouseOutAction.pause, PxMouseOutAction.reset, PxMouseOutAction.reverse], PX_TRIGGER_DEFAULTS.mouseOut).optional(),
|
|
941
948
|
// What happens after a NATURAL finish — `'hold'` (default: keep the end state per
|
|
942
|
-
// `fill`) or `'reset'` (snap back to the start state).
|
|
943
|
-
//
|
|
944
|
-
|
|
945
|
-
|
|
949
|
+
// `fill`) or `'reset'` (snap back to the start state). One of four occasion keys
|
|
950
|
+
// (`start`, `offScreen`, `mouseOut`, `finish`), all named the same way.
|
|
951
|
+
finish: px.enum([PxFinishAction.hold, PxFinishAction.reset]).optional(),
|
|
952
|
+
visibilityThreshold: px.number().optional(),
|
|
953
|
+
visibilityDebounce: px.number().optional()
|
|
946
954
|
}));
|
|
947
955
|
var PxGlyphSchema = implementsInterface()(px.object({
|
|
948
956
|
width: px.number(),
|
|
@@ -3168,32 +3176,34 @@ function reportDocumentDiagnostics(doc, where) {
|
|
|
3168
3176
|
}
|
|
3169
3177
|
|
|
3170
3178
|
// src/playback/PxDiagnostics.ts
|
|
3171
|
-
|
|
3172
|
-
|
|
3179
|
+
var DOCS_URL = "https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";
|
|
3180
|
+
function codeLine(code) {
|
|
3181
|
+
return "PX" + code + " " + DOCS_URL + "#px" + code;
|
|
3182
|
+
}
|
|
3183
|
+
function errorIn(data) {
|
|
3184
|
+
return data.find((d) => d instanceof Error);
|
|
3173
3185
|
}
|
|
3174
3186
|
function createDiagnostics(config, prefix) {
|
|
3175
3187
|
const tag = prefix ? prefix + " " : "";
|
|
3176
3188
|
return {
|
|
3177
|
-
warn: (kind,
|
|
3189
|
+
warn: (kind, code, ...data) => {
|
|
3190
|
+
const message = codeLine(code);
|
|
3178
3191
|
if (config == null ? void 0 : config.onWarn) {
|
|
3179
|
-
config.onWarn({ kind,
|
|
3192
|
+
config.onWarn({ code, kind, data, message });
|
|
3180
3193
|
return;
|
|
3181
3194
|
}
|
|
3182
3195
|
if (config == null ? void 0 : config.muteWarn) return;
|
|
3183
|
-
|
|
3184
|
-
if (detail === void 0) console.warn(line);
|
|
3185
|
-
else console.warn(line, detail);
|
|
3196
|
+
console.warn(tag + kind + " " + message, ...data);
|
|
3186
3197
|
},
|
|
3187
|
-
error: (kind,
|
|
3188
|
-
const
|
|
3198
|
+
error: (kind, code, ...data) => {
|
|
3199
|
+
const message = codeLine(code);
|
|
3200
|
+
const error = errorIn(data);
|
|
3189
3201
|
if (config == null ? void 0 : config.onError) {
|
|
3190
|
-
config.onError({ kind,
|
|
3202
|
+
config.onError({ code, kind, data, message, error });
|
|
3191
3203
|
return;
|
|
3192
3204
|
}
|
|
3193
3205
|
if (config == null ? void 0 : config.muteError) return;
|
|
3194
|
-
|
|
3195
|
-
if (detail === void 0) console.error(line);
|
|
3196
|
-
else console.error(line, detail);
|
|
3206
|
+
console.error(tag + kind + " " + message, ...data);
|
|
3197
3207
|
}
|
|
3198
3208
|
};
|
|
3199
3209
|
}
|