@pixodesk/svg-animator-core 1.0.40 → 1.0.41
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 +58 -13
- package/dist/{internal-BZSJtt_h.d.ts → PxDocumentDiagnostic-COGEjBbg.d.cts} +74 -448
- package/dist/{internal-BZSJtt_h.d.cts → PxDocumentDiagnostic-COGEjBbg.d.ts} +74 -448
- package/dist/chunk-7ZO7PQKZ.min.js +1 -0
- package/dist/{chunk-PAE3NF2U.js → chunk-L6GJ6Y2M.js} +168 -567
- package/dist/chunk-L6GJ6Y2M.js.map +1 -0
- package/dist/index.cjs +206 -926
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +84 -175
- 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 +78 -78
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +378 -1
- package/dist/internal.d.ts +378 -1
- package/dist/internal.js +413 -34
- package/dist/internal.js.map +1 -1
- package/dist/internal.min.cjs +1 -1
- package/dist/internal.min.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-PAE3NF2U.js.map +0 -1
- package/dist/chunk-WIVGJ5YO.min.js +0 -1
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BASELINE_PLAYER_VERSION as t,COLOR_ATTR_NAMES as e,CSS_ONLY_STYLE_PROPS as n,DEFAULT_DURATION_MS as r,DISALLOWED_SVG_TAGS_LOWER as o,LOOP_JUMP_SHIFT_MS as i,OFFSET_DISTANCE_ATTR as a,PCT_BASED_ATTR_NAMES as s,PLAYER_WIRE_STEPS as l,PLAYER_WIRE_VERSION as u,PX_ANIM_ATTR_NAME as f,PX_ANIM_SRC_ATTR_NAME as c,PX_PLAYER_SCHEMA_VERSION as d,PX_TIMELINE_SHARED_KEYS as m,PX_TIME_ONLY_TIMELINE_KEYS as h,PX_TRANSFORM_PART_KEYS as v,PX_TRIGGER_DEFAULTS as g,PX_UNKNOWN_KEY_ERROR as p,PxAlongPathMode as y,PxAnimatedSvgDocumentSchema as k,PxAnimatorConfigSchema as b,PxAttrValueSchema as w,PxBezierPathSchema as A,PxClipPathEffectSchema as O,PxCloneEffectSchema as j,PxCloneWithout as x,PxControlMode as M,PxDefsSchema as N,PxDiagnosticKind as F,PxEffectsSchema as P,PxElementAnimationSchema as S,PxFillGradientEffectSchema as C,PxFillMode as D,PxFinishAction as I,PxGradientSpreadMethod as R,PxGradientStopSchema as T,PxGradientType as B,PxKeyframeSchema as K,PxKeyframeValueSchema as E,PxLengthAdjust as U,PxLoopDirection as z,PxLoopRepeatAt as G,PxLoopSchema as L,PxMaskType as W,PxMaskedByEffectSchema as Y,PxNodeBase as _,PxNodeSchema as J,PxOutAction as X,PxPathOverflow as q,PxPinAlign as Z,PxPlaybackDirection as V,PxPropertyAnimationSchema as H,PxRepeaterEffectSchema as Q,PxRetimeEffectSchema as $,PxScrollAxis as tt,PxScrollKind as et,PxScrollPhase as nt,PxScrollRangePointSchema as rt,PxScrollRangeSchema as ot,PxScrollSchema as it,PxScrollSource as at,PxStartOn as st,PxStrokeTrimEffectSchema as lt,PxStrokeTrimSubPaths as ut,PxSvgNodeExtra as ft,PxTextEffectSchema as ct,PxTextPathEffectSchema as dt,PxTextPathMethod as mt,PxTextPathSpacing as ht,PxTimelineEngine as vt,PxTimelineEngineExtra as gt,PxTimelineSchema as pt,PxTransformByEffectSchema as yt,PxTransformPartsSchema as kt,PxTransformValueSchema as bt,PxTriggerSchema as wt,PxUnits as At,STYLE_ATTR_NAMES as Ot,TEXT_CONTENT_ATTR as jt,TRANSFORM_ATTR as xt,TRANSFORM_FN_NAMES as Mt,TRANSFORM_PART as Nt,WIRE_VERSION_KEY as Ft,WireStepKind as Pt,WireVersionRelation as St,__spreadProps as Ct,__spreadValues as Dt,applyTextGlyphsAlongPath as It,applyTextGlyphsEffect as Rt,applyTextPathEffect as Tt,applyUseOffsetToG as Bt,applyWireSteps as Kt,bezier2D_arcLengthLUT as Et,bezierToSvgPath as Ut,calcAnimationValues as zt,camelCaseToKebabWordIfNeeded as Gt,clamp as Lt,clone as Wt,compareWireVersion as Yt,composeTransformParts as _t,controlModeTakesOverTrigger as Jt,convertPlayerDocument as Xt,createDiagnostics as qt,createPathSampler as Zt,cubicBezier as Vt,deepClone as Ht,deepClonePxNode as Qt,describeSchema as $t,diagnoseDocument as te,diffFieldUniverse as ee,diffInEffect as ne,downgradePlayerDocument as re,extendedPathForBrowser as oe,flattenAnimatorTimeline as ie,formatWireVersion as ae,genId as se,generateNewIds as le,generateUniqueId as ue,getAnimatorConfig as fe,getBindings as ce,getChildren as de,getDefs as me,getNormalizedBindings as he,getNormalizedProps as ve,indexById as ge,interpolateValue as pe,isNativeForced as ye,isPxElementFileFormat as ke,isPxElementFileFormatDeep as be,isScrollTimeline as we,kebabToCamelCaseWord as Ae,keyframeWith as Oe,kfEasing as je,kfTangentIn as xe,kfTangentOut as Me,kfTime as Ne,kfValue as Fe,layoutGlyphTextChars as Pe,materializeGlyphText as Se,materializeGlyphTextAlongPath as Ce,materializeInternalLoopsInTree as De,materializeMotionPathInPropAnim as Ie,materializeMotionPathsInTree as Re,mayUseNativeScrollTimeline as Te,mergeStaticTransformIntoAnimDef as Be,nestAnimatorTimeline as Ke,parseSvgPathToBezier as Ee,parseWireVersion as Ue,partsRecord as ze,planSchemaRelease as Ge,px as Le,readAnimatable as We,readStaticOrigin as Ye,readWireVersion as _e,regenerateIdsAndRewriteRefs as Je,regenerateIdsInClone as Xe,releaseLogProblems as qe,reportDocumentDiagnostics as Ze,resolveControlMode as Ve,resolveTimelineEngine as He,resolveTrigger as Qe,reverseEasing as $e,sanitizeAttributeValue as tn,schemaFieldUniverse as en,schemaKeys as nn,scrollOffsetProgress as rn,scrollPhaseInterval as on,scrollResolveAxis as an,scrollTotalDurationMs as sn,scrollViewProgress as ln,spliceDefs as un,splitEasing as fn,stripHash as cn,subdivideCubicBezier as dn,toRGBA as mn,validateDocument as hn,validateNodeEffects as vn,versionAdvice as gn,writeAnimatableChannel as pn}from"./chunk-WIVGJ5YO.min.js";function yn(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=bn(r,e.origin,!0),r=kn(r,"scale",e.scale,n),r=kn(r,"skew",e.skew,n),r=kn(r,"rotate",e.rotate,n),r=bn(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=kn(r,"translate",e.translate,n):(r=bn(r,e.origin,!0),r=kn(r,"translate",e.translate,n),r=bn(r,e.origin,!1)),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function kn(t,e,n,r){if(void 0===n)return t;const o=We(n);if("static"===o.kind)return{type:"g",transform:{value:ze(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>Oe(t,ze(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 bn(t,e,n){if(void 0===e)return t;const r=We(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=>Oe(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function wn(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=cn(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=>wn(t,e,n))}function An(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=jn(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&&jn((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&jn((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=On(i.full),r=On(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=Dt({},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=jn(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=yn(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=yn(u,a,o),u.id=n),u}function On(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 jn(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 xn(t,e,n,r){if(!e)return t;const o=se(n,"grad"),i=function(t,e){const n={type:t.type===B.radial?"radialGradient":"linearGradient",id:e};t.type===B.linear?(Mn(n,"x1","y1",t.start),Mn(n,"x2","y2",t.end)):(Mn(n,"cx","cy",t.center),function(t,e,n){const r=We(n);if("absent"===r.kind)return;pn(t,e,r,{asString:!0})}(n,"r",t.radius),Mn(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=We(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(Nn):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=Fe(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=Fe(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:Fn(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=Ne(r),u=Fe(r),f=null!=(i=null==u?void 0:u[n])?i:Fn(e,e.indexOf(r),n);if(!f)continue;const c=je(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:Pn(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 Mn(t,e,n,r){var o,i,a;const s=We(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 Nn(t){return{type:"stop",offset:Pn(t.offset),stopColor:t.color}}function Fn(t,e,n){for(let r=e;r>=0;r--){const e=Fe(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=Fe(t[r]);if(null==e?void 0:e[n])return e[n]}}function Pn(t){return Math.round(1e3*t)/10+"%"}function Sn(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function Cn(t,e,n,r){if(!e)return t;const o=cn(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=se(r,"mask");let a={type:"use",href:"#"+o};if(n)a=Dn(a,n,r);else if(Bn(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,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=Oe(t,void 0);if(Array.isArray(e.translate)&&a.push(Ct(Dt(Dt({},r),Tn(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(Ct(Dt({},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(Ct(Dt({},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=Dn(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||Bn(t))}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?zn(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=Kn(l),n=Kn(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=En(l,t),n=En(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 Dn(t,e,n){if(!e)return t;const r=Ye(e.origin,n);let o=t;return o=In(o,"translate",e.translate,void 0,n),o=In(o,"rotate",e.rotate,r,n),o=In(o,"scale",e.scale,r,n),o}function In(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=We(i);if("static"===a.kind)return{type:"g",transform:{value:ze(e,Rn(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>{const n=Oe(t,ze(e,Rn(e,t.value),r));return"translate"===e?Dt(Dt({},n),Tn(t)):n})};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Rn(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Tn(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 Bn(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Kn(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 En(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Un(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Un(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 zn(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 Gn(t,e,n){if(!e)return;const r=cn(e.source);if(!r)return void(e.without===x.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===x.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Ln(t,e){const n={};return void 0!==t.translate&&(n.translate=Wn(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=Wn(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=Wn(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 Wn(t,n,!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function Wn(t,e,n=!1){const r=We(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?Ct(Dt({},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 Yn(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function _n(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=Dt({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function Jn(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Xn(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function qn(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 Zn(t,e,n){const r=cn(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Vn(r,e,n,new Set);o&&(t.href="#"+o)}function Vn(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=Wt(o);if(Xe(i,n),"use"===o.type?Qn(i,e.start,e.stretch):Hn(i,e.start,e.stretch),qn(i),"use"===o.type&&o.href){const a=cn(o.href);if(a){const s=Xn(o),l=s?Jn(Yn(s),e):e,u=new Set(r);u.add(t);const f=Vn(a,l,n,u);f&&(i.href="#"+f)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=Xn(t);if("use"===t.type&&s&&t.href){const i=cn(t.href);if(i){const a=Jn(Yn(s),e),l=new Set(r);l.add(o);const u=Vn(i,a,n,l);u&&(t.href="#"+u)}qn(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 Hn(t,e,n){var r;Qn(t,e,n),null==(r=t.children)||r.forEach(t=>Hn(t,e,n))}function Qn(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 $n(t,e,n){if(!e)return t;const r=e.subPaths===ut.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*hr,d=o*hr,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=Ee(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=dr(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=We(e.offset),f="absent"===u.kind?{kind:"static",value:0}:u,c=function(t){const e=We(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:Ne(t),value:Fe(t),easing:je(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=fr(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=cr(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=cr(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=Fe(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=rr(n,e,r),s=or(e,r),l=Dt({},t);return delete l.effects,sr(l,"strokeDasharray",ar(i,s)),sr(l,"strokeDashoffset",ar(o,a)),sr(l,"strokeOpacity",ur(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(...er(t.leaf,o.subpath,i,a,h,f,d,n))}v.set(t.leaf,tr(t.leaf,e))}const g=t=>{const e=v.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?Ct(Dt({},t),{children:t.children.map(g)}):t)};return g(t)}function tr(t,e){const n=Ct(Dt({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function er(t,e,n,r,o,i,a,s){const l=rr(r,n,o),u=or(n,o),f=ar(i,l),c=ar(a,u),d=ur(a),m=function(t){return{type:"path",d:t}}(Ut(e));return sr(m,"strokeDasharray",c),sr(m,"strokeDashoffset",f),sr(m,"strokeOpacity",d),[m]}var nr=1;function rr(t,e,n){const[r]=ir(n);return n=>e*(-n-r+t)+nr}function or(t,e){const[n,r]=ir(e),o=r-n+1;return e=>{const n=Lt(e[0],0,1),r=Lt(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=nr;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+nr),s}}function ir(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function ar(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:Ne(t),value:e(Fe(t)),easing:je(t)})),loop:t.loop}}function sr(t,e,n){n&&pn(t,e,n)}var lr=10;function ur(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(Fe(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=Ne(r),l=e(Fe(r)),u=o?l&&e(Fe(o)):l,f=a?l&&e(Fe(a)):l;u&&!f?(i.push({time:s,value:0}),i.push({time:s+lr,value:1})):!u&&f&&(i.push({time:s-lr,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function fr(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 cr(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 dr(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+=mr(t,r,r+1);return t.c&&e.length>1&&(n+=mr(t,e.length-1,0)),n}function mr(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=Et(l,f,c,u);return d.ds[d.ds.length-1]}var hr=.5522847498307936;function vr(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:He(null==(e=fe(t))?void 0:e.engine),glyphs:null==(n=me(t))?void 0:n.fonts},o=Wt(t);ge(o,r.idMap),wn(o,r,()=>se(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=cn(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=zn(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(),ge(t,e.idMap);const n=[],r=t=>{var e;Xn(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&&Xn(o)&&n++,"use"===o.type&&o.href){const t=cn(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=cn(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=Xn(t);if(!n)continue;const r=n.timeCrop;qn(t),Zn(t,Yn(n),e),r&&_n(t,r,e)}}(t,e),t}(gr(o,r),r);return un(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function gr(t,e){t.children&&(t.children=t.children.map(t=>gr(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=It(v,e,t,m.startOffset,m.textLength,m.pathOverflow);n&&(v=n,g=!0)}else v=Rt(v,h,e),g=!0;return g||(v=Tt(v,m,e)),v=function(t,e,n){return xn(t,e,n,"fill")}(v,c,e),v=function(t,e,n){return xn(t,e,n,"stroke")}(v,d,e),v=$n(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=Wt(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=Wt(l),o=Ln(e,t),i=o?yn(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=Cn(v,s,i,e),v=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=se(n,"clip"),o={type:"path"},i=We(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=Sn(i.value):(pn(o,"d",i),void 0!==o.d&&(o.d=Sn(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(v,l,e),o?(Gn(v,f,e),v=An(v,i,r,o,e)):v=function(t,e,n,r){return Gn(t,e,r),yn(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 pr(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 yr(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=pr(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var kr=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function br(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=Fe(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=Fe(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=>xe(t)||Me(t)))return;let l="M"+kr(s[0][0])+","+kr(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=Me(o[t]))?n:[0,0],f=null!=(r=xe(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"+kr(c[0])+","+kr(c[1])+","+kr(d[0])+","+kr(d[1])+","+kr(i[0])+","+kr(i[1]),u.push(yr(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:Ne(o[t]),v:d/f},n=je(o[t]);void 0!==n&&(e.e=n),c.push(e)}return{pathStr:l,distanceKfs:c,autoOrient:!!t.autoOrient,anchor:a}}(i);if(e){const n=Dt({},o);delete n[xt];const s={keyframes:e.distanceKfs};void 0!==i.loop&&(s.loop=i.loop),n[a]=s;const l=t.transform;let u=l;if(l&&"object"==typeof l){const t=Dt({},l);delete t[Nt.translate],delete t[Nt.origin],u=Object.keys(t).length?t:void 0}r=Ct(Dt({},t),{animate:n,style:Ct(Dt({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:kr(e.anchor[0])+"px "+kr(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==u?r.transform=u:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=Ct(Dt({},r),{children:t}))}return r};return e(t)}function wr(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=Or(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=xr(t.viewBox);if(e)return[e[2],e[3]];const n=Ar(t.width),r=Ar(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=Mr(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 Ct(Dt({},s),{children:u})}function Ar(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Or(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function jr(t,e,n,r,o,i,a){var s,l,u,f;const c=Qt(e);Je(c,o);const d="symbol"===c.type?xr(c.viewBox):void 0,m=null!=(l=null!=(s=Ar(t.width))?s:null==d?void 0:d[2])?l:a[0],h=null!=(f=null!=(u=Ar(t.height))?u:null==d?void 0:d[3])?f:a[1],v="symbol"===c.type?function(t,e,n,r,o){const i=xr(t.viewBox),a=Ct(Dt({},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=Mr(v,n,r,o,i,a),p=Ct(Dt({},t),{type:"g",children:[g]});return delete p.href,delete p.width,delete p.height,Bt(p)}function xr(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 Mr(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=Or(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return jr(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=Mr(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?Ct(Dt({},t),{children:s}):t}function Nr(t,e,n){var o,i;let a=vr(t).root;a=br(a);const s=null!=(i=null==(o=fe(a))?void 0:o.duration)?i:r;return a=De(a,s),e===vt.native&&(a=Re(a,null==n?void 0:n.motionPath),a=wr(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 Fr="setPlaybackRate: rate must be finite and non-zero";function Pr(t){return Number.isFinite(t)&&0!==t}function Sr(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}function Cr(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function Dr(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function Ir(t,e,n){const r=Cr(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function Rr(t,e,n){const r=Cr(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function Tr(t,e=Date.now){let n=0,r=0,o=!1,i=1;const a=()=>Dr(o?n+(e()-r)*i:n,t);return{now:a,isRunning:()=>o,start:(s,l)=>{n=Dr(null!=l?l:a(),t),i=Pr(s)?s:1,r=e(),o=!0},stop:()=>{n=a(),r=0,o=!1},seek:i=>{n=Dr(i,t),o&&(r=e())}}}function Br(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function Kr(t,e,n){var o;const i=fe(t)||{},a=he(t,vt.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||r),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 n=function(){const e=u>0?u:1;let n=0,r=0;if(u>0){t=Lt(t,0,l*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,l-1);n=Lt((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=zt(r,n*u);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}i.delay&&(i.delay<0?M(x()):h&&M(0));const N=()=>!!g&&(!!e.isConnected()&&(k<0?j()>0:!(Number.isFinite(f)&&x()>=f))),F=t=>{null!==v&&(Br(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,r;if(!e.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==n?void 0:n.onFinish)||t.call(n)));if(k>0&&f&&Number.isFinite(f)&&o>=f)return P(),M(m?f:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));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&&(Br(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==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;P(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;P(),p=0,y=0,g=!1,b=!1,M(p),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;p=Number.isFinite(f)?f:x(),y=0,g=!1,null!==v&&(Br(v),v=null),M(m?p:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!Pr(t))return void console.warn(Fr);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=Dr(t,f),p=t,g&&(y=Date.now()),(!Number.isFinite(f)||t<f)&&(b=!1),M(x())},getCurrentProgress:()=>Ir(x(),u,l),setCurrentProgress:t=>{S.setCurrentTime(Rr(t,u,l))},destroy:()=>{var t;S.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return S}var Er=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],Ur=["definitions","bindings"],zr=t=>!!t&&"object"==typeof t&&!Array.isArray(t);function Gr(t,e){const n=zr(t)?Dt({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?zr(r)?n[t]=Gr(n[t],r):n[t]=r:delete n[t]}return n}function Lr(t,e,n){const r=zr(o=t)&&"string"==typeof o.type?o.type:"time";var o;const i=zr(e)&&"string"==typeof e.type?String(e.type):r;let a;if(i!==r){const n={};if(zr(t))for(const e of m)void 0!==t[e]&&(n[e]=t[e]);a=Gr(n,e)}else a=Gr(t,e);if("scroll"===(s=i)||"view"===s){for(const t of h)void 0!==a[t]&&(n("animator.timeline."+t+": no slot on a '"+i+"' timeline — dropped"),delete a[t]);"infinite"===a.iterations&&(n("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete a.iterations)}var s;return a}function Wr(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=zr(n)?Dt({},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=Ct(Dt({},s.trigger),{startOn:a})),{timeline:s}}function Yr(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!zr(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=zr(t)?Er.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=zr(t)?Dt({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?zr(n)?i[t]=Gr(i[t],n):i[t]=n:i.timeline=zr(n)?Lr(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}function _r(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetDefaults);if(!(t&&void 0!==e&&(i||null!==e&&zr(e)&&Object.keys(e).length)))return{doc:t,warnings:[]};const a=t,s=zr(a.animator),l=!s&&zr(null==(r=a.meta)?void 0:r.animator),u=s?a.animator:l?a.meta.animator:void 0,f=[];s&&zr(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 Ur)zr(u)&&void 0!==u[e]&&(t[e]=u[e]);c=t}const d=Yr(c,null!=e?e:{});return f.push(...d.warnings),d.config===u?{doc:t,warnings:f}:l?{doc:Ct(Dt({},a),{meta:Ct(Dt({},a.meta),{animator:d.config})}),warnings:f}:{doc:Ct(Dt({},a),{animator:d.config}),warnings:f}}export{t as BASELINE_PLAYER_VERSION,e as COLOR_ATTR_NAMES,n as CSS_ONLY_STYLE_PROPS,r as DEFAULT_DURATION_MS,o as DISALLOWED_SVG_TAGS_LOWER,i as LOOP_JUMP_SHIFT_MS,s as PCT_BASED_ATTR_NAMES,l as PLAYER_WIRE_STEPS,u as PLAYER_WIRE_VERSION,f as PX_ANIM_ATTR_NAME,c as PX_ANIM_SRC_ATTR_NAME,d as PX_PLAYER_SCHEMA_VERSION,Fr as PX_RATE_REJECTED,v as PX_TRANSFORM_PART_KEYS,g as PX_TRIGGER_DEFAULTS,p as PX_UNKNOWN_KEY_ERROR,y as PxAlongPathMode,k as PxAnimatedSvgDocumentSchema,b as PxAnimatorConfigSchema,w as PxAttrValueSchema,A as PxBezierPathSchema,O as PxClipPathEffectSchema,j as PxCloneEffectSchema,x as PxCloneWithout,M as PxControlMode,N as PxDefsSchema,F as PxDiagnosticKind,P as PxEffectsSchema,S as PxElementAnimationSchema,C as PxFillGradientEffectSchema,D as PxFillMode,I as PxFinishAction,R as PxGradientSpreadMethod,T as PxGradientStopSchema,B as PxGradientType,K as PxKeyframeSchema,E as PxKeyframeValueSchema,U as PxLengthAdjust,z as PxLoopDirection,G as PxLoopRepeatAt,L as PxLoopSchema,W as PxMaskType,Y as PxMaskedByEffectSchema,_ as PxNodeBase,J as PxNodeSchema,X as PxOutAction,q as PxPathOverflow,Z as PxPinAlign,V as PxPlaybackDirection,H as PxPropertyAnimationSchema,Q as PxRepeaterEffectSchema,$ as PxRetimeEffectSchema,tt as PxScrollAxis,et as PxScrollKind,nt as PxScrollPhase,rt as PxScrollRangePointSchema,ot as PxScrollRangeSchema,it as PxScrollSchema,at as PxScrollSource,st as PxStartOn,lt as PxStrokeTrimEffectSchema,ut as PxStrokeTrimSubPaths,ft as PxSvgNodeExtra,ct as PxTextEffectSchema,dt as PxTextPathEffectSchema,mt as PxTextPathMethod,ht as PxTextPathSpacing,vt as PxTimelineEngine,gt as PxTimelineEngineExtra,pt as PxTimelineSchema,yt as PxTransformByEffectSchema,kt as PxTransformPartsSchema,bt as PxTransformValueSchema,wt as PxTriggerSchema,At as PxUnits,Ot as STYLE_ATTR_NAMES,jt as TEXT_CONTENT_ATTR,Mt as TRANSFORM_FN_NAMES,Ft as WIRE_VERSION_KEY,Pt as WireStepKind,St as WireVersionRelation,_r as applyAnimatorConfig,vr as applyPlayerEffects,Kt as applyWireSteps,Ut as bezierToSvgPath,zt as calcAnimationValues,Gt as camelCaseToKebabWordIfNeeded,Lt as clamp,Dr as clampSeekMs,Yt as compareWireVersion,_t as composeTransformParts,Jt as controlModeTakesOverTrigger,Xt as convertPlayerDocument,Kr as createBasicFrameLoopAnimator,qt as createDiagnostics,Zt as createPathSampler,Tr as createRunClock,Vt as cubicBezier,Ht as deepClone,$t as describeSchema,te as diagnoseDocument,ee as diffFieldUniverse,ne as diffInEffect,re as downgradePlayerDocument,oe as extendedPathForBrowser,ie as flattenAnimatorTimeline,Wr as foldTimelineOverride,ae as formatWireVersion,le as generateNewIds,ue as generateUniqueId,fe as getAnimatorConfig,ce as getBindings,de as getChildren,me as getDefs,he as getNormalizedBindings,ve as getNormalizedProps,pe as interpolateValue,ye as isNativeForced,ke as isPxElementFileFormat,be as isPxElementFileFormatDeep,we as isScrollTimeline,Pr as isValidPlaybackRate,Ae as kebabToCamelCaseWord,je as kfEasing,Fe as kfValue,Pe as layoutGlyphTextChars,Nr as materializeAllInTree,Se as materializeGlyphText,Ce as materializeGlyphTextAlongPath,Ie as materializeMotionPathInPropAnim,Te as mayUseNativeScrollTimeline,Yr as mergeAnimatorConfig,Be as mergeStaticTransformIntoAnimDef,Ke as nestAnimatorTimeline,Ue as parseWireVersion,Ge as planSchemaRelease,Cr as progressSpanMs,Rr as progressToTimeMs,Le as px,_e as readWireVersion,qe as releaseLogProblems,Ze as reportDocumentDiagnostics,Ve as resolveControlMode,He as resolveTimelineEngine,Qe as resolveTrigger,$e as reverseEasing,tn as sanitizeAttributeValue,en as schemaFieldUniverse,nn as schemaKeys,rn as scrollOffsetProgress,on as scrollPhaseInterval,an as scrollResolveAxis,sn as scrollTotalDurationMs,ln as scrollViewProgress,Sr as seekCeilingMs,fn as splitEasing,dn as subdivideCubicBezier,Ir as timeToProgress,mn as toRGBA,hn as validateDocument,vn as validateNodeEffects,gn as versionAdvice};
|
|
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};
|