@pixodesk/svg-animator-web 1.0.41 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +73 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +73 -41
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.prerendered-waapi.umd.js +26 -25
- package/dist/index.prerendered-waapi.umd.js.map +1 -1
- package/dist/index.prerendered-waapi.umd.min.js +1 -1
- package/dist/index.prerendered.umd.js +35 -33
- package/dist/index.prerendered.umd.js.map +1 -1
- package/dist/index.prerendered.umd.min.js +1 -1
- package/dist/pixodesk-svg-animator.umd.js +42 -40
- package/dist/pixodesk-svg-animator.umd.js.map +1 -1
- package/dist/pixodesk-svg-animator.umd.min.js +1 -1
- package/mangle-reserved.json +2 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var PixodeskAnimator=(()=>{var t=Object.defineProperty,n=Object.defineProperties,e=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(n,e,r)=>e in n?t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,c=(t,n)=>{for(var e in n||(n={}))s.call(n,e)&&u(t,e,n[e]);if(i)for(var e of i(n))l.call(n,e)&&u(t,e,n[e]);return t},a=(t,e)=>n(t,r(e)),f=(t,n)=>{var e={};for(var r in t)s.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&i)for(var r of i(t))n.indexOf(r)<0&&l.call(t,r)&&(e[r]=t[r]);return e},d={};function v(t){if(!t.length)return".";let n="";for(const e of t)e.startsWith("[")?n+=e:n+=(n?".":"")+e;return n}((n,e)=>{for(var r in e)t(n,r,{get:e[r],enumerable:!0})})(d,{PX_ANIMATOR_DOC_KEY:()=>ce,createAnimator:()=>le,setupAnimationTriggers:()=>ee});var h=class{_canSanitize(t){return this.isValid(t)}optional(){return new p(this)}},p=class extends h{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,n,e){return null==t||this.inner.isValid(t,n,e)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},y=class extends h{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,n,e){return"string"==typeof t||(null==n||n.errors.push(v(null!=e?e:[])+": expected string, got "+typeof t),!1)}},m=class extends h{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,n,e){return!("number"!=typeof t||!isFinite(t))||(null==n||n.errors.push(v(null!=e?e:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},b=class extends h{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,n,e){return"boolean"==typeof t||(null==n||n.errors.push(v(null!=e?e:[])+": expected boolean, got "+typeof t),!1)}},g=class extends h{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,n,e){return t===this.value||(null==n||n.errors.push(v(null!=e?e:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},A=class extends h{constructor(t,n){super(),this.values=t,this._default=null!=n?n:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,n,e){return!!this.values.includes(t)||(null==n||n.errors.push(v(null!=e?e:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},w=class extends h{constructor(t,n){super(),this.l=t,this.h="union",this._default=null!=n?n:t[0]._default}sanitize(t){for(const n of this.l)if(n.isValid(t))return n.sanitize(t);return this._default}isValid(t,n,e){var r;const o=n&&{errors:[],warnings:[],strict:n.strict};if(this.l.some(n=>n.isValid(t,o,e?[...e]:void 0)))return!0;if(!n)return!1;const i=v(null!=e?e:[]);let s;n.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let l=-1;const u=[];for(const r of this.l){const o={errors:[],warnings:[],strict:n.strict};if(r.isValid(t,o,e?[...e]:void 0),!o.errors.length)continue;const c=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((c>l||c===l&&s&&o.errors.length<s.length)&&(l=c,s=o.errors),c<=i.length)for(const t of o.errors){const n=/: expected (.+?), got /.exec(t);n&&!u.includes(n[1])&&u.push(n[1])}}if(s&&l>i.length)for(const t of s.slice(0,4))n.errors.includes(t)||n.errors.push(t);else u.length&&n.errors.push(i+": expected "+u.join(" | "));return!1}_canSanitize(t){return this.l.some(n=>n._canSanitize(t))}},j=class extends h{constructor(t){super(),this._shape=t;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e={};for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(n[t]);void 0!==r&&(e[t]=r)}return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(v(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(null==n?void 0:n.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),n.errors.push(v(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},M=class extends h{constructor(t,n){super(),this._shape=t,this.m=n;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e=c({},n);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(n[t]);void 0!==r&&(e[t]=r)}if(this.m)for(const t of Object.keys(n))t in this._shape||(e[t]=this.m.sanitize(n[t]));return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(v(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(this.m)for(const t of Object.keys(r))t in this._shape||(o.push(t),this.m.isValid(r[t],n,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},O=class extends h{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const n=[];for(const e of t)this.item._canSanitize(e)&&n.push(this.item.sanitize(e));return n}isValid(t,n,e){if(!Array.isArray(t))return null==n||n.errors.push(v(null!=e?e:[])+": expected array, got "+typeof t),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<t.length;e++)r.push("["+e+"]"),this.item.isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},k=class extends h{constructor(t){super(),this.value=t,this.h="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const n={};for(const[e,r]of Object.entries(t))this.value._canSanitize(r)&&(n[e]=this.value.sanitize(r));return n}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(v(null!=e?e:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(const[e,i]of Object.entries(t))r.push(e),this.value.isValid(i,n,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},x=class extends h{constructor(t,n){super(),this.fn=t,this._default=n,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,n,e){return this.schema.isValid(t,n,e)}_canSanitize(t){return this.schema._canSanitize(t)}},z=class extends h{constructor(t){super(),this.l=t,this.h="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.l.length?this.l.map((n,e)=>n.sanitize(t[e])):this._default}isValid(t,n,e){if(!Array.isArray(t)||t.length!==this.l.length)return null==n||n.errors.push(v(null!=e?e:[])+": expected tuple of length "+this.l.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<this.l.length;e++)r.push("["+e+"]"),this.l[e].isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.l.length}},S=(t="")=>new y(t),P=(t=0)=>new m(t),C=(t=!1)=>new b(t),N=t=>new g(t),V=(t,n)=>new A(t,n),T=(t,n)=>new w(t,n),_=t=>new j(t),U=(t,n)=>new M(t,n),I=t=>new O(t),E=t=>new k(t),W=t=>new z(t),R=(t,n)=>new x(t,n),F="block",D="inline",L="nearest",Z="root",B="center",J="bottom",X=["duration","iterations","engine","frameRate","trigger","delay","fillMode","direction","fill","resetOnFinish","timelineSource","scroll"],G={native:"native",js:"js"},q=a(c({},G),{auto:"auto"}),Y={startOn:"load",outAction:"continue",scrollIntoViewThreshold:0},H={start:"start",end:"end"},K={normal:"normal",alternate:"alternate"},$="userSpaceOnUse",Q="objectBoundingBox",tt="transform";function nt(t){var n;const e=(null==t?void 0:t.animator)||(null==(n=null==t?void 0:t.meta)?void 0:n.animator);if(!e)return;const r=rt.get(e);if(r)return r;const o=e,i=X.filter(t=>void 0!==o[t]),s=i.length?c({},o):e;for(const t of i)delete s[t];const l=function(t){const n=t.timeline;if(null==n||"object"!=typeof n)return t;const e=ot.get(t);if(e)return e;const r=t,{timeline:o}=r,i=f(r,["timeline"]);if(void 0!==n.engine&&(i.engine=n.engine),void 0!==n.frameRate&&(i.frameRate=n.frameRate),"scroll"===n.type||"view"===n.type){i.timelineSource="scroll",void 0!==n.duration&&(i.duration=n.duration),void 0!==n.iterations&&(i.iterations=n.iterations);const t=c({},i.scroll||{});t.kind=n.type,void 0!==n.axis&&(t.axis=n.axis),void 0!==n.source&&(t.source=n.source),void 0!==n.subject&&(t.subject=n.subject),void 0!==n.smoothing&&(t.smoothing=n.smoothing),void 0!==n.range&&(t.range=n.range);const e=n.pin;"boolean"==typeof e?t.pin=e:e&&"object"==typeof e&&(t.pin=!0,void 0!==e.align&&(t.pinAlign=e.align),void 0!==e.offset&&(t.pinOffset=e.offset),void 0!==e.distance&&(t.pinDistance=e.distance)),i.scroll=t}else{if(void 0!==n.duration&&(i.duration=n.duration),void 0!==n.trigger){const t=n.trigger,{finishAction:e}=t,r=f(t,["finishAction"]);Object.keys(r).length&&(i.trigger=r),void 0!==e&&(i.resetOnFinish="reset"===e)}void 0!==n.delay&&(i.delay=n.delay),void 0!==n.iterations&&(i.iterations=n.iterations),void 0!==n.direction&&(i.direction=n.direction),void 0!==n.fillMode&&(i.fill=n.fillMode)}return ot.set(t,i),i}(s);return rt.set(e,l),l}var et,rt=new WeakMap,ot=new WeakMap,it=T([S(),W([P(),P(),P(),P()])]),st=T([S(),P(),I(P()),_({pathData:S()}),R(()=>I(Lt),[]),R(()=>pt,{})]),lt=_({time:P().optional(),value:st.optional(),easing:it.optional(),tangentOut:W([P(),P()]).optional(),tangentIn:W([P(),P()]).optional()}),ut=t=>{var n,e;return null!=(e=null!=(n=t.time)?n:t.t)?e:0},ct=t=>{var n;return null!=(n=t.value)?n:t.v},at=t=>{var n;return null!=(n=t.easing)?n:t.e},ft=t=>t.tangentIn,dt=t=>t.tangentOut,vt=_({segmentCount:P().optional(),repeatAt:V([H.start,H.end]).optional(),direction:V([K.normal,K.alternate]).optional()}),ht=_({value:st.optional(),keyframes:I(lt).optional(),loop:T([vt,C()]).optional(),autoOrient:C().optional(),alongPathMode:V(["sampled","offsetPath"]).optional()}),pt=_({translate:W([P(),P()]).optional(),rotate:P().optional(),skew:P().optional(),scale:W([P(),P()]).optional(),origin:W([P(),P()]).optional()}),yt=(T([S(),pt,_({value:pt}),ht]),E(ht)),mt=T([S(),I(T([S(),yt])),yt]),bt=_({startOn:V(["load","mouseOver","click","scrollIntoView","programmatic"],Y.startOn).optional(),outAction:V(["continue","pause","reset","reverse"],Y.outAction).optional(),finishAction:V(["hold","reset"]).optional(),scrollIntoViewThreshold:P().optional()}),gt=_({width:P(),pathData:S()}),At=_({fontFamily:S(),fontStyle:S(),ascent:P(),unitsPerEm:P(),glyphs:E(gt)}),wt=_({easings:E(W([P(),P(),P(),P()])).optional(),animations:E(yt).optional(),fonts:E(At).optional()}),jt=_({phase:V(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:P().optional()}),Mt=_({start:jt.optional(),end:jt.optional()}),Ot=(_({kind:V(["view","scroll"]).optional(),axis:V([F,D,"x","y"]).optional(),source:V([L,Z]).optional(),subject:S().optional(),smoothing:P().optional(),pin:C().optional(),pinAlign:V(["top",B,J]).optional(),pinOffset:P().optional(),pinDistance:P().optional(),range:Mt.optional()}),_({align:V(["top",B,J]).optional(),offset:P().optional(),distance:P().optional()})),kt=V([q.auto,q.native,q.js]).optional(),xt=_({type:N("time").optional(),engine:kt,frameRate:P().optional(),duration:P().optional(),trigger:bt.optional(),delay:P().optional(),iterations:T([P(),N("infinite")]).optional(),fillMode:V(["forwards","backwards","both","none"]).optional(),direction:V(["normal","reverse","alternate","alternate-reverse"]).optional()}),zt={duration:P().optional(),iterations:P().optional(),engine:kt,frameRate:P().optional(),axis:V([F,D,"x","y"]).optional(),source:V([L,Z]).optional(),subject:S().optional(),smoothing:P().optional(),pin:T([C(),Ot]).optional(),range:Mt.optional()},St=(et=[xt,_(c({type:N("scroll")},zt)),_(c({type:N("view")},zt))],new class extends h{constructor(t,n,e){var r;super(),this.A=t,this.j=n,this.h="discriminatedUnion",this._default=null!=e?e:n[0]._default,this.M=new Map;for(const e of n){const n=e._shape[t];if(!n)continue;const o=null!=(r=n.inner)?r:n;this.M.set(o._default,e),n.inner&&(this.O=e)}}k(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const n=t[this.A];return null==n?this.O:this.M.get(n)}sanitize(t){var n;return(null!=(n=this.k(t))?n:this.j[0]).sanitize(t)}isValid(t,n,e){const r=this.k(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this.A];return null==n||n.errors.push(v(null!=e?e:[])+": no discriminated union member matched "+this.A+"="+JSON.stringify(r)),!1}return r.isValid(t,n,e)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const n=this.k(t);return n?n._canSanitize(t):this.j[0]._canSanitize(t)}}("type",et)),Pt=_({target:S(),animateWith:I(S())}),Ct=_({timeline:St.optional(),definitions:wt.optional(),bindings:I(Pt).optional(),debugGlobalName:S().optional(),version:S().optional()}),Nt=T([S(),P(),I(P()),_({value:new class extends h{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return void 0!==t||(null==n||n.errors.push(v(null!=e?e:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}}}),pt]),Vt=T([P(),ht,_({value:P()})]),Tt=T([W([P(),P()]),ht,_({value:W([P(),P()])})]),_t=T([S(),ht,_({value:S()})]),Ut=_({translate:Tt.optional(),rotate:Vt.optional(),scale:Tt.optional(),skew:Vt.optional(),origin:Tt.optional()}),It=_({copies:P().optional(),translate:Tt.optional(),rotate:Vt.optional(),skew:Vt.optional(),scale:Tt.optional(),origin:Tt.optional()}),Et=_({source:S().optional(),maskType:V(["luminance","alpha"]).optional(),maskUnits:V([$,Q]).optional(),maskContentUnits:V([$,Q]).optional(),x:P().optional(),y:P().optional(),width:P().optional(),height:P().optional()}),Wt=_({pathData:_t.optional()}),Rt=_({offset:Vt.optional(),range:Tt.optional(),subPaths:V(["separate","combined"]).optional()}),Ft=_({start:P().optional(),stretch:P().optional(),timeCrop:W([P(),P()]).optional()}),Dt=_({without:V(["translate"]).optional(),source:S().optional(),retime:Ft.optional()}),Lt=_({offset:P(),color:S()}),Zt=T([I(Lt),_({value:I(Lt)}),ht]),Bt=_({type:V(["linear","radial"]),start:Tt.optional(),end:Tt.optional(),center:Tt.optional(),radius:Vt.optional(),focal:Tt.optional(),stops:Zt.optional(),gradientUnits:V([$,Q]).optional(),spreadMethod:V(["pad","reflect","repeat"]).optional(),gradientTransform:S().optional()}),Jt=Bt,Xt=_({pathData:S(),pathOverflow:V(["clip","extend"]).optional(),lengthAdjust:V(["spacing","spacingAndGlyphs"]).optional(),method:V(["align","stretch"]).optional(),spacing:V(["auto","exact"]).optional(),startOffset:Vt.optional(),textLength:Vt.optional()}),Gt=_({useGlyphs:C().optional()}),qt=_({transformBy:Ut.optional(),repeater:It.optional(),maskedBy:Et.optional(),clipPath:Wt.optional(),strokeTrim:Rt.optional(),clone:Dt.optional(),fillGradient:Bt.optional(),strokeGradient:Jt.optional(),textPath:Xt.optional(),text:Gt.optional()}),Yt=U({type:S(),domType:S().optional(),textContent:S().optional(),id:S().optional(),meta:(new class extends h{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return!0}_canSanitize(t){return!0}}).optional(),effects:qt.optional(),animate:mt.optional(),style:E(T([S(),P()])).optional()},Nt),Ht=U(a(c({},Yt._shape),{children:R(()=>I(Ht),[]).optional()}),Nt),Kt=_({width:T([P(),S()]).optional(),height:T([P(),S()]).optional(),viewBox:S().optional(),animator:Ct.optional()});function $t(t,n,e){return t+(n-t)*e}function Qt(t,n,e){const r=[],o=Math.max(t.length,n.length);for(let i=0;i<o;i++)r[i]=$t(t[i]||0,n[i]||0,e);return r}function tn(t,n,e){const r=Math.max(t.length,n.length),o=[];for(let i=0;i<r;i++)o.push(nn(t[i],n[i],e));return o}function nn(t,n,e){var r,o,i,s,l,u,c,a,f;if(!t||!n)return t||n||{v:[]};const d=Math.min(Math.max(e,0),1),v=Math.min(t.v.length,n.v.length),h=[],p=[],y=[];for(let e=0;e<v;e++){const f=t.v[e],v=n.v[e];h.push(Qt(f,v,d));const m=null!=(o=null==(r=t.i)?void 0:r[e])?o:f,b=null!=(s=null==(i=n.i)?void 0:i[e])?s:v;p.push(Qt(m,b,d));const g=null!=(u=null==(l=t.o)?void 0:l[e])?u:f,A=null!=(a=null==(c=n.o)?void 0:c[e])?a:v;y.push(Qt(g,A,d))}return{v:h,i:p.length?p:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:n.c}}function en(t,n,e){if(e<=0)return 0;if(e>=1)return 1;const r=3*t,o=3*(n-t)-r,i=1-r-o;function s(t){return((i*t+o)*t+r)*t}function l(t){return(3*i*t+2*o)*t+r}let u=e,c=0,a=1;for(let t=0;t<8;t++){const t=s(u)-e;if(Math.abs(t)<1e-6)return u;const n=l(u);if(Math.abs(n)<1e-6)break;u-=t/n}for(u=e;c<a;){const t=s(u);if(Math.abs(t-e)<1e-6)return u;e>t?c=u:a=u,u=(a+c)/2}return u}function rn(t){const[n,e,r,o]=t,i=3*e,s=3*(o-e)-i,l=1-i-s;return function(t){return e=en(n,r,t),((l*e+s)*e+i)*e;var e}}function on(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function sn(t,n){if(!t)return{left:void 0,right:void 0};if(n<=0)return{left:void 0,right:t};if(n>=1)return{left:t,right:void 0};const[e,r,o,i]=t,s=en(e,o,n),l=[e,r],u=[o,i],{left:c,right:a}=function(t,n,e,r,o){const i=on(t,n,o),s=on(n,e,o),l=on(e,r,o),u=on(i,s,o),c=on(s,l,o),a=on(u,c,o);return{left:[t,i,u,a],right:[a,c,l,r]}}([0,0],l,u,[1,1],s),f=c[3][0],d=c[3][1];let v,h;f>1e-9&&Math.abs(d)>1e-9&&(v=[c[1][0]/f,c[1][1]/d,c[2][0]/f,c[2][1]/d]);const p=1-f,y=1-d;return p>1e-9&&Math.abs(y)>1e-9&&(h=[(a[1][0]-f)/p,(a[1][1]-d)/y,(a[2][0]-f)/p,(a[2][1]-d)/y]),{left:v,right:h}}function ln(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function un(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const n=t.slice(1),e=n.length<=4,r=e?n[0]+n[0]:n.slice(0,2),o=e?n[1]+n[1]:n.slice(2,4),i=e?n[2]+n[2]:n.slice(4,6),s=4===n.length?n[3]+n[3]:8===n.length?n.slice(6,8):null,l=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==s&&l.push(parseInt(s,16)/255),l}(t):t.startsWith("rgb")?function(t){var n;const e=null==(n=t.match(/rgba?\((.*)\)/))?void 0:n[1];if(!e)throw new Error("Invalid rgb/rgba format");const r=e.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}U(a(c(c({},Yt._shape),Kt._shape),{type:N("svg"),children:I(Ht).optional()}),Nt),_({v:I(I(P())),i:I(I(P())).optional(),o:I(I(P())).optional(),c:C().optional()});var cn=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),an=new Set(["translate","rotate","scale","skew"]),fn=new Set(["offset-distance","offsetDistance"]);function dn(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var vn=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function hn(t){return vn.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function pn(t,n,e){return Math.max(n,Math.min(t,e))}function yn(t,n,e,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,s=i*i,l=o*o,u=s*i,c=3*o*s,a=3*l*i,f=l*o;return[u*t[0]+c*n[0]+a*e[0]+f*r[0],u*t[1]+c*n[1]+a*e[1]+f*r[1]]}var mn=1e-4;function bn(t,n,e,r,o){const i=gn(t,n,e,r,o);return 0===i[0]&&0===i[1]?gn(t,n,e,r,o<.5?o+mn:o-mn):i}function gn(t,n,e,r,o){const i=1-o,s=3*i*i,l=6*o*i,u=3*o*o;return[s*(n[0]-t[0])+l*(e[0]-n[0])+u*(r[0]-e[0]),s*(n[1]-t[1])+l*(e[1]-n[1])+u*(r[1]-e[1])]}function An(t,n){const{ts:e,ds:r}=t,o=e.length-1;if(n<=e[0])return r[0];if(n>=e[o])return r[o];let i=1,s=o;for(;i<s;){const t=i+s>>>1;e[t]<n?i=t+1:s=t}const l=e[s-1],u=e[s]-l,c=u>0?(n-l)/u:0;return r[s-1]+c*(r[s]-r[s-1])}function wn(t){const n=ct(t);if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const e=n.translate;return Array.isArray(e)&&e.length>=2?[e[0],e[1]]:void 0}function jn(t){return ut(t)}function Mn(t){return at(t)}var On=new WeakMap;function kn(t,n,e,r){let o=On.get(t);const i=null==o?void 0:o.get(n);if(i)return i;const s=dt(t),l=ft(n),u=[e[0]+(s?s[0]:0),e[1]+(s?s[1]:0)],c=[r[0]+(l?l[0]:0),r[1]+(l?l[1]:0)],a=function(t,n,e,r,o=100){const i=o+1,s=new Float64Array(i),l=new Float64Array(i);let u=yn(t,n,e,r,0);s[0]=0,l[0]=0;let c=0;for(let a=1;a<i;a++){const i=a/o,f=yn(t,n,e,r,i),d=f[0]-u[0],v=f[1]-u[1];c+=Math.sqrt(d*d+v*v),s[a]=i,l[a]=c,u=f}return{ts:s,ds:l}}(e,u,c,r),f={P0:e,P1:u,P2:c,P3:r,S:a,P:a.ds[a.ds.length-1]};return o||(o=new WeakMap,On.set(t,o)),o.set(n,f),f}var xn=.5,zn=5,Sn=32;function Pn(t,n){var e,r,o;if(!function(t){const n=t.keyframes;if(!Array.isArray(n))return!1;if(t.autoOrient)return!0;for(const t of n)if(ft(t)||dt(t))return!0;return!1}(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,l=null!=(e=null==n?void 0:n.flatnessTolerance)?e:xn,u=null!=(r=null==n?void 0:n.rotationTolerance)?r:zn,c=null!=(o=null==n?void 0:n.maxSamplesPerSegment)?o:Sn,a=[],f=wn(i[0]);if(!f)return t;const d=s?function(t,n){const e=wn(t),r=wn(n);if(!e||!r)return 0;const o=kn(t,n,e,r),i=bn(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(i[0],i[1]):void 0;a.push(Cn(jn(i[0]),Tn(Nn(i[0]),Nn(i[0]),0,f,d,s)));for(let t=0;t<i.length-1;t++){const n=i[t],e=i[t+1],r=wn(n),o=wn(e);r&&o?(s&&t>0&&Un(a,n,e,r,o,u),En(a,n,e,r,o,s,l,u,c)):a.push(Cn(jn(e),Tn(Nn(e),Nn(e),1,null!=o?o:[0,0],void 0,s)))}const v=Mn(i[i.length-1]);v&&(a[a.length-1].e=v),s&&function(t){let n;for(const e of t){const t=ct(e);if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let r=t.rotate;for(;r-n>180;)r-=360;for(;r-n<-180;)r+=360;t.rotate=r,n=r}}(a);const h={keyframes:a};return void 0!==t.loop&&(h.loop=t.loop),h}function Cn(t,n){return{t:t,v:n}}function Nn(t){const n=ct(t);if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Vn(t,n,e){if(void 0===t)return n;if(void 0===n)return t;if("number"==typeof t&&"number"==typeof n)return t+(n-t)*e;if(Array.isArray(t)&&Array.isArray(n)&&t.length===n.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,s="number"==typeof n[o]?n[o]:0;r[o]=i+(s-i)*e}return r}return e<.5?t:n}function Tn(t,n,e,r,o,i){const s={translate:r},l=new Set;if(t)for(const n of Object.keys(t))l.add(n);if(n)for(const t of Object.keys(n))l.add(t);for(const r of l){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],l=null==n?void 0:n[r];void 0===o&&void 0===l||(s[r]=Vn(o,l,e))}return void 0!==o&&(s.rotate=o+_n(t,n,e)),s}function _n(t,n,e){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=Vn(r,o,e);return"number"==typeof i?i:0}function Un(t,n,e,r,o,i){const s=t[t.length-1],l=ct(s),u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=Nn(n),a=u-_n(c,c,0),f=kn(n,e,r,o),d=bn(f.P0,f.P1,f.P2,f.P3,0),v=180*Math.atan2(d[1],d[0])/Math.PI,h=function(t,n){let e=t-n;for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}(v,a);if(Math.abs(h)<=i)return;const p=jn(n),y=Math.min(p+In,(p+jn(e))/2),m=Tn(Nn(n),Nn(n),0,r,v,!0);t.push(Cn(y,m))}var In=.05;function En(t,n,e,r,o,i,s,l,u){const c=kn(n,e,r,o),a=jn(n),f=jn(e),d=Mn(n),v=(h=d)?rn([h[1],h[0],h[3],h[2]]):t=>t;var h;const p=Nn(n),y=Nn(e),m=function(t,n,e,r,o){const i=[];Wn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),Wn(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,n)=>t-n);const s=[0];for(const t of i)t>s[s.length-1]+1e-6&&t<.999999&&s.push(t);s.push(1);const l=[],u={C:o-s.length};for(let o=0;o<s.length-1;o++)Rn(s[o],s[o+1],l,t,n,e,r,u);return l}(c,i,s,l,u),b=[];for(const t of m){const n=An(c.S,t),e=pn(c.P>0?n/c.P:t,0,1),r={u:pn(v(e),0,1),p:e,N:yn(c.P0,c.P1,c.P2,c.P3,t)};if(i){const n=bn(c.P0,c.P1,c.P2,c.P3,t);r.rotateDeg=180*Math.atan2(n[1],n[0])/Math.PI}b.push(r)}let g=d,A=0;const w=t.length-1;for(let n=0;n<b.length;n++){const e=b[n],r=A<1?pn((e.u-A)/(1-A),0,1):1,{left:o,right:s}=sn(g,r),l=0===n?w:t.length-1;o?t[l].e=o:delete t[l].e;const u=a+e.u*(f-a),c=Tn(p,y,e.p,e.N,e.rotateDeg,i);t.push(Cn(u,c)),g=s,A=e.u}}function Wn(t,n,e,r,o){const i=n-t,s=e-n,l=i-2*s+(r-e),u=2*(s-i),c=i;if(Math.abs(l)<1e-10){if(Math.abs(u)>1e-10){const t=-c/u;t>1e-6&&t<.999999&&o.push(t)}return}const a=u*u-4*l*c;if(a<0)return;const f=Math.sqrt(a),d=(-u-f)/(2*l),v=(-u+f)/(2*l);d>1e-6&&d<.999999&&o.push(d),v>1e-6&&v<.999999&&o.push(v)}function Rn(t,n,e,r,o,i,s,l){const u=(t+n)/2,c=yn(r.P0,r.P1,r.P2,r.P3,t),a=yn(r.P0,r.P1,r.P2,r.P3,n),f=n-t,d=yn(r.P0,r.P1,r.P2,r.P3,t+.25*f),v=yn(r.P0,r.P1,r.P2,r.P3,u),h=yn(r.P0,r.P1,r.P2,r.P3,t+.75*f),p=Math.max(Fn(d,c,a),Fn(v,c,a),Fn(h,c,a));let y=!0;if(o){const e=bn(r.P0,r.P1,r.P2,r.P3,t),o=bn(r.P0,r.P1,r.P2,r.P3,n),i=180*Math.atan2(e[1],e[0])/Math.PI,l=180*Math.atan2(o[1],o[0])/Math.PI;let u=Math.abs(i-l);u>180&&(u=360-u),u>s&&(y=!1)}p<=i&&y||l.C<=0||f<1e-6?e.push(n):(l.C-=1,Rn(t,u,e,r,o,i,s,l),Rn(u,n,e,r,o,i,s,l))}function Fn(t,n,e){const r=e[0]-n[0],o=e[1]-n[1],i=r*r+o*o;if(i<1e-20){const e=t[0]-n[0],r=t[1]-n[1];return Math.sqrt(e*e+r*r)}const s=(t[0]-n[0])*o-(t[1]-n[1])*r;return Math.abs(s)/Math.sqrt(i)}var Dn=1;function Ln(t,n){if(t===n)return!0;if(typeof t!=typeof n||null===t||null===n||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(n))return!1;const e=Object.keys(t),r=Object.keys(n);return e.length===r.length&&e.every(e=>Ln(t[e],n[e]))}function Zn(t){const n=[];let e;const r=function(t){const n=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),e=[];let r=null;for(const t of n)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},e.push(r);else if(r){const n=+t;r.values.push(Number.isNaN(n)?0:n)}return e}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;e={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},n.push(e);continue}if(e||(e={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},n.push(e)),"L"===r){const t=o[0]||0,n=o[1]||0;e.v.push([t,n]),e.i.push([t,n]),e.o.push([t,n])}else if("C"===r){const t=o[0]||0,n=o[1]||0,r=o[2]||0,i=o[3]||0,s=o[4]||0,l=o[5]||0;e.o[e.o.length-1]=[t,n],e.v.push([s,l]),e.i.push([r,i]),e.o.push([s,l])}else"Z"===r||"z"===r?e.c=!0:console.warn('Unsupported path command "'+r+'"')}return n}function Bn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Jn(t){return"string"==typeof t&&void 0!==Bn(t)}function Xn(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const n=Bn(t.pathData);return n?{paths:Zn(n)}:t}if(t&&"object"==typeof t&&"paths"in t){const n=t.paths;if(Array.isArray(n)&&n.length>0&&Jn(n[0])){const t=[];for(const e of n){const n=Bn(e);n&&t.push(...Zn(n))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Jn(t[0])){const n=[];for(const e of t){const t=Bn(e);t&&n.push(...Zn(t))}return{paths:n}}return{paths:t}}return Jn(t)?{paths:Zn(Bn(t))}:t}function Gn(t,n){var e;if(t)return Array.isArray(t)?t:(null==(e=null==n?void 0:n.easings)?void 0:e[t])?n.easings[t]:void console.warn("Unknown easing name: "+t)}function qn(t,n){var e;if("string"==typeof t){const r=null==(e=null==n?void 0:n.animations)?void 0:e[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Yn(t,n,e,r){var o,i;return"d"===t?{paths:tn(null!=(o=null==n?void 0:n.paths)?o:Array.isArray(n)?n:[],null!=(i=null==e?void 0:e.paths)?i:Array.isArray(e)?e:[],r)}:cn.has(t)?function(t,n,e){return[$t(t[0]||0,n[0]||0,e),$t(t[1]||0,n[1]||0,e),$t(t[2]||0,n[2]||0,e),$t(void 0===t[3]?1:t[3],void 0===n[3]?1:n[3],e)]}(n||[0,0,0,1],e||[0,0,0,1],r):"transform"!==t||"object"!=typeof n||null===n||Array.isArray(n)||"object"!=typeof e||null===e||Array.isArray(e)?"rotate"===t&&"number"==typeof n&&"number"==typeof e?$t(n,e,r):an.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Qt(n||[],e||[],r):$t(+(n||0),+(e||0),r):function(t,n,e){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=n?n:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],s=null==n?void 0:n[i];if("rotate"===i||"skew"===i)o[i]=$t(+(null!=r?r:0),+(null!=s?s:0),e);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=Qt(r||t,s||t,e)}else o[i]=null!=s?s:r}return o}(n,e,r)}function Hn(t,n,e,r){var o;const i=n.keyframes||[],s=[];for(const n of i){const e=ut(n);let i=ct(n);const l=at(n);"d"===t&&(i=Xn(i));const u=dn(t)?hn(t):t;cn.has(u)&&(i=null!=(o=un(i))?o:i);const c={t:e,v:i,e:Gn(l,r)},a=ft(n),f=dt(n);a&&(c.tangentIn=a),f&&(c.tangentOut=f),s.push(c)}s.sort((t,n)=>{var e,r;return(null!=(e=t.t)?e:0)-(null!=(r=n.t)?r:0)});const l=n.loop,u=!0===l?{}:l||void 0;return u&&s.length>=2?function(t,n,e,r){var o,i,s,l,u;const f=n.length-1,d=pn(null!=(o=e.segmentCount)?o:f,1,f);let v;v=e.repeatAt===H.start?n.slice(0,d+1):n.slice(f-d);const h=null!=(i=n[0].t)?i:0,p=null!=(s=n[n.length-1].t)?s:0;let y,m;e.repeatAt===H.start?(y=0,m=h):(y=p,m=r);const b=m-y;if(b<=0)return n;const g=null!=(l=v[0].t)?l:0,A=(null!=(u=v[v.length-1].t)?u:0)-g;if(A<=0)return n;const w=v.map(t=>({V:(t.t-g)/A,v:t.v,e:t.e,tangentIn:ft(t),tangentOut:dt(t)})),j=Math.floor(b/A),M=b-j*A,O=M/A,k=[],x=e.repeatAt!==H.start,z=n[n.length-1];let S,P=!1;function C(n,e,r){var o;let i;if(e){i=[];for(let t=w.length-1;t>=0;t--)i.push({V:1-w[t].V,v:w[t].v,e:t>0?ln(w[t-1].e):void 0,tangentIn:w[t].tangentOut,tangentOut:w[t].tangentIn})}else i=w;const s=void 0!==r?r:1;for(let e=0;e<i.length;e++){const r=i[e];if(r.V>s+1e-9){const o=i[e-1],l=r.V-o.V,u=(s-o.V)/l,c=o.e?rn(o.e)(u):u,a=Yn(t,o.v,r.v,c),{left:f}=sn(o.e,u);return k.length>0&&o.V<=s&&(k[k.length-1].e=f),void k.push({t:n+s*A,v:a,e:void 0})}const l=k.length>0?k[k.length-1]:z,u=x&&0===e&&void 0!==l&&Math.abs((null!=(o=l.t)?o:0)-(n+r.V*A))<1e-9;if(u){if(Ln(l.v,r.v)){k.length>0?(l.e=r.e,l.tangentOut=r.tangentOut):(S=r.e,P=!0);continue}k.length>0&&(delete l.tangentIn,delete l.tangentOut)}const c={t:n+r.V*A+(u?Dn:0),v:r.v,e:e<i.length-1?r.e:void 0};r.tangentIn&&(c.tangentIn=r.tangentIn),r.tangentOut&&(c.tangentOut=r.tangentOut),k.push(c)}}if(e.repeatAt===H.start){O>1e-9&&function(n,e,r){let o;if(e){o=[];for(let t=w.length-1;t>=0;t--)o.push({V:1-w[t].V,v:w[t].v,e:t>0?ln(w[t-1].e):void 0,tangentIn:w[t].tangentOut,tangentOut:w[t].tangentIn})}else o=w;const i=1-r;for(let e=0;e<o.length;e++){const r=o[e];if(r.V<i-1e-9)continue;const s=o[e-1];if(s&&s.V<i-1e-9&&r.V>i+1e-9){const e=r.V-s.V,o=(i-s.V)/e,l=s.e?rn(s.e)(o):o,u=Yn(t,s.v,r.v,l),{right:c}=sn(s.e,o);k.push({t:n,v:u,e:c})}const l={t:n+(r.V-i)*A,v:r.v,e:e<o.length-1?r.e:void 0};r.tangentIn&&(l.tangentIn=r.tangentIn),r.tangentOut&&(l.tangentOut=r.tangentOut),k.push(l)}}(y,e.direction===K.alternate&&j%2==0,O);for(let t=0;t<j;t++){const n=j-1-t,r=e.direction===K.alternate&&n%2==0;C(y+M+t*A,r)}}else{for(let t=0;t<j;t++){const n=e.direction===K.alternate&&t%2==0;C(y+t*A,n)}if(O>1e-9){const t=e.direction===K.alternate&&j%2==0;C(y+j*A,t,O)}}return e.repeatAt===H.start?[...k,...n]:P&&n.length>0?[...n.slice(0,-1),a(c({},n[n.length-1]),{e:S}),...k]:[...n,...k]}(t,s,u,e):s}var Kn=0;var $n="setPlaybackRate: rate must be finite and non-zero";function Qn(t,n){return t>0?n===1/0?t:t*(n>0?n:1):0}var te={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"};function ne(t,n){const e=n?n+" ":"";return{warn:(n,r,o)=>{if(null==t?void 0:t.onWarn)return void t.onWarn({kind:n,message:r,detail:o});if(null==t?void 0:t.muteWarn)return;const i=e+n+": "+r;void 0===o?console.warn(i):console.warn(i,o)},error:(n,r,o)=>{const i=function(t){return"string"==typeof t?new Error(t):t}(r);if(null==t?void 0:t.onError)return void t.onError({kind:n,message:i.message,error:i,detail:o});if(null==t?void 0:t.muteError)return;const s=e+n+": "+i.message;void 0===o?console.error(s):console.error(s,o)}}}function ee(t,n,e){const r=null!=e?e:ne(void 0,"[PxAnimator]"),o=[],i=()=>{for(const t of o.splice(0))t()},{startOn:s,outAction:l,scrollIntoViewThreshold:u}=function(t){var n,e,r;return{startOn:null!=(n=null==t?void 0:t.startOn)?n:Y.startOn,outAction:null!=(e=null==t?void 0:t.outAction)?e:Y.outAction,scrollIntoViewThreshold:null!=(r=null==t?void 0:t.scrollIntoViewThreshold)?r:Y.scrollIntoViewThreshold}}(n),c=t.getRootElement();if(!c)return r.warn(te.host,"setupAnimationTriggers: No root element found for animation."),i;let a=!1;const f=()=>{a&&(a=!1,t.setPlaybackRate(1)),t.play()},d=()=>{switch(l){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":a=!0,t.setPlaybackRate(-1),t.play()}};switch(s){case"load":{const t=()=>f();"complete"===document.readyState?t():(window.addEventListener("load",t,{once:!0}),o.push(()=>window.removeEventListener("load",t)));break}case"mouseOver":{let t=!1;const n=()=>{t=!0,f()},e=()=>{t&&d()};c.addEventListener("mouseenter",n),c.addEventListener("mouseleave",e),o.push(()=>{c.removeEventListener("mouseenter",n),c.removeEventListener("mouseleave",e)});break}case"click":{const n=()=>{t.isPlaying()?d():f()};c.addEventListener("click",n),o.push(()=>c.removeEventListener("click",n));break}case"scrollIntoView":{const t=t=>{var n,e;const r=t.boundingClientRect,o=t.intersectionRect;if(!(null==r?void 0:r.height)||!o)return t.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,s=null!=(e=null==(n=t.rootBounds)?void 0:n.height)?e:1/0,l=Math.min(i,s),u=Math.min(r.height,Number.isFinite(l)?l:r.height);return u>0?o.height/u:t.intersectionRatio},n=Array.from({length:21},(t,n)=>n/20);let e=!1;const r=new IntersectionObserver(n=>{n.forEach(n=>{n.isIntersecting&&t(n)>=u?(e=!0,f()):e&&(e=!1,d())})},{threshold:n});r.observe(c),o.push(()=>r.disconnect());break}}return i}function re(t){return"#"+t}function oe(t,n,e,r){let o=ct(t);const i=at(t),s={offset:n,easing:i&&Array.isArray(i)?"cubic-bezier("+i.join(",")+")":void 0};let l,u=e;var c;return cn.has(e)&&Array.isArray(o)?l=function(t){const n=Math.round(255*t[0]),e=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+n+","+e+","+r+","+t[3]+")":"rgb("+n+","+e+","+r+")"}(o):"transform"!==e||null===o||"object"!=typeof o||Array.isArray(o)?an.has(e)?(Array.isArray(o)&&("translate"===e&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===e&&(o+="deg"),l=e+"("+o+")",u="transform"):l="d"===e?'path("'+(o&&"object"==typeof o&&Array.isArray(o.paths)?o.paths:[]).map(t=>function(t,n=!1){var e,r,o,i;const s=t.v,l=t.i,u=t.o,c=t.c;if(!s.length)return"";const a=[],f=s.length;a.push("M"+s[0][0]+","+s[0][1]);for(let t=1;t<f;t++){const o=s[t-1],i=null!=(e=null==u?void 0:u[t-1])?e:o,c=null!=(r=null==l?void 0:l[t])?r:s[t],f=s[t];n||i[0]!==o[0]||i[1]!==o[1]||c[0]!==f[0]||c[1]!==f[1]?a.push("C"+i[0]+","+i[1]+","+c[0]+","+c[1]+","+f[0]+","+f[1]):a.push("L"+f[0]+","+f[1])}if(c&&f>0){const t=s[f-1],e=null!=(o=null==u?void 0:u[f-1])?o:t,r=null!=(i=null==l?void 0:l[0])?i:s[0],c=s[0];!n&&e[0]===t[0]&&e[1]===t[1]&&r[0]===c[0]&&r[1]===c[1]||a.push("C"+e[0]+","+e[1]+","+r[0]+","+r[1]+","+c[0]+","+c[1]),a.push("z")}return a.join("")}(t,!0)).join("")+'")':fn.has(e)&&"number"==typeof o?100*o+"%":""+o:(l=function(t,n){var e;if(!t)return"";const r=null==(e=null==n?void 0:n.T)||e,o=[],i=t.translate,s=t.origin,l=t.rotate,u=t.skew,c=t.scale,a=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+a+","+i[1]+a+")"),s&&o.push("translate("+s[0]+a+","+s[1]+a+")"),null!=l&&o.push("rotate("+l+f+")"),null!=u&&o.push("skewX("+u+f+")"),c&&o.push("scale("+c[0]+","+c[1]+")"),s&&o.push("translate("+-s[0]+a+","+-s[1]+a+")"),o.join("")}(o,{T:!0}),u="transform"),CSS.supports(hn(u),l)||r.add(u),u=(c=u).includes("-")?c.replace(/-([a-z])/g,(t,n)=>n.toUpperCase()):c,s[u]=l,s}function ie(t,n,e){var r,o,i,s,l;const u=[];for(let f=0;f<n.length;f++){const d=n[f],v=null!=(r=d.t)?r:0;if(v<0){const e=n[f+1];if(e&&(null!=(o=e.t)?o:0)>=0){const n=(0-v)/((null!=(i=e.t)?i:0)-v),r=d.e?rn(d.e)(n):n,{right:o}=sn(d.e,n);u.push({t:0,v:Yn(t,d.v,e.v,r),e:o})}continue}if(v>e){const r=n[f-1];if(r&&(null!=(s=r.t)?s:0)<=e){const n=null!=(l=r.t)?l:0,o=(e-n)/(v-n),i=r.e?rn(r.e)(o):o,{left:s}=sn(r.e,o);u.length>0&&(u[u.length-1]=a(c({},u[u.length-1]),{e:s})),u.push({t:e,v:Yn(t,r.v,d.v,i),e:void 0})}break}u.push(d)}return u}function se(t,n,e){var r;const o=new Map;for(const[i,s]of Object.entries(t)){const t=e.duration||1,l=ie(i,s.keyframes||[],t),u=[];for(let e=0;e<l.length;e++){const o=l[e],s=oe(o,pn((null!=(r=o.t)?r:0)/t,0,1),i,n);0===e&&(s.offset||0)>0&&u.push(a(c({},s),{offset:0})),u.push(s)}u.length>0&&(u[u.length-1].offset||0)<1&&u.push(a(c({},u[u.length-1]),{offset:1})),u.length>0&&o.set(i,u)}return o}function le(t){const n=function(t){if(!(null==t?void 0:t.doc))throw new Error("createAnimator: `doc` is required");return t.doc}(t);return function(t,n){try{return n()}catch(n){const e=function(t){return t instanceof Error?t:new Error(String(t))}(n);return ne(t,"[PxAnimator]").error(te.internal,"createAnimator: could not build the player — "+e.message,e),{isReady:()=>!1,getRootElement:()=>null,isPlaying:()=>!1,play:()=>{},pause:()=>{},cancel:()=>{},finish:()=>{},setPlaybackRate:()=>{},getCurrentTime:()=>null,setCurrentTime:()=>{},getCurrentProgress:()=>null,setCurrentProgress:()=>{},destroy:()=>{}}}}(t,()=>function(t,e){let r,o=e;t.resetOnFinish&&(o=a(c({},e),{onFinish:()=>{var t;null==(t=null==e?void 0:e.onFinish)||t.call(e),null==r||r.cancel()}}));const i=function(t,n,e,r,o){var i,s;const l=nt(t)||{},u=ne(n,"[PxAnimator]");if(!e)if(t.id){const n=re(t.id);(e=document.querySelector(n))||u.warn(te.host,"createWebApiAnimator: No root element found for selector: "+n)}else u.warn(te.host,"createWebApiAnimator: No root element provided");const f=function(t,n=G.native){const e=nt(t)||{},r=function(t){var n;if(t)return null==(n=nt(t))?void 0:n.definitions}(t),o=e.duration||1e3,i=[],s=(t,e,i)=>{if(0===e.length)return null;const s=function(t,n,e,r=G.native){const o={};for(const[i,s]of Object.entries(t)){if("transform"===i&&"offsetPath"===s.alongPathMode&&void 0!==t.offsetDistance)continue;const l=Hn(i,s,n,e);if(l.length>0){const t={keyframes:l};void 0!==s.autoOrient&&(t.autoOrient=s.autoOrient),void 0!==s.loop&&(t.loop=s.loop),o[i]=r===G.native&&"transform"===i?Pn(t):t}}return o}(function(t,n){if(!t)return t;const e=n&&"object"==typeof n&&!Array.isArray(n)?n:function(t){var n,e;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let s,l=-1;for(;null!==(s=o.exec(t));){const t=s[1],o=i.indexOf(t);if(o<0||o<=l)return;l=o;const u=s[2].split(/[\s,]+/).filter(Boolean).map(Number);if(u.some(t=>Number.isNaN(t)))return;if("translate"===t){if(u.length<1||u.length>2)return;r.translate=[u[0],null!=(n=u[1])?n:0]}else if("rotate"===t){if(1!==u.length)return;r.rotate=u[0]}else if("skewX"===t){if(1!==u.length)return;r.skew=u[0]}else{if(u.length<1||u.length>2)return;r.scale=[u[0],null!=(e=u[1])?e:u[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}(n);if(!e||!Object.keys(e).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?c(c({},e),t):t,o=t[tt];if(o&&"object"==typeof o){const n=o;if(Array.isArray(n.keyframes)){const e=a(c({},n),{keyframes:n.keyframes.map(t=>a(c({},t),{value:r(t.value)}))});return void 0!==e.value&&(e.value=r(e.value)),a(c({},t),{transform:e})}return t}const i=Object.keys(t).filter(t=>an.has(t));if(1!==i.length)return t;const s=i[0],l=t[s];if(!l||"object"!=typeof l||!Array.isArray(l.keyframes))return t;const u=a(c({},l),{keyframes:l.keyframes.map(t=>a(c({},t),{value:a(c({},e),{[s]:t.value})}))});void 0!==u.value&&(u.value=a(c({},e),{[s]:u.value}));const f=c({},t);return delete f[s],a(c({},f),{transform:u})}(function(t){const n={};for(const e of t)for(const[t,r]of Object.entries(e))n[t]=r;return n}(e),i),o,r,n);return 0===Object.keys(s).length?null:{id:t,animate:s}},l=function(t){var n;if(t)return null==(n=nt(t))?void 0:n.bindings}(t);if(l)for(const t of l){const n=t.target.startsWith("#")?t.target.slice(1):t.target,e=t.animateWith.map(t=>qn(t,r)).filter(t=>!!t),o=s(n,e);o&&i.push(o)}const u=t=>{const n=t.animate;if(n&&Object.keys(n).length>0){const e=t.id||"_px_el_"+ ++Kn;t.id=e;const o=s(e,function(t,n){if(!t)return[];const e=[];if("string"==typeof t){const r=qn(t,n);r&&e.push(r)}else if(Array.isArray(t))for(const r of t){const t=qn(r,n);t&&e.push(t)}else e.push(t);return e}(n,r),t.transform);o&&i.push(o)}if(t.children)for(let n=0;n<t.children.length;n++)u(t.children[n])};if(t.children)for(let n=0;n<t.children.length;n++)u(t.children[n]);return i}(t,G.native),d=[],v=l.iterations;let h;"number"==typeof v&&(h=v),"infinite"===v&&(h=1/0);const p=new Set;let y=!1,m=!1;(null==f?void 0:f.length)||u.warn(te.document,"createWebApiAnimator: No animation bindings defined");for(const t of f||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){u.warn(te.document,"createWebApiAnimator: Empty or unresolved binding",t);continue}const s=re(t.id),c=(null==e?void 0:e.querySelectorAll(s))||document.querySelectorAll(s);0===c.length&&u.warn(te.host,'createWebApiAnimator: No elements found for selector "'+s+'"');const a=se(r,p,l),f=l.delay&&l.delay>0?l.delay:void 0;let v;if(l.delay&&l.delay<0&&l.duration){const t=-l.delay;v=h===1/0?t%l.duration:Math.min(t,l.duration*(null!=h?h:1))}const b={duration:l.duration,delay:f,fill:null!=(i=l.fill)?i:"forwards",direction:l.direction,iterations:h};for(let t=0;t<c.length;t++){const e=c[t];for(const[,t]of a)if(t.length>0)try{const r=new KeyframeEffect(e,t,b),i=new Animation(r,document.timeline);o,(null==n?void 0:n.onFinish)&&(i.onfinish=()=>{var t;y||(y=!0,null==(t=n.onFinish)||t.call(n))}),(null==n?void 0:n.onRemove)&&(i.onremove=()=>{var t;m||(m=!0,null==(t=n.onRemove)||t.call(n))}),void 0!==v&&(i.currentTime=v),d.push(i)}catch(t){u.warn(te.internal,"createWebApiAnimator: could not build the animation",t)}}}const b={isReady:()=>!0,getRootElement:()=>e||null,isPlaying:()=>{var t;return"running"===(null==(t=d[0])?void 0:t.playState)},play:()=>{var t;y=!1,d.forEach(t=>t.play()),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;d.forEach(t=>t.pause()),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;y=!1,d.forEach(t=>t.cancel()),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{var t;for(const n of d)try{(null==(t=n.effect)?void 0:t.getTiming().iterations)===1/0?(n.effect.updateTiming({iterations:1}),n.finish(),n.effect.updateTiming({iterations:1/0})):n.finish()}catch(t){n.cancel()}},setPlaybackRate:t=>function(t){return Number.isFinite(t)&&0!==t}(t)?(d.forEach(n=>n.playbackRate=t),b):(u.warn(te.usage,$n),b),getCurrentTime:()=>{var t,n;const e=null!=(n=null==(t=d[0])?void 0:t.currentTime)?n:null;return null!==e?+e:null},setCurrentTime:t=>{var n;const e=function(t,n){return t>0?n===1/0?1/0:t*(n>0?n:1):0}(null!=(n=l.duration)?n:0,null!=h?h:1),r=e>0?(o=t,i=e,Number.isNaN(o)||o<0?0:Number.isFinite(i)?o>i?i:o:Number.isFinite(o)?o:0):Math.max(0,t);var o,i;y=!1,d.forEach(t=>{t.currentTime=r})},getCurrentProgress:()=>{var t;const n=b.getCurrentTime();return null===n?null:function(t,n,e){const r=Qn(n,e);return r>0&&Number.isFinite(t)?t<=0?0:e===1/0?t%r/r:t>=r?1:t/r:0}(n,null!=(t=l.duration)?t:0,null!=h?h:1)},setCurrentProgress:t=>{var n;b.setCurrentTime(function(t,n,e){const r=Qn(n,e);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}(t,null!=(n=l.duration)?n:0,null!=h?h:1))},destroy:()=>{var t;b.cancel(),d.splice(0,d.length),m||(m=!0,null==(t=null==n?void 0:n.onRemove)||t.call(n))}};if("scroll"===l.timelineSource)l.trigger&&u.warn(te.usage,"scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)");else{const t=ee(b,null!=(s=l.trigger)?s:{},u),n=b.destroy.bind(b);b.destroy=()=>{t(),n()}}return b}(n,o,null);return r=i,t.debugGlobalName&&(window[t.debugGlobalName]=i),i}(nt(n)||{},function(t){const{onPlay:n,onPause:e,onCancel:r,onFinish:o,onRemove:i,onStop:s,onWarn:l,onError:u,muteWarn:c,muteError:a}=null!=t?t:{},f=t=>t||s?()=>{null==t||t(),null==s||s()}:void 0;return{onPlay:n,onPause:f(e),onCancel:f(r),onFinish:f(o),onRemove:f(i),onWarn:l,onError:u,muteWarn:c,muteError:a}}(t)))}var ue,ce="doc";return ue=d,((n,r,i,l)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let i of o(r))s.call(n,i)||void 0===i||t(n,i,{get:()=>r[i],enumerable:!(l=e(r,i))||l.enumerable});return n})(t({},"__esModule",{value:!0}),ue)})();
|
|
1
|
+
"use strict";var PixodeskAnimator=(()=>{var t=Object.defineProperty,n=Object.defineProperties,e=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(n,e,r)=>e in n?t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,c=(t,n)=>{for(var e in n||(n={}))s.call(n,e)&&u(t,e,n[e]);if(i)for(var e of i(n))l.call(n,e)&&u(t,e,n[e]);return t},a=(t,e)=>n(t,r(e)),f=(t,n)=>{var e={};for(var r in t)s.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&i)for(var r of i(t))n.indexOf(r)<0&&l.call(t,r)&&(e[r]=t[r]);return e},d={};function v(t){if(!t.length)return".";let n="";for(const e of t)e.startsWith("[")?n+=e:n+=(n?".":"")+e;return n}((n,e)=>{for(var r in e)t(n,r,{get:e[r],enumerable:!0})})(d,{PX_ANIMATOR_DOC_KEY:()=>ae,createAnimator:()=>ue,setupAnimationTriggers:()=>re});var h=class{_canSanitize(t){return this.isValid(t)}optional(){return new p(this)}},p=class extends h{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,n,e){return null==t||this.inner.isValid(t,n,e)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},y=class extends h{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,n,e){return"string"==typeof t||(null==n||n.errors.push(v(null!=e?e:[])+": expected string, got "+typeof t),!1)}},m=class extends h{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,n,e){return!("number"!=typeof t||!isFinite(t))||(null==n||n.errors.push(v(null!=e?e:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},b=class extends h{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,n,e){return"boolean"==typeof t||(null==n||n.errors.push(v(null!=e?e:[])+": expected boolean, got "+typeof t),!1)}},g=class extends h{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,n,e){return t===this.value||(null==n||n.errors.push(v(null!=e?e:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},w=class extends h{constructor(t,n){super(),this.values=t,this._default=null!=n?n:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,n,e){return!!this.values.includes(t)||(null==n||n.errors.push(v(null!=e?e:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},A=class extends h{constructor(t,n){super(),this.l=t,this.h="union",this._default=null!=n?n:t[0]._default}sanitize(t){for(const n of this.l)if(n.isValid(t))return n.sanitize(t);return this._default}isValid(t,n,e){var r;const o=n&&{errors:[],warnings:[],strict:n.strict};if(this.l.some(n=>n.isValid(t,o,e?[...e]:void 0)))return!0;if(!n)return!1;const i=v(null!=e?e:[]);let s;n.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let l=-1;const u=[];for(const r of this.l){const o={errors:[],warnings:[],strict:n.strict};if(r.isValid(t,o,e?[...e]:void 0),!o.errors.length)continue;const c=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((c>l||c===l&&s&&o.errors.length<s.length)&&(l=c,s=o.errors),c<=i.length)for(const t of o.errors){const n=/: expected (.+?), got /.exec(t);n&&!u.includes(n[1])&&u.push(n[1])}}if(s&&l>i.length)for(const t of s.slice(0,4))n.errors.includes(t)||n.errors.push(t);else u.length&&n.errors.push(i+": expected "+u.join(" | "));return!1}_canSanitize(t){return this.l.some(n=>n._canSanitize(t))}},j=class extends h{constructor(t){super(),this._shape=t;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e={};for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(n[t]);void 0!==r&&(e[t]=r)}return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(v(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(null==n?void 0:n.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),n.errors.push(v(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},M=class extends h{constructor(t,n){super(),this._shape=t,this.m=n;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e=c({},n);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(n[t]);void 0!==r&&(e[t]=r)}if(this.m)for(const t of Object.keys(n))t in this._shape||(e[t]=this.m.sanitize(n[t]));return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(v(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(this.m)for(const t of Object.keys(r))t in this._shape||(o.push(t),this.m.isValid(r[t],n,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},O=class extends h{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const n=[];for(const e of t)this.item._canSanitize(e)&&n.push(this.item.sanitize(e));return n}isValid(t,n,e){if(!Array.isArray(t))return null==n||n.errors.push(v(null!=e?e:[])+": expected array, got "+typeof t),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<t.length;e++)r.push("["+e+"]"),this.item.isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},x=class extends h{constructor(t){super(),this.value=t,this.h="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const n={};for(const[e,r]of Object.entries(t))this.value._canSanitize(r)&&(n[e]=this.value.sanitize(r));return n}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(v(null!=e?e:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(const[e,i]of Object.entries(t))r.push(e),this.value.isValid(i,n,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},k=class extends h{constructor(t,n){super(),this.fn=t,this._default=n,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,n,e){return this.schema.isValid(t,n,e)}_canSanitize(t){return this.schema._canSanitize(t)}},z=class extends h{constructor(t){super(),this.l=t,this.h="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.l.length?this.l.map((n,e)=>n.sanitize(t[e])):this._default}isValid(t,n,e){if(!Array.isArray(t)||t.length!==this.l.length)return null==n||n.errors.push(v(null!=e?e:[])+": expected tuple of length "+this.l.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<this.l.length;e++)r.push("["+e+"]"),this.l[e].isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.l.length}},S=(t="")=>new y(t),P=(t=0)=>new m(t),C=(t=!1)=>new b(t),V=t=>new g(t),_=(t,n)=>new w(t,n),T=(t,n)=>new A(t,n),U=t=>new j(t),N=(t,n)=>new M(t,n),I=t=>new O(t),E=t=>new x(t),R=t=>new z(t),F=(t,n)=>new k(t,n),W="block",D="inline",L="nearest",Z="root",B="center",J="bottom",X=["duration","iterations","engine","frameRate","trigger","delay","fillMode","direction","fill","resetOnFinish","timelineSource","scroll"],G={native:"native",js:"js"},q=a(c({},G),{auto:"auto"}),Y={startOn:"load",outAction:"continue",scrollIntoViewThreshold:0},H={start:"start",end:"end"},K={normal:"normal",alternate:"alternate"},$="userSpaceOnUse",Q="objectBoundingBox",tt="transform";function nt(t){var n;const e=(null==t?void 0:t.animator)||(null==(n=null==t?void 0:t.meta)?void 0:n.animator);if(!e)return;const r=rt.get(e);if(r)return r;const o=e,i=X.filter(t=>void 0!==o[t]),s=i.length?c({},o):e;for(const t of i)delete s[t];const l=function(t){const n=t.timeline;if(null==n||"object"!=typeof n)return t;const e=ot.get(t);if(e)return e;const r=t,{timeline:o}=r,i=f(r,["timeline"]);if(void 0!==n.engine&&(i.engine=n.engine),void 0!==n.frameRate&&(i.frameRate=n.frameRate),"scroll"===n.type||"view"===n.type){i.timelineSource="scroll",void 0!==n.duration&&(i.duration=n.duration),void 0!==n.iterations&&(i.iterations=n.iterations);const t=c({},i.scroll||{});t.kind=n.type,void 0!==n.axis&&(t.axis=n.axis),void 0!==n.source&&(t.source=n.source),void 0!==n.subject&&(t.subject=n.subject),void 0!==n.smoothing&&(t.smoothing=n.smoothing),void 0!==n.range&&(t.range=n.range);const e=n.pin;"boolean"==typeof e?t.pin=e:e&&"object"==typeof e&&(t.pin=!0,void 0!==e.align&&(t.pinAlign=e.align),void 0!==e.offset&&(t.pinOffset=e.offset),void 0!==e.distance&&(t.pinDistance=e.distance)),i.scroll=t}else{if(void 0!==n.duration&&(i.duration=n.duration),void 0!==n.trigger){const t=n.trigger,{finishAction:e}=t,r=f(t,["finishAction"]);Object.keys(r).length&&(i.trigger=r),void 0!==e&&(i.resetOnFinish="reset"===e)}void 0!==n.delay&&(i.delay=n.delay),void 0!==n.iterations&&(i.iterations=n.iterations),void 0!==n.direction&&(i.direction=n.direction),void 0!==n.fillMode&&(i.fill=n.fillMode)}return ot.set(t,i),i}(s);return rt.set(e,l),l}var et,rt=new WeakMap,ot=new WeakMap,it=T([S(),R([P(),P(),P(),P()])]),st=T([S(),P(),I(P()),U({pathData:S()}),F(()=>I(Lt),[]),F(()=>pt,{})]),lt=U({time:P().optional(),value:st.optional(),easing:it.optional(),tangentOut:R([P(),P()]).optional(),tangentIn:R([P(),P()]).optional()}),ut=t=>{var n,e;return null!=(e=null!=(n=t.time)?n:t.t)?e:0},ct=t=>{var n;return null!=(n=t.value)?n:t.v},at=t=>{var n;return null!=(n=t.easing)?n:t.e},ft=t=>t.tangentIn,dt=t=>t.tangentOut,vt=U({segmentCount:P().optional(),repeatAt:_([H.start,H.end]).optional(),direction:_([K.normal,K.alternate]).optional()}),ht=U({value:st.optional(),keyframes:I(lt).optional(),loop:T([vt,C()]).optional(),autoOrient:C().optional(),alongPathMode:_(["sampled","offsetPath"]).optional()}),pt=U({translate:R([P(),P()]).optional(),rotate:P().optional(),skew:P().optional(),scale:R([P(),P()]).optional(),origin:R([P(),P()]).optional()}),yt=(T([S(),pt,U({value:pt}),ht]),E(ht)),mt=T([S(),I(T([S(),yt])),yt]),bt=U({startOn:_(["load","mouseOver","click","scrollIntoView","programmatic"],Y.startOn).optional(),outAction:_(["continue","pause","reset","reverse"],Y.outAction).optional(),finishAction:_(["hold","reset"]).optional(),scrollIntoViewThreshold:P().optional()}),gt=U({width:P(),pathData:S()}),wt=U({fontFamily:S(),fontStyle:S(),ascent:P(),unitsPerEm:P(),glyphs:E(gt)}),At=U({easings:E(R([P(),P(),P(),P()])).optional(),animations:E(yt).optional(),fonts:E(wt).optional()}),jt=U({phase:_(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:P().optional()}),Mt=U({start:jt.optional(),end:jt.optional()}),Ot=(U({kind:_(["view","scroll"]).optional(),axis:_([W,D,"x","y"]).optional(),source:_([L,Z]).optional(),subject:S().optional(),smoothing:P().optional(),pin:C().optional(),pinAlign:_(["top",B,J]).optional(),pinOffset:P().optional(),pinDistance:P().optional(),range:Mt.optional()}),U({align:_(["top",B,J]).optional(),offset:P().optional(),distance:P().optional()})),xt=_([q.auto,q.native,q.js]).optional(),kt=U({type:V("time").optional(),engine:xt,frameRate:P().optional(),duration:P().optional(),trigger:bt.optional(),delay:P().optional(),iterations:T([P(),V("infinite")]).optional(),fillMode:_(["forwards","backwards","both","none"]).optional(),direction:_(["normal","reverse","alternate","alternate-reverse"]).optional()}),zt={duration:P().optional(),iterations:P().optional(),engine:xt,frameRate:P().optional(),axis:_([W,D,"x","y"]).optional(),source:_([L,Z]).optional(),subject:S().optional(),smoothing:P().optional(),pin:T([C(),Ot]).optional(),range:Mt.optional()},St=(et=[kt,U(c({type:V("scroll")},zt)),U(c({type:V("view")},zt))],new class extends h{constructor(t,n,e){var r;super(),this.A=t,this.j=n,this.h="discriminatedUnion",this._default=null!=e?e:n[0]._default,this.M=new Map;for(const e of n){const n=e._shape[t];if(!n)continue;const o=null!=(r=n.inner)?r:n;this.M.set(o._default,e),n.inner&&(this.O=e)}}k(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const n=t[this.A];return null==n?this.O:this.M.get(n)}sanitize(t){var n;return(null!=(n=this.k(t))?n:this.j[0]).sanitize(t)}isValid(t,n,e){const r=this.k(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this.A];return null==n||n.errors.push(v(null!=e?e:[])+": no discriminated union member matched "+this.A+"="+JSON.stringify(r)),!1}return r.isValid(t,n,e)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const n=this.k(t);return n?n._canSanitize(t):this.j[0]._canSanitize(t)}}("type",et)),Pt=U({target:S(),animateWith:I(S())}),Ct=U({timeline:St.optional(),definitions:At.optional(),bindings:I(Pt).optional(),debugGlobalName:S().optional(),version:S().optional()}),Vt=T([S(),P(),I(P()),U({value:new class extends h{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return void 0!==t||(null==n||n.errors.push(v(null!=e?e:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}}}),pt]),_t=T([P(),ht,U({value:P()})]),Tt=T([R([P(),P()]),ht,U({value:R([P(),P()])})]),Ut=T([S(),ht,U({value:S()})]),Nt=U({translate:Tt.optional(),rotate:_t.optional(),scale:Tt.optional(),skew:_t.optional(),origin:Tt.optional()}),It=U({copies:P().optional(),translate:Tt.optional(),rotate:_t.optional(),skew:_t.optional(),scale:Tt.optional(),origin:Tt.optional()}),Et=U({source:S().optional(),maskType:_(["luminance","alpha"]).optional(),maskUnits:_([$,Q]).optional(),maskContentUnits:_([$,Q]).optional(),x:P().optional(),y:P().optional(),width:P().optional(),height:P().optional()}),Rt=U({pathData:Ut.optional()}),Ft=U({offset:_t.optional(),range:Tt.optional(),subPaths:_(["separate","combined"]).optional()}),Wt=U({start:P().optional(),stretch:P().optional(),timeCrop:R([P(),P()]).optional()}),Dt=U({without:_(["translate"]).optional(),source:S().optional(),retime:Wt.optional()}),Lt=U({offset:P(),color:S()}),Zt=T([I(Lt),U({value:I(Lt)}),ht]),Bt=U({type:_(["linear","radial"]),start:Tt.optional(),end:Tt.optional(),center:Tt.optional(),radius:_t.optional(),focal:Tt.optional(),stops:Zt.optional(),gradientUnits:_([$,Q]).optional(),spreadMethod:_(["pad","reflect","repeat"]).optional(),gradientTransform:S().optional()}),Jt=Bt,Xt=U({pathData:S(),pathOverflow:_(["clip","extend"]).optional(),lengthAdjust:_(["spacing","spacingAndGlyphs"]).optional(),method:_(["align","stretch"]).optional(),spacing:_(["auto","exact"]).optional(),startOffset:_t.optional(),textLength:_t.optional()}),Gt=U({useGlyphs:C().optional()}),qt=U({transformBy:Nt.optional(),repeater:It.optional(),maskedBy:Et.optional(),clipPath:Rt.optional(),strokeTrim:Ft.optional(),clone:Dt.optional(),fillGradient:Bt.optional(),strokeGradient:Jt.optional(),textPath:Xt.optional(),text:Gt.optional()}),Yt=N({type:S(),domType:S().optional(),textContent:S().optional(),id:S().optional(),meta:(new class extends h{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return!0}_canSanitize(t){return!0}}).optional(),effects:qt.optional(),animate:mt.optional(),style:E(T([S(),P()])).optional()},Vt),Ht=N(a(c({},Yt._shape),{children:F(()=>I(Ht),[]).optional()}),Vt),Kt=U({width:T([P(),S()]).optional(),height:T([P(),S()]).optional(),viewBox:S().optional(),animator:Ct.optional()});function $t(t,n,e){return t+(n-t)*e}function Qt(t,n,e){const r=[],o=Math.max(t.length,n.length);for(let i=0;i<o;i++)r[i]=$t(t[i]||0,n[i]||0,e);return r}function tn(t,n,e){const r=Math.max(t.length,n.length),o=[];for(let i=0;i<r;i++)o.push(nn(t[i],n[i],e));return o}function nn(t,n,e){var r,o,i,s,l,u,c,a,f;if(!t||!n)return t||n||{v:[]};const d=Math.min(Math.max(e,0),1),v=Math.min(t.v.length,n.v.length),h=[],p=[],y=[];for(let e=0;e<v;e++){const f=t.v[e],v=n.v[e];h.push(Qt(f,v,d));const m=null!=(o=null==(r=t.i)?void 0:r[e])?o:f,b=null!=(s=null==(i=n.i)?void 0:i[e])?s:v;p.push(Qt(m,b,d));const g=null!=(u=null==(l=t.o)?void 0:l[e])?u:f,w=null!=(a=null==(c=n.o)?void 0:c[e])?a:v;y.push(Qt(g,w,d))}return{v:h,i:p.length?p:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:n.c}}function en(t,n,e){if(e<=0)return 0;if(e>=1)return 1;const r=3*t,o=3*(n-t)-r,i=1-r-o;function s(t){return((i*t+o)*t+r)*t}function l(t){return(3*i*t+2*o)*t+r}let u=e,c=0,a=1;for(let t=0;t<8;t++){const t=s(u)-e;if(Math.abs(t)<1e-6)return u;const n=l(u);if(Math.abs(n)<1e-6)break;u-=t/n}for(u=e;c<a;){const t=s(u);if(Math.abs(t-e)<1e-6)return u;e>t?c=u:a=u,u=(a+c)/2}return u}function rn(t){const[n,e,r,o]=t,i=3*e,s=3*(o-e)-i,l=1-i-s;return function(t){return e=en(n,r,t),((l*e+s)*e+i)*e;var e}}function on(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function sn(t,n){if(!t)return{left:void 0,right:void 0};if(n<=0)return{left:void 0,right:t};if(n>=1)return{left:t,right:void 0};const[e,r,o,i]=t,s=en(e,o,n),l=[e,r],u=[o,i],{left:c,right:a}=function(t,n,e,r,o){const i=on(t,n,o),s=on(n,e,o),l=on(e,r,o),u=on(i,s,o),c=on(s,l,o),a=on(u,c,o);return{left:[t,i,u,a],right:[a,c,l,r]}}([0,0],l,u,[1,1],s),f=c[3][0],d=c[3][1];let v,h;f>1e-9&&Math.abs(d)>1e-9&&(v=[c[1][0]/f,c[1][1]/d,c[2][0]/f,c[2][1]/d]);const p=1-f,y=1-d;return p>1e-9&&Math.abs(y)>1e-9&&(h=[(a[1][0]-f)/p,(a[1][1]-d)/y,(a[2][0]-f)/p,(a[2][1]-d)/y]),{left:v,right:h}}function ln(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function un(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const n=t.slice(1),e=n.length<=4,r=e?n[0]+n[0]:n.slice(0,2),o=e?n[1]+n[1]:n.slice(2,4),i=e?n[2]+n[2]:n.slice(4,6),s=4===n.length?n[3]+n[3]:8===n.length?n.slice(6,8):null,l=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==s&&l.push(parseInt(s,16)/255),l}(t):t.startsWith("rgb")?function(t){var n;const e=null==(n=t.match(/rgba?\((.*)\)/))?void 0:n[1];if(!e)throw new Error("Invalid rgb/rgba format");const r=e.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}N(a(c(c({},Yt._shape),Kt._shape),{type:V("svg"),children:I(Ht).optional()}),Vt),U({v:I(I(P())),i:I(I(P())).optional(),o:I(I(P())).optional(),c:C().optional()});var cn=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),an=new Set(["translate","rotate","scale","skew"]),fn=new Set(["offset-distance","offsetDistance"]);function dn(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var vn=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function hn(t){return vn.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function pn(t,n,e){return Math.max(n,Math.min(t,e))}function yn(t,n,e,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,s=i*i,l=o*o,u=s*i,c=3*o*s,a=3*l*i,f=l*o;return[u*t[0]+c*n[0]+a*e[0]+f*r[0],u*t[1]+c*n[1]+a*e[1]+f*r[1]]}var mn=1e-4;function bn(t,n,e,r,o){const i=gn(t,n,e,r,o);return 0===i[0]&&0===i[1]?gn(t,n,e,r,o<.5?o+mn:o-mn):i}function gn(t,n,e,r,o){const i=1-o,s=3*i*i,l=6*o*i,u=3*o*o;return[s*(n[0]-t[0])+l*(e[0]-n[0])+u*(r[0]-e[0]),s*(n[1]-t[1])+l*(e[1]-n[1])+u*(r[1]-e[1])]}function wn(t,n){const{ts:e,ds:r}=t,o=e.length-1;if(n<=e[0])return r[0];if(n>=e[o])return r[o];let i=1,s=o;for(;i<s;){const t=i+s>>>1;e[t]<n?i=t+1:s=t}const l=e[s-1],u=e[s]-l,c=u>0?(n-l)/u:0;return r[s-1]+c*(r[s]-r[s-1])}function An(t){const n=ct(t);if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const e=n.translate;return Array.isArray(e)&&e.length>=2?[e[0],e[1]]:void 0}function jn(t){return ut(t)}function Mn(t){return at(t)}var On=new WeakMap;function xn(t,n,e,r){let o=On.get(t);const i=null==o?void 0:o.get(n);if(i)return i;const s=dt(t),l=ft(n),u=[e[0]+(s?s[0]:0),e[1]+(s?s[1]:0)],c=[r[0]+(l?l[0]:0),r[1]+(l?l[1]:0)],a=function(t,n,e,r,o=100){const i=o+1,s=new Float64Array(i),l=new Float64Array(i);let u=yn(t,n,e,r,0);s[0]=0,l[0]=0;let c=0;for(let a=1;a<i;a++){const i=a/o,f=yn(t,n,e,r,i),d=f[0]-u[0],v=f[1]-u[1];c+=Math.sqrt(d*d+v*v),s[a]=i,l[a]=c,u=f}return{ts:s,ds:l}}(e,u,c,r),f={P0:e,P1:u,P2:c,P3:r,S:a,P:a.ds[a.ds.length-1]};return o||(o=new WeakMap,On.set(t,o)),o.set(n,f),f}var kn=.5,zn=5,Sn=32;function Pn(t,n){var e,r,o;if(!function(t){const n=t.keyframes;if(!Array.isArray(n))return!1;if(t.autoOrient)return!0;for(const t of n)if(ft(t)||dt(t))return!0;return!1}(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,l=null!=(e=null==n?void 0:n.flatnessTolerance)?e:kn,u=null!=(r=null==n?void 0:n.rotationTolerance)?r:zn,c=null!=(o=null==n?void 0:n.maxSamplesPerSegment)?o:Sn,a=[],f=An(i[0]);if(!f)return t;const d=s?function(t,n){const e=An(t),r=An(n);if(!e||!r)return 0;const o=xn(t,n,e,r),i=bn(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(i[0],i[1]):void 0;a.push(Cn(jn(i[0]),Tn(Vn(i[0]),Vn(i[0]),0,f,d,s)));for(let t=0;t<i.length-1;t++){const n=i[t],e=i[t+1],r=An(n),o=An(e);r&&o?(s&&t>0&&Nn(a,n,e,r,o,u),En(a,n,e,r,o,s,l,u,c)):a.push(Cn(jn(e),Tn(Vn(e),Vn(e),1,null!=o?o:[0,0],void 0,s)))}const v=Mn(i[i.length-1]);v&&(a[a.length-1].e=v),s&&function(t){let n;for(const e of t){const t=ct(e);if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let r=t.rotate;for(;r-n>180;)r-=360;for(;r-n<-180;)r+=360;t.rotate=r,n=r}}(a);const h={keyframes:a};return void 0!==t.loop&&(h.loop=t.loop),h}function Cn(t,n){return{t:t,v:n}}function Vn(t){const n=ct(t);if(n&&"object"==typeof n&&!Array.isArray(n))return n}function _n(t,n,e){if(void 0===t)return n;if(void 0===n)return t;if("number"==typeof t&&"number"==typeof n)return t+(n-t)*e;if(Array.isArray(t)&&Array.isArray(n)&&t.length===n.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,s="number"==typeof n[o]?n[o]:0;r[o]=i+(s-i)*e}return r}return e<.5?t:n}function Tn(t,n,e,r,o,i){const s={translate:r},l=new Set;if(t)for(const n of Object.keys(t))l.add(n);if(n)for(const t of Object.keys(n))l.add(t);for(const r of l){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],l=null==n?void 0:n[r];void 0===o&&void 0===l||(s[r]=_n(o,l,e))}return void 0!==o&&(s.rotate=o+Un(t,n,e)),s}function Un(t,n,e){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=_n(r,o,e);return"number"==typeof i?i:0}function Nn(t,n,e,r,o,i){const s=t[t.length-1],l=ct(s),u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=Vn(n),a=u-Un(c,c,0),f=xn(n,e,r,o),d=bn(f.P0,f.P1,f.P2,f.P3,0),v=180*Math.atan2(d[1],d[0])/Math.PI,h=function(t,n){let e=t-n;for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}(v,a);if(Math.abs(h)<=i)return;const p=jn(n),y=Math.min(p+In,(p+jn(e))/2),m=Tn(Vn(n),Vn(n),0,r,v,!0);t.push(Cn(y,m))}var In=.05;function En(t,n,e,r,o,i,s,l,u){const c=xn(n,e,r,o),a=jn(n),f=jn(e),d=Mn(n),v=(h=d)?rn([h[1],h[0],h[3],h[2]]):t=>t;var h;const p=Vn(n),y=Vn(e),m=function(t,n,e,r,o){const i=[];Rn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),Rn(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,n)=>t-n);const s=[0];for(const t of i)t>s[s.length-1]+1e-6&&t<.999999&&s.push(t);s.push(1);const l=[],u={C:o-s.length};for(let o=0;o<s.length-1;o++)Fn(s[o],s[o+1],l,t,n,e,r,u);return l}(c,i,s,l,u),b=[];for(const t of m){const n=wn(c.S,t),e=pn(c.P>0?n/c.P:t,0,1),r={u:pn(v(e),0,1),p:e,V:yn(c.P0,c.P1,c.P2,c.P3,t)};if(i){const n=bn(c.P0,c.P1,c.P2,c.P3,t);r.rotateDeg=180*Math.atan2(n[1],n[0])/Math.PI}b.push(r)}let g=d,w=0;const A=t.length-1;for(let n=0;n<b.length;n++){const e=b[n],r=w<1?pn((e.u-w)/(1-w),0,1):1,{left:o,right:s}=sn(g,r),l=0===n?A:t.length-1;o?t[l].e=o:delete t[l].e;const u=a+e.u*(f-a),c=Tn(p,y,e.p,e.V,e.rotateDeg,i);t.push(Cn(u,c)),g=s,w=e.u}}function Rn(t,n,e,r,o){const i=n-t,s=e-n,l=i-2*s+(r-e),u=2*(s-i),c=i;if(Math.abs(l)<1e-10){if(Math.abs(u)>1e-10){const t=-c/u;t>1e-6&&t<.999999&&o.push(t)}return}const a=u*u-4*l*c;if(a<0)return;const f=Math.sqrt(a),d=(-u-f)/(2*l),v=(-u+f)/(2*l);d>1e-6&&d<.999999&&o.push(d),v>1e-6&&v<.999999&&o.push(v)}function Fn(t,n,e,r,o,i,s,l){const u=(t+n)/2,c=yn(r.P0,r.P1,r.P2,r.P3,t),a=yn(r.P0,r.P1,r.P2,r.P3,n),f=n-t,d=yn(r.P0,r.P1,r.P2,r.P3,t+.25*f),v=yn(r.P0,r.P1,r.P2,r.P3,u),h=yn(r.P0,r.P1,r.P2,r.P3,t+.75*f),p=Math.max(Wn(d,c,a),Wn(v,c,a),Wn(h,c,a));let y=!0;if(o){const e=bn(r.P0,r.P1,r.P2,r.P3,t),o=bn(r.P0,r.P1,r.P2,r.P3,n),i=180*Math.atan2(e[1],e[0])/Math.PI,l=180*Math.atan2(o[1],o[0])/Math.PI;let u=Math.abs(i-l);u>180&&(u=360-u),u>s&&(y=!1)}p<=i&&y||l.C<=0||f<1e-6?e.push(n):(l.C-=1,Fn(t,u,e,r,o,i,s,l),Fn(u,n,e,r,o,i,s,l))}function Wn(t,n,e){const r=e[0]-n[0],o=e[1]-n[1],i=r*r+o*o;if(i<1e-20){const e=t[0]-n[0],r=t[1]-n[1];return Math.sqrt(e*e+r*r)}const s=(t[0]-n[0])*o-(t[1]-n[1])*r;return Math.abs(s)/Math.sqrt(i)}var Dn=1;function Ln(t,n){if(t===n)return!0;if(typeof t!=typeof n||null===t||null===n||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(n))return!1;const e=Object.keys(t),r=Object.keys(n);return e.length===r.length&&e.every(e=>Ln(t[e],n[e]))}function Zn(t){const n=[];let e;const r=function(t){const n=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),e=[];let r=null;for(const t of n)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},e.push(r);else if(r){const n=+t;r.values.push(Number.isNaN(n)?0:n)}return e}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;e={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},n.push(e);continue}if(e||(e={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},n.push(e)),"L"===r){const t=o[0]||0,n=o[1]||0;e.v.push([t,n]),e.i.push([t,n]),e.o.push([t,n])}else if("C"===r){const t=o[0]||0,n=o[1]||0,r=o[2]||0,i=o[3]||0,s=o[4]||0,l=o[5]||0;e.o[e.o.length-1]=[t,n],e.v.push([s,l]),e.i.push([r,i]),e.o.push([s,l])}else"Z"===r||"z"===r?e.c=!0:console.warn('Unsupported path command "'+r+'"')}return n}function Bn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Jn(t){return"string"==typeof t&&void 0!==Bn(t)}function Xn(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const n=Bn(t.pathData);return n?{paths:Zn(n)}:t}if(t&&"object"==typeof t&&"paths"in t){const n=t.paths;if(Array.isArray(n)&&n.length>0&&Jn(n[0])){const t=[];for(const e of n){const n=Bn(e);n&&t.push(...Zn(n))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Jn(t[0])){const n=[];for(const e of t){const t=Bn(e);t&&n.push(...Zn(t))}return{paths:n}}return{paths:t}}return Jn(t)?{paths:Zn(Bn(t))}:t}function Gn(t,n){var e;if(t)return Array.isArray(t)?t:(null==(e=null==n?void 0:n.easings)?void 0:e[t])?n.easings[t]:void console.warn("Unknown easing name: "+t)}function qn(t,n){var e;if("string"==typeof t){const r=null==(e=null==n?void 0:n.animations)?void 0:e[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Yn(t,n,e,r){var o,i;return"d"===t?{paths:tn(null!=(o=null==n?void 0:n.paths)?o:Array.isArray(n)?n:[],null!=(i=null==e?void 0:e.paths)?i:Array.isArray(e)?e:[],r)}:cn.has(t)?function(t,n,e){return[$t(t[0]||0,n[0]||0,e),$t(t[1]||0,n[1]||0,e),$t(t[2]||0,n[2]||0,e),$t(void 0===t[3]?1:t[3],void 0===n[3]?1:n[3],e)]}(n||[0,0,0,1],e||[0,0,0,1],r):"transform"!==t||"object"!=typeof n||null===n||Array.isArray(n)||"object"!=typeof e||null===e||Array.isArray(e)?"rotate"===t&&"number"==typeof n&&"number"==typeof e?$t(n,e,r):an.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Qt(n||[],e||[],r):$t(+(n||0),+(e||0),r):function(t,n,e){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=n?n:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],s=null==n?void 0:n[i];if("rotate"===i||"skew"===i)o[i]=$t(+(null!=r?r:0),+(null!=s?s:0),e);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=Qt(r||t,s||t,e)}else o[i]=null!=s?s:r}return o}(n,e,r)}function Hn(t,n,e,r){var o;const i=n.keyframes||[],s=[];for(const n of i){const e=ut(n);let i=ct(n);const l=at(n);"d"===t&&(i=Xn(i));const u=dn(t)?hn(t):t;cn.has(u)&&(i=null!=(o=un(i))?o:i);const c={t:e,v:i,e:Gn(l,r)},a=ft(n),f=dt(n);a&&(c.tangentIn=a),f&&(c.tangentOut=f),s.push(c)}s.sort((t,n)=>{var e,r;return(null!=(e=t.t)?e:0)-(null!=(r=n.t)?r:0)});const l=n.loop,u=!0===l?{}:l||void 0;return u&&s.length>=2?function(t,n,e,r){var o,i,s,l,u;const f=n.length-1,d=pn(null!=(o=e.segmentCount)?o:f,1,f);let v;v=e.repeatAt===H.start?n.slice(0,d+1):n.slice(f-d);const h=null!=(i=n[0].t)?i:0,p=null!=(s=n[n.length-1].t)?s:0;let y,m;e.repeatAt===H.start?(y=0,m=h):(y=p,m=r);const b=m-y;if(b<=0)return n;const g=null!=(l=v[0].t)?l:0,w=(null!=(u=v[v.length-1].t)?u:0)-g;if(w<=0)return n;const A=v.map(t=>({_:(t.t-g)/w,v:t.v,e:t.e,tangentIn:ft(t),tangentOut:dt(t)})),j=Math.floor(b/w),M=b-j*w,O=M/w,x=[],k=e.repeatAt!==H.start,z=n[n.length-1];let S,P=!1;function C(n,e,r){var o;let i;if(e){i=[];for(let t=A.length-1;t>=0;t--)i.push({_:1-A[t]._,v:A[t].v,e:t>0?ln(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else i=A;const s=void 0!==r?r:1;for(let e=0;e<i.length;e++){const r=i[e];if(r._>s+1e-9){const o=i[e-1],l=r._-o._,u=(s-o._)/l,c=o.e?rn(o.e)(u):u,a=Yn(t,o.v,r.v,c),{left:f}=sn(o.e,u);return x.length>0&&o._<=s&&(x[x.length-1].e=f),void x.push({t:n+s*w,v:a,e:void 0})}const l=x.length>0?x[x.length-1]:z,u=k&&0===e&&void 0!==l&&Math.abs((null!=(o=l.t)?o:0)-(n+r._*w))<1e-9;if(u){if(Ln(l.v,r.v)){x.length>0?(l.e=r.e,l.tangentOut=r.tangentOut):(S=r.e,P=!0);continue}x.length>0&&(delete l.tangentIn,delete l.tangentOut)}const c={t:n+r._*w+(u?Dn:0),v:r.v,e:e<i.length-1?r.e:void 0};r.tangentIn&&(c.tangentIn=r.tangentIn),r.tangentOut&&(c.tangentOut=r.tangentOut),x.push(c)}}if(e.repeatAt===H.start){O>1e-9&&function(n,e,r){let o;if(e){o=[];for(let t=A.length-1;t>=0;t--)o.push({_:1-A[t]._,v:A[t].v,e:t>0?ln(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else o=A;const i=1-r;for(let e=0;e<o.length;e++){const r=o[e];if(r._<i-1e-9)continue;const s=o[e-1];if(s&&s._<i-1e-9&&r._>i+1e-9){const e=r._-s._,o=(i-s._)/e,l=s.e?rn(s.e)(o):o,u=Yn(t,s.v,r.v,l),{right:c}=sn(s.e,o);x.push({t:n,v:u,e:c})}const l={t:n+(r._-i)*w,v:r.v,e:e<o.length-1?r.e:void 0};r.tangentIn&&(l.tangentIn=r.tangentIn),r.tangentOut&&(l.tangentOut=r.tangentOut),x.push(l)}}(y,e.direction===K.alternate&&j%2==0,O);for(let t=0;t<j;t++){const n=j-1-t,r=e.direction===K.alternate&&n%2==0;C(y+M+t*w,r)}}else{for(let t=0;t<j;t++){const n=e.direction===K.alternate&&t%2==0;C(y+t*w,n)}if(O>1e-9){const t=e.direction===K.alternate&&j%2==0;C(y+j*w,t,O)}}return e.repeatAt===H.start?[...x,...n]:P&&n.length>0?[...n.slice(0,-1),a(c({},n[n.length-1]),{e:S}),...x]:[...n,...x]}(t,s,u,e):s}var Kn=0;function $n(t,n){return t>0?n===1/0?t:t*(n>0?n:1):0}var Qn={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"},te="https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";function ne(t){return"PX"+t+" "+te+"#px"+t}function ee(t,n){const e=n?n+" ":"";return{warn:(n,r,...o)=>{const i=ne(r);(null==t?void 0:t.onWarn)?t.onWarn({code:r,kind:n,data:o,message:i}):(null==t?void 0:t.muteWarn)||console.warn(e+n+" "+i,...o)},error:(n,r,...o)=>{const i=ne(r),s=function(t){return t.find(t=>t instanceof Error)}(o);(null==t?void 0:t.onError)?t.onError({code:r,kind:n,data:o,message:i,error:s}):(null==t?void 0:t.muteError)||console.error(e+n+" "+i,...o)}}}function re(t,n,e){const r=null!=e?e:ee(void 0,"[PxAnimator]"),o=[],i=()=>{for(const t of o.splice(0))t()},{startOn:s,outAction:l,scrollIntoViewThreshold:u}=function(t){var n,e,r;return{startOn:null!=(n=null==t?void 0:t.startOn)?n:Y.startOn,outAction:null!=(e=null==t?void 0:t.outAction)?e:Y.outAction,scrollIntoViewThreshold:null!=(r=null==t?void 0:t.scrollIntoViewThreshold)?r:Y.scrollIntoViewThreshold}}(n),c=t.getRootElement();if(!c)return r.warn(Qn.host,1201),i;let a=!1;const f=()=>{a&&(a=!1,t.setPlaybackRate(1)),t.play()},d=()=>{switch(l){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":a=!0,t.setPlaybackRate(-1),t.play()}};switch(s){case"load":{const t=()=>f();"complete"===document.readyState?t():(window.addEventListener("load",t,{once:!0}),o.push(()=>window.removeEventListener("load",t)));break}case"mouseOver":{let t=!1;const n=()=>{t=!0,f()},e=()=>{t&&d()};c.addEventListener("mouseenter",n),c.addEventListener("mouseleave",e),o.push(()=>{c.removeEventListener("mouseenter",n),c.removeEventListener("mouseleave",e)});break}case"click":{const n=()=>{t.isPlaying()?d():f()};c.addEventListener("click",n),o.push(()=>c.removeEventListener("click",n));break}case"scrollIntoView":{const t=t=>{var n,e;const r=t.boundingClientRect,o=t.intersectionRect;if(!(null==r?void 0:r.height)||!o)return t.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,s=null!=(e=null==(n=t.rootBounds)?void 0:n.height)?e:1/0,l=Math.min(i,s),u=Math.min(r.height,Number.isFinite(l)?l:r.height);return u>0?o.height/u:t.intersectionRatio},n=Array.from({length:21},(t,n)=>n/20);let e=!1;const r=new IntersectionObserver(n=>{n.forEach(n=>{n.isIntersecting&&t(n)>=u?(e=!0,f()):e&&(e=!1,d())})},{threshold:n});r.observe(c),o.push(()=>r.disconnect());break}}return i}function oe(t){return"#"+t}function ie(t,n,e,r){let o=ct(t);const i=at(t),s={offset:n,easing:i&&Array.isArray(i)?"cubic-bezier("+i.join(",")+")":void 0};let l,u=e;var c;return cn.has(e)&&Array.isArray(o)?l=function(t){const n=Math.round(255*t[0]),e=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+n+","+e+","+r+","+t[3]+")":"rgb("+n+","+e+","+r+")"}(o):"transform"!==e||null===o||"object"!=typeof o||Array.isArray(o)?an.has(e)?(Array.isArray(o)&&("translate"===e&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===e&&(o+="deg"),l=e+"("+o+")",u="transform"):l="d"===e?'path("'+(o&&"object"==typeof o&&Array.isArray(o.paths)?o.paths:[]).map(t=>function(t,n=!1){var e,r,o,i;const s=t.v,l=t.i,u=t.o,c=t.c;if(!s.length)return"";const a=[],f=s.length;a.push("M"+s[0][0]+","+s[0][1]);for(let t=1;t<f;t++){const o=s[t-1],i=null!=(e=null==u?void 0:u[t-1])?e:o,c=null!=(r=null==l?void 0:l[t])?r:s[t],f=s[t];n||i[0]!==o[0]||i[1]!==o[1]||c[0]!==f[0]||c[1]!==f[1]?a.push("C"+i[0]+","+i[1]+","+c[0]+","+c[1]+","+f[0]+","+f[1]):a.push("L"+f[0]+","+f[1])}if(c&&f>0){const t=s[f-1],e=null!=(o=null==u?void 0:u[f-1])?o:t,r=null!=(i=null==l?void 0:l[0])?i:s[0],c=s[0];!n&&e[0]===t[0]&&e[1]===t[1]&&r[0]===c[0]&&r[1]===c[1]||a.push("C"+e[0]+","+e[1]+","+r[0]+","+r[1]+","+c[0]+","+c[1]),a.push("z")}return a.join("")}(t,!0)).join("")+'")':fn.has(e)&&"number"==typeof o?100*o+"%":""+o:(l=function(t,n){var e;if(!t)return"";const r=null==(e=null==n?void 0:n.T)||e,o=[],i=t.translate,s=t.origin,l=t.rotate,u=t.skew,c=t.scale,a=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+a+","+i[1]+a+")"),s&&o.push("translate("+s[0]+a+","+s[1]+a+")"),null!=l&&o.push("rotate("+l+f+")"),null!=u&&o.push("skewX("+u+f+")"),c&&o.push("scale("+c[0]+","+c[1]+")"),s&&o.push("translate("+-s[0]+a+","+-s[1]+a+")"),o.join("")}(o,{T:!0}),u="transform"),CSS.supports(hn(u),l)||r.add(u),u=(c=u).includes("-")?c.replace(/-([a-z])/g,(t,n)=>n.toUpperCase()):c,s[u]=l,s}function se(t,n,e){var r,o,i,s,l;const u=[];for(let f=0;f<n.length;f++){const d=n[f],v=null!=(r=d.t)?r:0;if(v<0){const e=n[f+1];if(e&&(null!=(o=e.t)?o:0)>=0){const n=(0-v)/((null!=(i=e.t)?i:0)-v),r=d.e?rn(d.e)(n):n,{right:o}=sn(d.e,n);u.push({t:0,v:Yn(t,d.v,e.v,r),e:o})}continue}if(v>e){const r=n[f-1];if(r&&(null!=(s=r.t)?s:0)<=e){const n=null!=(l=r.t)?l:0,o=(e-n)/(v-n),i=r.e?rn(r.e)(o):o,{left:s}=sn(r.e,o);u.length>0&&(u[u.length-1]=a(c({},u[u.length-1]),{e:s})),u.push({t:e,v:Yn(t,r.v,d.v,i),e:void 0})}break}u.push(d)}return u}function le(t,n,e){var r;const o=new Map;for(const[i,s]of Object.entries(t)){const t=e.duration||1,l=se(i,s.keyframes||[],t),u=[];for(let e=0;e<l.length;e++){const o=l[e],s=ie(o,pn((null!=(r=o.t)?r:0)/t,0,1),i,n);0===e&&(s.offset||0)>0&&u.push(a(c({},s),{offset:0})),u.push(s)}u.length>0&&(u[u.length-1].offset||0)<1&&u.push(a(c({},u[u.length-1]),{offset:1})),u.length>0&&o.set(i,u)}return o}function ue(t){const n=function(t){if(!(null==t?void 0:t.doc))throw new Error("createAnimator: `doc` is required");return t.doc}(t);return function(t,n){try{return n()}catch(n){const e=function(t){return t instanceof Error?t:new Error(String(t))}(n);return ee(t,"[PxAnimator]").error(Qn.internal,1001,e),{isReady:()=>!1,getRootElement:()=>null,isPlaying:()=>!1,play:()=>{},pause:()=>{},cancel:()=>{},finish:()=>{},setPlaybackRate:()=>{},getCurrentTime:()=>null,setCurrentTime:()=>{},getCurrentProgress:()=>null,setCurrentProgress:()=>{},destroy:()=>{}}}}(t,()=>function(t,e){let r,o=e;t.resetOnFinish&&(o=a(c({},e),{onFinish:()=>{var t;null==(t=null==e?void 0:e.onFinish)||t.call(e),null==r||r.cancel()}}));const i=function(t,n,e,r,o){var i,s;const l=nt(t)||{},u=ee(n,"[PxAnimator]");if(!e)if(t.id){const n=oe(t.id);(e=document.querySelector(n))||u.warn(Qn.host,1202,n)}else u.warn(Qn.host,1203);const f=function(t,n=G.native){const e=nt(t)||{},r=function(t){var n;if(t)return null==(n=nt(t))?void 0:n.definitions}(t),o=e.duration||1e3,i=[],s=(t,e,i)=>{if(0===e.length)return null;const s=function(t,n,e,r=G.native){const o={};for(const[i,s]of Object.entries(t)){if("transform"===i&&"offsetPath"===s.alongPathMode&&void 0!==t.offsetDistance)continue;const l=Hn(i,s,n,e);if(l.length>0){const t={keyframes:l};void 0!==s.autoOrient&&(t.autoOrient=s.autoOrient),void 0!==s.loop&&(t.loop=s.loop),o[i]=r===G.native&&"transform"===i?Pn(t):t}}return o}(function(t,n){if(!t)return t;const e=n&&"object"==typeof n&&!Array.isArray(n)?n:function(t){var n,e;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let s,l=-1;for(;null!==(s=o.exec(t));){const t=s[1],o=i.indexOf(t);if(o<0||o<=l)return;l=o;const u=s[2].split(/[\s,]+/).filter(Boolean).map(Number);if(u.some(t=>Number.isNaN(t)))return;if("translate"===t){if(u.length<1||u.length>2)return;r.translate=[u[0],null!=(n=u[1])?n:0]}else if("rotate"===t){if(1!==u.length)return;r.rotate=u[0]}else if("skewX"===t){if(1!==u.length)return;r.skew=u[0]}else{if(u.length<1||u.length>2)return;r.scale=[u[0],null!=(e=u[1])?e:u[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}(n);if(!e||!Object.keys(e).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?c(c({},e),t):t,o=t[tt];if(o&&"object"==typeof o){const n=o;if(Array.isArray(n.keyframes)){const e=a(c({},n),{keyframes:n.keyframes.map(t=>a(c({},t),{value:r(t.value)}))});return void 0!==e.value&&(e.value=r(e.value)),a(c({},t),{transform:e})}return t}const i=Object.keys(t).filter(t=>an.has(t));if(1!==i.length)return t;const s=i[0],l=t[s];if(!l||"object"!=typeof l||!Array.isArray(l.keyframes))return t;const u=a(c({},l),{keyframes:l.keyframes.map(t=>a(c({},t),{value:a(c({},e),{[s]:t.value})}))});void 0!==u.value&&(u.value=a(c({},e),{[s]:u.value}));const f=c({},t);return delete f[s],a(c({},f),{transform:u})}(function(t){const n={};for(const e of t)for(const[t,r]of Object.entries(e))n[t]=r;return n}(e),i),o,r,n);return 0===Object.keys(s).length?null:{id:t,animate:s}},l=function(t){var n;if(t)return null==(n=nt(t))?void 0:n.bindings}(t);if(l)for(const t of l){const n=t.target.startsWith("#")?t.target.slice(1):t.target,e=t.animateWith.map(t=>qn(t,r)).filter(t=>!!t),o=s(n,e);o&&i.push(o)}const u=t=>{const n=t.animate;if(n&&Object.keys(n).length>0){const e=t.id||"_px_el_"+ ++Kn;t.id=e;const o=s(e,function(t,n){if(!t)return[];const e=[];if("string"==typeof t){const r=qn(t,n);r&&e.push(r)}else if(Array.isArray(t))for(const r of t){const t=qn(r,n);t&&e.push(t)}else e.push(t);return e}(n,r),t.transform);o&&i.push(o)}if(t.children)for(let n=0;n<t.children.length;n++)u(t.children[n])};if(t.children)for(let n=0;n<t.children.length;n++)u(t.children[n]);return i}(t,G.native),d=[],v=l.iterations;let h;"number"==typeof v&&(h=v),"infinite"===v&&(h=1/0);const p=new Set;let y=!1,m=!1;(null==f?void 0:f.length)||u.warn(Qn.document,1105);for(const t of f||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){u.warn(Qn.document,1106,t);continue}const s=oe(t.id),c=(null==e?void 0:e.querySelectorAll(s))||document.querySelectorAll(s);0===c.length&&u.warn(Qn.host,1206,s);const a=le(r,p,l),f=l.delay&&l.delay>0?l.delay:void 0;let v;if(l.delay&&l.delay<0&&l.duration){const t=-l.delay;v=h===1/0?t%l.duration:Math.min(t,l.duration*(null!=h?h:1))}const b={duration:l.duration,delay:f,fill:null!=(i=l.fill)?i:"forwards",direction:l.direction,iterations:h};for(let t=0;t<c.length;t++){const e=c[t];for(const[,t]of a)if(t.length>0)try{const r=new KeyframeEffect(e,t,b),i=new Animation(r,document.timeline);o,(null==n?void 0:n.onFinish)&&(i.onfinish=()=>{var t;y||(y=!0,null==(t=n.onFinish)||t.call(n))}),(null==n?void 0:n.onRemove)&&(i.onremove=()=>{var t;m||(m=!0,null==(t=n.onRemove)||t.call(n))}),void 0!==v&&(i.currentTime=v),d.push(i)}catch(t){u.warn(Qn.internal,1004,t)}}}const b={isReady:()=>!0,getRootElement:()=>e||null,isPlaying:()=>{var t;return"running"===(null==(t=d[0])?void 0:t.playState)},play:()=>{var t;y=!1,d.forEach(t=>t.play()),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;d.forEach(t=>t.pause()),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;y=!1,d.forEach(t=>t.cancel()),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{var t;for(const n of d)try{(null==(t=n.effect)?void 0:t.getTiming().iterations)===1/0?(n.effect.updateTiming({iterations:1}),n.finish(),n.effect.updateTiming({iterations:1/0})):n.finish()}catch(t){n.cancel()}},setPlaybackRate:t=>function(t){return Number.isFinite(t)&&0!==t}(t)?(d.forEach(n=>n.playbackRate=t),b):(u.warn(Qn.usage,1401),b),getCurrentTime:()=>{var t,n;const e=null!=(n=null==(t=d[0])?void 0:t.currentTime)?n:null;return null!==e?+e:null},setCurrentTime:t=>{var n;const e=function(t,n){return t>0?n===1/0?1/0:t*(n>0?n:1):0}(null!=(n=l.duration)?n:0,null!=h?h:1),r=e>0?(o=t,i=e,Number.isNaN(o)||o<0?0:Number.isFinite(i)?o>i?i:o:Number.isFinite(o)?o:0):Math.max(0,t);var o,i;y=!1,d.forEach(t=>{t.currentTime=r})},getCurrentProgress:()=>{var t;const n=b.getCurrentTime();return null===n?null:function(t,n,e){const r=$n(n,e);return r>0&&Number.isFinite(t)?t<=0?0:e===1/0?t%r/r:t>=r?1:t/r:0}(n,null!=(t=l.duration)?t:0,null!=h?h:1)},setCurrentProgress:t=>{var n;b.setCurrentTime(function(t,n,e){const r=$n(n,e);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}(t,null!=(n=l.duration)?n:0,null!=h?h:1))},destroy:()=>{var t;b.cancel(),d.splice(0,d.length),m||(m=!0,null==(t=null==n?void 0:n.onRemove)||t.call(n))}};if("scroll"===l.timelineSource)l.trigger&&u.warn(Qn.usage,1306);else{const t=re(b,null!=(s=l.trigger)?s:{},u),n=b.destroy.bind(b);b.destroy=()=>{t(),n()}}return b}(n,o,null);return r=i,t.debugGlobalName&&(window[t.debugGlobalName]=i),i}(nt(n)||{},function(t){const{onPlay:n,onPause:e,onCancel:r,onFinish:o,onRemove:i,onStop:s,onWarn:l,onError:u,muteWarn:c,muteError:a}=null!=t?t:{},f=t=>t||s?()=>{null==t||t(),null==s||s()}:void 0;return{onPlay:n,onPause:f(e),onCancel:f(r),onFinish:f(o),onRemove:f(i),onWarn:l,onError:u,muteWarn:c,muteError:a}}(t)))}var ce,ae="doc";return ce=d,((n,r,i,l)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let i of o(r))s.call(n,i)||void 0===i||t(n,i,{get:()=>r[i],enumerable:!(l=e(r,i))||l.enumerable});return n})(t({},"__esModule",{value:!0}),ce)})();
|
|
@@ -2949,32 +2949,34 @@ var PixodeskAnimator = (() => {
|
|
|
2949
2949
|
/** The player failed where it did not expect to — report it to us. */
|
|
2950
2950
|
internal: "internal"
|
|
2951
2951
|
};
|
|
2952
|
-
|
|
2953
|
-
|
|
2952
|
+
var DOCS_URL = "https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";
|
|
2953
|
+
function codeLine(code) {
|
|
2954
|
+
return "PX" + code + " " + DOCS_URL + "#px" + code;
|
|
2955
|
+
}
|
|
2956
|
+
function errorIn(data) {
|
|
2957
|
+
return data.find((d) => d instanceof Error);
|
|
2954
2958
|
}
|
|
2955
2959
|
function createDiagnostics(config, prefix) {
|
|
2956
2960
|
const tag = prefix ? prefix + " " : "";
|
|
2957
2961
|
return {
|
|
2958
|
-
warn: (kind,
|
|
2962
|
+
warn: (kind, code, ...data) => {
|
|
2963
|
+
const message = codeLine(code);
|
|
2959
2964
|
if (config == null ? void 0 : config.onWarn) {
|
|
2960
|
-
config.onWarn({ kind,
|
|
2965
|
+
config.onWarn({ code, kind, data, message });
|
|
2961
2966
|
return;
|
|
2962
2967
|
}
|
|
2963
2968
|
if (config == null ? void 0 : config.muteWarn) return;
|
|
2964
|
-
|
|
2965
|
-
if (detail === void 0) console.warn(line);
|
|
2966
|
-
else console.warn(line, detail);
|
|
2969
|
+
console.warn(tag + kind + " " + message, ...data);
|
|
2967
2970
|
},
|
|
2968
|
-
error: (kind,
|
|
2969
|
-
const
|
|
2971
|
+
error: (kind, code, ...data) => {
|
|
2972
|
+
const message = codeLine(code);
|
|
2973
|
+
const error = errorIn(data);
|
|
2970
2974
|
if (config == null ? void 0 : config.onError) {
|
|
2971
|
-
config.onError({ kind,
|
|
2975
|
+
config.onError({ code, kind, data, message, error });
|
|
2972
2976
|
return;
|
|
2973
2977
|
}
|
|
2974
2978
|
if (config == null ? void 0 : config.muteError) return;
|
|
2975
|
-
|
|
2976
|
-
if (detail === void 0) console.error(line);
|
|
2977
|
-
else console.error(line, detail);
|
|
2979
|
+
console.error(tag + kind + " " + message, ...data);
|
|
2978
2980
|
}
|
|
2979
2981
|
};
|
|
2980
2982
|
}
|
|
@@ -3093,7 +3095,7 @@ var PixodeskAnimator = (() => {
|
|
|
3093
3095
|
const { startOn, outAction, scrollIntoViewThreshold } = resolveTrigger(trigger);
|
|
3094
3096
|
const root = api.getRootElement();
|
|
3095
3097
|
if (!root) {
|
|
3096
|
-
report.warn(PxDiagnosticKind.host,
|
|
3098
|
+
report.warn(PxDiagnosticKind.host, 1201 /* triggersNoRoot */);
|
|
3097
3099
|
return dispose;
|
|
3098
3100
|
}
|
|
3099
3101
|
let reversed = false;
|
|
@@ -3212,9 +3214,9 @@ var PixodeskAnimator = (() => {
|
|
|
3212
3214
|
if (doc.id) {
|
|
3213
3215
|
const rootSelector = getSelector(doc.id);
|
|
3214
3216
|
rootElement = document.querySelector(rootSelector);
|
|
3215
|
-
if (!rootElement) diag.warn(PxDiagnosticKind.host,
|
|
3217
|
+
if (!rootElement) diag.warn(PxDiagnosticKind.host, 1202 /* noRootForSelector */, rootSelector);
|
|
3216
3218
|
} else {
|
|
3217
|
-
diag.warn(PxDiagnosticKind.host,
|
|
3219
|
+
diag.warn(PxDiagnosticKind.host, 1203 /* noRootElement */);
|
|
3218
3220
|
}
|
|
3219
3221
|
}
|
|
3220
3222
|
const basicApi = createAdapterAnimator(
|
|
@@ -3226,7 +3228,7 @@ var PixodeskAnimator = (() => {
|
|
|
3226
3228
|
"getRootElement": () => rootElement || null
|
|
3227
3229
|
});
|
|
3228
3230
|
if (isScrollTimeline(config)) {
|
|
3229
|
-
if (config.trigger) diag.warn(PxDiagnosticKind.usage,
|
|
3231
|
+
if (config.trigger) diag.warn(PxDiagnosticKind.usage, 1306 /* scrollTriggerIgnored */);
|
|
3230
3232
|
} else {
|
|
3231
3233
|
const detachTriggers = setupAnimationTriggers(api, (_a = config.trigger) != null ? _a : {}, diag);
|
|
3232
3234
|
const destroyEngine = api.destroy.bind(api);
|
|
@@ -3251,7 +3253,7 @@ var PixodeskAnimator = (() => {
|
|
|
3251
3253
|
const elements = (rootElement == null ? void 0 : rootElement.querySelectorAll(selector)) || document.querySelectorAll(selector);
|
|
3252
3254
|
if (elements.length === 0 && !warnedSelectors.has(selector)) {
|
|
3253
3255
|
warnedSelectors.add(selector);
|
|
3254
|
-
report.warn(PxDiagnosticKind.host,
|
|
3256
|
+
report.warn(PxDiagnosticKind.host, 1207 /* setAttributeNoElement */, selector);
|
|
3255
3257
|
}
|
|
3256
3258
|
for (let i = 0; i < elements.length; i++) {
|
|
3257
3259
|
const element = elements[i];
|
|
@@ -3370,9 +3372,9 @@ var PixodeskAnimator = (() => {
|
|
|
3370
3372
|
if (doc.id) {
|
|
3371
3373
|
const rootSelector = getSelector(doc.id);
|
|
3372
3374
|
rootElement = document.querySelector(rootSelector);
|
|
3373
|
-
if (!rootElement) diag.warn(PxDiagnosticKind.host,
|
|
3375
|
+
if (!rootElement) diag.warn(PxDiagnosticKind.host, 1202 /* noRootForSelector */, rootSelector);
|
|
3374
3376
|
} else {
|
|
3375
|
-
diag.warn(PxDiagnosticKind.host,
|
|
3377
|
+
diag.warn(PxDiagnosticKind.host, 1203 /* noRootElement */);
|
|
3376
3378
|
}
|
|
3377
3379
|
}
|
|
3378
3380
|
const bindings = normalizeBindings(doc, PxTimelineEngine.native);
|
|
@@ -3385,18 +3387,18 @@ var PixodeskAnimator = (() => {
|
|
|
3385
3387
|
let finishNotified = false;
|
|
3386
3388
|
let removeCalled = false;
|
|
3387
3389
|
if (!(bindings == null ? void 0 : bindings.length)) {
|
|
3388
|
-
diag.warn(PxDiagnosticKind.document,
|
|
3390
|
+
diag.warn(PxDiagnosticKind.document, 1105 /* noBindings */);
|
|
3389
3391
|
}
|
|
3390
3392
|
for (const binding of bindings || []) {
|
|
3391
3393
|
const animDef = binding.animate;
|
|
3392
3394
|
if (!animDef || typeof animDef !== "object" || Array.isArray(animDef)) {
|
|
3393
|
-
diag.warn(PxDiagnosticKind.document,
|
|
3395
|
+
diag.warn(PxDiagnosticKind.document, 1106 /* unresolvedBinding */, binding);
|
|
3394
3396
|
continue;
|
|
3395
3397
|
}
|
|
3396
3398
|
const selector = getSelector(binding.id);
|
|
3397
3399
|
const elements = (rootElement == null ? void 0 : rootElement.querySelectorAll(selector)) || document.querySelectorAll(selector);
|
|
3398
3400
|
if (elements.length === 0) {
|
|
3399
|
-
diag.warn(PxDiagnosticKind.host,
|
|
3401
|
+
diag.warn(PxDiagnosticKind.host, 1206 /* noElementsForSelector */, selector);
|
|
3400
3402
|
}
|
|
3401
3403
|
const keyframesMap = convertToWebApiKeyframes(animDef, unsupportedSet, config);
|
|
3402
3404
|
const positiveDelay = config.delay && config.delay > 0 ? config.delay : void 0;
|
|
@@ -3445,14 +3447,14 @@ var PixodeskAnimator = (() => {
|
|
|
3445
3447
|
}
|
|
3446
3448
|
animations.push(anim);
|
|
3447
3449
|
} catch (e) {
|
|
3448
|
-
diag.warn(PxDiagnosticKind.internal,
|
|
3450
|
+
diag.warn(PxDiagnosticKind.internal, 1004 /* animationBuildFailed */, e);
|
|
3449
3451
|
}
|
|
3450
3452
|
}
|
|
3451
3453
|
}
|
|
3452
3454
|
}
|
|
3453
3455
|
}
|
|
3454
3456
|
if (!forceEvenIfHasUnsupportedAttrs && unsupportedSet.size) {
|
|
3455
|
-
diag.warn(PxDiagnosticKind.platform,
|
|
3457
|
+
diag.warn(PxDiagnosticKind.platform, 1104 /* unsupportedAnimatedAttrs */, [...unsupportedSet].join(", "));
|
|
3456
3458
|
return null;
|
|
3457
3459
|
}
|
|
3458
3460
|
const api = {
|
|
@@ -3497,7 +3499,7 @@ var PixodeskAnimator = (() => {
|
|
|
3497
3499
|
},
|
|
3498
3500
|
"setPlaybackRate": (rate) => {
|
|
3499
3501
|
if (!isValidPlaybackRate(rate)) {
|
|
3500
|
-
diag.warn(PxDiagnosticKind.usage,
|
|
3502
|
+
diag.warn(PxDiagnosticKind.usage, 1401 /* rateRejected */);
|
|
3501
3503
|
return api;
|
|
3502
3504
|
}
|
|
3503
3505
|
animations.forEach((a) => a.playbackRate = rate);
|
|
@@ -3537,7 +3539,7 @@ var PixodeskAnimator = (() => {
|
|
|
3537
3539
|
}
|
|
3538
3540
|
};
|
|
3539
3541
|
if (config.timelineSource === "scroll") {
|
|
3540
|
-
if (config.trigger) diag.warn(PxDiagnosticKind.usage,
|
|
3542
|
+
if (config.trigger) diag.warn(PxDiagnosticKind.usage, 1306 /* scrollTriggerIgnored */);
|
|
3541
3543
|
} else {
|
|
3542
3544
|
const detachTriggers = setupAnimationTriggers(api, (_b = config.trigger) != null ? _b : {}, diag);
|
|
3543
3545
|
const destroyEngine = api.destroy.bind(api);
|
|
@@ -3567,7 +3569,7 @@ var PixodeskAnimator = (() => {
|
|
|
3567
3569
|
const scroll = config.scroll || {};
|
|
3568
3570
|
const kind = (_a = scroll.kind) != null ? _a : "view";
|
|
3569
3571
|
if (scroll.smoothing) {
|
|
3570
|
-
report.warn(PxDiagnosticKind.platform,
|
|
3572
|
+
report.warn(PxDiagnosticKind.platform, 1301 /* scrollSmoothingNeedsOwnDriver */);
|
|
3571
3573
|
return null;
|
|
3572
3574
|
}
|
|
3573
3575
|
const g = globalThis;
|
|
@@ -3584,7 +3586,7 @@ var PixodeskAnimator = (() => {
|
|
|
3584
3586
|
timeline = new Ctor({ source, axis });
|
|
3585
3587
|
}
|
|
3586
3588
|
} catch (e) {
|
|
3587
|
-
report.warn(PxDiagnosticKind.platform,
|
|
3589
|
+
report.warn(PxDiagnosticKind.platform, 1302 /* scrollNativeUnavailable */, e);
|
|
3588
3590
|
return null;
|
|
3589
3591
|
}
|
|
3590
3592
|
return {
|
|
@@ -3631,11 +3633,11 @@ var PixodeskAnimator = (() => {
|
|
|
3631
3633
|
try {
|
|
3632
3634
|
found = document.querySelector(spec);
|
|
3633
3635
|
} catch (e) {
|
|
3634
|
-
report.warn(PxDiagnosticKind.document,
|
|
3636
|
+
report.warn(PxDiagnosticKind.document, 1303 /* scrollSubjectInvalid */, spec);
|
|
3635
3637
|
return svgRoot;
|
|
3636
3638
|
}
|
|
3637
3639
|
if (!found) {
|
|
3638
|
-
report.warn(PxDiagnosticKind.host,
|
|
3640
|
+
report.warn(PxDiagnosticKind.host, 1304 /* scrollSubjectNoMatch */, spec);
|
|
3639
3641
|
return svgRoot;
|
|
3640
3642
|
}
|
|
3641
3643
|
return found;
|
|
@@ -3877,7 +3879,7 @@ var PixodeskAnimator = (() => {
|
|
|
3877
3879
|
};
|
|
3878
3880
|
}
|
|
3879
3881
|
} else {
|
|
3880
|
-
diag.warn(PxDiagnosticKind.host,
|
|
3882
|
+
diag.warn(PxDiagnosticKind.host, 1305 /* scrollNoRootToObserve */);
|
|
3881
3883
|
}
|
|
3882
3884
|
return api;
|
|
3883
3885
|
});
|
|
@@ -3903,7 +3905,7 @@ var PixodeskAnimator = (() => {
|
|
|
3903
3905
|
return build();
|
|
3904
3906
|
} catch (e) {
|
|
3905
3907
|
const err = asThrownError(e);
|
|
3906
|
-
createDiagnostics(options, "[PxAnimator]").error(PxDiagnosticKind.internal,
|
|
3908
|
+
createDiagnostics(options, "[PxAnimator]").error(PxDiagnosticKind.internal, 1001 /* buildFailed */, err);
|
|
3907
3909
|
return createInertAnimator();
|
|
3908
3910
|
}
|
|
3909
3911
|
}
|