@glissade/browser 0.18.0-pre.2 → 0.18.0-pre.3

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.
@@ -1,6 +1,6 @@
1
- "use strict";var glissade=(()=>{var be=Object.defineProperty,Fi=Object.defineProperties,zi=Object.getOwnPropertyDescriptor,Li=Object.getOwnPropertyDescriptors,Ri=Object.getOwnPropertyNames,we=Object.getOwnPropertySymbols;var un=Object.prototype.hasOwnProperty,As=Object.prototype.propertyIsEnumerable;var Ps=t=>{throw TypeError(t)};var hn=(t,e,n)=>e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,T=(t,e)=>{for(var n in e||(e={}))un.call(e,n)&&hn(t,n,e[n]);if(we)for(var n of we(e))As.call(e,n)&&hn(t,n,e[n]);return t},z=(t,e)=>Fi(t,Li(e));var Ds=t=>typeof t=="symbol"?t:t+"",Lt=(t,e)=>{var n={};for(var s in t)un.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&we)for(var s of we(t))e.indexOf(s)<0&&As.call(t,s)&&(n[s]=t[s]);return n};var Ni=(t,e)=>{for(var n in e)be(t,n,{get:e[n],enumerable:!0})},Vi=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ri(e))!un.call(t,r)&&r!==n&&be(t,r,{get:()=>e[r],enumerable:!(s=zi(e,r))||s.enumerable});return t};var qi=t=>Vi(be({},"__esModule",{value:!0}),t);var x=(t,e,n)=>hn(t,typeof e!="symbol"?e+"":e,n),fn=(t,e,n)=>e.has(t)||Ps("Cannot "+n);var A=(t,e,n)=>(fn(t,e,"read from private field"),n?n.call(t):e.get(t)),U=(t,e,n)=>e.has(t)?Ps("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),H=(t,e,n,s)=>(fn(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),q=(t,e,n)=>(fn(t,e,"access private method"),n);var Ia={};Ni(Ia,{ALL_FILTER_KINDS:()=>ws,BakeError:()=>qe,BindTypeMismatchError:()=>vr,Canvas2DBackend:()=>rn,Circle:()=>Br,CircularDependencyError:()=>lr,ClipError:()=>ct,ColdAssetError:()=>fe,ColorParseError:()=>xn,Custom:()=>qr,DEFAULT_EASE:()=>Ws,DL_SNAPSHOT_VERSION:()=>Fr,DeterminismViolationError:()=>oi,DlSnapshotError:()=>Xe,DuplicateNodeIdError:()=>ai,EachError:()=>Ht,FilterValidationError:()=>Ft,FollowPath:()=>ui,FontValidationError:()=>pr,Group:()=>Et,GsPlayerElement:()=>Oi,Highlight:()=>si,IDENTITY:()=>St,Image:()=>_r,ImageNode:()=>_r,LayoutEngineMissingError:()=>fs,MEASURE_QUANTUM_PX:()=>Ye,MESH_DOWNSCALE:()=>na,MESH_SHEPARD_POWER:()=>sa,MESH_SIGMA:()=>ys,MorphError:()=>Xt,NODE_TAXONOMY:()=>To,Node:()=>Q,Path:()=>us,PositionError:()=>jn,PresenceError:()=>xi,Raster2D:()=>ks,Rect:()=>Wr,ReservedNodeIdError:()=>ci,ShaderEffect:()=>Ko,SidecarVersionError:()=>Vn,SketchValidationError:()=>dt,TARGET_PATH:()=>At,TargetOverlapError:()=>Ti,Text:()=>Ze,TextCursor:()=>ri,TimelineValidationError:()=>et,TokenHighlight:()=>fi,TokenMatchError:()=>me,TrackValidationError:()=>gt,UnboundTargetError:()=>kr,UnknownEasingError:()=>bn,UnknownValueTypeError:()=>Sn,UnresolvableTargetError:()=>Ie,ValueTypeInferenceError:()=>Dn,Video:()=>jr,WriteDuringEvaluationError:()=>Ne,applyToPoint:()=>Pr,arcLength:()=>os,assignKeyIds:()=>Wn,audioOffsetSamples:()=>Zs,auditCacheCold:()=>Wo,bake:()=>yo,bakeCheckpointed:()=>wo,batch:()=>co,beginReadPhase:()=>hr,bindScene:()=>hi,bindTimeline:()=>Gn,booleanType:()=>On,breakLines:()=>at,buildFontRegistry:()=>ie,buildTimeline:()=>br,clip:()=>Tt,clipList:()=>da,clockDriver:()=>Ei,coercePathData:()=>Ge,collapseReplacer:()=>_t,collectLocalizedTextUsages:()=>Uo,collectTextUsages:()=>di,colorType:()=>$n,compileTimeline:()=>nt,computed:()=>re,createDisplayListBuilder:()=>le,createPlayer:()=>Ii,createPlayhead:()=>Be,createScene:()=>qo,cubicBezier:()=>yn,cubicBezierDerivative:()=>wn,defineGsPlayer:()=>Di,deleteSidecarTrack:()=>ir,diffDisplayLists:()=>ts,drawOn:()=>ii,drawOnEach:()=>Ro,driftLoop:()=>ya,each:()=>Lo,easingDerivatives:()=>Ee,easings:()=>gn,emitDevWarning:()=>B,emptySidecar:()=>sr,endReadPhase:()=>ur,estimatingMeasurer:()=>ns,evaluate:()=>de,evaluateAt:()=>Un,filtersToCanvasFilter:()=>Ue,flatten:()=>he,followPath:()=>Ho,fontString:()=>sn,formatColor:()=>Ce,formatDisplayDiff:()=>Dr,fromTRS:()=>Zn,getLayoutEngine:()=>Yr,getTimelineCallbacks:()=>wr,getValueType:()=>te,glow:()=>Rr,hachureLines:()=>cs,hashKeys:()=>ze,highlight:()=>Io,inReadPhase:()=>lo,inferValueType:()=>Ot,invert:()=>Ar,isDurationEditable:()=>er,isEditableNodeId:()=>ne,isExemptFamily:()=>mr,key:()=>O,lerpColor:()=>ht,matEquals:()=>Mt,matchTokenRun:()=>gs,mediaPrefersReducedMotion:()=>Ci,mergeSidecar:()=>or,mergeSidecarDetailed:()=>Bn,meshRasterSize:()=>mi,migrateSidecar:()=>qn,morph:()=>wa,motionPath:()=>pe,mount:()=>xs,multiply:()=>ae,namedEasing:()=>Qt,normalizeEditedKeys:()=>ar,numberType:()=>En,oklabToRgba:()=>Nt,paintType:()=>Pn,parseCmap:()=>Fe,parseColor:()=>ut,parseDisplaySnapshot:()=>Lr,parseSvgPathData:()=>Si,pathFromSegs:()=>Je,pathFromSvg:()=>Ma,pathLength:()=>_o,pathType:()=>An,planReducedMotion:()=>$i,pointAtLength:()=>jo,popIn:()=>pa,presence:()=>xa,pulse:()=>ga,quantize:()=>G,random:()=>ot,rasterizeMesh:()=>pi,registerValueType:()=>it,reprOf:()=>Oe,requireLayoutEngine:()=>Gr,resolveAnchor:()=>ss,resolveEase:()=>Fn,resolveEaseDerivative:()=>zn,resolveSketch:()=>is,resolveTweenTarget:()=>bt,revealSchedule:()=>Hr,rgbaToOklab:()=>Ct,roughen:()=>Qe,roundedRectSegs:()=>jt,sampleTrack:()=>De,scrollDriver:()=>Sa,segmentGraphemes:()=>xt,segmentWords:()=>Ke,serializeDisplayList:()=>zr,setDefaultMeasurer:()=>Nr,setDevWarning:()=>Xs,setLayoutEngine:()=>Xr,setScheduler:()=>ro,setShaderRunner:()=>yi,setSidecarTrack:()=>rr,signal:()=>C,sketchStrokes:()=>Vr,slideIn:()=>ma,spring:()=>yt,springEasing:()=>kn,springEasingDerivative:()=>vn,springPresets:()=>js,springTo:()=>Gs,stagger:()=>Pe,stringType:()=>Cn,swapOnHmr:()=>Ea,synchronousScheduler:()=>Hn,targetNodeId:()=>Vt,textCursor:()=>$o,timeline:()=>go,tokenHighlight:()=>Xo,track:()=>wt,typewriter:()=>Ao,untracked:()=>ho,validateFilters:()=>es,validateFonts:()=>Yn,validateHachure:()=>as,validateSceneFonts:()=>bs,validateSketch:()=>rs,validateTrack:()=>ee,vec2ArcType:()=>In,vec2Equals:()=>Ae,vec2Signal:()=>Wt,vec2Type:()=>Tn,velocityAt:()=>Ln,withDeterminismGuards:()=>Vo});var Me=2.5949095,Se=2.70158,Rt=2*Math.PI/3,Kt=2*Math.PI/4.5;function ke(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}var gn={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-(-2*t+2)**2/2,easeInCubic:t=>t**3,easeOutCubic:t=>1-(1-t)**3,easeInOutCubic:t=>t<.5?4*t**3:1-(-2*t+2)**3/2,easeInQuart:t=>t**4,easeOutQuart:t=>1-(1-t)**4,easeInOutQuart:t=>t<.5?8*t**4:1-(-2*t+2)**4/2,easeInQuint:t=>t**5,easeOutQuint:t=>1-(1-t)**5,easeInOutQuint:t=>t<.5?16*t**5:1-(-2*t+2)**5/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>t===0?0:2**(10*t-10),easeOutExpo:t=>t===1?1:1-2**(-10*t),easeInOutExpo:t=>t===0?0:t===1?1:t<.5?2**(20*t-10)/2:(2-2**(-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-t*t),easeOutCirc:t=>Math.sqrt(1-(t-1)*(t-1)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-(2*t)**2))/2:(Math.sqrt(1-(-2*t+2)**2)+1)/2,easeInBack:t=>Se*t**3-1.70158*t*t,easeOutBack:t=>1+Se*(t-1)**3+1.70158*(t-1)**2,easeInOutBack:t=>t<.5?(2*t)**2*(3.5949095*2*t-Me)/2:((2*t-2)**2*(3.5949095*(t*2-2)+Me)+2)/2,easeInElastic:t=>t===0?0:t===1?1:-(2**(10*t-10))*Math.sin((t*10-10.75)*Rt),easeOutElastic:t=>t===0?0:t===1?1:2**(-10*t)*Math.sin((t*10-.75)*Rt)+1,easeInOutElastic:t=>t===0?0:t===1?1:t<.5?-(2**(20*t-10)*Math.sin((20*t-11.125)*Kt))/2:2**(-20*t+10)*Math.sin((20*t-11.125)*Kt)/2+1,easeInBounce:t=>1-ke(1-t),easeOutBounce:ke,easeInOutBounce:t=>t<.5?(1-ke(1-2*t))/2:(1+ke(2*t-1))/2};function ve(t){return t<1/2.75?2*7.5625*t:t<2/2.75?2*7.5625*(t-1.5/2.75):t<2.5/2.75?2*7.5625*(t-2.25/2.75):2*7.5625*(t-2.625/2.75)}var mt=Math.LN2,Ee={linear:()=>1,easeInQuad:t=>2*t,easeOutQuad:t=>2*(1-t),easeInOutQuad:t=>t<.5?4*t:4*(1-t),easeInCubic:t=>3*t**2,easeOutCubic:t=>3*(1-t)**2,easeInOutCubic:t=>t<.5?12*t**2:12*(1-t)**2,easeInQuart:t=>4*t**3,easeOutQuart:t=>4*(1-t)**3,easeInOutQuart:t=>t<.5?32*t**3:32*(1-t)**3,easeInQuint:t=>5*t**4,easeOutQuint:t=>5*(1-t)**4,easeInOutQuint:t=>t<.5?80*t**4:80*(1-t)**4,easeInSine:t=>Math.PI/2*Math.sin(t*Math.PI/2),easeOutSine:t=>Math.PI/2*Math.cos(t*Math.PI/2),easeInOutSine:t=>Math.PI/2*Math.sin(Math.PI*t),easeInExpo:t=>t===0?0:10*mt*2**(10*t-10),easeOutExpo:t=>t===1?0:10*mt*2**(-10*t),easeInOutExpo:t=>t===0||t===1?0:t<.5?10*mt*2**(20*t-10):10*mt*2**(-20*t+10),easeInCirc:t=>t/Math.sqrt(1-t*t),easeOutCirc:t=>(1-t)/Math.sqrt(1-(t-1)*(t-1)),easeInOutCirc:t=>t<.5?2*t/Math.sqrt(1-4*t*t):(2-2*t)/Math.sqrt(1-(-2*t+2)**2),easeInBack:t=>3*Se*t**2-2*1.70158*t,easeOutBack:t=>3*Se*(t-1)**2+2*1.70158*(t-1),easeInOutBack:t=>t<.5?12*3.5949095*t**2-4*Me*t:3*3.5949095*(2*t-2)**2+2*Me*(2*t-2),easeInElastic:t=>{if(t===0||t===1)return 0;let e=(t*10-10.75)*Rt,n=2**(10*t-10);return-(10*mt*n*Math.sin(e)+n*10*Rt*Math.cos(e))},easeOutElastic:t=>{if(t===0||t===1)return 0;let e=(t*10-.75)*Rt,n=2**(-10*t);return-10*mt*n*Math.sin(e)+n*10*Rt*Math.cos(e)},easeInOutElastic:t=>{if(t===0||t===1)return 0;let e=(20*t-11.125)*Kt;if(t<.5){let s=2**(20*t-10);return-(20*mt*s*Math.sin(e)+s*20*Kt*Math.cos(e))/2}let n=2**(-20*t+10);return(-20*mt*n*Math.sin(e)+n*20*Kt*Math.cos(e))/2},easeInBounce:t=>ve(1-t),easeOutBounce:ve,easeInOutBounce:t=>t<.5?ve(1-2*t):ve(2*t-1)},Ws="easeInOutCubic";function Bs(t,e,n,s){let r=3*t-3*n+1,i=3*n-6*t,o=3*t,a=3*e-3*s+1,l=3*s-6*e,c=3*e,h=p=>((r*p+i)*p+o)*p,f=p=>((a*p+l)*p+c)*p,u=p=>(3*r*p+2*i)*p+o;return{sampleY:f,sampleDX:u,sampleDY:p=>(3*a*p+2*l)*p+c,solveU:p=>{let v=p;for(let g=0;g<8;g++){let k=h(v)-p;if(Math.abs(k)<1e-7)return v;let E=u(v);if(Math.abs(E)<1e-6)break;v-=k/E}let w=0,y=1;for(v=p;y-w>1e-7;)h(v)<p?w=v:y=v,v=(w+y)/2;return v}}}function yn(t,e,n,s){let r=Bs(t,e,n,s);return i=>i<=0?0:i>=1?1:r.sampleY(r.solveU(i))}function wn(t,e,n,s){let r=Bs(t,e,n,s);return i=>{let o=r.solveU(Math.min(1,Math.max(0,i))),a=r.sampleDX(o);return Math.abs(a)<1e-9?0:r.sampleDY(o)/a}}var bn=class extends Error{constructor(t){super(`unknown easing '${t}'; register it via easings or use cubicBezier/spring`),this.name="UnknownEasingError"}};function Qt(t){let e=gn[t];if(!e)throw new bn(t);return e}var Wi=.005;function Zt(t){var n;let e=(n=t.mass)!=null?n:1;if(!(t.stiffness>0)||!(t.damping>0)||!(e>0))throw new RangeError("spring stiffness, damping, and mass must all be > 0");return{w0:Math.sqrt(t.stiffness/e),zeta:t.damping/(2*Math.sqrt(t.stiffness*e))}}function Bi(t,e){if(e<=0)return 0;let{w0:n,zeta:s}=Zt(t);if(Math.abs(s-1)<1e-9)return n*n*e*Math.exp(-n*e);if(s<1){let a=n*Math.sqrt(1-s*s);return Math.exp(-s*n*e)*(n*n/a)*Math.sin(a*e)}let r=Math.sqrt(s*s-1),i=-n*(s-r),o=-n*(s+r);return i*o*(Math.exp(i*e)-Math.exp(o*e))/(i-o)}function Jt(t,e){if(e<=0)return 0;let{w0:n,zeta:s}=Zt(t);if(Math.abs(s-1)<1e-9)return 1-Math.exp(-n*e)*(1+n*e);if(s<1){let a=n*Math.sqrt(1-s*s);return 1-Math.exp(-s*n*e)*(Math.cos(a*e)+s*n/a*Math.sin(a*e))}let r=Math.sqrt(s*s-1),i=-n*(s-r),o=-n*(s+r);return 1+(o*Math.exp(i*e)-i*Math.exp(o*e))/(i-o)}function $e(t,e){var a;let n=(a=e==null?void 0:e.settleTolerance)!=null?a:Wi,{w0:s,zeta:r}=Zt(t);if(r<1){let l=s*Math.sqrt(1-r*r),c=Math.sqrt(1+(r*s/l)**2);return Math.log(c/n)/(r*s)}let i=1/s;for(;1-Jt(t,i)>n;)i*=2;let o=0;for(let l=0;l<64&&i-o>1e-9;l++){let c=(o+i)/2;1-Jt(t,c)>n?o=c:i=c}return i}function _s(t,e,n){let s=$e(t,n);return Jt(t,Math.min(e,s))/Jt(t,s)}function _i(t,e,n){let{w0:s,zeta:r}=Zt(t),i,o,a;if(Math.abs(r-1)<1e-9){let c=n+s*e;i=h=>h<=0?e:Math.exp(-s*h)*(e+c*h),o=h=>h<=0?n:Math.exp(-s*h)*(n-s*c*h),a=h=>Math.exp(-s*h)*(Math.abs(e)+Math.abs(c)*h)}else if(r<1){let c=s*Math.sqrt(1-r*r),h=(n+r*s*e)/c,f=Math.hypot(e,h);i=u=>u<=0?e:Math.exp(-r*s*u)*(e*Math.cos(c*u)+h*Math.sin(c*u)),o=u=>u<=0?n:Math.exp(-r*s*u)*(n*Math.cos(c*u)-(s*s*e+r*s*n)/c*Math.sin(c*u)),a=u=>Math.exp(-r*s*u)*f}else{let c=Math.sqrt(r*r-1),h=s*(-r+c),f=s*(-r-c),u=(n-f*e)/(h-f),d=(h*e-n)/(h-f);i=m=>m<=0?e:u*Math.exp(h*m)+d*Math.exp(f*m),o=m=>m<=0?n:u*h*Math.exp(h*m)+d*f*Math.exp(f*m),a=m=>Math.abs(u)*Math.exp(h*m)+Math.abs(d)*Math.exp(f*m)}return{value:i,velocity:o,settleTime:c=>{let h=c!=null?c:Math.abs(e)*.005+1e-6;if(a(0)<=h&&Math.abs(n)<1e-12)return 0;let f=1/s,u=0;for(;a(f)>h&&u++<64;)f*=2;let d=0;for(let m=0;m<64&&f-d>1e-9;m++){let p=(d+f)/2;Math.max(a(p),a(p*1.05+1e-6))>h?d=p:f=p}return f}}}var yt=Object.assign(t=>{var e;return Zt(t),{kind:"spring",stiffness:t.stiffness,damping:t.damping,mass:(e=t.mass)!=null?e:1}},{duration:$e,value:_s,retarget:_i}),js={default:{stiffness:170,damping:26},gentle:{stiffness:120,damping:14},wobbly:{stiffness:180,damping:12},stiff:{stiffness:210,damping:20},slow:{stiffness:280,damping:60},molasses:{stiffness:280,damping:120}};function kn(t){let e=$e(t);return n=>_s(t,n*e)}function vn(t){let e=$e(t),n=e/Jt(t,e);return s=>s>=1?0:Bi(t,s*e)*n}var Hs=t=>{var e;(e=globalThis.console)==null||e.warn(`[glissade] ${t}`)};function Xs(t){Hs=t}function B(t){Hs(t)}var ji=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Hi=/^rgba?\(\s*([\d.]+)\s*[, ]\s*([\d.]+)\s*[, ]\s*([\d.]+)\s*(?:[,/]\s*([\d.]+%?)\s*)?\)$/i,xn=class extends Error{constructor(t){super(`cannot parse color '${t}' (supported: #rgb[a], #rrggbb[aa], rgb()/rgba())`),this.name="ColorParseError"}};function ut(t){let e=ji.exec(t);if(e){let s=e[1];s.length<=4&&(s=[...s].map(i=>i+i).join(""));let r=parseInt(s,16);return s.length===6?{r:r>>16,g:r>>8&255,b:r&255,a:1}:{r:r>>>24&255,g:r>>>16&255,b:r>>>8&255,a:(r&255)/255}}let n=Hi.exec(t);if(n){let s=n[4],r=s===void 0?1:s.endsWith("%")?parseFloat(s)/100:parseFloat(s);return{r:parseFloat(n[1]),g:parseFloat(n[2]),b:parseFloat(n[3]),a:r}}throw new xn(t)}function Ce(t){let e=i=>Math.min(255,Math.max(0,Math.round(i))),n=i=>e(i).toString(16).padStart(2,"0"),s=`#${n(t.r)}${n(t.g)}${n(t.b)}`,r=Math.min(1,Math.max(0,t.a));return r>=1?s:`${s}${n(r*255)}`}function dn(t){let e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function pn(t){return(t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055)*255}function Ct(t){let e=dn(t.r),n=dn(t.g),s=dn(t.b),r=Math.cbrt(.4122214708*e+.5363325363*n+.0514459929*s),i=Math.cbrt(.2119034982*e+.6806995451*n+.1073969566*s),o=Math.cbrt(.0883024619*e+.2817188376*n+.6299787005*s);return{L:.2104542553*r+.793617785*i-.0040720468*o,a:1.9779984951*r-2.428592205*i+.4505937099*o,b:.0259040371*r+.7827717662*i-.808675766*o,alpha:t.a}}function Nt(t){let e=(t.L+.3963377774*t.a+.2158037573*t.b)**3,n=(t.L-.1055613458*t.a-.0638541728*t.b)**3,s=(t.L-.0894841775*t.a-1.291485548*t.b)**3;return{r:pn(4.0767416621*e-3.3077115913*n+.2309699292*s),g:pn(-1.2684380046*e+2.6097574011*n-.3413193965*s),b:pn(-.0041960863*e-.7034186147*n+1.707614701*s),a:t.alpha}}function ht(t,e,n){let s=Ct(ut(t)),r=Ct(ut(e)),i=(o,a)=>o+(a-o)*n;return Ce(Nt({L:i(s.L,r.L),a:i(s.a,r.a),b:i(s.b,r.b),alpha:i(s.alpha,r.alpha)}))}var Mn=new Map;function it(t){Mn.set(t.id,t)}var Sn=class extends Error{constructor(t){super(`unknown value type '${t}'; register it via registerValueType()`),this.name="UnknownValueTypeError"}};function te(t){let e=Mn.get(t);if(!e)throw new Sn(t);return e}function Oe(t){var e,n;return(n=(e=Mn.get(t))==null?void 0:e.repr)!=null?n:t}var En={id:"number",lerp:(t,e,n)=>t+(e-t)*n,extrapolates:!0,equals:Object.is,add:(t,e)=>t+e,sub:(t,e)=>t-e,scale:(t,e)=>t*e,defaultHandoff:"spring"},Ae=(t,e)=>t[0]===e[0]&&t[1]===e[1],Tn={id:"vec2",lerp:(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n],extrapolates:!0,equals:Ae,add:(t,e)=>[t[0]+e[0],t[1]+e[1]],sub:(t,e)=>[t[0]-e[0],t[1]-e[1]],scale:(t,e)=>[t[0]*e,t[1]*e],defaultHandoff:"spring"},In={id:"vec2-arc",repr:"vec2",lerp:(t,e,n)=>{let s=Math.hypot(t[0],t[1]),r=Math.hypot(e[0],e[1]),i=Math.atan2(t[1],t[0]),o=Math.atan2(e[1],e[0])-i;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;let a=s+(r-s)*n,l=i+o*n;return[a*Math.cos(l),a*Math.sin(l)]},extrapolates:!0,equals:Ae,defaultHandoff:"blend-from-frozen"},$n={id:"color",lerp:ht,extrapolates:!0,equals:(t,e)=>t===e,defaultHandoff:"blend-from-frozen"};function Ys(t){return{id:t,lerp:(e,n,s)=>s>=1?n:e,extrapolates:!1,equals:(e,n)=>Object.is(e,n),defaultHandoff:"cut"}}var Cn=Ys("string"),On=Ys("boolean"),mn=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n];function Fs(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let s=t[n],r=e[n];if(s.closed!==r.closed||s.v.length!==r.v.length)return!1}return!0}var zs=!1,An={id:"path",lerp:(t,e,n)=>Fs(t,e)?t.map((s,r)=>{let i=e[r];return{closed:s.closed,v:s.v.map((o,a)=>mn(o,i.v[a],n)),in:s.in.map((o,a)=>mn(o,i.in[a],n)),out:s.out.map((o,a)=>mn(o,i.out[a],n))}}):(zs||(zs=!0,B("path lerp with mismatched topology (contour/vertex counts or closed flags differ): snapping instead of morphing \u2014 supply matched vertex counts (\xA72.2)")),n>=1?e:t),extrapolates:!1,equals:(t,e)=>{if(t===e)return!0;if(!Fs(t,e))return!1;let n=(s,r)=>s[0]===r[0]&&s[1]===r[1];return t.every((s,r)=>{let i=e[r];return s.v.every((o,a)=>n(o,i.v[a]))&&s.in.every((o,a)=>n(o,i.in[a]))&&s.out.every((o,a)=>n(o,i.out[a]))})},defaultHandoff:"blend-from-frozen"},Te=(t,e,n)=>t+(e-t)*n,xe=(t,e,n)=>[Te(t[0],e[0],n),Te(t[1],e[1],n)];function Ls(t){try{return Ce(z(T({},ut(t)),{a:0}))}catch(e){return t}}function Xi(t,e,n){try{return ht(t,e,n)}catch(s){return n>=1?e:t}}function Rs(t,e){let n=e.stops.map(r=>({offset:r.offset,color:t})),s=e.interpolation?{interpolation:e.interpolation}:{};return e.kind==="radial"?T(T(T({kind:"radial",stops:n},e.center?{center:e.center}:{}),e.radius!==void 0?{radius:e.radius}:{}),s):T(T(T({kind:"linear",stops:n},e.from?{from:e.from}:{}),e.to?{to:e.to}:{}),s)}var Ns=!1;function Ut(t,e,n,s="paint lerp across mismatched gradient shapes (different kind or stop count): snapping instead of interpolating \u2014 match the kind + stop count on both keyframes (\xA72.2)"){return Ns||(Ns=!0,B(s)),t>=1?n:e}var Yi=(t,e)=>t.length===e.length&&t.every((n,s)=>n.offset===e[s].offset&&n.color===e[s].color),Pn={id:"paint",lerp:(t,e,n)=>{var a,l,c,h;if(t.kind==="color"&&e.kind==="color")return{kind:"color",color:ht(t.color,e.color,n)};if(t.kind==="mesh"&&e.kind==="mesh"){if(t.points.length!==e.points.length)return Ut(n,t,e);if(t.interpolation!==e.interpolation)return Ut(n,t,e,`paint lerp across mismatched mesh interpolation modes ('${(a=t.interpolation)!=null?a:"smooth"}' \u2192 '${(l=e.interpolation)!=null?l:"smooth"}'): snapping instead of interpolating \u2014 the blend kernel is discrete, so it switches once at the boundary; match \`interpolation\` on both keyframes to morph the points (\xA73 Paint)`);let f=t.points.map((d,m)=>{let p=e.points[m];return{pos:xe(d.pos,p.pos,n),color:ht(d.color,p.color,n)}}),u=t.bg!==void 0||e.bg!==void 0?{bg:Xi((c=t.bg)!=null?c:Ls(e.bg),(h=e.bg)!=null?h:Ls(t.bg),n)}:{};return T(T({kind:"mesh",points:f},t.interpolation?{interpolation:t.interpolation}:{}),u)}if(t.kind==="mesh"||e.kind==="mesh")return Ut(n,t,e);let s=t,r=e;if(s.kind==="color"&&r.kind!=="color"?s=Rs(s.color,r):r.kind==="color"&&s.kind!=="color"&&(r=Rs(r.color,s)),s.kind==="color"||r.kind==="color"||s.kind!==r.kind||s.stops.length!==r.stops.length)return Ut(n,t,e);let i=s.stops.map((f,u)=>({offset:Te(f.offset,r.stops[u].offset,n),color:ht(f.color,r.stops[u].color,n)})),o=s.interpolation?{interpolation:s.interpolation}:{};return s.kind==="radial"&&r.kind==="radial"?T(T(T({kind:"radial",stops:i},s.center&&r.center?{center:xe(s.center,r.center,n)}:s.center?{center:s.center}:{}),s.radius!==void 0&&r.radius!==void 0?{radius:Te(s.radius,r.radius,n)}:s.radius!==void 0?{radius:s.radius}:{}),o):s.kind==="linear"&&r.kind==="linear"?T(T(T({kind:"linear",stops:i},s.from&&r.from?{from:xe(s.from,r.from,n)}:s.from?{from:s.from}:{}),s.to&&r.to?{to:xe(s.to,r.to,n)}:s.to?{to:s.to}:{}),o):Ut(n,t,e)},extrapolates:!1,equals:(t,e)=>t===e?!0:t.kind!==e.kind?!1:t.kind==="color"?e.kind==="color"&&t.color===e.color:t.kind==="mesh"?e.kind!=="mesh"||t.interpolation!==e.interpolation||t.bg!==e.bg||t.points.length!==e.points.length?!1:t.points.every((n,s)=>{let r=e.points[s];return n.color===r.color&&n.pos[0]===r.pos[0]&&n.pos[1]===r.pos[1]}):e.kind==="color"||e.kind==="mesh"||!Yi(t.stops,e.stops)||t.interpolation!==e.interpolation?!1:t.kind==="radial"&&e.kind==="radial"?JSON.stringify(t.center)===JSON.stringify(e.center)&&t.radius===e.radius:t.kind==="linear"&&e.kind==="linear"?JSON.stringify(t.from)===JSON.stringify(e.from)&&JSON.stringify(t.to)===JSON.stringify(e.to):!1,defaultHandoff:"blend-from-frozen"},Dn=class extends Error{constructor(t){super(`cannot infer a value type for ${JSON.stringify(t)}; register a custom type`),this.name="ValueTypeInferenceError"}},Gi=t=>typeof t=="object"&&t!==null&&typeof t.closed=="boolean"&&Array.isArray(t.v)&&Array.isArray(t.in)&&Array.isArray(t.out),Ui=t=>typeof t=="object"&&t!==null&&(t.kind==="color"||t.kind==="linear"||t.kind==="radial"||t.kind==="mesh");function Ot(t){if(typeof t=="number")return"number";if(typeof t=="boolean")return"boolean";if(Ui(t))return"paint";if(Array.isArray(t)&&t.length===2&&t.every(e=>typeof e=="number"))return"vec2";if(Array.isArray(t)&&t.length>0&&t.every(Gi))return"path";if(typeof t=="string")try{return ut(t),"color"}catch(e){return"string"}throw new Dn(t)}it(En);it(Tn);it(In);it($n);it(Cn);it(On);it(An);it(Pn);var gt=class extends Error{constructor(t,e){super(`track '${t}': ${e}`),this.name="TrackValidationError"}};function ee(t){let e=te(t.type);if(t.keys.length===0)throw new gt(t.target,"must have at least one key");if(e.defaultHandoff==="cut")for(let n of t.keys)n.interp!=="hold"&&(n.interp="hold");for(let n=1;n<t.keys.length;n++){let s=t.keys[n-1],r=t.keys[n];if(r.t<=s.t)throw new gt(t.target,`keys must be strictly increasing in t (key[${n}] at t=${r.t} after t=${s.t})`)}if(!/^[^/]+\/.+$/.test(t.target))throw new gt(t.target,"target must be '<nodeId>/<prop.path>' (e.g. 'circle/opacity')")}function O(t,e,n){if(n===void 0)return{t,value:e};if(typeof n=="string"||"kind"in n)return{t,value:e,ease:n};let s=n,r={t,value:e};return s.ease!==void 0&&(r.ease=s.ease),s.interp!==void 0&&(r.interp=s.interp),s.id!==void 0&&(r.id=s.id),s.derived!==void 0&&(r.derived=s.derived),r}function Gs(t,e,n,s){let r=yt.duration(s);if(t-r<0)throw new gt("springTo",`this spring needs ${r.toFixed(3)}s to settle \u2014 endT must be \u2265 its duration (got ${t})`);return[O(t-r,e),O(t,n,yt(s))]}function Pe(t,e){let n=typeof e=="function"?e:s=>s*e;return t.map((s,r)=>{let i=n(r);return z(T({},s),{keys:s.keys.map(o=>z(T({},o),{t:o.t+i}))})})}function wt(t,e,n,s){let r={target:t,type:e,keys:n};return(s==null?void 0:s.editable)!==void 0&&(r.editable=s.editable),ee(r),r}function Fn(t){return t===void 0?Qt("linear"):typeof t=="string"?Qt(t):t.kind==="cubicBezier"?yn(...t.pts):kn(t)}var Vs=new Set;function zn(t){if(t===void 0)return Ee.linear;if(typeof t=="string"){let e=Ee[t];if(e)return e;let n=Qt(t);Vs.has(t)||(Vs.add(t),B(`easing '${t}' has no registered derivative; velocity uses a numeric fallback \u2014 register one in easingDerivatives for exact interruption handoff`));let s=1/1024;return r=>(n(Math.min(1,r+s))-n(Math.max(0,r-s)))/(Math.min(1,r+s)-Math.max(0,r-s))}return t.kind==="cubicBezier"?wn(...t.pts):vn(t)}var qs=new WeakMap;function Us(t){let e=qs.get(t);return e||(e={cursor:1,easeCache:new Array(t.keys.length)},qs.set(t,e)),e}function Ks(t,e,n){let s=e.easeCache[n];return s||(s=Fn(t.keys[n].ease),e.easeCache[n]=s),s}function Qs(t,e,n){let s=t.length;for(let o=Math.max(1,n-1);o<=Math.min(s-1,n+1);o++)if(t[o-1].t<=e&&e<t[o].t)return o;if(e<t[0].t)return 0;if(e>=t[s-1].t)return s;let r=1,i=s-1;for(;r<i;){let o=r+i>>1;t[o].t<=e?r=o+1:i=o}return r}function Ln(t,e){let n=te(t.type);if(!n.sub||!n.scale)return null;let s=t.keys,r=s.length,i=Us(t),o=Qs(s,e,i.cursor),a=n.scale(n.sub(s[0].value,s[0].value),0);if(o===0||o>=r)return a;let l=s[o];if(l.interp==="hold")return a;let c=s[o-1],h=l.t-c.t,f=(e-c.t)/h;if(!n.extrapolates){let d=Ks(t,i,o)(f);if(d<0||d>1)return a}let u=zn(l.ease)(f);return n.scale(n.sub(l.value,c.value),u/h)}function De(t,e){let n=t.keys,s=n.length,r=Us(t),i=Qs(n,e,r.cursor);if(i===0)return n[0].value;if(i>=s)return n[s-1].value;r.cursor=i;let o=n[i],a=n[i-1];if(o.interp==="hold")return a.value;let l=te(t.type),c=(e-a.t)/(o.t-a.t),h=Ks(t,r,i)(c);return!l.extrapolates&&(h<0||h>1)&&(r.warnedClamp||(r.warnedClamp=!0,B(`track '${t.target}' (type '${t.type}') clamped an out-of-range eased value \u2014 non-extrapolating types can't overshoot, so a spring/overshooting ease on this track is flattened`)),h=Math.min(1,Math.max(0,h))),l.lerp(a.value,o.value,h)}var At=Symbol.for("glissade.targetPath"),Ie=class extends Error{constructor(t){super(t!=null?t:'tween target is not addressable: pass a target string ("node/prop") or a property signal of a node that has an explicit id (\xA73.1 \u2014 anonymous nodes cannot be track targets)'),this.name="UnresolvableTargetError"}};function Vt(t){let e=t.indexOf("/");return e<0?t:t.slice(0,e)}function ne(t){return typeof t=="string"&&t.length>0&&t!=="__root"&&!t.startsWith("~")}function bt(t){let e=typeof t=="string"?t:t[At];if(typeof e!="string")throw new Ie;if(Vt(e).startsWith("~"))throw new Ie(`'${e}': structural ids (~Type.ordinal) are inspection-only and cannot be track targets (\xA76.5) \u2014 give the node an explicit id`);return e}function tt(t,e){return e+2<=t.byteLength?t.getUint16(e):0}function ft(t,e){return e+4<=t.byteLength?t.getUint32(e):0}function Ki(t,e){return t===3&&e===10||t===0&&e>=4?5:t===3&&e===1||t===0?3:0}function Qi(t,e,n){let s=tt(t,e+6),r=s>>1,i=e+14,o=i+s+2,a=o+s,l=a+s;for(let c=0;c<r;c++){let h=tt(t,i+c*2),f=tt(t,o+c*2);if(f>h)continue;let u=tt(t,a+c*2),d=tt(t,l+c*2);for(let m=f;m<=h;m++){if(m===65535)continue;let p;if(d===0)p=m+u&65535;else{let v=tt(t,l+c*2+d+(m-f)*2);p=v===0?0:v+u&65535}p!==0&&n.add(m)}}}function Ji(t,e,n){let s=ft(t,e+12),r=Math.max(0,Math.floor((t.byteLength-(e+16))/12)),i=Math.min(s,r),o=e+16;for(let a=0;a<i;a++,o+=12){let l=ft(t,o),c=ft(t,o+4),h=ft(t,o+8);if(!(l>c)&&!(c-l>2097152))for(let f=l;f<=c;f++)h+(f-l)!==0&&n.add(f)}}function Fe(t){let e=new Set;try{let n=ArrayBuffer.isView(t)?new DataView(t.buffer,t.byteOffset,t.byteLength):new DataView(t);if(n.byteLength<12)return e;let s=0;ft(n,0)===1953784678&&(s=ft(n,12));let r=tt(n,s+4),i=0;for(let h=0;h<r;h++){let f=s+12+h*16;if(ft(n,f)===1668112752){i=ft(n,f+8);break}}if(i===0)return e;let o=tt(n,i+2),a=0,l=-1;for(let h=0;h<o;h++){let f=i+4+h*8,u=tt(n,f),d=tt(n,f+2),m=i+ft(n,f+4),p=Ki(u,d);p>l&&m+2<=n.byteLength&&(l=p,a=m)}if(l<0)return e;let c=tt(n,a);c===4?Qi(n,a,e):c===12&&Ji(n,a,e)}catch(n){return e}return e}function Rn(t){var n;let e={version:1,tracks:(n=t.tracks)!=null?n:[]};return t.duration!==void 0&&(e.duration=t.duration),t.editableDuration!==void 0&&(e.editableDuration=t.editableDuration),t.fps!==void 0&&(e.fps=t.fps),t.posterTime!==void 0&&(e.posterTime=t.posterTime),t.labels!==void 0&&(e.labels=t.labels),t.markers!==void 0&&(e.markers=t.markers),t.children!==void 0&&(e.children=t.children),t.audio!==void 0&&(e.audio=t.audio),t.assets!==void 0&&(e.assets=t.assets),e}var et=class extends Error{constructor(t){super(t),this.name="TimelineValidationError"}};function Zi(t){for(let e=1;e<t.keys.length;e++){let n=t.keys[e];if(n.ease&&typeof n.ease=="object"&&n.ease.kind==="spring"){let s=t.keys[e-1].t+yt.duration(n.ease);if(Math.abs(n.t-s)>1e-6)throw new et(`track '${t.target}': spring-eased key at t=${n.t} must sit at prev.t + spring.duration (${s.toFixed(6)}); the builder computes this automatically`)}}}function Zs(t,e=48e3){return Math.round(t*e)}function to(t,e,n){return t.map(s=>z(T({},s),{t:e+s.t/n}))}function tr(t,e,n,s,r,i){var o,a;for(let l of t.tracks)ee(l),Zi(l),r.push({track:z(T({},l),{keys:to(l.keys,e,n)}),unit:s});for(let l of(o=t.children)!=null?o:[]){let c=l.mode==="sync"&&(a=l.timeScale)!=null?a:1;if(l.mode==="add"&&l.timeScale!==void 0)throw new et("timeScale is only valid on mode:'sync' children (\xA72.3)");if(c<=0)throw new et("sync timeScale must be > 0");let h=l.mode==="sync"?++i.n:s;tr(l.timeline,e+l.at/n,n*c,h,r,i)}}function eo(t){let e=new Map;for(let{track:s,unit:r}of t){let i=e.get(s.target);if(!i){e.set(s.target,{track:z(T({},s),{keys:[...s.keys]}),unit:r});continue}if(i.unit!==r)throw new et(`target '${s.target}' is animated by a sync (opaque) child and another timeline unit; sync children must own disjoint targets (no last-writer-wins across the sync boundary, \xA72.3)`);if(i.track.type!==s.type)throw new et(`target '${s.target}' has conflicting value types '${i.track.type}' and '${s.type}'`);let o=s.keys[0].t,a=s.keys[s.keys.length-1].t,l=i.track.keys[0].t,c=i.track.keys[i.track.keys.length-1].t,h=i.track.keys.filter(f=>f.t<o||f.t>a);l<=a&&o<=c&&B(`overlapping tracks for '${s.target}' in [${o}, ${a}]: later insertion wins (${i.track.keys.length-h.length} earlier key(s) dropped)`),i.track.keys=[...h,...s.keys].sort((f,u)=>f.t-u.t)}let n=new Map;for(let[s,{track:r}]of e)n.set(s,r);return n}function er(t){return t.editableDuration===!0}function no(t){var n;let e=t.mode==="sync"&&(n=t.timeScale)!=null?n:1;return t.at+nr(t.timeline)/e}function nr(t){var n,s;if(t.duration!==void 0)return t.duration;let e=0;for(let r of t.tracks){let i=r.keys[r.keys.length-1];i&&(e=Math.max(e,i.t))}for(let r of(n=t.markers)!=null?n:[])e=Math.max(e,r.t);for(let r of(s=t.children)!=null?s:[])e=Math.max(e,no(r));return e}function nt(t){var a,l;if(t.version!==1)throw new et(`unsupported timeline document version ${String(t.version)}`);let e=[];tr(t,0,1,0,e,{n:0});let n=eo(e),s=T({},t.labels),r=[...(a=t.markers)!=null?a:[]],i=[...(l=t.audio)!=null?l:[]],o=(c,h,f)=>{var u,d,m,p,v;for(let w of c!=null?c:[]){let y=h+w.at/f,g=f*(w.mode==="sync"&&(u=w.timeScale)!=null?u:1);for(let[k,E]of Object.entries((d=w.timeline.labels)!=null?d:{}))k in s||(s[k]=y+E/g);for(let k of(m=w.timeline.markers)!=null?m:[])r.push(z(T({},k),{t:y+k.t/g}));for(let k of(p=w.timeline.audio)!=null?p:[])i.push(T(z(T({},k),{at:y+k.at/g}),g!==1?{playbackRate:((v=k.playbackRate)!=null?v:1)*g}:{}));o(w.timeline.children,y,g)}};return o(t.children,0,1),r.sort((c,h)=>c.t-h.t),i.sort((c,h)=>c.at-h.at),{duration:nr(t),labels:s,markers:r,tracks:n,audio:i}}var Nn="main",Vn=class extends Error{constructor(t){super(`unsupported sidecar version ${String(t)}; this build reads sidecarVersion 1 or 2`),this.name="SidecarVersionError"}};function sr(){return{sidecarVersion:2,timelines:{[Nn]:{tracks:{}}}}}function qn(t){if(!t)return null;if(t.sidecarVersion===2)return t;if(t.sidecarVersion===1){let e={};for(let s of t.tracks)e[s.target]={type:s.type,baseHash:null,keys:s.keys};let n={tracks:e};return t.labels&&(n.labels=t.labels),{sidecarVersion:2,timelines:{[Nn]:n}}}throw new Vn(t.sidecarVersion)}function ze(t){let e=JSON.stringify(t.map(s=>{var r,i;return[s.t,s.value,(r=s.ease)!=null?r:null,(i=s.interp)!=null?i:null]})),n=2166136261;for(let s=0;s<e.length;s++)n^=e.charCodeAt(s),n=Math.imul(n,16777619);return(n>>>0).toString(16)}function Wn(t){let e=-1;for(let n of t){let s=n.id?/^k(\d+)$/.exec(n.id):null;s&&(e=Math.max(e,Number(s[1])))}return t.map(n=>n.id?T({},n):z(T({},n),{id:`k${++e}`}))}function rr(t,e,n,s,r,i){var l;if(!ne(Vt(n)))throw new gt(n,"structural/un-id'd nodes cannot host editor tracks (\xA76.5) \u2014 only nodes with an explicit id");let o=(l=t.timelines[e])!=null?l:{tracks:{}},a={type:s,baseHash:i?ze(i):null,keys:Wn(r)};return z(T({},t),{timelines:z(T({},t.timelines),{[e]:z(T({},o),{tracks:z(T({},o.tracks),{[n]:a})})})})}function ir(t,e,n){let s=t.timelines[e];if(!s||!(n in s.tracks))return t;let o=s.tracks,{[n]:r}=o,i=Lt(o,[Ds(n)]);return z(T({},t),{timelines:z(T({},t.timelines),{[e]:z(T({},s),{tracks:i})})})}function Js(t){return t.some(e=>e.derived)?t.map((e,n)=>e.derived&&n>0?z(T({},e),{value:t[n-1].value}):e):t}function Bn(t,e){var c,h,f;let n=qn(e);if(!n)return{timeline:t,drift:[],orphans:{}};let s=(c=n.timelines[Nn])!=null?c:{tracks:{}},r=new Map(Object.entries(s.tracks)),i=[],o=T({},(h=s.orphans)!=null?h:{}),a=t.tracks.map(u=>{let d=r.get(u.target);return d?(r.delete(u.target),d.type!==u.type?(o[u.target]={type:d.type,keys:d.keys,reason:"type-changed"},u):(d.baseHash!==null&&d.baseHash!==ze(u.keys)&&i.push(u.target),z(T({},u),{keys:Js(d.keys.map(m=>T({},m))),editable:!0}))):u});for(let[u,d]of r)d.baseHash!==null?o[u]={type:d.type,keys:d.keys,reason:"prop-missing"}:a.push({target:u,type:d.type,keys:Js(d.keys.map(m=>T({},m))),editable:!0});let l=z(T({},t),{tracks:a});if(s.labels&&Object.keys(s.labels).length>0){let u=(f=t.labels)!=null?f:{},d=Object.keys(s.labels).filter(m=>m in u);d.length&&B(`sidecar label(s) ${d.join(", ")} collide with code labels; code wins (\xA76.2)`),l.labels=T(T({},s.labels),u)}return i.length&&B(`sidecar: code baseline changed beneath edits on ${i.join(", ")} (\xA76.2)`),{timeline:l,drift:i,orphans:o}}function or(t,e){return Bn(t,e).timeline}function ar(t){let e=t.map(n=>T({},n)).sort((n,s)=>n.t-s.t);for(let n=0;n<2;n++){for(let s=1;s<e.length;s++){let r=e[s].ease;r&&typeof r=="object"&&r.kind==="spring"&&(e[s].t=e[s-1].t+yt.duration(r))}e.sort((s,r)=>s.t-r.t)}for(let n=1;n<e.length;n++)e[n].t<=e[n-1].t&&(e[n].t=e[n-1].t+.001);return e}var Hn=t=>t(),_n=Hn,Pt=new Set,Ve=0,qt=!1,se=!1,so=1e3;function ro(t){let e=_n;return _n=t!=null?t:Hn,se&&!qt&&(se=!1,Pt.size>0&&Xn()),e}function io(t){Pt.add(t),Xn()}function Xn(){Ve>0||qt||se||(se=!0,_n(oo))}function oo(){se=!1,!qt&&ao()}function ao(){if(qt)return;qt=!0;let t;try{let e=0;for(;Pt.size>0;){if(++e>so)throw Pt.clear(),new Error("signal notification flush did not settle within 1000 passes: a subscriber is writing to a signal it observes (DESIGN.md \xA76.1).");let n=[...Pt];Pt.clear();for(let s of n)try{s()}catch(r){t!=null||(t={err:r})}}}finally{qt=!1}if(t)throw t.err}function Le(){Ve++}function Re(){Ve--,Ve===0&&Pt.size>0&&Xn()}function co(t){Le();try{return t()}finally{Re()}}var kt=null,Dt=0,Ne=class extends Error{constructor(){super("signal.set() during evaluation: the read phase is pure (DESIGN.md \xA72.1). Drivers write the playhead before evaluation begins; stateful animation belongs in bake()."),this.name="WriteDuringEvaluationError"}},lr=class extends Error{constructor(){super("circular signal dependency detected"),this.name="CircularDependencyError"}};function hr(){Dt++}function ur(){if(Dt===0)throw new Error("endReadPhase() without matching beginReadPhase()");Dt--}function lo(){return Dt>0}var fr=class{constructor(t){x(this,"value");x(this,"fn");x(this,"equals");x(this,"version",0);x(this,"state");x(this,"computing",!1);x(this,"deps",[]);x(this,"depVersions",[]);x(this,"dependents",new Set);x(this,"subscribers",new Set);var e,n;this.fn=(e=t.fn)!=null?e:null,this.value=t.value,this.equals=(n=t.equals)!=null?n:Object.is,this.state=this.fn?2:0}get(){return kt&&kt.addDep(this),this.updateIfNecessary(),this.value}peek(){return this.updateIfNecessary(),this.value}set(t){if(Dt>0)throw new Ne;Le();try{this.fn&&this.detachFn(),this.writeValue(t)}finally{Re()}}forceSet(t){Le();try{this.fn&&this.detachFn(),this.writeValue(t)}finally{Re()}}bindSource(t){if(Dt>0)throw new Ne;Le();try{this.fn=t,this.state=2,this.invalidateDependents(2)}finally{Re()}}unbindSource(){if(Dt>0)throw new Ne;this.fn&&(this.updateIfNecessary(),this.detachFn())}get isBound(){return this.fn!==null}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}addDep(t){this.deps[this.deps.length-1]!==t&&(this.deps.push(t),this.depVersions.push(-1),t.dependents.add(this))}detachFn(){this.fn=null,this.clearDeps(),this.state=0}writeValue(t){(this.version>0||this.value!==void 0)&&this.equals(this.value,t)||(this.value=t,this.version++,this.invalidateDependents(2))}invalidateDependents(t){for(let e of[...this.dependents])e.markStale(t);if(this.subscribers.size>0)for(let e of[...this.subscribers])io(e)}markStale(t){if(this.state>=t)return;let e=this.state===0;this.state=t,e&&this.invalidateDependents(1)}updateIfNecessary(){if(!(this.fn===null||this.state===0)){if(this.computing)throw new lr;if(this.state===1){this.state=0;for(let t=0;t<this.deps.length;t++){let e=this.deps[t];if(e.updateIfNecessary(),e.version!==this.depVersions[t]){this.state=2;break}}}this.state===2&&this.recompute(),this.state=0}}recompute(){this.clearDeps();let t=kt;kt=this,this.computing=!0;let e;try{e=this.fn()}finally{this.computing=!1,kt=t}for(let n=0;n<this.deps.length;n++)this.depVersions[n]=this.deps[n].version;(!(this.version>0||this.value!==void 0)||!this.equals(this.value,e))&&(this.value=e,this.version++)}clearDeps(){for(let t of this.deps)t.dependents.delete(this);this.deps=[],this.depVersions=[]}};function dr(t,e){let n=(()=>t.get());return n.peek=()=>t.peek(),n.subscribe=s=>t.subscribe(s),e(n),n}function C(t,e){let n=new fr({value:t,equals:e==null?void 0:e.equals});return dr(n,s=>{s.set=r=>n.set(r),s.forceSet=r=>n.forceSet(r),s.bindSource=r=>n.bindSource(r),s.unbindSource=()=>n.unbindSource(),Object.defineProperty(s,"isBound",{get:()=>n.isBound})})}function re(t,e){return dr(new fr({fn:t,equals:e==null?void 0:e.equals}),()=>{})}function ho(t){let e=kt;kt=null;try{return t()}finally{kt=e}}function Wt(t){let[e,n]=Array.isArray(t)?t:[t.x,t.y],s=C(e),r=C(n);s.expects="number",r.expects="number";let i=C(null,{equals:(h,f)=>h===null||f===null?h===f:h[0]===f[0]&&h[1]===f[1]}),o=C(e),a=C(n);s.bindSource(()=>{let h=i();return h===null?o():h[0]}),r.bindSource(()=>{let h=i();return h===null?a():h[1]});let l=re(()=>[s(),r()],{equals:(h,f)=>h[0]===f[0]&&h[1]===f[1]}),c=(()=>l());return c.peek=()=>l.peek(),c.subscribe=h=>l.subscribe(h),c.set=h=>{i.set(null),o.set(h[0]),a.set(h[1])},c.bindSource=h=>i.bindSource(()=>h()),c.unbindSource=()=>{i.unbindSource(),i.set(null)},c.expects="vec2",Object.defineProperty(c,"x",{value:s,enumerable:!0}),Object.defineProperty(c,"y",{value:r,enumerable:!0}),c}function uo(t,e){return e.faces&&e.faces.length>0?e.faces.map(n=>{var s,r;return{family:t,url:n.url,weight:(s=n.weight)!=null?s:400,style:(r=n.style)!=null?r:"normal"}}):[{family:t,url:e.url,weight:400,style:"normal"}]}function fo(t,e){let n,s=Number.POSITIVE_INFINITY;for(let r of t){let i=Math.abs(r.weight-e);(i<s||i===s&&n!==void 0&&r.weight<n.weight)&&(n=r,s=i)}return n}function ie(t){let e=new Map;for(let[n,s]of Object.entries(t!=null?t:{}))s.kind==="font"&&e.set(n,{faces:uo(n,s),fallback:s.fallback?[...s.fallback]:[]});return{has(n){return e.has(n)},faces(){let n=[];for(let s of e.values())n.push(...s.faces);return n},resolveFace(n,s=400,r="normal"){let i=e.get(n);if(!i)return;let o=i.faces.filter(a=>a.style===r);return fo(o.length>0?o:i.faces,s)},fallbackChain(n){let s=e.get(n);return s?[n,...s.fallback]:[n]}}}var pr=class extends Error{constructor(e){super(gr(e));x(this,"report");this.name="FontValidationError",this.report=e}},po=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);function mr(t,e){var s;let n=t.trim().toLowerCase();return po.has(n)?!0:(s=e==null?void 0:e.has(n))!=null?s:!1}function mo(t){let e=[];for(let n of t){let s=n.codePointAt(0);s!==void 0&&e.push(s)}return e}function gr(t){let e=[];t.unregistered.length>0&&e.push(`unregistered font ${t.unregistered.length===1?"family":"families"}: ${t.unregistered.join(", ")}`);for(let n of t.missingGlyphs){let s=n.codePoints.map(r=>"U+"+r.toString(16).toUpperCase().padStart(4,"0")).join(", ");e.push(`family '${n.family}' is missing glyphs for ${s}`)}return"font validation failed (\xA73.6): "+e.join("; ")+" \u2014 register the family with its faces/fallback, or supply covering glyphs"}function Yn(t,e,n,s,r={}){let i=new Set,o=new Map;for(let l of t){let c=l.family,h=mr(c,r.osFamilies);if(!e.has(c)){h||i.add(c);continue}let f=e.fallbackChain(c);for(let u of mo(l.text))if(!f.some(d=>{var m,p;return(p=(m=n.get(d))==null?void 0:m.has(u))!=null?p:!1})){let d=o.get(c);d||(d=new Set,o.set(c,d)),d.add(u)}}let a={unregistered:[...i].sort(),missingGlyphs:[...o.entries()].map(([l,c])=>({family:l,codePoints:[...c].sort((h,f)=>h-f)})).sort((l,c)=>l.family<c.family?-1:l.family>c.family?1:0)};if(!(a.unregistered.length===0&&a.missingGlyphs.length===0)){if(s==="strict")throw new pr(a);B(gr(a))}return a}var jn=class extends Error{constructor(t,e){super(`invalid position '${t}': ${e}`),this.name="PositionError"}};function cr(t){return typeof t!="string"&&typeof t.peek=="function"?t.peek():void 0}var yr=new WeakMap;function wr(t){var e;return(e=yr.get(t))!=null?e:new Map}function br(t,e={}){var v;let n=[],s=T({},e.labels),r=[],i=[],o=new Map,a=!1,l=0,c=0,h=0;function f(w){if(w===void 0)return c;if(typeof w=="number")return w;if(w==="<")return l;if(w===">")return c;let y=/^([+-])=([\d.]+)$/.exec(w);if(y)return c+(y[1]==="+"?1:-1)*parseFloat(y[2]);let g=/^([^+\-=]+?)(?:([+-])=([\d.]+))?$/.exec(w);if(g){let k=g[1];if(!(k in s))throw new jn(w,`unknown label '${k}' (labels must be declared before use)`);let E=g[2]?(g[2]==="+"?1:-1)*parseFloat(g[3]):0;return s[k]+E}throw new jn(w,"expected a number, '<', '>', '+=x', '-=x', or 'label[+=x]'")}let u={to(w,y,g={}){var S,$;let k=(S=g.ease)!=null?S:"easeInOutCubic",E=typeof k=="object"&&k.kind==="spring",I=E?yt.duration(k):($=g.duration)!=null?$:1;if(E&&g.duration!==void 0)throw new et("a spring ease determines its duration (spring.duration(cfg)); do not pass duration with a spring");let b=f(g.at),M={kind:"tween",target:bt(w),value:y,duration:I,ease:k,at:g.at,baseValue:cr(w),editable:!1,start:b};return g.from!==void 0&&(M.explicitFrom=g.from),n.push(M),l=b,c=b+I,u},fromTo(w,y,g,k={}){return u.to(w,g,k),n[n.length-1].explicitFrom=y,u},stagger(w,y,g){var L;let k=w.length,E=f(g.at),I=(k-1)/2,b=P=>{var Y;let V=(Y=g.from)!=null?Y:"start";return V==="start"?P:V==="end"?k-1-P:Math.round(V==="center"?Math.abs(P-I):V==="edges"?I-Math.abs(P-I):Math.abs(P-V))},M=(L=y.duration)!=null?L:1,S=0,$=P=>T(T({at:E+P},y.duration!==void 0?{duration:y.duration}:{}),y.ease!==void 0?{ease:y.ease}:{});for(let P=0;P<k;P++){let V=b(P)*g.each;V>S&&(S=V);let Y=w[P];y.from!==void 0?u.fromTo(Y,y.from,y.to,$(V)):u.to(Y,y.to,$(V))}return l=E,c=E+S+M,u},set(w,y,g={}){let k=f(g.at);return n.push({kind:"set",target:bt(w),value:y,duration:0,ease:"linear",at:g.at,baseValue:cr(w),editable:!1,start:k}),l=k,c=k,u},label(w,y){return s[w]=y===void 0?c:f(y),u},add(w,y,g={}){var M,S;let k=y===void 0?c:f(y),E=(M=g.mode)!=null?M:"add",I={timeline:w,at:k,mode:E,_pos:y};g.timeScale!==void 0&&(I.timeScale=g.timeScale),r.push(I);for(let[$,L]of wr(w))o.has($)||o.set($,L);let b=E==="sync"&&(S=g.timeScale)!=null?S:1;return l=k,c=k+nt(w).duration/b,u},sequence(w,y={}){var E;let g=(E=y.gap)!=null?E:0,k=g<0?`-=${-g}`:`+=${g}`;for(let I=0;I<w.length;I++)u.add(w[I],I===0?void 0:k);return u},at(w,y){return u.add(y,w)},call(w,y){let g=y===void 0?c:f(y),k=`call:${h++}`;return i.push({t:g,name:k}),o.set(k,w),u},cue(w,y,g){let k=g!=null&&typeof g=="object"&&!Array.isArray(g)?T({kind:"cue"},g):{kind:"cue"};return i.push({t:f(w),name:y,data:k}),u},adBreak(w,y={}){var k;let g=T({kind:"ad-break"},y.duration!==void 0?{duration:y.duration}:{});return i.push({t:f(w),name:(k=y.id)!=null?k:"ad-break",data:g}),u},editable(){let w=n[n.length-1];if(!w)throw new et(".editable() requires a preceding insertion");let y=Vt(w.target);if(!ne(y))throw new et(`.editable() needs a node with an explicit id; '${y}' is not an editable host (\xA76.4)`);return w.editable=!0,u},editableDuration(){return a=!0,u}};t(u);let d=new Map;for(let w of n){let y=d.get(w.target);y||(y=[],d.set(w.target,y)),y.push(w)}let m=[];for(let[w,y]of d){y.sort((S,$)=>S.start-$.start);let g=[],k=y.some(S=>S.editable),E=(v=y.find(S=>S.baseValue!==void 0))==null?void 0:v.baseValue,I=y[0];I.kind==="tween"&&I.explicitFrom===void 0&&E===void 0&&B(`'${w}': first tween has no resolvable from-value (string targets have no base) \u2014 the track sits at its end state before the tween. Anchor it with { from }, fromTo(), or set(..., { at: 0 }).`);for(let S of y){if(S.kind==="set"){g.push({t:S.start,value:S.value,interp:"hold"}),E=S.value;continue}let $=S.explicitFrom!==void 0?S.explicitFrom:E,L=g[g.length-1];if($!==void 0&&(!L||L.t<S.start)){let P={t:S.start,value:$};S.explicitFrom===void 0&&(P.derived=!0),(!L||S.start>L.t)&&g.push(P)}g.push({t:S.start+S.duration,value:S.value,ease:S.ease}),E=S.value}let b=[];for(let S of g.sort(($,L)=>$.t-L.t)){let $=b[b.length-1];$&&$.t===S.t?b[b.length-1]=S:b.push(S)}let M={target:w,type:Ot(y[0].value),keys:b};k&&(M.editable=!0),m.push(M)}let p=Rn(T(T(T(z(T({},e),{tracks:m,labels:s}),a?{editableDuration:!0}:{}),i.length?{markers:i}:{}),r.length?{children:r.map(g=>{var k=g,{_pos:w}=k,y=Lt(k,["_pos"]);return y})}:{}));return o.size&&yr.set(p,o),p}function go(t,e){return typeof t=="function"?br(t,e):Rn(t)}function Be(t=0){return C(t)}var kr=class extends Error{constructor(t){super(`timeline targets '${t}' but no property signal resolves to it`),this.name="UnboundTargetError"}},vr=class extends Error{constructor(e,n,s){let r=e.slice(e.lastIndexOf("/")+1),i=[s].flat(),o=n==="number"&&i.includes("vec2")?`; target '${r}.x'/'${r}.y' or author a vec2 track`:"";super(`track '${e}' is '${n}' but '${r}' expects '${i.join("'|'")}' (would silently NaN evaluation)${o}`);x(this,"target");x(this,"got");x(this,"expected");this.target=e,this.got=n,this.name="BindTypeMismatchError",this.expected=s}};function Gn(t,e,n=Be()){let s=[],r=new Map;for(let[i,o]of t.tracks){let a=e(i);if(!a)throw new kr(i);let l=o.type,c=a.expects;if(c!==void 0){let h=Oe(l);if(!(Array.isArray(c)?c:[c]).some(f=>Oe(f)===h))throw new vr(i,l,c)}a.bindSource(()=>De(o,n())),s.push(a),r.set(i,{track:o,value:h=>De(o,h),velocity:h=>Ln(o,h)})}return{playhead:n,samplers:r,unbind:()=>{for(let i of s)i.unbindSource()}}}function Un(t,e,n){t.forceSet(e),hr();try{return n()}finally{ur()}}function ot(t){let e=t>>>0;return()=>{e=e+2654435769|0;let n=e^e>>>16;return n=Math.imul(n,569420461),n=n^n>>>15,n=Math.imul(n,1935289751),n=n^n>>>15,(n>>>0)/4294967296}}var qe=class extends Error{constructor(t){super(`bake(): ${t}`),this.name="BakeError"}};function We(t,e,n){for(let[s,r]of Object.entries(e)){let i=t.get(s);i||(i={keys:[],type:Ot(r)},t.set(s,i)),i.keys.push({t:n,value:r})}}function xr(t){return[...t.entries()].map(([e,n])=>({target:e,type:n.type,keys:n.keys}))}function yo(t){var o,a;if(!(t.fps>0)||!(t.duration>=0))throw new qe("fps must be > 0 and duration >= 0");let e=ot((o=t.seed)!=null?o:0),n=1/t.fps,s=Math.round(t.duration*t.fps),r=t.setup(e),i=new Map;We(i,t.sample(r),0);for(let l=1;l<=s;l++)r=(a=t.step(r,n,e))!=null?a:r,We(i,t.sample(r),l*n);return xr(i)}function wo(t){var f;if(!(t.every>=1))throw new qe("checkpoint interval `every` must be >= 1 frame");let e=1/t.fps,n=Math.round(t.duration*t.fps),s=0,r=ot((f=t.seed)!=null?f:0),i=()=>(s++,r()),o=u=>{var m;let d=ot((m=t.seed)!=null?m:0);for(let p=0;p<u;p++)d();return d},a=t.setup(i),l=[{snap:t.snapshot(a),rngDraws:s}],c=0;function h(u){var d;for(;c<Math.min(u,n);)a=(d=t.step(a,e,i))!=null?d:a,c++,c%t.every===0&&l.push({snap:t.snapshot(a),rngDraws:s})}return{frames:n,bakeRange(u,d){var k;if(u<0||d>n||u>d)throw new qe(`range ${u}..${d} outside 0..${n}`);let m=Math.floor(u/t.every)*t.every;h(m);let p=l[m/t.every],v=t.restore(p.snap),w=o(p.rngDraws),y=m,g=new Map;for(y>=u&&We(g,t.sample(v),y*e);y<d;)v=(k=t.step(v,e,w))!=null?k:v,y++,y>=u&&We(g,t.sample(v),y*e);return xr(g)}}}var St=[1,0,0,1,0,0],_=t=>t===0?0:t;function ae(t,e){let[n,s,r,i,o,a]=t,[l,c,h,f,u,d]=e;return[_(n*l+r*c),_(s*l+i*c),_(n*h+r*f),_(s*h+i*f),_(n*u+r*d+o),_(s*u+i*d+a)]}function Zn(t,e,n){let s=e*Math.PI/180,r=Math.cos(s),i=Math.sin(s),[o,a]=n;return[_(r*o),_(i*o),_(-i*a),_(r*a),_(t[0]),_(t[1])]}function Ar(t){let[e,n,s,r,i,o]=t,a=e*r-n*s;if(a===0)return null;let l=r/a,c=-n/a,h=-s/a,f=e/a;return[_(l),_(c),_(h),_(f),_(-(l*i+h*o)),_(-(c*i+f*o))]}function Pr(t,e){return[t[0]*e[0]+t[2]*e[1]+t[4],t[1]*e[0]+t[3]*e[1]+t[5]]}function Mt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function _t(t,e){if(e instanceof ArrayBuffer)return`ab:${e.byteLength}`;if(ArrayBuffer.isView(e))return`view:${e.byteLength}`;if(typeof e!="function")return typeof e=="number"&&!Number.isFinite(e)?Number.isNaN(e)?"NaN":e>0?"Infinity":"-Infinity":e}function Mr(t,e){let n={};for(let[s,r]of Object.entries(t))n[s]=r;return t.op==="clip"||t.op==="fillPath"||t.op==="strokePath"?n.path=e[t.path]:t.op==="drawImage"&&(n.image=e[t.image]),n}var Bt=t=>JSON.stringify(t,_t);function bo(t,e){let n=[],s=new Set([...Object.keys(t),...Object.keys(e)]);for(let r of s)r!=="op"&&Bt(t[r])!==Bt(e[r])&&n.push({path:r,from:t[r],to:e[r]});return n}function ts(t,e){let n=[],s=Math.max(t.commands.length,e.commands.length);for(let i=0;i<s;i++){let o=t.commands[i],a=e.commands[i];if(o!==void 0&&a!==void 0){let l=Mr(o,t.resources),c=Mr(a,e.resources);if(Bt(l)===Bt(c))continue;o.op!==a.op?n.push({index:i,kind:"change",opA:o.op,opB:a.op,fields:[{path:"op",from:o.op,to:a.op}]}):n.push({index:i,kind:"change",opA:o.op,opB:a.op,fields:bo(l,c)})}else a!==void 0?n.push({index:i,kind:"add",opB:a.op,fields:[]}):o!==void 0&&n.push({index:i,kind:"remove",opA:o.op,fields:[]})}let r=t.size.w!==e.size.w||t.size.h!==e.size.h;return T({equal:n.length===0&&!r,deltas:n},r?{size:{from:t.size,to:e.size}}:{})}function Dr(t){var n,s,r,i;if(t.equal)return"DisplayLists are identical.";let e=[];t.size&&e.push(`size ${t.size.from.w}x${t.size.from.h} -> ${t.size.to.w}x${t.size.to.h}`);for(let o of t.deltas)if(o.kind==="add")e.push(`+ [${o.index}] add ${(n=o.opB)!=null?n:"?"}`);else if(o.kind==="remove")e.push(`- [${o.index}] remove ${(s=o.opA)!=null?s:"?"}`);else{let a=o.opA===o.opB?o.opA:`${(r=o.opA)!=null?r:"?"} -> ${(i=o.opB)!=null?i:"?"}`;e.push(`~ [${o.index}] ${a}`);for(let l of o.fields)e.push(` ${l.path}: ${Bt(l.from)} -> ${Bt(l.to)}`)}return e.join(`
2
- `)}var Fr=1;function zr(t){let e={dlSnapshotVersion:1,size:t.size,commands:t.commands,resources:t.resources};return JSON.stringify(e,_t,2)}var Xe=class extends Error{constructor(t){super(t),this.name="DlSnapshotError"}};function Lr(t){let e=JSON.parse(t);if(e.dlSnapshotVersion!==1)throw new Xe(`unsupported dlSnapshotVersion ${String(e.dlSnapshotVersion)}; this build reads 1`);if(!e.size||!Array.isArray(e.commands)||!Array.isArray(e.resources))throw new Xe("malformed .dl.json snapshot (need size, commands[], resources[])");return{size:e.size,commands:e.commands,resources:e.resources}}var Ft=class extends Error{constructor(t){super(t),this.name="FilterValidationError"}},Sr=new Set(["blur","drop-shadow","brightness","contrast","saturate"]);function es(t){for(let e of t){if(!Sr.has(e.kind))throw new Ft(`unknown filter kind '${String(e.kind)}' (have: ${[...Sr].join(", ")})`);if(e.kind==="blur"&&!(Number.isFinite(e.radius)&&e.radius>=0))throw new Ft(`blur radius must be \u2265 0, got ${String(e.radius)}`);if(e.kind==="drop-shadow"){if(![e.dx,e.dy,e.blur].every(Number.isFinite)||e.blur<0)throw new Ft("drop-shadow needs finite dx/dy and blur \u2265 0");if(typeof e.color!="string"||e.color.length===0)throw new Ft("drop-shadow needs a color string")}if((e.kind==="brightness"||e.kind==="contrast"||e.kind==="saturate")&&!(Number.isFinite(e.amount)&&e.amount>=0))throw new Ft(`${e.kind} amount must be \u2265 0, got ${String(e.amount)}`)}}function Ue(t){return t.length===0?"none":t.map(e=>{switch(e.kind){case"blur":return`blur(${e.radius}px)`;case"drop-shadow":return`drop-shadow(${e.dx}px ${e.dy}px ${e.blur}px ${e.color})`;default:return`${e.kind}(${e.amount})`}}).join(" ")}function Rr(t,e=16,n=2){let s=[];for(let r=0;r<Math.max(1,n);r++)s.push({kind:"drop-shadow",dx:0,dy:0,blur:e*(1+r*1.5),color:t});return s}function ko(t){switch(t.op){case"clip":case"fillPath":case"strokePath":return[t.path];case"drawImage":return[t.image];default:return[]}}function vo(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}function le(t){let e=[],n=[],s=new Map;return{push:r=>{r.op==="pushGroup"&&r.filters.length>0&&es(r.filters),e.push(r)},resource:r=>{let i=JSON.stringify(r),o=s.get(i);if(o!==void 0)return o;let a=n.length;return n.push(r),s.set(i,a),a},mark:()=>e.length,cacheKey:(r,i)=>{if(i<=r)return;let o=new Map,a=[],l=h=>{let f=o.get(h);return f===void 0&&(f=o.size,o.set(h,f),a.push(n[h])),f},c=e.slice(r,i).map(h=>ko(h).length===0?h:h.op==="drawImage"?z(T({},h),{image:l(h.image)}):z(T({},h),{path:l(h.path)}));return vo(JSON.stringify({c,r:a},_t))},patchCacheKey:(r,i)=>{let o=e[r];o&&o.op==="pushGroup"&&(o.cacheKey=i)},finish:()=>({commands:e,resources:n,size:t})}}var Ye=.5;function G(t){return Math.round(t/Ye)*Ye}var He=null;function Nr(t){He=t}function K(){return He!=null?He:ns}var ns={measureText(t,e){return{width:t.length*e.size*.52,ascent:e.size*.8,descent:e.size*.2}}},_e;function Ke(t){if(_e===void 0&&(_e=typeof Intl!="undefined"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"word"}):null),_e){let e=[..._e.segment(t)].map(s=>s.segment),n=[];for(let s of e)n.length>0&&/^[^\p{L}\p{N}\s]+$/u.test(s)?n[n.length-1]+=s:n.push(s);return n}return t.split(/(\s+)/).filter(e=>e.length>0)}var je;function xt(t){return je===void 0&&(je=typeof Intl!="undefined"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null),je?[...je.segment(t)].map(e=>e.segment):Array.from(t)}function at(t,e,n,s){let r=t.split(`
3
- `);if(n===void 0||n<=0)return r;let i=[];for(let o of r){let a=Ke(o),l="";for(let c of a){let h=l+c;l!==""&&G(s.measureText(h.trimEnd(),e).width)>n?(i.push(l.trimEnd()),l=c.trimStart()===""?"":c):l=h}i.push(l.trimEnd())}return i}var xo={center:[.5,.5],"top-left":[0,0],top:[.5,0],"top-right":[1,0],left:[0,.5],right:[1,.5],"bottom-left":[0,1],bottom:[.5,1],"bottom-right":[1,1]};function ss(t){if(typeof t=="string"){let e=xo[t];if(!e)throw new Error(`unknown anchor '${t}' (use a preset like 'top-left' or a [ax, ay] pair)`);return e}return[t[0],t[1]]}function oe(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}function Er(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}var ce,Cr,Q=(Cr=class{constructor(t={}){x(this,"id");x(this,"position");x(this,"rotation");x(this,"scale");x(this,"opacity");x(this,"blend");x(this,"zIndex");x(this,"filters");x(this,"anchor");x(this,"hasAnchor");x(this,"cache");x(this,"parent",null);U(this,ce,!1);x(this,"interactive",!1);x(this,"interactiveChildren",!0);x(this,"hitArea");x(this,"measurerSource",null);x(this,"localMatrix");x(this,"worldMatrix");x(this,"targets",new Map);var e;this.id=t.id,this.position=Er(Wt([0,0]),t.position),this.rotation=oe(C(0),t.rotation),this.scale=Er(Wt([1,1]),t.scale),this.opacity=oe(C(1),t.opacity),this.blend=oe(C("source-over"),t.blend),this.zIndex=oe(C(0),t.zIndex),this.filters=oe(C([]),t.filters),this.hasAnchor=t.anchor!==void 0,this.anchor=ss((e=t.anchor)!=null?e:"center"),this.cache=t.cache===!0,this.localMatrix=re(()=>{let n=Zn(this.position(),this.rotation(),this.scale()),[s,r]=this.anchorShift();return s===0&&r===0?n:ae(n,[1,0,0,1,s,r])},{equals:Mt}),this.worldMatrix=re(()=>this.parent?ae(this.parent.worldMatrix(),this.localMatrix()):this.localMatrix(),{equals:Mt}),this.registerTarget("position",this.position,"vec2"),this.registerTarget("position.x",this.position.x,"number"),this.registerTarget("position.y",this.position.y,"number"),this.registerTarget("rotation",this.rotation,"number"),this.registerTarget("scale",this.scale,"vec2"),this.registerTarget("scale.x",this.scale.x,"number"),this.registerTarget("scale.y",this.scale.y,"number"),this.registerTarget("opacity",this.opacity,"number"),this.registerTarget("zIndex",this.zIndex,"number")}registerTarget(t,e,n){e.expects=n,this.targets.set(t,e),this.id!==void 0&&(e[At]=`${this.id}/${t}`)}resolveTarget(t){return this.targets.get(t)}intrinsicSize(t){return null}drawOffset(t){var s,r,i;let e=(r=t!=null?t:(s=this.measurerSource)==null?void 0:s.call(this))!=null?r:K(),n=(i=this.intrinsicSize(e))!=null?i:{w:0,h:0};return{x:-n.w/2,y:-n.h/2}}flowOffset(t){var i,o;let e=(o=t!=null?t:(i=this.measurerSource)==null?void 0:i.call(this))!=null?o:K(),n=this.drawOffset(e),[s,r]=this.anchorShift(e);return{x:n.x+s,y:n.y+r}}anchorShift(t){var l,c;if(!this.hasAnchor)return[0,0];let[e,n]=this.anchor,s=(c=t!=null?t:(l=this.measurerSource)==null?void 0:l.call(this))!=null?c:K(),r=this.intrinsicSize(s);if(!r)return A(this,ce)||(H(this,ce,!0),B(`anchor set on a node without an intrinsic box${this.id?` ('${this.id}')`:""} \u2014 ignored (give it a sized node, or position children explicitly)`)),[0,0];let i=this.drawOffset(s),o=-(i.x+e*r.w),a=-(i.y+n*r.h);return[o===0?0:o,a===0?0:a]}requiresGroup(){return this.opacity()<1||this.blend()!=="source-over"||this.filters().length>0}groupShader(){}emit(t,e){let n=this.opacity();if(n<=0)return;let s=this.localMatrix(),r=Mt(s,St),i=this.groupShader(),o=this.requiresGroup()||i!==void 0||this.cache,a=this.cache&&t.mark!==void 0;t.push({op:"save"}),r||t.push({op:"transform",m:s});let l=-1;o&&(a&&(l=t.mark()),t.push(T({op:"pushGroup",opacity:n,blend:this.blend(),filters:this.filters()},i!==void 0?{shader:i}:{})));let c=a?t.mark():-1;if(this.draw(t,e),o){if(a){let h=t.cacheKey(c,t.mark());h!==void 0&&t.patchCacheKey(l,h)}t.push({op:"popGroup"})}t.push({op:"restore"})}},ce=new WeakMap,Cr),Tr=["marker","crayon","pencil","ink","chalk"],dt=class extends Error{constructor(t){super(t),this.name="SketchValidationError"}};function rs(t){if(!Tr.includes(t.kind))throw new dt(`unknown sketch kind '${String(t.kind)}' (have: ${Tr.join(", ")})`);if(t.width!==void 0&&!(t.width>0))throw new dt(`sketch width must be > 0, got ${String(t.width)}`);if(t.roughness!==void 0&&!(t.roughness>=0))throw new dt(`sketch roughness must be \u2265 0, got ${String(t.roughness)}`);if((t.kind==="crayon"||t.kind==="pencil")&&t.passes!==void 0&&!(t.passes>=1))throw new dt(`sketch passes must be \u2265 1, got ${String(t.passes)}`);if(t.kind==="chalk"&&t.dash!==void 0&&(!Array.isArray(t.dash)||t.dash.some(e=>!(e>=0))))throw new dt("sketch chalk dash must be an array of non-negative numbers")}function is(t){var e,n,s,r,i,o,a,l,c,h,f,u,d;switch(t.kind){case"marker":return{width:(e=t.width)!=null?e:8,roughness:(n=t.roughness)!=null?n:1.2,passes:2};case"crayon":return{width:(s=t.width)!=null?s:4,roughness:(r=t.roughness)!=null?r:2.4,passes:(i=t.passes)!=null?i:3};case"pencil":return{width:(o=t.width)!=null?o:1.5,roughness:(a=t.roughness)!=null?a:1,passes:(l=t.passes)!=null?l:2};case"ink":return{width:(c=t.width)!=null?c:2.5,roughness:(h=t.roughness)!=null?h:.8,passes:1};case"chalk":return{width:(f=t.width)!=null?f:3,roughness:(u=t.roughness)!=null?u:1.6,passes:1,dash:(d=t.dash)!=null?d:[6,5]}}}var Mo=(t,e,n,s,r)=>{let i=1-r,o=i*i*i,a=3*i*i*r,l=3*i*r*r,c=r*r*r;return[o*t[0]+a*e[0]+l*n[0]+c*s[0],o*t[1]+a*e[1]+l*n[1]+c*s[1]]},So=(t,e,n,s)=>{let r=1-s;return[r*r*t[0]+2*r*s*e[0]+s*s*n[0],r*r*t[1]+2*r*s*e[1]+s*s*n[1]]},Kn=(t,e,n,s,r,i)=>{let o=n*Math.cos(i),a=s*Math.sin(i),l=Math.cos(r),c=Math.sin(r);return[t+o*l-a*c,e+o*c+a*l]};function he(t,e=16){let n=[],s=null,r=0,i=0,o=0,a=0,l=(c,h)=>(s||(s={points:[[c,h]],closed:!1},n.push(s),o=c,a=h),s);for(let c of t)switch(c[0]){case"M":s={points:[[c[1],c[2]]],closed:!1},n.push(s),r=o=c[1],i=a=c[2];break;case"L":l(r,i).points.push([c[1],c[2]]),r=c[1],i=c[2];break;case"C":{let h=l(r,i);for(let f=1;f<=e;f++)h.points.push(Mo([r,i],[c[1],c[2]],[c[3],c[4]],[c[5],c[6]],f/e));r=c[5],i=c[6];break}case"Q":{let h=l(r,i);for(let f=1;f<=e;f++)h.points.push(So([r,i],[c[1],c[2]],[c[3],c[4]],f/e));r=c[3],i=c[4];break}case"E":{let[,h,f,u,d,m,p,v]=c,w=Kn(h,f,u,d,m,p),y=l(w[0],w[1]);for(let k=1;k<=e;k++)y.points.push(Kn(h,f,u,d,m,p+(v-p)*(k/e)));let g=Kn(h,f,u,d,m,v);r=g[0],i=g[1];break}case"Z":s&&(s.points.push([o,a]),s.closed=!0,r=o,i=a);break}return n.filter(c=>c.points.length>0)}function os(t){let e=0;for(let n=1;n<t.points.length;n++)e+=Math.hypot(t.points[n][0]-t.points[n-1][0],t.points[n][1]-t.points[n-1][1]);return e}function as(t){if(!(t.gap>0))throw new dt(`hachure gap must be > 0, got ${String(t.gap)}`);if(t.roughness!==void 0&&!(t.roughness>=0))throw new dt(`hachure roughness must be \u2265 0, got ${String(t.roughness)}`)}function cs(t,e,n){var I;let s=he(t),r=1/0,i=1/0,o=-1/0,a=-1/0;for(let b of s)for(let[M,S]of b.points)M<r&&(r=M),S<i&&(i=S),M>o&&(o=M),S>a&&(a=S);if(!Number.isFinite(r))return[];let l=(r+o)/2,c=(i+a)/2,h=Math.cos(e.angleRad),f=Math.sin(e.angleRad),u=(b,M)=>[(b-l)*h+(M-c)*f,-(b-l)*f+(M-c)*h],d=(b,M)=>[l+b*h-M*f,c+b*f+M*h],m=1/0,p=1/0,v=-1/0,w=-1/0,y=[[r,i],[o,i],[o,a],[r,a]];for(let[b,M]of y){let[S,$]=u(b,M);S<m&&(m=S),$<p&&(p=$),S>v&&(v=S),$>w&&(w=$)}let g=(I=e.roughness)!=null?I:1,k=()=>(n()*2-1)*g,E=[];for(let b=p+e.gap/2;b<w;b+=e.gap){let M=d(m,b+k()),S=d(v,b+k());E.push(["M",M[0],M[1]],["L",S[0],S[1]])}return E}function Qe(t,e,n){let s=is(e),r=he(t),i=()=>(n()*2-1)*s.roughness,o=[];for(let a=0;a<s.passes;a++){let l=[];for(let c of r){let h=c.points;if(h.length<2)continue;let f=h[0][0]+i(),u=h[0][1]+i();l.push(["M",f,u]);for(let d=1;d<h.length;d++){let m=h[d][0]+i(),p=h[d][1]+i(),v=m-f,w=p-u,y=Math.hypot(v,w)||1,g=i()*.5,k=(f+m)/2+-w/y*g,E=(u+p)/2+v/y*g;l.push(["Q",k,E,m,p]),f=m,u=p}}o.push(l)}return{strokes:o,resolved:s}}function ls(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}function Vr(t,e,n){return Qe(t,e,ot(n>>>0)).strokes}var qr=class extends Q{};function jt(t,e,n,s,r){if(r<=0)return[["M",t,e],["L",t+n,e],["L",t+n,e+s],["L",t,e+s],["Z"]];let i=Math.PI/2;return[["M",t+r,e],["L",t+n-r,e],["E",t+n-r,e+r,r,r,0,-i,0],["L",t+n,e+s-r],["E",t+n-r,e+s-r,r,r,0,0,i],["L",t+r,e+s],["E",t+r,e+s-r,r,r,0,i,Math.PI],["L",t,e+r],["E",t+r,e+r,r,r,0,Math.PI,Math.PI+i],["Z"]]}var vt,Or,Et=(Or=class extends Q{constructor(e={}){var n;super(e);x(this,"children");U(this,vt,C(0));this.children=(n=e.children)!=null?n:[];for(let s of this.children)s.parent=this}trackStructure(){A(this,vt).call(this)}add(e){return e.parent=this,this.children.push(e),A(this,vt).set(A(this,vt).peek()+1),this}remove(e){let n=this.children.indexOf(e);return n>=0&&(this.children.splice(n,1),e.parent===this&&(e.parent=null),A(this,vt).set(A(this,vt).peek()+1)),this}draw(e,n){let s=this.children.map((r,i)=>({node:r,i})).sort((r,i)=>r.node.zIndex()-i.node.zIndex()||r.i-i.i).map(r=>r.node);for(let r of s)r.emit(e,n)}},vt=new WeakMap,Or);function Ir(t){return typeof t=="string"?{kind:"color",color:t}:t}var hs=class extends Q{constructor(e={}){var n;super(e);x(this,"fill");x(this,"stroke");x(this,"strokeWidth");x(this,"sketch");x(this,"sketchFill");x(this,"sketchSeed");x(this,"reveal");this.fill=j(C(""),e.fill),this.stroke=j(C(""),e.stroke),this.strokeWidth=j(C(0),e.strokeWidth),this.reveal=j(C(1),e.reveal),this.registerTarget("fill",this.fill,["color","paint"]),this.registerTarget("stroke",this.stroke,"color"),this.registerTarget("strokeWidth",this.strokeWidth,"number"),this.registerTarget("reveal",this.reveal,"number"),e.sketch&&rs(e.sketch),e.sketchFill&&as(e.sketchFill),e.sketchFill&&!e.sketch&&B(`${this.id!==void 0?`'${this.id}': `:""}sketchFill is ignored without sketch \u2014 hachure fill is drawn only by the sketch renderer. Set a sketch style (e.g. { kind: 'pencil' }) to see it.`),this.sketch=e.sketch,this.sketchFill=e.sketchFill,this.sketchSeed=(n=e.sketchSeed)!=null?n:this.id!==void 0?ls(this.id):0}draw(e){let n=this.pathSegs();if(this.sketch)return this.drawSketch(e,n);let s=e.resource({kind:"path",segs:n}),r=this.fill();r&&e.push({op:"fillPath",path:s,paint:Ir(r)});let i=this.stroke(),o=this.strokeWidth();if(i&&o>0){let a=this.reveal();a<1?$r(e,n,{kind:"color",color:i},{width:o},a):e.push({op:"strokePath",path:s,paint:{kind:"color",color:i},stroke:{width:o}})}}drawSketch(e,n){let s=ot(this.sketchSeed>>>0),r=this.fill();if(r){let h=e.resource({kind:"path",segs:n});e.push({op:"fillPath",path:h,paint:Ir(r)})}let{strokes:i,resolved:o}=Qe(n,this.sketch,s),a=this.stroke()||(typeof r=="string"?r:"")||"#000000";if(this.sketchFill){let h=e.resource({kind:"path",segs:n});e.push({op:"save"}),e.push({op:"clip",path:h,rule:"nonzero"});let f=cs(n,this.sketchFill,s);if(f.length>0){let u=e.resource({kind:"path",segs:f});e.push({op:"strokePath",path:u,paint:{kind:"color",color:a},stroke:{width:Math.max(1,o.width*.5),cap:"round"}})}e.push({op:"restore"})}let l=this.reveal(),c=l<1;for(let h of i){if(h.length===0)continue;if(c){$r(e,h,{kind:"color",color:a},{width:o.width,cap:"round",join:"round"},l);continue}let f=e.resource({kind:"path",segs:h});e.push({op:"strokePath",path:f,paint:{kind:"color",color:a},stroke:T({width:o.width,cap:"round",join:"round"},o.dash?{dash:o.dash}:{})})}}};function j(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}function Eo(t){let e=[],n=null;for(let s of t)s[0]==="M"?(n=[s],e.push(n)):n&&n.push(s);return e}function $r(t,e,n,s,r){for(let i of Eo(e)){let o=he(i).reduce((l,c)=>l+os(c),0),a=t.resource({kind:"path",segs:i});t.push({op:"strokePath",path:a,paint:n,stroke:z(T({},s),{dash:[o,o],dashOffset:o*(1-r)})})}}function Ge(t){if(t===void 0)return[];if(Array.isArray(t)&&t.every(e=>typeof e=="object"&&e!==null&&Array.isArray(e.v)&&Array.isArray(e.in)&&Array.isArray(e.out)))return t;throw new TypeError(`Path.data expects PathValue (PathContour[]); for an SVG path 'd' string, parse it with pathFromSvg(d) from "@glissade/scene/path" (or window.glissade.pathFromSvg in the browser bundle)`)}function Je(t){let e=[],n=null,s=(i,o=[0,0],a=[0,0])=>{n.v.push(i),n.in.push(o),n.out.push(a)},r=()=>n.v[n.v.length-1];for(let i of t)switch(i[0]){case"M":n={closed:!1,v:[[i[1],i[2]]],in:[[0,0]],out:[[0,0]]},e.push(n);break;case"L":n&&s([i[1],i[2]]);break;case"C":if(n){let o=r();n.out[n.out.length-1]=[i[1]-o[0],i[2]-o[1]],s([i[5],i[6]],[i[3]-i[5],i[4]-i[6]])}break;case"Q":if(n){let o=r(),a=i[1],l=i[2],c=i[3],h=i[4];n.out[n.out.length-1]=[2/3*(a-o[0]),2/3*(l-o[1])],s([c,h],[2/3*(a-c),2/3*(l-h)])}break;case"E":if(n){let[,o,a,l,c,h,f,u]=i,d=Math.cos(h),m=Math.sin(h);for(let p=1;p<=16;p++){let v=f+(u-f)*(p/16),w=l*Math.cos(v),y=c*Math.sin(v);s([o+w*d-y*m,a+w*m+y*d])}}break;case"Z":if(n){n.closed=!0;let o=n.v[0],a=r();n.v.length>1&&Math.abs(o[0]-a[0])<1e-9&&Math.abs(o[1]-a[1])<1e-9&&(n.in[0]=n.in[n.in.length-1],n.v.pop(),n.in.pop(),n.out.pop())}break}return e}var Wr=class extends hs{constructor(e={}){super(e);x(this,"width");x(this,"height");x(this,"cornerRadius");this.width=j(C(0),e.width),this.height=j(C(0),e.height),this.cornerRadius=j(C(0),e.cornerRadius),this.registerTarget("width",this.width,"number"),this.registerTarget("height",this.height,"number"),this.registerTarget("cornerRadius",this.cornerRadius,"number")}intrinsicSize(){return{w:this.width(),h:this.height()}}pathSegs(){let e=this.width(),n=this.height(),s=Math.min(Math.max(0,this.cornerRadius()),e/2,n/2);return jt(-e/2,-n/2,e,n,s)}},Br=class extends hs{constructor(e={}){super(e);x(this,"radius");this.radius=j(C(0),e.radius),this.registerTarget("radius",this.radius,"number")}intrinsicSize(){let e=this.radius()*2;return{w:e,h:e}}pathSegs(){let e=this.radius();return[["E",0,0,e,e,0,0,Math.PI*2],["Z"]]}},us=class extends hs{constructor(e={}){super(e);x(this,"data");let n=e.data,s=typeof n=="function"?()=>Ge(n()):n!==void 0?Ge(n):void 0;this.data=j(C([]),s),this.registerTarget("d",this.data,"path")}bounds(){let e=1/0,n=1/0,s=-1/0,r=-1/0;for(let i of this.data())for(let o=0;o<i.v.length;o++){let a=i.v[o][0],l=i.v[o][1],c=[[a,l],[a+i.in[o][0],l+i.in[o][1]],[a+i.out[o][0],l+i.out[o][1]]];for(let h of c)h[0]<e&&(e=h[0]),h[1]<n&&(n=h[1]),h[0]>s&&(s=h[0]),h[1]>r&&(r=h[1])}return e>s?{minX:0,minY:0,maxX:0,maxY:0}:{minX:e,minY:n,maxX:s,maxY:r}}intrinsicSize(){let e=this.bounds();return{w:e.maxX-e.minX,h:e.maxY-e.minY}}drawOffset(){let e=this.bounds();return{x:e.minX,y:e.minY}}pathSegs(){let e=[];for(let n of this.data()){let s=n.v.length;if(s!==0){e.push(["M",n.v[0][0],n.v[0][1]]);for(let r=0;r<s-1;r++)e.push(["C",n.v[r][0]+n.out[r][0],n.v[r][1]+n.out[r][1],n.v[r+1][0]+n.in[r+1][0],n.v[r+1][1]+n.in[r+1][1],n.v[r+1][0],n.v[r+1][1]]);n.closed&&s>1&&(e.push(["C",n.v[s-1][0]+n.out[s-1][0],n.v[s-1][1]+n.out[s-1][1],n.v[0][0]+n.in[0][0],n.v[0][1]+n.in[0][1],n.v[0][0],n.v[0][1]]),e.push(["Z"]))}}return e}},Qn,_r=(Qn=class extends Q{constructor(e){super(e);x(this,"assetId");x(this,"width");x(this,"height");this.assetId=e.assetId,this.width=j(C(0),e.width),this.height=j(C(0),e.height),this.registerTarget("width",this.width,"number"),this.registerTarget("height",this.height,"number")}intrinsicSize(){return{w:this.width(),h:this.height()}}draw(e){let n=this.width(),s=this.height();if(n<=0||s<=0)return;let r=e.resource({kind:"image",assetId:this.assetId});e.push({op:"drawImage",image:r,dst:{x:-n/2,y:-s/2,w:n,h:s}})}},x(Qn,"assetKind","image"),Qn),Jn,jr=(Jn=class extends Q{constructor(e){var n,s,r;super(e);x(this,"assetId");x(this,"at");x(this,"trimStart");x(this,"playbackRate");x(this,"clipDuration");x(this,"sourceFps");x(this,"width");x(this,"height");this.assetId=e.assetId,this.at=(n=e.at)!=null?n:0,this.trimStart=(s=e.trimStart)!=null?s:0,this.playbackRate=(r=e.playbackRate)!=null?r:1,this.clipDuration=e.clipDuration,this.sourceFps=e.sourceFps,this.width=j(C(0),e.width),this.height=j(C(0),e.height),this.registerTarget("width",this.width,"number"),this.registerTarget("height",this.height,"number")}mediaTime(e){let n=(e-this.at)*this.playbackRate;if(n<0||this.clipDuration!==void 0&&e-this.at>=this.clipDuration)return null;let s=this.trimStart+n;return this.sourceFps!==void 0?Math.floor(s*this.sourceFps+1e-9)/this.sourceFps:s}draw(e,n){let s=this.mediaTime(n.time);if(s===null)return;let r=this.width(),i=this.height();if(r<=0||i<=0)return;let o=e.resource({kind:"videoFrame",assetId:this.assetId,mediaT:s});e.push({op:"drawImage",image:o,dst:{x:-r/2,y:-i/2,w:r,h:i}})}},x(Jn,"assetKind","video"),Jn),Ze=class extends Q{constructor(e={}){var n,s,r,i,o;super(e);x(this,"text");x(this,"fill");x(this,"fontSize");x(this,"fontFamily");x(this,"fontWeight");x(this,"fontStyle");x(this,"align");x(this,"width");x(this,"lineHeight");x(this,"reveal");this.text=j(C(""),e.text),this.fill=j(C("#000000"),e.fill),this.fontSize=j(C(16),e.fontSize),this.fontFamily=(n=e.fontFamily)!=null?n:"sans-serif",this.fontWeight=(s=e.fontWeight)!=null?s:400,this.fontStyle=(r=e.fontStyle)!=null?r:"normal",this.align=(i=e.align)!=null?i:"left",this.width=j(C(0),e.width),this.lineHeight=(o=e.lineHeight)!=null?o:1.25,this.reveal=j(C(Number.POSITIVE_INFINITY),e.reveal),this.registerTarget("width",this.width,"number"),this.registerTarget("text",this.text,"string"),this.registerTarget("fill",this.fill,"color"),this.registerTarget("fontSize",this.fontSize,"number"),this.registerTarget("reveal",this.reveal,"number")}intrinsicSize(e){let n=this.text();if(!n)return{w:0,h:0};let s=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),r=this.width(),i=at(n,s,r>0?r:void 0,e),o=Math.max(...i.map(a=>G(e.measureText(a,s).width)),0);return{w:r>0?r:o,h:G(s.size*this.lineHeight)*i.length}}drawOffset(e){var a,l,c;let n=(l=e!=null?e:(a=this.measurerSource)==null?void 0:a.call(this))!=null?l:K(),s=this.intrinsicSize(n),r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=(c=at(this.text(),r,this.width()>0?this.width():void 0,n)[0])!=null?c:"",o=n.measureText(i,r).ascent;return{x:this.align==="left"?0:this.align==="center"?-s.w/2:-s.w,y:-o}}measuredSize(e){var n,s;return this.intrinsicSize((s=e!=null?e:(n=this.measurerSource)==null?void 0:n.call(this))!=null?s:K())}lineBoxes(e){var c,h;let n=(h=e!=null?e:(c=this.measurerSource)==null?void 0:c.call(this))!=null?h:K(),s=this.text();if(!s)return[];let r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=this.width(),o=at(s,r,i>0?i:void 0,n),a=G(r.size*this.lineHeight),l=[];for(let f=0;f<o.length;f++){let u=o[f];if(!u)continue;let d=n.measureText(u,r),m=G(d.width),p=this.align==="left"?0:this.align==="center"?-m/2:-m;l.push({text:u,x:p,y:f*a-d.ascent,w:m,h:d.ascent+d.descent})}return l}wordBoxes(e){var c,h;let n=(h=e!=null?e:(c=this.measurerSource)==null?void 0:c.call(this))!=null?h:K(),s=this.text();if(!s)return[];let r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=this.width(),o=at(s,r,i>0?i:void 0,n),a=G(r.size*this.lineHeight),l=[];for(let f=0;f<o.length;f++){let u=o[f];if(!u)continue;let d=n.measureText(u,r),m=G(d.width),p=this.align==="left"?0:this.align==="center"?-m/2:-m,v=f*a-d.ascent,w=d.ascent+d.descent,y="";for(let g of Ke(u)){let k=y;y+=g;let E=g.trim();if(E==="")continue;let I=g.length-g.trimStart().length,b=n.measureText(k+g.slice(0,I),r).width,M=n.measureText(k+g.trimEnd(),r).width;l.push({text:E,line:f,x:p+b,y:v,w:M-b,h:w})}}return l}graphemes(e){var l,c;let n=(c=e!=null?e:(l=this.measurerSource)==null?void 0:l.call(this))!=null?c:K(),s=this.text();if(!s)return[];let r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=this.width(),o=at(s,r,i>0?i:void 0,n),a=[];for(let h of o)for(let f of xt(h))a.push(f);return a}revealHead(e){var u,d,m;let n=(d=e!=null?e:(u=this.measurerSource)==null?void 0:u.call(this))!=null?d:K(),s=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),r=this.width(),i=at(this.text(),s,r>0?r:void 0,n),o=G(s.size*this.lineHeight),a=i.reduce((p,v)=>p+xt(v).length,0),l=this.reveal(),c=Math.max(0,Math.min(Number.isFinite(l)?Math.floor(l):a,a)),h=c,f={x:0,y:0,h:0,line:0,index:c};for(let p=0;p<i.length;p++){let v=(m=i[p])!=null?m:"",w=n.measureText(v,s),y=G(w.width),g=this.align==="left"?0:this.align==="center"?-y/2:-y,k=p*o-w.ascent,E=w.ascent+w.descent,I=xt(v);if(h<=I.length)return{x:g+(h<=0?0:n.measureText(I.slice(0,h).join(""),s).width),y:k,h:E,line:p,index:c};h-=I.length,f={x:g+w.width,y:k,h:E,line:p,index:c}}return f}draw(e,n){let s=this.text();if(!s)return;let r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=this.width(),o=at(s,r,i>0?i:void 0,n.measurer),a=G(r.size*this.lineHeight),l=this.reveal(),c=Number.isFinite(l),h=c?Math.max(0,Math.floor(l)):0;for(let f=0;f<o.length;f++){let u=o[f];if(!u)continue;if(!c){e.push(T({op:"fillText",text:u,font:r,paint:{kind:"color",color:this.fill()},x:0,y:f*a},this.align!=="left"?{align:this.align}:{}));continue}if(h<=0)break;let d=xt(u),m=Math.min(h,d.length);if(h-=m,m===d.length)e.push(T({op:"fillText",text:u,font:r,paint:{kind:"color",color:this.fill()},x:0,y:f*a},this.align!=="left"?{align:this.align}:{}));else{let p=G(n.measurer.measureText(u,r).width),v=this.align==="left"?0:this.align==="center"?-p/2:-p;e.push({op:"fillText",text:d.slice(0,m).join(""),font:r,paint:{kind:"color",color:this.fill()},x:v,y:f*a})}}}};function Hr(t,e,n){var u,d;let s=(d=n!=null?n:(u=t.measurerSource)==null?void 0:u.call(t))!=null?d:K(),r=t.text();if(!r)return[];let i=T({family:t.fontFamily,size:t.fontSize(),weight:t.fontWeight},t.fontStyle==="italic"?{style:"italic"}:{}),o=t.width(),a=at(r,i,o>0?o:void 0,s),l=G(i.size*t.lineHeight),c=e.keys,h=[],f=0;for(let m=0;m<a.length;m++){let p=a[m];if(!p)continue;let v=s.measureText(p,i),w=G(v.width),y=t.align==="left"?0:t.align==="center"?-w/2:-w,g=m*l-v.ascent,k="";for(let E of xt(p)){k+=E;let I=f+1,b=Number.POSITIVE_INFINITY;for(let M of c)if(M.value>=I){b=M.t;break}Number.isFinite(b)&&h.push({charIndex:f,grapheme:E,time:b,x:y+s.measureText(k,i).width,y:g,line:m}),f++}}return h}var fs=class extends Error{constructor(){super("a Layout node was evaluated but no LayoutEngine is registered \u2014 await loadYogaLayoutEngine() from '@glissade/scene/layout' before mounting/rendering (the engine is wasm and loads async; evaluate() never awaits, \xA72.5)"),this.name="LayoutEngineMissingError"}},tn=null;function Xr(t){tn=t}function Yr(){return tn}function Gr(){if(!tn)throw new fs;return tn}var To=["Group","Rect","Circle","Path","Text","Image","Video","Layout","Custom"],si=class extends Q{constructor(e){var n,s;super(e);x(this,"target");x(this,"color");x(this,"progress");x(this,"padding");x(this,"cornerRadius");this.target=e.text,this.color=Ur(C("#ffe066"),e.color),this.progress=Ur(C(1),e.progress),this.padding=(n=e.padding)!=null?n:[4,2],this.cornerRadius=(s=e.cornerRadius)!=null?s:4,this.registerTarget("progress",this.progress,"number"),this.registerTarget("color",this.color,"color")}draw(e,n){let s=Math.min(1,Math.max(0,this.progress()));if(s<=0)return;let[r,i]=this.padding,o=this.target.lineBoxes(n.measurer).map(f=>({x:f.x-r,y:f.y-i,w:f.w+2*r,h:f.h+2*i})),a=o.reduce((f,u)=>f+u.w,0);if(a<=0)return;let l=this.target.localMatrix();Mt(l,St)||e.push({op:"transform",m:l});let c=this.color(),h=s*a;for(let f of o){let u=Math.min(f.w,h);if(h-=u,u<=0)break;let d=Math.min(this.cornerRadius,u/2,f.h/2),m=e.resource({kind:"path",segs:jt(f.x,f.y,u,f.h,d)});if(e.push({op:"fillPath",path:m,paint:{kind:"color",color:c}}),h<=0)break}}};function Io(t,e={}){return new si(z(T({},e),{text:t}))}function Ur(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}var ri=class extends Q{constructor(e){var n,s,r,i;super(e);x(this,"target");x(this,"blinkPeriod");x(this,"blinkPhase");x(this,"solidWhileTyping");x(this,"caretWidth");x(this,"fill");this.target=e.text,this.blinkPeriod=(n=e.blinkPeriod)!=null?n:1.06,this.blinkPhase=(s=e.blinkPhase)!=null?s:0,this.solidWhileTyping=(r=e.solidWhileTyping)!=null?r:!0,this.caretWidth=(i=e.width)!=null?i:2,this.fill=Co(C(""),e.fill),this.registerTarget("fill",this.fill,"color")}draw(e,n){let s=this.target.revealHead(n.measurer);if(s.h<=0)return;let r=!0,i=this.target.graphemes(n.measurer).length,o=s.index<i;if(!(this.solidWhileTyping&&o)){let h=this.blinkPeriod>0?this.blinkPeriod:1;r=((n.time-this.blinkPhase)%h+h)%h<h/2}if(!r)return;let a=this.target.localMatrix();Mt(a,St)||e.push({op:"transform",m:a});let l=this.fill()||this.target.fill(),c=e.resource({kind:"path",segs:jt(s.x,s.y,this.caretWidth,s.h,0)});e.push({op:"fillPath",path:c,paint:{kind:"color",color:l}})}};function $o(t,e={}){return new ri(z(T({},e),{text:t}))}function Co(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}var Oo=.06;function Ao(t,e,n={}){var f,u,d,m;let s=(f=n.start)!=null?f:0,r=(u=n.perChar)!=null?u:Oo,i=(d=n.gap)!=null?d:0,o=s,a=[],l=[O(s,"",{interp:"hold"})],c=[],h=[];for(let p=0;p<e.length;p++){let v=e[p],w=o,y=(m=v.perChar)!=null?m:r;if(v.type!==void 0)for(let g of xt(v.type)){o+=y,a.push(g);let k=a.join("");l.push(O(o,k,{interp:"hold"})),c.push({time:o,kind:"insert",grapheme:g,value:k})}if(v.delete!==void 0)for(let g=0;g<v.delete&&a.length>0;g++){o+=y;let k=a.pop(),E=a.join("");l.push(O(o,E,{interp:"hold"})),c.push({time:o,kind:"delete",grapheme:k,value:E})}v.hold!==void 0&&(o+=v.hold),h.push({index:p,start:w,end:o,value:a.join("")}),i>0&&p<e.length-1&&(o+=i)}return{track:wt(t,"string",l),marks:c,steps:h,duration:o}}var Ht=class extends Error{constructor(t){super(t),this.name="EachError"}};function ds(t,e){let n=(t^Math.imul(e+1,2654435769))>>>0;return n=Math.imul(n^n>>>16,569420461),n=Math.imul(n^n>>>15,1935289751),(n^n>>>15)>>>0}var Po=1779033703;function Do(t,e,n){var s,r,i,o,a,l,c,h,f,u,d,m;if(typeof t=="function")return t(e,n);switch(t.kind){case"row":{let p=(s=t.gap)!=null?s:n>1?1/(n-1):0,v=(r=t.align)!=null?r:.5,w=.5-p*(n-1)/2;return[n===1?.5:w+p*e,v]}case"column":{let p=(i=t.gap)!=null?i:n>1?1/(n-1):0,v=(o=t.align)!=null?o:.5,w=.5-p*(n-1)/2;return[v,n===1?.5:w+p*e]}case"grid":{let p=t.cols;if(!(p>=1))throw new Ht(`grid layout needs cols >= 1 (got ${p})`);let v=(a=t.rows)!=null?a:Math.ceil(n/p),w=(l=t.order)!=null?l:"row",y=w==="row"?e%p:Math.floor(e/v),g=w==="row"?Math.floor(e/p):e%v,k=(c=t.gapX)!=null?c:p>1?1/(p-1):0,E=(h=t.gapY)!=null?h:v>1?1/(v-1):0,I=k*(p-1),b=E*(v-1);return[p===1?.5:.5-I/2+k*y,v===1?.5:.5-b/2+E*g]}case"ring":{let p=(f=t.radius)!=null?f:.5,[v,w]=(u=t.center)!=null?u:[.5,.5],y=((d=t.startAngle)!=null?d:-Math.PI/2)+((m=t.sweep)!=null?m:Math.PI*2)*(n===0?0:e/n);return[v+p*Math.cos(y),w+p*Math.sin(y)]}}}function Fo(t,e,n){let s=(n-1)/2;switch(t){case"from-center":return r=>Math.abs(r-s)*e;case"from-edges":return r=>(s-Math.abs(r-s))*e;case"delay":return r=>r*e}}function zo(t,e){var s,r;let n=(s=t.stagger)!=null?s:0;return typeof n=="function"?n:Fo((r=t.distribute)!=null?r:"delay",n,e)}function Lo(t,e,n){var d,m,p,v,w,y;if(!Number.isInteger(t)||t<0)throw new Ht(`each() count must be a non-negative integer (got ${t})`);let s=((d=n.seed)!=null?d:ls(n.id))>>>0,r=n.box,[i,o]=(m=r==null?void 0:r.origin)!=null?m:[0,0],a=[],l=[],c=new Set;for(let g=0;g<t;g++){let k=`${n.id}/${g}`,E=Do(n.layout,g,t),I={i:g,n:t,id:k,place:E,rng:ot(ds(s,g)),seed:s},b=e(g,I);if(!(b instanceof Q))throw new Ht(`each() factory must return a Node for index ${g} (got ${typeof b})`);if(c.has(b))throw new Ht(`each() factory returned the same Node instance for index ${g} \u2014 the factory must construct a new node per index (it is called once per clone)`);if(c.add(b),b.id===void 0)b.id=k;else if(b.id!==k)throw new Ht(`each() factory set id '${b.id}' on index ${g}, but each owns the id namespace \u2014 leave it unset so it becomes '${k}'`);a.push(b),l.push(r?{frac:E,px:[i+E[0]*r.w,o+E[1]*r.h]}:{frac:E})}let h=new Et({id:n.id,children:a}),f=[],u=(v=(p=n.motion)==null?void 0:p.startSec)!=null?v:0;if(n.motion){let g=n.motion,k=(w=g.startSec)!=null?w:0,E=zo(g,t);for(let I=0;I<t;I++){let b=ot(ds(ds(s,I),Po)),M=(y=g.jitter)==null?void 0:y.call(g,I,b,t),S=T(T({},M!==void 0?{overrides:M}:{}),g.speed!==void 0?{speed:g.speed}:{}),$=g.clip.apply(`${n.id}/${I}`,k+E(I),S);f.push(...$.tracks),$.end>u&&(u=$.end)}}return{node:h,children:a,tracks:f,end:u,places:l}}function ii(t,e={}){var i,o,a;let n=(i=e.start)!=null?i:0,s=(o=e.duration)!=null?o:1,r=(a=e.ease)!=null?a:"easeInOutCubic";return wt(`${t}/reveal`,"number",[O(n,0),O(n+s,1,r)])}function Ro(t,e={}){var s,r;let n=(r=e.delay)!=null?r:((s=e.duration)!=null?s:1)*.6;return Pe(t.map(i=>ii(i,e)),n)}var oi=class extends Error{constructor(t){super(`'${t}' was called inside evaluate() \u2014 scene code must be a pure function of time (\xA75.5). Read ctx.time/frame, use the seeded random(seed) from @glissade/core, and resolve assets before rendering.`),this.name="DeterminismViolationError"}};function No(){let t=globalThis,e=[{target:Math,key:"random",label:"Math.random"},{target:Date,key:"now",label:"Date.now"},{target:t,key:"setTimeout",label:"setTimeout"},{target:t,key:"setInterval",label:"setInterval"}];return typeof performance!="undefined"&&e.push({target:performance,key:"now",label:"performance.now"}),typeof t.requestAnimationFrame=="function"&&e.push({target:t,key:"requestAnimationFrame",label:"requestAnimationFrame"}),e}function Vo(t,e){if(t==="off")return e();let n=No(),s=n.map(i=>i.target[i.key]),r=new Set;n.forEach((i,o)=>{i.target[i.key]=(...a)=>{if(t==="throw")throw new oi(i.label);return r.has(i.label)||(r.add(i.label),B(`${i.label} called inside evaluate() \u2014 nondeterministic, not reproducible on export (\xA75.5)`)),s[o].apply(i.target,a)}});try{return e()}finally{n.forEach((i,o)=>{i.target[i.key]=s[o]})}}var ai=class extends Error{constructor(t){super(`duplicate node id '${t}' \u2014 explicit ids must be unique (\xA73.1/\xA76.5)`),this.name="DuplicateNodeIdError"}},ci=class extends Error{constructor(t){super(`node id '${t}' uses the reserved '~' prefix \u2014 that namespace is for structural fallback ids (\xA76.5), which are inspection-only and never track targets; choose another id`),this.name="ReservedNodeIdError"}};function li(t,e,n){if(t.measurerSource=n,t.id!==void 0){if(t.id.startsWith("~"))throw new ci(t.id);if(e.has(t.id))throw new ai(t.id);e.set(t.id,t)}if(t instanceof Et)for(let s of t.children)li(s,e,n)}function qo(t){let e=new Et({id:"__root",children:t.children}),n=new Map,s=Be(),r=C(null);return li(e,n,()=>{var i;return(i=r())!=null?i:K()}),{root:e,nodes:n,size:t.size,playhead:s,resolveTarget:i=>{for(let o=i.lastIndexOf("/");o>0;o=i.lastIndexOf("/",o-1)){let a=n.get(i.slice(0,o));if(a)return a.resolveTarget(i.slice(o+1))}},setTextMeasurer:i=>{r.set(i)},get textMeasurer(){var i;return(i=r.peek())!=null?i:K()}}}var Kr=new WeakMap;function hi(t,e){let n=Kr.get(t);n||(n=new WeakMap,Kr.set(t,n));let s=n.get(e);if(!s){let r=nt(e);s={compiled:r,bound:Gn(r,t.resolveTarget,t.playhead)},n.set(e,s)}return s}function de(t,e,n){hi(t,e);let s=e.fps,r={time:n,frame:s!==void 0?Math.round(n*s):-1,measurer:t.textMeasurer};return Un(t.playhead,n,()=>{let i=le(t.size);return t.root.emit(i,r),i.finish()})}function en(t){return JSON.stringify(t,_t)}function Wo(t,e,n){let s=t(),r=t(),i=de(s,e,n),o=de(r,e,n);if(en(i)===en(o))return{ok:!0};let a=e.fps!==void 0?Math.round(n*e.fps):-1,l={time:n,frame:a,measurer:s.textMeasurer},c={time:n,frame:a,measurer:r.textMeasurer},h;for(let[f,u]of s.nodes){let d=r.nodes.get(f);if(!d)return{ok:!1,node:f};let m=le(s.size);u.emit(m,l);let p=le(r.size);d.emit(p,c);let v=m.finish(),w=p.finish();if(en(v)===en(w))continue;if(u instanceof Et){h!=null||(h=f);continue}let y=ts(v,w).deltas[0];return T({ok:!1,node:f},y!==void 0?{delta:y}:{})}return T({ok:!1},h!==void 0?{node:h}:{})}var ws=new Set(["blur","drop-shadow","brightness","contrast","saturate"]),Qr=t=>t<0?0:t>1?1:t;function Jr(t,e,n,s,r){let i=1-r,o=i*i*i,a=3*i*i*r,l=3*i*r*r,c=r*r*r;return[o*t[0]+a*e[0]+l*n[0]+c*s[0],o*t[1]+a*e[1]+l*n[1]+c*s[1]]}function Bo(t){let e=[];for(let n of t){let s=n.v.length;for(let r=0;r<s-1;r++)e.push([n.v[r],[n.v[r][0]+n.out[r][0],n.v[r][1]+n.out[r][1]],[n.v[r+1][0]+n.in[r+1][0],n.v[r+1][1]+n.in[r+1][1]],n.v[r+1]]);n.closed&&s>1&&e.push([n.v[s-1],[n.v[s-1][0]+n.out[s-1][0],n.v[s-1][1]+n.out[s-1][1]],[n.v[0][0]+n.in[0][0],n.v[0][1]+n.in[0][1]],n.v[0]])}return e}function pe(t,e={}){var h,f;let n=Math.max(1,Math.floor((h=e.samplesPerSegment)!=null?h:32)),s=Bo(t),r=[],i=[];if(s.length>0){let u=Jr(...s[0],0);r.push(u),i.push(0);let d=0;for(let m of s)for(let p=1;p<=n;p++){let v=Jr(...m,p/n);d+=Math.hypot(v[0]-u[0],v[1]-u[1]),r.push(v),i.push(d),u=v}}else{let u=(f=t[0])==null?void 0:f.v[0];r.push(u?[u[0],u[1]]:[0,0]),i.push(0)}let o=i[i.length-1],a=u=>{if(o<=0||u<=0)return{i:0,f:0};if(u>=o)return{i:r.length-2,f:1};let d=0;for(;d<i.length-1&&i[d+1]<u;)d++;let m=i[d+1]-i[d];return{i:d,f:m>0?(u-i[d])/m:0}},l=u=>{if(r.length===1)return[r[0][0],r[0][1]];let{i:d,f:m}=a(u),p=r[d],v=r[d+1];return[p[0]+(v[0]-p[0])*m,p[1]+(v[1]-p[1])*m]},c=u=>{if(r.length===1)return[1,0];let{i:d}=a(u),m=r[d],p=r[d+1],v=p[0]-m[0],w=p[1]-m[1],y=Math.hypot(v,w);return y>0?[v/y,w/y]:[1,0]};return{length:o,at:l,tangentAt:c,atProgress:u=>l(Qr(u)*o),tangentAtProgress:u=>c(Qr(u)*o)}}function _o(t){return pe(t).length}function jo(t,e){return pe(t).at(e)}var ui=class extends Q{constructor(e){var a;super(e);x(this,"target");x(this,"progress");this.target=e.target,this.progress=C(1),typeof e.progress=="function"?this.progress.bindSource(e.progress):e.progress!==void 0&&this.progress.set(e.progress),this.registerTarget("progress",this.progress,"number");let n=e.samplesPerSegment!==void 0?{samplesPerSegment:e.samplesPerSegment}:{},s=e.path instanceof us?()=>e.path.data():()=>e.path,r=s(),i=pe(r,n),o=()=>{let l=s();return l!==r&&(r=l,i=pe(l,n)),i};if(e.target.position.bindSource(()=>o().atProgress(this.progress())),e.orient){let l=(a=e.orientOffset)!=null?a:0;e.target.rotation.bindSource(()=>{let c=o().tangentAtProgress(this.progress());return Math.atan2(c[1],c[0])*180/Math.PI+l})}}draw(){}};function Ho(t,e,n={}){return new ui(z(T({},n),{target:t,path:e}))}var me=class extends Error{constructor(t){super(t),this.name="TokenMatchError"}},ms=t=>t.replace(/\s+/g,"");function gs(t,e,n=1){let s=ms(e);if(s.length===0)throw new me("empty token");let r=0;for(let i=0;i<t.length;i++){let o="";for(let a=i;a<t.length;a++){if(o+=ms(t[a].text),o===s){if(r++,r===n)return[i,a];break}if(!s.startsWith(o))break}}throw new me(`no match for token '${e}'${n>1?` (occurrence ${n})`:""} \u2014 segments are [${t.map(i=>`'${i.text}'`).join(", ")}]`)}var fi=class extends Q{constructor(e){var s,r,i;super(e);x(this,"target");x(this,"padding");x(this,"cornerRadius");x(this,"rematch");x(this,"ranges");this.target=e.text,this.padding=(s=e.padding)!=null?s:[4,2],this.cornerRadius=(r=e.cornerRadius)!=null?r:4,this.rematch=(i=e.rematch)!=null?i:!1;let n=this.target.wordBoxes();this.ranges=e.ranges.map((o,a)=>{var f;let l=this.resolveRun(n,o),c=(f=o.id)!=null?f:`r${a}`,h={spec:o,fill:nn(C("#ffe066"),o.fill),opacity:nn(C(1),o.opacity),progress:nn(C(1),o.progress),scale:nn(C(1),o.scale),offset:Yo(Wt([0,0]),o.offset),run:l,bound:Zr(n,l)};return this.registerTarget(`${c}/fill`,h.fill,"color"),this.registerTarget(`${c}/opacity`,h.opacity,"number"),this.registerTarget(`${c}/progress`,h.progress,"number"),this.registerTarget(`${c}/scale`,h.scale,"number"),this.registerTarget(`${c}/offset`,h.offset,"vec2"),this.registerTarget(`${c}/offset.x`,h.offset.x,"number"),this.registerTarget(`${c}/offset.y`,h.offset.y,"number"),h})}resolveRun(e,n){var s;if(typeof n.match!="string"){let[r,i]=n.match;if(r<0||i>=e.length||r>i)throw new me(`word index range [${r}, ${i}] out of bounds (${e.length} boxes)`);return[r,i]}return gs(e,n.match,(s=n.occurrence)!=null?s:1)}draw(e,n){var l;let s=this.target.wordBoxes(n.measurer);if(s.length===0)return;let r=this.target.localMatrix(),[i,o]=this.padding,a=!1;for(let c of this.ranges){let h=c.opacity();if(h<=0)continue;let f=Math.min(1,Math.max(0,c.progress()));if(f<=0)continue;let u=c.run;if(this.rematch&&typeof c.spec.match=="string")u=gs(s,c.spec.match,(l=c.spec.occurrence)!=null?l:1);else if(Zr(s,u)!==c.bound)throw new me(`bound token '${c.bound}' no longer matches boxes [${u[0]}, ${u[1]}] \u2014 the text changed (segments now [${s.slice(u[0],u[1]+1).map(k=>`'${k.text}'`).join(", ")}]); pass rematch: true for animated text`);let d=[];for(let k=u[0];k<=u[1];k++){let E=s[k],I=d[d.length-1],b=k>u[0]&&s[k-1].line===E.line?I:void 0;b?(b.w=E.x+E.w+i-b.x,b.y=Math.min(b.y,E.y-o),b.h=Math.max(b.h,E.y+E.h+o-b.y)):d.push({x:E.x-i,y:E.y-o,w:E.w+2*i,h:E.h+2*o})}!a&&!Mt(r,St)&&(e.push({op:"transform",m:r}),a=!0);let m=h<1;m&&e.push({op:"pushGroup",opacity:h,blend:"source-over",filters:[]});let p=c.fill(),v=c.scale(),[w,y]=c.offset(),g=f*d.reduce((k,E)=>k+E.w,0);for(let k of d){let E=Math.min(k.w,g);if(g-=E,E<=0)break;let I=k.x+k.w/2+w,b=k.y+k.h/2+y,M=E*v,S=k.h*v,$=I-k.w/2*v,L=b-S/2,P=Math.min(this.cornerRadius,M/2,S/2),V=e.resource({kind:"path",segs:jt($,L,M,S,P)});if(e.push({op:"fillPath",path:V,paint:{kind:"color",color:p}}),g<=0)break}m&&e.push({op:"popGroup"})}}};function Zr(t,e){return t.slice(e[0],e[1]+1).map(n=>ms(n.text)).join("")}function Xo(t,e){return new fi(z(T({},e),{text:t}))}function nn(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}function Yo(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}function di(t){let e=[],n=s=>{if(s instanceof Ze){let r=s.text();r&&e.push({family:s.fontFamily,text:r})}if(s instanceof Et)for(let r of s.children)n(r)};return n(t.root),e}function Go(t){let e=t.indexOf("/");return e>=0?t.slice(0,e):t}function Uo(t,e){let n=[];for(let s of e.tracks){if(s.type!=="string")continue;let r=t.nodes.get(Go(s.target));if(r instanceof Ze)for(let i of s.keys){let o=i.value;typeof o=="string"&&o&&n.push({family:r.fontFamily,text:o})}}return n}async function bs(t,e,n,s={}){var c,h;let r=(c=s.mode)!=null?c:"dev",i=ie(e.assets),o=[...di(t),...(h=s.extraUsages)!=null?h:[]],a=new Set;for(let f of o)if(i.has(f.family))for(let u of i.fallbackChain(f.family))a.add(u);let l=new Map;for(let f of a){let u=i.resolveFace(f);if(!u)continue;let d=await n(u.url);d&&l.set(f,Fe(d))}return Yn(o,i,l,r,T({},s.osFamilies!==void 0?{osFamilies:s.osFamilies}:{}))}var fe=class extends Error{constructor(e,n,s){super(`asset '${e}' not ready: ${n}. evaluate() never awaits \u2014 warm assets before evaluating (\xA72.5 readiness precondition)`);x(this,"assetId");x(this,"detail");x(this,"mediaT");this.name="ColdAssetError",this.assetId=e,this.detail=n,this.mediaT=s}},Ko=class extends Et{constructor(e){var s;super(e);x(this,"wgsl");x(this,"uniformSignals");this.wgsl=e.wgsl;let n=new Map;for(let[r,i]of Object.entries((s=e.uniforms)!=null?s:{})){let o=C(i);n.set(r,o),this.registerTarget(`u.${r}`,o,"number")}this.uniformSignals=n}uniform(e){let n=this.uniformSignals.get(e);if(!n)throw new Error(`ShaderEffect has no uniform '${e}' (have: ${[...this.uniformSignals.keys()].join(", ")})`);return n}groupShader(){let e={};for(let[n,s]of this.uniformSignals)e[n]=s();return{wgsl:this.wgsl,uniforms:e}}},Qo=t=>t*t*(3-2*t),Jo=2.4,Zo=1-Math.exp(-5.76/2),ta=t=>(1-Math.exp(-((t*Jo)**2)/2))/Zo;function ea(t,e){if(e==="linear"||t.length<2)return t;let n=e==="gaussian"?ta:Qo,s=t[0].offset,r=t[t.length-1].offset-s;if(r<=0)return t;let i=[],o=0;for(let a=0;a<64;a++){let l=s+r*(a/63);for(;o<t.length-2&&l>t[o+1].offset;)o++;let c=t[o],h=t[o+1],f=h.offset-c.offset,u=f>0?Math.min(1,Math.max(0,(l-c.offset)/f)):0;i.push({offset:l,color:ht(c.color,h.color,n(u))})}return i}var na=4,sa=2,ys=.32,ti=1e-6,ei=1024;function pi(t,e,n){let s=new Uint8ClampedArray(Math.max(1,e)*Math.max(1,n)*4),r=t.points.map(l=>({u:l.pos[0],v:l.pos[1],lab:Ct(ut(l.color))})),i=t.bg!==void 0?Ct(ut(t.bg)):null,o=t.interpolation==="gaussian",a=2*ys*ys;for(let l=0;l<n;l++){let c=n>1?(l+.5)/n:.5;for(let h=0;h<e;h++){let f=e>1?(h+.5)/e:.5,u=0,d=0,m=0,p=0,v=0;i&&(u=1,d=i.L,m=i.a,p=i.b,v=i.alpha);let w=!1;for(let k=0;k<r.length;k++){let E=r[k],I=f-E.u,b=c-E.v,M=I*I+b*b;if(M<=ti*ti){d=E.lab.L,m=E.lab.a,p=E.lab.b,v=E.lab.alpha,w=!0;break}let S;o?S=Math.exp(-M/a):S=1/M,u+=S,d+=S*E.lab.L,m+=S*E.lab.a,p+=S*E.lab.b,v+=S*E.lab.alpha}let y;if(w)y=Nt({L:d,a:m,b:p,alpha:v});else if(u>0){let k=1/u;y=Nt({L:d*k,a:m*k,b:p*k,alpha:v*k})}else y={r:0,g:0,b:0,a:0};let g=(l*e+h)*4;s[g]=y.r,s[g+1]=y.g,s[g+2]=y.b,s[g+3]=Math.round(y.a*255)}}return s}function mi(t,e){return{w:Math.min(ei,Math.max(1,Math.ceil(Math.abs(t)/4))),h:Math.min(ei,Math.max(1,Math.ceil(Math.abs(e)/4)))}}var ni=!1;function ra(t){var e,n,s;return ni||(ni=!0,B("mesh Paint on a stroke/text resolves to a representative solid color (mesh fill is supported only on filled paths, \xA73 Paint) \u2014 use a fillPath for the mesh gradient")),(s=(n=t.bg)!=null?n:(e=t.points[0])==null?void 0:e.color)!=null?s:"#00000000"}function ps(t,e,n){if(e.kind==="color")return e.color;if(e.kind==="mesh")return ra(e);let s;if(e.kind==="radial"){let i=e.center?e.center[0]:n?(n.minX+n.maxX)/2:0,o=e.center?e.center[1]:n?(n.minY+n.maxY)/2:0,a=e.radius!==void 0?e.radius:n?Math.hypot(n.maxX-n.minX,n.maxY-n.minY)/2:0;s=t.createRadialGradient(i,o,0,i,o,a)}else{let i=e.from?e.from[0]:n?(n.minX+n.maxX)/2:0,o=e.from?e.from[1]:n?n.minY:0,a=e.to?e.to[0]:n?(n.minX+n.maxX)/2:0,l=e.to?e.to[1]:n?n.maxY:0;s=t.createLinearGradient(i,o,a,l)}let r=e.interpolation?ea(e.stops,e.interpolation):e.stops;for(let i of r)s.addColorStop(i.offset,i.color);return s}function sn(t){return`${t.style==="italic"?"italic ":""}${t.weight!==void 0&&t.weight!==400?`${t.weight} `:""}${t.size}px ${t.family}`}var ia=16;function oa(t){let e=n=>Object.is(n,-0)?"0":String(Math.round(n*1e4)/1e4);return`${e(t[0])},${e(t[1])},${e(t[2])},${e(t[3])},${e(t[4])},${e(t[5])}`}function aa(t){let e=0;for(let n of t!=null?t:[])n.kind==="blur"?e+=3*n.radius:n.kind==="drop-shadow"&&(e+=Math.max(Math.abs(n.dx),Math.abs(n.dy))+3*n.blur);return e}function gi(t,e,n){return t?(e<t.minX&&(t.minX=e),n<t.minY&&(t.minY=n),e>t.maxX&&(t.maxX=e),n>t.maxY&&(t.maxY=n),t):{minX:e,minY:n,maxX:e,maxY:n}}function ue(t,e,n,s,r,i){for(let[o,a]of[[n,s],[r,s],[n,i],[r,i]])t.bounds=gi(t.bounds,e[0]*o+e[2]*a+e[4],e[1]*o+e[3]*a+e[5])}function ca(t){let e=null,n=(s,r)=>{e=gi(e,s,r)};for(let s of t)switch(s[0]){case"M":case"L":n(s[1],s[2]);break;case"C":n(s[1],s[2]),n(s[3],s[4]),n(s[5],s[6]);break;case"Q":n(s[1],s[2]),n(s[3],s[4]);break;case"E":{let r=Math.max(s[3],s[4]);n(s[1]-r,s[2]-r),n(s[1]+r,s[2]+r);break}}return e}var ks=class{constructor(t,e="warn",n=(i=>(i=(r=>(r=(s=>(s=globalThis.process)==null?void 0:s.env)())==null?void 0:r.RASTER_CACHE)())!=null?i:"1")()!=="0"){x(this,"host");x(this,"shaderCaps");x(this,"pool",[]);x(this,"pathCache",new WeakMap);x(this,"pathBoundsCache",new WeakMap);x(this,"images",new Map);x(this,"videos",new Map);x(this,"warnedShaders",!1);x(this,"rasterCache",new Map);x(this,"cacheEnabled");this.host=t,this.shaderCaps=e,this.cacheEnabled=n}setImageAsset(t,e){this.images.set(t,e)}setVideoAsset(t,e){this.videos.set(t,e)}dispose(){this.pool.length=0,this.rasterCache.clear()}resolveDrawable(t,e){if(t.kind==="image"){let n=this.images.get(t.assetId);if(!n)throw new fe(t.assetId,"no decoded image registered");return n}if(t.kind==="videoFrame"){let n=this.videos.get(t.assetId);if(!n)throw new fe(t.assetId,"no VideoFrameSource registered",t.mediaT);try{return n.getFrameSync(t.mediaT)}catch(s){throw s instanceof fe?new fe(t.assetId,s.detail,t.mediaT):s}}throw new Error(`resource ${e} is not drawable`)}path(t,e){let n=t[e];if(!n||n.kind!=="path")throw new Error(`resource ${e} is not a path`);let s=this.pathCache.get(n);return s||(s=this.buildPath(n.segs),this.pathCache.set(n,s)),s}pathBounds(t,e){var s;let n=t[e];return!n||n.kind!=="path"?null:(this.pathBoundsCache.has(n)||this.pathBoundsCache.set(n,ca(n.segs)),(s=this.pathBoundsCache.get(n))!=null?s:null)}buildPath(t){let e=this.host.newPath();for(let n of t)switch(n[0]){case"M":e.moveTo(n[1],n[2]);break;case"L":e.lineTo(n[1],n[2]);break;case"C":e.bezierCurveTo(n[1],n[2],n[3],n[4],n[5],n[6]);break;case"Q":e.quadraticCurveTo(n[1],n[2],n[3],n[4]);break;case"E":e.ellipse(n[1],n[2],n[3],n[4],n[5],n[6],n[7]);break;case"Z":e.closePath();break}return e}acquire(t,e){let n=this.pool.pop();return n?(n.width!==t&&(n.width=t),n.height!==e&&(n.height=e),n):this.host.createCanvas(t,e)}release(t){this.pool.length<8&&this.pool.push(t)}cacheStore(t,e){let n=this.rasterCache.get(t);for(n&&(this.rasterCache.delete(t),n.canvas!==e.canvas&&this.release(n.canvas)),this.rasterCache.set(t,e);this.rasterCache.size>ia;){let s=this.rasterCache.keys().next().value;if(s===void 0)break;let r=this.rasterCache.get(s);this.rasterCache.delete(s),this.release(r.canvas)}}cacheTouch(t){let e=this.rasterCache.get(t);return e&&(this.rasterCache.delete(t),this.rasterCache.set(t,e)),e}fillMesh(t,e,n,s){let r=s.maxX-s.minX,i=s.maxY-s.minY;if(r<=0||i<=0)return;let{w:o,h:a}=mi(r,i),l=pi(n,o,a),c=this.acquire(o,a),h=this.host.context(c),f=h.createImageData(o,a);f.data.set(l),h.putImageData(f,0,0),t.save(),t.clip(e,"nonzero"),t.imageSmoothingEnabled=!0,t.drawImage(c,0,0,o,a,s.minX,s.minY,r,i),t.restore(),this.release(c)}composite(t,e,n,s,r,i,o,a,l,c,h,f){let u=l!==void 0&&l!=="none",d=u?aa(c):0;r||a!=="source-over"?e.unbounded=!0:s&&ue(e,St,s.minX-d,s.minY-d,s.maxX+d,s.maxY+d);let m=u&&!i&&!r&&a==="source-over";if(!(m&&s===null)){if(t.save(),t.resetTransform(),m&&s){let p=Math.max(0,Math.floor(s.minX-d)),v=Math.max(0,Math.floor(s.minY-d)),w=Math.min(h,Math.ceil(s.maxX+d)),y=Math.min(f,Math.ceil(s.maxY+d));if(p>=w||v>=y){t.restore();return}let g=this.host.newPath();g.moveTo(p,v),g.lineTo(w,v),g.lineTo(w,y),g.lineTo(p,y),g.closePath(),t.clip(g,"nonzero")}t.globalAlpha=o,u&&(t.filter=l),t.globalCompositeOperation=a,t.drawImage(n,0,0),t.restore()}}render(t,e){var f,u,d,m,p,v,w,y,g,k,E;let{w:n,h:s}=e.size;t.width!==n&&(t.width=n),t.height!==s&&(t.height=s);let r=this.host.context(t);r.resetTransform(),r.clearRect(0,0,n,s);let i=[{ctx:r,canvas:null,opacity:1,blend:"source-over",bounds:null,unbounded:!1}],o=()=>i[i.length-1].ctx,a=()=>i[i.length-1],l=St,c=[],h=e.commands;for(let I=0;I<h.length;I++){let b=h[I];switch(b.op){case"save":c.push(l),o().save();break;case"restore":l=(f=c.pop())!=null?f:l,o().restore();break;case"transform":l=ae(l,b.m),o().transform(b.m[0],b.m[1],b.m[2],b.m[3],b.m[4],b.m[5]);break;case"clip":o().clip(this.path(e.resources,b.path),(u=b.rule)!=null?u:"nonzero");break;case"fillPath":{let M=o(),S=this.pathBounds(e.resources,b.path);b.paint.kind==="mesh"&&S?this.fillMesh(M,this.path(e.resources,b.path),b.paint,S):(M.fillStyle=ps(M,b.paint,S),M.fill(this.path(e.resources,b.path))),S&&ue(a(),l,S.minX,S.minY,S.maxX,S.maxY);break}case"strokePath":{let M=o(),S=this.pathBounds(e.resources,b.path);if(M.strokeStyle=ps(M,b.paint,S),M.lineWidth=b.stroke.width,M.lineCap=(d=b.stroke.cap)!=null?d:"butt",M.lineJoin=(m=b.stroke.join)!=null?m:"miter",b.stroke.dash&&(M.setLineDash(b.stroke.dash),M.lineDashOffset=(p=b.stroke.dashOffset)!=null?p:0),M.stroke(this.path(e.resources,b.path)),b.stroke.dash&&(M.setLineDash([]),M.lineDashOffset=0),S){let $=b.stroke.width*(((v=b.stroke.join)!=null?v:"miter")==="miter"?5:1);ue(a(),l,S.minX-$,S.minY-$,S.maxX+$,S.maxY+$)}break}case"fillText":{let M=o();M.font=sn(b.font),M.fillStyle=ps(M,b.paint,null),M.textBaseline="alphabetic",M.textAlign=(w=b.align)!=null?w:"left",M.fillText(b.text,b.x,b.y);try{let S=M.measureText(b.text).width,$=(y=b.align)!=null?y:"left",L=$==="center"?b.x-S/2:$==="right"?b.x-S:b.x,P=b.font.size;ue(a(),l,L-P,b.y-1.5*P,L+S+P,b.y+.75*P)}catch(S){a().unbounded=!0}break}case"drawImage":{let M=e.resources[b.image];if(!M)throw new Error(`drawImage references missing resource ${b.image}`);let S=this.resolveDrawable(M,b.image),$=o();b.smoothing!==void 0&&($.imageSmoothingEnabled=b.smoothing);let{x:L,y:P,w:V,h:Y}=b.dst;b.src?$.drawImage(S,b.src.x,b.src.y,b.src.w,b.src.h,L,P,V,Y):$.drawImage(S,L,P,V,Y),ue(a(),l,L,P,L+V,P+Y);break}case"pushGroup":{let M=o(),S=this.cacheEnabled&&b.cacheKey!==void 0&&b.shader===void 0?`${b.cacheKey}@${oa(l)}`:void 0;if(S!==void 0){let P=this.cacheTouch(S);if(P){this.composite(M,a(),P.canvas,P.bounds,P.unbounded,!1,b.opacity,b.blend,Ue(b.filters),b.filters,n,s);let V=1;for(;V>0&&++I<h.length;){let Y=h[I];Y.op==="pushGroup"?V++:Y.op==="popGroup"&&V--}break}}let $=this.acquire(n,s),L=this.host.context($);L.resetTransform(),L.clearRect(0,0,n,s),L.setTransform(M.getTransform()),i.push(T(z(T({ctx:L,canvas:$,opacity:b.opacity,blend:b.blend,filter:Ue(b.filters),filters:b.filters},b.shader!==void 0?{shader:b.shader}:{}),{bounds:null,unbounded:!1}),S!==void 0?{cacheStoreKey:S}:{}));break}case"popGroup":{let M=i.pop();if(!M||M.canvas===null)throw new Error("popGroup without matching pushGroup");let S=o(),$=M.canvas,L=!1;if(M.shader!==void 0){let P=(E=(k=(g=this.host).applyShader)==null?void 0:k.call(g,M.canvas,M.shader,n,s))!=null?E:null;if(P!==null)$=P,L=!0,M.bounds={minX:0,minY:0,maxX:n,maxY:s},M.unbounded=!1;else{if(this.shaderCaps==="error")throw new Error("a ShaderEffect reached a backend without a shader runner (\xA73.7) \u2014 load @glissade/effects-webgpu in the browser, or accept passthrough with caps.shaders: warn");this.warnedShaders||(this.warnedShaders=!0,B("ShaderEffect pass skipped: no shader runner here (headless or webgpu-less browser) \u2014 subtree composites unfiltered (\xA73.7 caps.shaders)"))}}this.composite(S,a(),$,M.bounds,M.unbounded,L,M.opacity,M.blend,M.filter,M.filters,n,s),M.cacheStoreKey!==void 0&&!L?this.cacheStore(M.cacheStoreKey,{canvas:M.canvas,bounds:M.bounds,unbounded:M.unbounded}):this.release(M.canvas);break}}}if(i.length!==1)throw new Error("unbalanced pushGroup/popGroup in DisplayList")}};var ge=null;function yi(t){ge=t}function la(t,e){if(typeof OffscreenCanvas!="undefined")return new OffscreenCanvas(t,e);let n=document.createElement("canvas");return n.width=t,n.height=e,n}var ha=16384,rn=class{constructor(t,e={}){x(this,"target");x(this,"raster");var n;this.target=t,this.raster=new ks({context:s=>this.context(s),createCanvas:(s,r)=>la(s,r),newPath:()=>new Path2D,applyShader:(s,r,i,o)=>{var a;return(a=ge==null?void 0:ge.apply(s,r,i,o))!=null?a:null}},(n=e.shaderCaps)!=null?n:"warn")}get caps(){return{filters:ws,shaders:ge!==null,maxTextureSize:ha}}setImageAsset(t,e){this.raster.setImageAsset(t,e)}setVideoAsset(t,e){this.raster.setVideoAsset(t,e)}measureText(t,e){let n=this.context(this.target);n.save(),n.font=sn(e);let s=n.measureText(t);return n.restore(),{width:s.width,ascent:s.actualBoundingBoxAscent,descent:s.actualBoundingBoxDescent}}render(t){this.raster.render(this.target,t)}async readPixels(){return this.context(this.target).getImageData(0,0,this.target.width,this.target.height).data}dispose(){this.raster.dispose()}context(t){let e=t.getContext("2d");if(!e)throw new Error("canvas 2d context unavailable");return e}};var ct=class extends Error{constructor(t){super(t),this.name="ClipError"}};function wi(t,e,n){let s;try{s=Ot(n)}catch(i){throw new ct(`clip override for '${t}' has an un-typeable value ${JSON.stringify(n)} (channel type '${e}')`)}let r=i=>i==="color"||i==="string";if(!(s===e||r(s)&&r(e)))throw new ct(`clip override for '${t}' is a '${s}' value but the channel is '${e}' (${JSON.stringify(n)}); a mismatched override samples to NaN`);return n}function bi(t){return t.keys.length===0?0:t.keys[t.keys.length-1].t}function ua(t,e,n){if(typeof t=="string")return bt(`${t}/${n}`);let s=t[e];if(s===void 0)throw new ct(`clip target map is missing channel '${e}' \u2014 provide a target for every channel, or pass a node-id string`);return bt(s)}function fa(t,e,n,s,r){var a;if(e.keys.length===0)throw new ct(`clip channel '${t}' has no keys`);let i=(a=e.type)!=null?a:Ot(e.keys[0].value),o=e.keys.length-1;if(r&&o===0&&r.from!==void 0)throw new ct(r.to!==void 0?`clip override for '${t}' supplies both 'from' and 'to' on a single-key channel \u2014 ambiguous (both target the only key)`:`clip override for '${t}' supplies 'from' on a single-key channel \u2014 ambiguous (the only key already is the 'to' value)`);return wt(t,i,e.keys.map((l,c)=>{let h=l.value,f=!1;r&&(c===0&&r.from!==void 0&&(h=wi(t,i,r.from),f=!0),c===o&&r.to!==void 0&&(h=wi(t,i,r.to),f=!0));let u={t:n+l.t/s,value:h},d=r&&c===o&&r.ease!==void 0?r.ease:l.ease;return d!==void 0&&(u.ease=d),l.interp!==void 0&&(u.interp=l.interp),l.id!==void 0&&(u.id=l.id),l.derived!==void 0&&!f&&(u.derived=l.derived),l.from!==void 0&&(u.from=l.from),u}))}function Tt(t){let e=Object.keys(t.channels);if(e.length===0)throw new ct("clip() requires at least one channel");let n=0;for(let r of e){let i=t.channels[r];if(i.keys.length===0)throw new ct(`clip channel '${r}' has no keys`);n=Math.max(n,bi(i))}function s(r,i,o){var f;let a=(f=o==null?void 0:o.speed)!=null?f:1;if(!(a>0))throw new ct(`clip speed must be > 0 (got ${a})`);let l=o==null?void 0:o.overrides,c=[],h=i;for(let u of e){let d=t.channels[u],m=ua(r,u,d.path);c.push(fa(m,d,i,a,l==null?void 0:l[u])),h=Math.max(h,i+bi(d)/a)}if(l){for(let u of Object.keys(l))if(!(u in t.channels))throw new ct(`clip override references unknown channel '${u}'`)}return{tracks:c,end:h}}return{spec:t,duration:n,apply:s}}function da(t,e,n,s){var h;let r=(h=s==null?void 0:s.stagger)!=null?h:0,i=typeof r=="function"?r:u=>u*r,f=s!=null?s:{},{stagger:o}=f,a=Lt(f,["stagger"]),l=[],c=n;return e.forEach((u,d)=>{let m=t.apply(u,n+i(d),a);l.push(...m.tracks),m.end>c&&(c=m.end)}),{tracks:l,end:c}}function pa(t){var s,r;let e=(s=t==null?void 0:t.duration)!=null?s:.3,n=(r=t==null?void 0:t.ease)!=null?r:"easeOutCubic";return Tt({channels:{opacity:{path:"opacity",keys:[O(0,0),O(e,1,n)]},scale:{path:"scale",keys:[O(0,[.8,.8]),O(e,[1,1],n)]}}})}function ma(t,e){var o,a,l;let n=(o=e==null?void 0:e.duration)!=null?o:.3,s=(a=e==null?void 0:e.ease)!=null?a:"easeOutCubic",r=(l=e==null?void 0:e.distance)!=null?l:40,i=t==="left"?[-r,0]:t==="right"?[r,0]:t==="top"?[0,-r]:[0,r];return Tt({channels:{opacity:{path:"opacity",keys:[O(0,0),O(n,1,s)]},offset:{path:"position",keys:[O(0,i),O(n,[0,0],s)]}}})}function ga(t){var r,i,o;let e=(r=t==null?void 0:t.duration)!=null?r:.4,n=(i=t==null?void 0:t.ease)!=null?i:"easeInOutSine",s=(o=t==null?void 0:t.scale)!=null?o:1.1;return Tt({channels:{scale:{path:"scale",keys:[O(0,[1,1]),O(e/2,[s,s],n),O(e,[1,1],n)]}}})}function ya(t){var r,i,o;let e=(r=t==null?void 0:t.duration)!=null?r:2,n=(i=t==null?void 0:t.ease)!=null?i:"easeInOutSine",s=(o=t==null?void 0:t.amplitude)!=null?o:8;return Tt({channels:{drift:{path:"position",keys:[O(0,[0,0]),O(e/2,[s,0],n),O(e,[0,0],n)]}}})}var Xt=class extends Error{constructor(t){super(t),this.name="MorphError"}};function vs(t,e){for(let[n,s]of[["x",e.x],["y",e.y],["w",e.w],["h",e.h]])if(!Number.isFinite(s))throw new Xt(`morph ${t}.${n} must be finite (got ${s})`);if(!(e.w>0)||!(e.h>0))throw new Xt(`morph ${t} must have w>0 and h>0 (got w=${e.w}, h=${e.h}); a zero/negative box yields a NaN/Infinity scale`)}function on(t,e){let n=typeof t=="string"?t:t[At];return typeof n!="string"||n.length===0?`${String(n)}/${e}`:`${typeof t=="string"?n:n.slice(0,Math.max(0,n.lastIndexOf("/")))}/${e}`}function wa(t,e,n,s){var w,y,g;let{at:r,duration:i}=s,o=s.ease,a=(w=s.crossfade)!=null?w:.5,l=(y=s.metric)!=null?y:"transform";if(l!=="transform")throw new Xt(`morph metric '${l}' is not supported in v1 (only 'transform')`);if(vs("from",t),vs("to",e),!(i>0))throw new Xt(`morph duration must be > 0 (got ${i})`);if(!(a>=0&&a<=1))throw new Xt(`morph crossfade must be in [0,1] (got ${a})`);let c=(g=s.base)!=null?g:{w:e.w,h:e.h};vs("to",{x:0,y:0,w:c.w,h:c.h});let h=[t.w/c.w,t.h/c.h],f=[e.w/c.w,e.h/c.h],u=[t.x,t.y],d=[e.x,e.y],m={position:{path:"position",type:"vec2",keys:[O(0,u),O(i,d,o)]},scale:{path:"scale",type:"vec2",keys:[O(0,h),O(i,f,o)]}},p={position:on(n.morphNode,"position"),scale:on(n.morphNode,"scale")};n.fromNode!==void 0&&i*a>0&&(m.fromOpacity={path:"opacity",type:"number",keys:[O(0,1),O(i*a,0,o)]},p.fromOpacity=on(n.fromNode,"opacity")),n.toNode!==void 0&&i*(1-a)<i&&(m.toOpacity={path:"opacity",type:"number",keys:[O(i*(1-a),0),O(i,1,o)]},p.toOpacity=on(n.toNode,"opacity"));let{tracks:v}=Tt({channels:m}).apply(p,r);return{tracks:v,end:r+i}}var xi=class extends Error{constructor(t){super(t),this.name="PresenceError"}},Mi=.3;function ba(){return Tt({channels:{opacity:{path:"opacity",keys:[O(0,0),O(Mi,1)]}}})}function ka(){return Tt({channels:{opacity:{path:"opacity",keys:[O(0,1),O(Mi,0)]}}})}function ki(t,e){var n;return t.duration/((n=e==null?void 0:e.speed)!=null?n:1)}function va(t){return t.map((e,n)=>[e,n]).sort((e,n)=>e[0].t-n[0].t||e[1]-n[1]).map(([e])=>e)}function vi(t,e){let n=[],s=[];for(let r of t)r.target===e?s=r.keys:n.push(r);return{opacityKeys:s,rest:n}}function xa(t,e){var I,b;let{show:n,hide:s}=e,r=bt(typeof t=="string"?`${t}/opacity`:t),i=r.lastIndexOf("/"),o=i<0?r:r.slice(0,i),a=(I=e.enter)!=null?I:ba(),l=(b=e.exit)!=null?b:ka(),c=a.apply(o,n,e.enterOpts),h=n+ki(a,e.enterOpts),f=ki(l,e.exitOpts),u=s-f;if(u<=n)throw new xi(`presence('${o}') exit needs ${f.toFixed(3)}s but only ${(s-n).toFixed(3)}s between show (${n}) and hide (${s}) \u2014 widen the window or shorten/speed up the exit`);let d=l.apply(o,u,e.exitOpts),{opacityKeys:m,rest:p}=vi(c.tracks,r),{opacityKeys:v,rest:w}=vi(d.tracks,r),y=[O(0,0,{interp:"hold"}),O(h,1,{interp:"hold"}),O(s,0,{interp:"hold"})],g=[];if(m.length>0?m.forEach((M,S)=>{S===0&&M.value!==0&&M.interp!=="hold"?g.push(z(T({},M),{interp:"hold"})):g.push(M)}):g.push(O(n,0),O(h,1)),v.length>0)for(let M of v)g.push(M);else g.push(O(u,1),O(s,0));let k=va([...y,...g]),E=[];for(let M of k){let S=E[E.length-1];S&&S.t===M.t?E[E.length-1]=M:E.push(M)}return{tracks:[wt(r,"number",E),...p,...w],end:s,shownAt:n,hiddenAt:s}}function Si(t){var f;let e=(f=t.match(/[MmLlHhVvCcQqZz]|-?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g))!=null?f:[],n=[],s=0,r=0,i=0,o=0,a=0,l="",c=()=>Number(e[s++]),h=u=>!!u&&/^[MmLlHhVvCcQqZz]$/.test(u);for(;s<e.length;){let u=e[s];if(h(u)?s++:u=l==="M"?"L":l==="m"?"l":l,!u)break;let d=u===u.toLowerCase();switch(u.toUpperCase()){case"M":{let m=c()+(d?r:0),p=c()+(d?i:0);r=m,i=p,o=m,a=p,n.push(["M",m,p]);break}case"L":{let m=c()+(d?r:0),p=c()+(d?i:0);r=m,i=p,n.push(["L",m,p]);break}case"H":{let m=c()+(d?r:0);r=m,n.push(["L",m,i]);break}case"V":{let m=c()+(d?i:0);i=m,n.push(["L",r,m]);break}case"C":{let m=c()+(d?r:0),p=c()+(d?i:0),v=c()+(d?r:0),w=c()+(d?i:0),y=c()+(d?r:0),g=c()+(d?i:0);r=y,i=g,n.push(["C",m,p,v,w,y,g]);break}case"Q":{let m=c()+(d?r:0),p=c()+(d?i:0),v=c()+(d?r:0),w=c()+(d?i:0);r=v,i=w,n.push(["Q",m,p,v,w]);break}case"Z":n.push(["Z"]),r=o,i=a;break;default:s++;break}l=u}return n}function Ma(t){return Je(Si(t))}function Ei(){let t=0,e=!1;return{start(n){e=!0;let s,r=i=>{e&&(s!=null||(s=i),n((i-s)/1e3),t=requestAnimationFrame(r))};t=requestAnimationFrame(r)},stop(){e=!1,cancelAnimationFrame(t)}}}function Sa(t){var r;let e=(r=t.axis)!=null?r:"y",n=null,s=t.source;return{start(i,o){var c,h;let a=(h=t.range)!=null?h:[0,(c=o.duration)!=null?c:1],l=()=>{if(s instanceof Element){let m=e==="y"?s.scrollHeight-s.clientHeight:s.scrollWidth-s.clientWidth,p=e==="y"?s.scrollTop:s.scrollLeft;return m>0?p/m:0}let f=document.documentElement,u=e==="y"?f.scrollHeight-window.innerHeight:f.scrollWidth-window.innerWidth,d=e==="y"?window.scrollY:window.scrollX;return u>0?d/u:0};n=()=>{let f=Math.min(1,Math.max(0,l()));i(a[0]+f*(a[1]-a[0]))},s.addEventListener("scroll",n,{passive:!0}),n()},stop(){n&&s.removeEventListener("scroll",n),n=null}}}var Ti=class extends Error{constructor(t){super(`machine targets overlap an already-bound target set: ${t.join(", ")} \u2014 concurrent writers to one property is the silent last-writer-wins \xA72.2 exists to kill`),this.name="TargetOverlapError"}};function Ii(t,e={}){var P,V,Y,Is,$s,Cs,Os;let{playhead:n}=t,s=t.duration,r=(P=t.markers)!=null?P:[],i=(V=t.driver)!=null?V:Ei(),o=(Y=e.loop)!=null?Y:!1,a=(Is=e.background)!=null?Is:"pause",l=($s=t.visibility)!=null?$s:(()=>"visible"),c=new Map,h=new Map,f=(Cs=e.rate)!=null?Cs:1,u=!1,d=C(!1),m=D=>{u=D,d.set(D)},p=!1,v=new Set((Os=t.targets)!=null?Os:[]),w=[],y=0,g=null,k=0,E=[0,s],I=0,b=null;function M(D,F){var W,X,Z;if(D===F||c.size===0&&h.size===0)return;let R=F>D;for(let rt of r){if(!(R?rt.t>D&&rt.t<=F:rt.t>=F&&rt.t<D))continue;for(let ln of(W=c.get(rt.name))!=null?W:[])ln(rt);let $t=(X=rt.data)==null?void 0:X.kind;if(typeof $t=="string")for(let ln of(Z=h.get($t))!=null?Z:[])ln(rt)}}function S(D){m(!1),g=null;let F=b;b=null,F==null||F(D)}function $(D){k=D;for(let $t of w)$t.step(D);if(!u)return;if(a==="pause"&&l()==="hidden"){y=n.peek(),g=null;return}g!=null||(g=D);let F=n.peek(),R=y+(D-g)*f,[W,X]=E;if(!(f>=0?R>=X:R<=W)){n.set(R),M(F,R);return}let Z=o===!0?{mode:"restart"}:o===!1?null:o,rt=Z&&"count"in Z&&Z.count!==void 0?Z.count:1/0;if(!Z||I+1>=rt){let $t=f>=0?X:W;n.set($t),M(F,$t),S(!0);return}I++,X-W,Z.mode==="alternate"?(M(F,f>=0?X:W),f=-f,y=f>=0?W:X):(M(F,f>=0?X:W),y=f>=0?W:X),g=D,R=y,n.set(R)}function L(){p||(p=!0,i.start($,{duration:s,visibility:l}))}return{playhead:n,get duration(){return s},get playing(){return u},playingSignal:d,get rate(){return f},set rate(D){y=n.peek(),g=u?k:null,f=D},play(D){var X;b&&S(!1),E=(X=D==null?void 0:D.range)!=null?X:[0,s];let F=n.peek(),[R,W]=E;return y=f>=0?F>=W||F<R?R:F:F<=R||F>W?W:F,n.set(y),g=null,I=0,m(!0),L(),{finished:new Promise(Z=>{b=Z})}},pause(){u&&(y=n.peek(),S(!1))},seek(D){y=Math.min(Math.max(D,0),s),g=u?k:null,n.set(y)},swap(D){var R,W;s=D.duration,r=(R=D.markers)!=null?R:[],v=new Set((W=D.targets)!=null?W:[]);let F=Math.min(n.peek(),s);E=[0,s],y=F,g=u?k:null,I=0,n.set(F)},attach(D){if(D.targets){let F=[];for(let R of D.targets)v.has(R)?F.push(`'${R}' (player timeline)`):w.some(W=>{var X;return(X=W.targets)==null?void 0:X.has(R)})&&F.push(`'${R}' (another machine)`);if(F.length>0)throw new Ti(F)}return w.push(D),L(),()=>{let F=w.indexOf(D);F>=0&&w.splice(F,1)}},onMarker(D,F){let R=c.get(D);return R||(R=new Set,c.set(D,R)),R.add(F),()=>R.delete(F)},onCue(D,F){let R=h.get(D);return R||(R=new Set,h.set(D,R)),R.add(F),()=>R.delete(F)},dispose(){u&&S(!1),w.length=0,p&&i.stop(),p=!1}}}function $i(t,e,n,s,r){var o;let i=t!=null?t:"respect";return i==="ignore"||!e?{autoplay:r}:typeof i=="function"?{autoplay:r,swapTo:i(n)}:{autoplay:!1,seekTo:(o=n.posterTime)!=null?o:s}}function Ci(){return typeof matchMedia!="undefined"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function xs(t,e,n,s={}){var w;let r=t,i=e,o=nt(i),a=new rn(n);r.setTextMeasurer(a);let l=r.playhead,c=Ii({playhead:l,duration:o.duration,markers:o.markers,targets:o.tracks.keys()},s),h=()=>a.render(de(r,i,l.peek())),f=!1,u=()=>{f||(f=!0,requestAnimationFrame(()=>{f=!1,h()}))},d=l.subscribe(u),m=y=>{if(typeof FontFace=="undefined")return;let g=ie(y.assets);for(let k of g.faces()){let E=new FontFace(k.family,`url(${k.url})`,{weight:String(k.weight),style:k.style});document.fonts.add(E),E.load().then(()=>h(),()=>{})}bs(r,y,async k=>{try{let E=await fetch(k);return E.ok?await E.arrayBuffer():void 0}catch(E){return}},T({mode:s.strictFonts?"strict":"dev"},s.osFonts!==void 0?{osFamilies:s.osFonts}:{}))};m(i);let p=((w=s.prefersReducedMotion)!=null?w:Ci)(),v=$i(s.reducedMotion,p,i,o.duration,!!s.autoplay);if(v.swapTo){i=v.swapTo;let y=nt(i);c.swap({duration:y.duration,markers:y.markers,targets:y.tracks.keys()}),m(i)}return v.seekTo!==void 0&&c.seek(v.seekTo),h(),v.autoplay&&c.play(),{player:c,backend:a,render:h,swap(y){y.scene&&(r=y.scene,r.setTextMeasurer(a)),i=y.timeline;let g=nt(i);c.swap({duration:g.duration,markers:g.markers,targets:g.tracks.keys()}),m(i),h()},dispose(){d(),c.dispose(),a.dispose()}}}function Ea(t,e,n){let s=Object.keys(nt(e).labels);return r=>{if(r==null)return;let i=n(r),o=Object.keys(nt(i.timeline).labels),a=s.filter(l=>!o.includes(l));a.length>0&&console.warn(`[glissade] HMR: this edit removed label(s) ${a.map(l=>`'${l}'`).join(", ")} \u2014 anything seeking to them will no longer resolve`),s=o,t.swap(i)}}var Ta=`
1
+ "use strict";var glissade=(()=>{var be=Object.defineProperty,Ni=Object.defineProperties,Vi=Object.getOwnPropertyDescriptor,qi=Object.getOwnPropertyDescriptors,Wi=Object.getOwnPropertyNames,we=Object.getOwnPropertySymbols;var un=Object.prototype.hasOwnProperty,zs=Object.prototype.propertyIsEnumerable;var Ls=t=>{throw TypeError(t)};var hn=(t,e,n)=>e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,T=(t,e)=>{for(var n in e||(e={}))un.call(e,n)&&hn(t,n,e[n]);if(we)for(var n of we(e))zs.call(e,n)&&hn(t,n,e[n]);return t},L=(t,e)=>Ni(t,qi(e));var Rs=t=>typeof t=="symbol"?t:t+"",Lt=(t,e)=>{var n={};for(var s in t)un.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&we)for(var s of we(t))e.indexOf(s)<0&&zs.call(t,s)&&(n[s]=t[s]);return n};var Bi=(t,e)=>{for(var n in e)be(t,n,{get:e[n],enumerable:!0})},_i=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Wi(e))!un.call(t,r)&&r!==n&&be(t,r,{get:()=>e[r],enumerable:!(s=Vi(e,r))||s.enumerable});return t};var ji=t=>_i(be({},"__esModule",{value:!0}),t);var x=(t,e,n)=>hn(t,typeof e!="symbol"?e+"":e,n),fn=(t,e,n)=>e.has(t)||Ls("Cannot "+n);var A=(t,e,n)=>(fn(t,e,"read from private field"),n?n.call(t):e.get(t)),U=(t,e,n)=>e.has(t)?Ls("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),H=(t,e,n,s)=>(fn(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),q=(t,e,n)=>(fn(t,e,"access private method"),n);var za={};Bi(za,{ALL_FILTER_KINDS:()=>ws,BakeError:()=>qe,BindTypeMismatchError:()=>Er,Canvas2DBackend:()=>rn,Circle:()=>Xr,CircularDependencyError:()=>dr,ClipError:()=>ct,ColdAssetError:()=>fe,ColorParseError:()=>xn,Custom:()=>jr,DEFAULT_EASE:()=>Hs,DL_SNAPSHOT_VERSION:()=>Nr,DeterminismViolationError:()=>hi,DlSnapshotError:()=>Xe,DuplicateNodeIdError:()=>ui,EachError:()=>Ht,FilterValidationError:()=>Ft,FollowPath:()=>mi,FontValidationError:()=>wr,Group:()=>Tt,GsPlayerElement:()=>Fi,Highlight:()=>ai,IDENTITY:()=>Et,Image:()=>Yr,ImageNode:()=>Yr,LayoutEngineMissingError:()=>fs,MEASURE_QUANTUM_PX:()=>Ye,MESH_DOWNSCALE:()=>oa,MESH_SHEPARD_POWER:()=>aa,MESH_SIGMA:()=>ys,MorphError:()=>Xt,NODE_TAXONOMY:()=>Oo,Node:()=>Q,Path:()=>us,PositionError:()=>jn,PresenceError:()=>Ms,Raster2D:()=>ks,Rect:()=>Hr,ReservedNodeIdError:()=>fi,ShaderEffect:()=>ta,SidecarVersionError:()=>Vn,SketchValidationError:()=>dt,TARGET_PATH:()=>At,TargetOverlapError:()=>Oi,Text:()=>Ze,TextCursor:()=>ci,TimelineValidationError:()=>et,TokenHighlight:()=>gi,TokenMatchError:()=>me,TrackValidationError:()=>yt,UnboundTargetError:()=>Sr,UnknownEasingError:()=>bn,UnknownValueTypeError:()=>Sn,UnresolvableTargetError:()=>Ie,ValueTypeInferenceError:()=>Dn,Video:()=>Gr,WriteDuringEvaluationError:()=>Ne,applyToPoint:()=>Lr,arcLength:()=>os,assignKeyIds:()=>Wn,audioOffsetSamples:()=>sr,auditCacheCold:()=>Ho,bake:()=>vo,bakeCheckpointed:()=>xo,batch:()=>fo,beginReadPhase:()=>pr,bindScene:()=>pi,bindTimeline:()=>Gn,booleanType:()=>On,breakLines:()=>at,buildFontRegistry:()=>ie,buildTimeline:()=>Mr,clip:()=>pt,clipList:()=>ya,clockDriver:()=>Ci,coercePathData:()=>Ge,collapseReplacer:()=>_t,collectLocalizedTextUsages:()=>Zo,collectTextUsages:()=>yi,colorType:()=>$n,compileTimeline:()=>nt,computed:()=>re,createDisplayListBuilder:()=>le,createPlayer:()=>Ai,createPlayhead:()=>Be,createScene:()=>jo,cubicBezier:()=>yn,cubicBezierDerivative:()=>wn,defineGsPlayer:()=>Ri,deleteSidecarTrack:()=>lr,diffDisplayLists:()=>ts,drawOn:()=>li,drawOnEach:()=>Wo,driftLoop:()=>va,each:()=>qo,easingDerivatives:()=>Ee,easings:()=>gn,emitDevWarning:()=>B,emptySidecar:()=>ar,endReadPhase:()=>mr,estimatingMeasurer:()=>ns,evaluate:()=>de,evaluateAt:()=>Un,filtersToCanvasFilter:()=>Ue,flatten:()=>he,followPath:()=>Uo,fontString:()=>sn,formatColor:()=>Ce,formatDisplayDiff:()=>Rr,fromTRS:()=>Zn,getLayoutEngine:()=>Qr,getTimelineCallbacks:()=>xr,getValueType:()=>te,glow:()=>Wr,hachureLines:()=>cs,hashKeys:()=>ze,highlight:()=>Ao,inReadPhase:()=>po,inferValueType:()=>Ot,invert:()=>zr,isDurationEditable:()=>ir,isEditableNodeId:()=>ne,isExemptFamily:()=>br,key:()=>C,lerpColor:()=>ht,matEquals:()=>St,matchTokenRun:()=>gs,mediaPrefersReducedMotion:()=>Di,mergeSidecar:()=>hr,mergeSidecarDetailed:()=>Bn,meshRasterSize:()=>bi,migrateSidecar:()=>qn,morph:()=>xa,motionPath:()=>pe,mount:()=>Ts,multiply:()=>ae,namedEasing:()=>Qt,normalizeEditedKeys:()=>ur,numberType:()=>En,oklabToRgba:()=>Nt,paintType:()=>Pn,parseCmap:()=>Fe,parseColor:()=>ut,parseDisplaySnapshot:()=>qr,parseSvgPathData:()=>$i,pathFromSegs:()=>Je,pathFromSvg:()=>Aa,pathLength:()=>Yo,pathType:()=>An,planReducedMotion:()=>Pi,pointAtLength:()=>Go,popIn:()=>wa,presence:()=>Oa,pulse:()=>ka,quantize:()=>G,random:()=>ot,rasterizeMesh:()=>wi,registerValueType:()=>it,reprOf:()=>Oe,requireLayoutEngine:()=>Jr,resolveAnchor:()=>ss,resolveEase:()=>Fn,resolveEaseDerivative:()=>zn,resolveSketch:()=>is,resolveTweenTarget:()=>kt,revealSchedule:()=>Ur,rgbaToOklab:()=>Ct,roughen:()=>Qe,roundedRectSegs:()=>jt,sampleTrack:()=>De,scrollDriver:()=>Pa,segmentGraphemes:()=>Mt,segmentWords:()=>Ke,serializeDisplayList:()=>Vr,setDefaultMeasurer:()=>Br,setDevWarning:()=>Ks,setLayoutEngine:()=>Kr,setScheduler:()=>co,setShaderRunner:()=>vi,setSidecarTrack:()=>cr,signal:()=>O,sketchStrokes:()=>_r,slideIn:()=>ba,spring:()=>wt,springEasing:()=>kn,springEasingDerivative:()=>vn,springPresets:()=>Gs,springTo:()=>Js,stagger:()=>Pe,stringType:()=>Cn,swapOnHmr:()=>Da,synchronousScheduler:()=>Hn,targetNodeId:()=>Vt,textCursor:()=>Po,timeline:()=>ko,tokenHighlight:()=>Ko,track:()=>bt,transitionToClip:()=>Ii,typewriter:()=>zo,untracked:()=>mo,validateFilters:()=>es,validateFonts:()=>Yn,validateHachure:()=>as,validateSceneFonts:()=>bs,validateSketch:()=>rs,validateTrack:()=>ee,vec2ArcType:()=>In,vec2Equals:()=>Ae,vec2Signal:()=>Wt,vec2Type:()=>Tn,velocityAt:()=>Ln,withDeterminismGuards:()=>_o});var Me=2.5949095,Se=2.70158,Rt=2*Math.PI/3,Kt=2*Math.PI/4.5;function ke(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}var gn={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-(-2*t+2)**2/2,easeInCubic:t=>t**3,easeOutCubic:t=>1-(1-t)**3,easeInOutCubic:t=>t<.5?4*t**3:1-(-2*t+2)**3/2,easeInQuart:t=>t**4,easeOutQuart:t=>1-(1-t)**4,easeInOutQuart:t=>t<.5?8*t**4:1-(-2*t+2)**4/2,easeInQuint:t=>t**5,easeOutQuint:t=>1-(1-t)**5,easeInOutQuint:t=>t<.5?16*t**5:1-(-2*t+2)**5/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>t===0?0:2**(10*t-10),easeOutExpo:t=>t===1?1:1-2**(-10*t),easeInOutExpo:t=>t===0?0:t===1?1:t<.5?2**(20*t-10)/2:(2-2**(-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-t*t),easeOutCirc:t=>Math.sqrt(1-(t-1)*(t-1)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-(2*t)**2))/2:(Math.sqrt(1-(-2*t+2)**2)+1)/2,easeInBack:t=>Se*t**3-1.70158*t*t,easeOutBack:t=>1+Se*(t-1)**3+1.70158*(t-1)**2,easeInOutBack:t=>t<.5?(2*t)**2*(3.5949095*2*t-Me)/2:((2*t-2)**2*(3.5949095*(t*2-2)+Me)+2)/2,easeInElastic:t=>t===0?0:t===1?1:-(2**(10*t-10))*Math.sin((t*10-10.75)*Rt),easeOutElastic:t=>t===0?0:t===1?1:2**(-10*t)*Math.sin((t*10-.75)*Rt)+1,easeInOutElastic:t=>t===0?0:t===1?1:t<.5?-(2**(20*t-10)*Math.sin((20*t-11.125)*Kt))/2:2**(-20*t+10)*Math.sin((20*t-11.125)*Kt)/2+1,easeInBounce:t=>1-ke(1-t),easeOutBounce:ke,easeInOutBounce:t=>t<.5?(1-ke(1-2*t))/2:(1+ke(2*t-1))/2};function ve(t){return t<1/2.75?2*7.5625*t:t<2/2.75?2*7.5625*(t-1.5/2.75):t<2.5/2.75?2*7.5625*(t-2.25/2.75):2*7.5625*(t-2.625/2.75)}var gt=Math.LN2,Ee={linear:()=>1,easeInQuad:t=>2*t,easeOutQuad:t=>2*(1-t),easeInOutQuad:t=>t<.5?4*t:4*(1-t),easeInCubic:t=>3*t**2,easeOutCubic:t=>3*(1-t)**2,easeInOutCubic:t=>t<.5?12*t**2:12*(1-t)**2,easeInQuart:t=>4*t**3,easeOutQuart:t=>4*(1-t)**3,easeInOutQuart:t=>t<.5?32*t**3:32*(1-t)**3,easeInQuint:t=>5*t**4,easeOutQuint:t=>5*(1-t)**4,easeInOutQuint:t=>t<.5?80*t**4:80*(1-t)**4,easeInSine:t=>Math.PI/2*Math.sin(t*Math.PI/2),easeOutSine:t=>Math.PI/2*Math.cos(t*Math.PI/2),easeInOutSine:t=>Math.PI/2*Math.sin(Math.PI*t),easeInExpo:t=>t===0?0:10*gt*2**(10*t-10),easeOutExpo:t=>t===1?0:10*gt*2**(-10*t),easeInOutExpo:t=>t===0||t===1?0:t<.5?10*gt*2**(20*t-10):10*gt*2**(-20*t+10),easeInCirc:t=>t/Math.sqrt(1-t*t),easeOutCirc:t=>(1-t)/Math.sqrt(1-(t-1)*(t-1)),easeInOutCirc:t=>t<.5?2*t/Math.sqrt(1-4*t*t):(2-2*t)/Math.sqrt(1-(-2*t+2)**2),easeInBack:t=>3*Se*t**2-2*1.70158*t,easeOutBack:t=>3*Se*(t-1)**2+2*1.70158*(t-1),easeInOutBack:t=>t<.5?12*3.5949095*t**2-4*Me*t:3*3.5949095*(2*t-2)**2+2*Me*(2*t-2),easeInElastic:t=>{if(t===0||t===1)return 0;let e=(t*10-10.75)*Rt,n=2**(10*t-10);return-(10*gt*n*Math.sin(e)+n*10*Rt*Math.cos(e))},easeOutElastic:t=>{if(t===0||t===1)return 0;let e=(t*10-.75)*Rt,n=2**(-10*t);return-10*gt*n*Math.sin(e)+n*10*Rt*Math.cos(e)},easeInOutElastic:t=>{if(t===0||t===1)return 0;let e=(20*t-11.125)*Kt;if(t<.5){let s=2**(20*t-10);return-(20*gt*s*Math.sin(e)+s*20*Kt*Math.cos(e))/2}let n=2**(-20*t+10);return(-20*gt*n*Math.sin(e)+n*20*Kt*Math.cos(e))/2},easeInBounce:t=>ve(1-t),easeOutBounce:ve,easeInOutBounce:t=>t<.5?ve(1-2*t):ve(2*t-1)},Hs="easeInOutCubic";function Xs(t,e,n,s){let r=3*t-3*n+1,i=3*n-6*t,o=3*t,a=3*e-3*s+1,l=3*s-6*e,c=3*e,h=p=>((r*p+i)*p+o)*p,f=p=>((a*p+l)*p+c)*p,u=p=>(3*r*p+2*i)*p+o;return{sampleY:f,sampleDX:u,sampleDY:p=>(3*a*p+2*l)*p+c,solveU:p=>{let v=p;for(let g=0;g<8;g++){let k=h(v)-p;if(Math.abs(k)<1e-7)return v;let M=u(v);if(Math.abs(M)<1e-6)break;v-=k/M}let w=0,y=1;for(v=p;y-w>1e-7;)h(v)<p?w=v:y=v,v=(w+y)/2;return v}}}function yn(t,e,n,s){let r=Xs(t,e,n,s);return i=>i<=0?0:i>=1?1:r.sampleY(r.solveU(i))}function wn(t,e,n,s){let r=Xs(t,e,n,s);return i=>{let o=r.solveU(Math.min(1,Math.max(0,i))),a=r.sampleDX(o);return Math.abs(a)<1e-9?0:r.sampleDY(o)/a}}var bn=class extends Error{constructor(t){super(`unknown easing '${t}'; register it via easings or use cubicBezier/spring`),this.name="UnknownEasingError"}};function Qt(t){let e=gn[t];if(!e)throw new bn(t);return e}var Hi=.005;function Zt(t){var n;let e=(n=t.mass)!=null?n:1;if(!(t.stiffness>0)||!(t.damping>0)||!(e>0))throw new RangeError("spring stiffness, damping, and mass must all be > 0");return{w0:Math.sqrt(t.stiffness/e),zeta:t.damping/(2*Math.sqrt(t.stiffness*e))}}function Xi(t,e){if(e<=0)return 0;let{w0:n,zeta:s}=Zt(t);if(Math.abs(s-1)<1e-9)return n*n*e*Math.exp(-n*e);if(s<1){let a=n*Math.sqrt(1-s*s);return Math.exp(-s*n*e)*(n*n/a)*Math.sin(a*e)}let r=Math.sqrt(s*s-1),i=-n*(s-r),o=-n*(s+r);return i*o*(Math.exp(i*e)-Math.exp(o*e))/(i-o)}function Jt(t,e){if(e<=0)return 0;let{w0:n,zeta:s}=Zt(t);if(Math.abs(s-1)<1e-9)return 1-Math.exp(-n*e)*(1+n*e);if(s<1){let a=n*Math.sqrt(1-s*s);return 1-Math.exp(-s*n*e)*(Math.cos(a*e)+s*n/a*Math.sin(a*e))}let r=Math.sqrt(s*s-1),i=-n*(s-r),o=-n*(s+r);return 1+(o*Math.exp(i*e)-i*Math.exp(o*e))/(i-o)}function $e(t,e){var a;let n=(a=e==null?void 0:e.settleTolerance)!=null?a:Hi,{w0:s,zeta:r}=Zt(t);if(r<1){let l=s*Math.sqrt(1-r*r),c=Math.sqrt(1+(r*s/l)**2);return Math.log(c/n)/(r*s)}let i=1/s;for(;1-Jt(t,i)>n;)i*=2;let o=0;for(let l=0;l<64&&i-o>1e-9;l++){let c=(o+i)/2;1-Jt(t,c)>n?o=c:i=c}return i}function Ys(t,e,n){let s=$e(t,n);return Jt(t,Math.min(e,s))/Jt(t,s)}function Yi(t,e,n){let{w0:s,zeta:r}=Zt(t),i,o,a;if(Math.abs(r-1)<1e-9){let c=n+s*e;i=h=>h<=0?e:Math.exp(-s*h)*(e+c*h),o=h=>h<=0?n:Math.exp(-s*h)*(n-s*c*h),a=h=>Math.exp(-s*h)*(Math.abs(e)+Math.abs(c)*h)}else if(r<1){let c=s*Math.sqrt(1-r*r),h=(n+r*s*e)/c,f=Math.hypot(e,h);i=u=>u<=0?e:Math.exp(-r*s*u)*(e*Math.cos(c*u)+h*Math.sin(c*u)),o=u=>u<=0?n:Math.exp(-r*s*u)*(n*Math.cos(c*u)-(s*s*e+r*s*n)/c*Math.sin(c*u)),a=u=>Math.exp(-r*s*u)*f}else{let c=Math.sqrt(r*r-1),h=s*(-r+c),f=s*(-r-c),u=(n-f*e)/(h-f),d=(h*e-n)/(h-f);i=m=>m<=0?e:u*Math.exp(h*m)+d*Math.exp(f*m),o=m=>m<=0?n:u*h*Math.exp(h*m)+d*f*Math.exp(f*m),a=m=>Math.abs(u)*Math.exp(h*m)+Math.abs(d)*Math.exp(f*m)}return{value:i,velocity:o,settleTime:c=>{let h=c!=null?c:Math.abs(e)*.005+1e-6;if(a(0)<=h&&Math.abs(n)<1e-12)return 0;let f=1/s,u=0;for(;a(f)>h&&u++<64;)f*=2;let d=0;for(let m=0;m<64&&f-d>1e-9;m++){let p=(d+f)/2;Math.max(a(p),a(p*1.05+1e-6))>h?d=p:f=p}return f}}}var wt=Object.assign(t=>{var e;return Zt(t),{kind:"spring",stiffness:t.stiffness,damping:t.damping,mass:(e=t.mass)!=null?e:1}},{duration:$e,value:Ys,retarget:Yi}),Gs={default:{stiffness:170,damping:26},gentle:{stiffness:120,damping:14},wobbly:{stiffness:180,damping:12},stiff:{stiffness:210,damping:20},slow:{stiffness:280,damping:60},molasses:{stiffness:280,damping:120}};function kn(t){let e=$e(t);return n=>Ys(t,n*e)}function vn(t){let e=$e(t),n=e/Jt(t,e);return s=>s>=1?0:Xi(t,s*e)*n}var Us=t=>{var e;(e=globalThis.console)==null||e.warn(`[glissade] ${t}`)};function Ks(t){Us=t}function B(t){Us(t)}var Gi=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Ui=/^rgba?\(\s*([\d.]+)\s*[, ]\s*([\d.]+)\s*[, ]\s*([\d.]+)\s*(?:[,/]\s*([\d.]+%?)\s*)?\)$/i,xn=class extends Error{constructor(t){super(`cannot parse color '${t}' (supported: #rgb[a], #rrggbb[aa], rgb()/rgba())`),this.name="ColorParseError"}};function ut(t){let e=Gi.exec(t);if(e){let s=e[1];s.length<=4&&(s=[...s].map(i=>i+i).join(""));let r=parseInt(s,16);return s.length===6?{r:r>>16,g:r>>8&255,b:r&255,a:1}:{r:r>>>24&255,g:r>>>16&255,b:r>>>8&255,a:(r&255)/255}}let n=Ui.exec(t);if(n){let s=n[4],r=s===void 0?1:s.endsWith("%")?parseFloat(s)/100:parseFloat(s);return{r:parseFloat(n[1]),g:parseFloat(n[2]),b:parseFloat(n[3]),a:r}}throw new xn(t)}function Ce(t){let e=i=>Math.min(255,Math.max(0,Math.round(i))),n=i=>e(i).toString(16).padStart(2,"0"),s=`#${n(t.r)}${n(t.g)}${n(t.b)}`,r=Math.min(1,Math.max(0,t.a));return r>=1?s:`${s}${n(r*255)}`}function dn(t){let e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function pn(t){return(t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055)*255}function Ct(t){let e=dn(t.r),n=dn(t.g),s=dn(t.b),r=Math.cbrt(.4122214708*e+.5363325363*n+.0514459929*s),i=Math.cbrt(.2119034982*e+.6806995451*n+.1073969566*s),o=Math.cbrt(.0883024619*e+.2817188376*n+.6299787005*s);return{L:.2104542553*r+.793617785*i-.0040720468*o,a:1.9779984951*r-2.428592205*i+.4505937099*o,b:.0259040371*r+.7827717662*i-.808675766*o,alpha:t.a}}function Nt(t){let e=(t.L+.3963377774*t.a+.2158037573*t.b)**3,n=(t.L-.1055613458*t.a-.0638541728*t.b)**3,s=(t.L-.0894841775*t.a-1.291485548*t.b)**3;return{r:pn(4.0767416621*e-3.3077115913*n+.2309699292*s),g:pn(-1.2684380046*e+2.6097574011*n-.3413193965*s),b:pn(-.0041960863*e-.7034186147*n+1.707614701*s),a:t.alpha}}function ht(t,e,n){let s=Ct(ut(t)),r=Ct(ut(e)),i=(o,a)=>o+(a-o)*n;return Ce(Nt({L:i(s.L,r.L),a:i(s.a,r.a),b:i(s.b,r.b),alpha:i(s.alpha,r.alpha)}))}var Mn=new Map;function it(t){Mn.set(t.id,t)}var Sn=class extends Error{constructor(t){super(`unknown value type '${t}'; register it via registerValueType()`),this.name="UnknownValueTypeError"}};function te(t){let e=Mn.get(t);if(!e)throw new Sn(t);return e}function Oe(t){var e,n;return(n=(e=Mn.get(t))==null?void 0:e.repr)!=null?n:t}var En={id:"number",lerp:(t,e,n)=>t+(e-t)*n,extrapolates:!0,equals:Object.is,add:(t,e)=>t+e,sub:(t,e)=>t-e,scale:(t,e)=>t*e,defaultHandoff:"spring"},Ae=(t,e)=>t[0]===e[0]&&t[1]===e[1],Tn={id:"vec2",lerp:(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n],extrapolates:!0,equals:Ae,add:(t,e)=>[t[0]+e[0],t[1]+e[1]],sub:(t,e)=>[t[0]-e[0],t[1]-e[1]],scale:(t,e)=>[t[0]*e,t[1]*e],defaultHandoff:"spring"},In={id:"vec2-arc",repr:"vec2",lerp:(t,e,n)=>{let s=Math.hypot(t[0],t[1]),r=Math.hypot(e[0],e[1]),i=Math.atan2(t[1],t[0]),o=Math.atan2(e[1],e[0])-i;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;let a=s+(r-s)*n,l=i+o*n;return[a*Math.cos(l),a*Math.sin(l)]},extrapolates:!0,equals:Ae,defaultHandoff:"blend-from-frozen"},$n={id:"color",lerp:ht,extrapolates:!0,equals:(t,e)=>t===e,defaultHandoff:"blend-from-frozen"};function Qs(t){return{id:t,lerp:(e,n,s)=>s>=1?n:e,extrapolates:!1,equals:(e,n)=>Object.is(e,n),defaultHandoff:"cut"}}var Cn=Qs("string"),On=Qs("boolean"),mn=(t,e,n)=>[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n];function Ns(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let s=t[n],r=e[n];if(s.closed!==r.closed||s.v.length!==r.v.length)return!1}return!0}var Vs=!1,An={id:"path",lerp:(t,e,n)=>Ns(t,e)?t.map((s,r)=>{let i=e[r];return{closed:s.closed,v:s.v.map((o,a)=>mn(o,i.v[a],n)),in:s.in.map((o,a)=>mn(o,i.in[a],n)),out:s.out.map((o,a)=>mn(o,i.out[a],n))}}):(Vs||(Vs=!0,B("path lerp with mismatched topology (contour/vertex counts or closed flags differ): snapping instead of morphing \u2014 supply matched vertex counts (\xA72.2)")),n>=1?e:t),extrapolates:!1,equals:(t,e)=>{if(t===e)return!0;if(!Ns(t,e))return!1;let n=(s,r)=>s[0]===r[0]&&s[1]===r[1];return t.every((s,r)=>{let i=e[r];return s.v.every((o,a)=>n(o,i.v[a]))&&s.in.every((o,a)=>n(o,i.in[a]))&&s.out.every((o,a)=>n(o,i.out[a]))})},defaultHandoff:"blend-from-frozen"},Te=(t,e,n)=>t+(e-t)*n,xe=(t,e,n)=>[Te(t[0],e[0],n),Te(t[1],e[1],n)];function qs(t){try{return Ce(L(T({},ut(t)),{a:0}))}catch(e){return t}}function Ki(t,e,n){try{return ht(t,e,n)}catch(s){return n>=1?e:t}}function Ws(t,e){let n=e.stops.map(r=>({offset:r.offset,color:t})),s=e.interpolation?{interpolation:e.interpolation}:{};return e.kind==="radial"?T(T(T({kind:"radial",stops:n},e.center?{center:e.center}:{}),e.radius!==void 0?{radius:e.radius}:{}),s):T(T(T({kind:"linear",stops:n},e.from?{from:e.from}:{}),e.to?{to:e.to}:{}),s)}var Bs=!1;function Ut(t,e,n,s="paint lerp across mismatched gradient shapes (different kind or stop count): snapping instead of interpolating \u2014 match the kind + stop count on both keyframes (\xA72.2)"){return Bs||(Bs=!0,B(s)),t>=1?n:e}var Qi=(t,e)=>t.length===e.length&&t.every((n,s)=>n.offset===e[s].offset&&n.color===e[s].color),Pn={id:"paint",lerp:(t,e,n)=>{var a,l,c,h;if(t.kind==="color"&&e.kind==="color")return{kind:"color",color:ht(t.color,e.color,n)};if(t.kind==="mesh"&&e.kind==="mesh"){if(t.points.length!==e.points.length)return Ut(n,t,e);if(t.interpolation!==e.interpolation)return Ut(n,t,e,`paint lerp across mismatched mesh interpolation modes ('${(a=t.interpolation)!=null?a:"smooth"}' \u2192 '${(l=e.interpolation)!=null?l:"smooth"}'): snapping instead of interpolating \u2014 the blend kernel is discrete, so it switches once at the boundary; match \`interpolation\` on both keyframes to morph the points (\xA73 Paint)`);let f=t.points.map((d,m)=>{let p=e.points[m];return{pos:xe(d.pos,p.pos,n),color:ht(d.color,p.color,n)}}),u=t.bg!==void 0||e.bg!==void 0?{bg:Ki((c=t.bg)!=null?c:qs(e.bg),(h=e.bg)!=null?h:qs(t.bg),n)}:{};return T(T({kind:"mesh",points:f},t.interpolation?{interpolation:t.interpolation}:{}),u)}if(t.kind==="mesh"||e.kind==="mesh")return Ut(n,t,e);let s=t,r=e;if(s.kind==="color"&&r.kind!=="color"?s=Ws(s.color,r):r.kind==="color"&&s.kind!=="color"&&(r=Ws(r.color,s)),s.kind==="color"||r.kind==="color"||s.kind!==r.kind||s.stops.length!==r.stops.length)return Ut(n,t,e);let i=s.stops.map((f,u)=>({offset:Te(f.offset,r.stops[u].offset,n),color:ht(f.color,r.stops[u].color,n)})),o=s.interpolation?{interpolation:s.interpolation}:{};return s.kind==="radial"&&r.kind==="radial"?T(T(T({kind:"radial",stops:i},s.center&&r.center?{center:xe(s.center,r.center,n)}:s.center?{center:s.center}:{}),s.radius!==void 0&&r.radius!==void 0?{radius:Te(s.radius,r.radius,n)}:s.radius!==void 0?{radius:s.radius}:{}),o):s.kind==="linear"&&r.kind==="linear"?T(T(T({kind:"linear",stops:i},s.from&&r.from?{from:xe(s.from,r.from,n)}:s.from?{from:s.from}:{}),s.to&&r.to?{to:xe(s.to,r.to,n)}:s.to?{to:s.to}:{}),o):Ut(n,t,e)},extrapolates:!1,equals:(t,e)=>t===e?!0:t.kind!==e.kind?!1:t.kind==="color"?e.kind==="color"&&t.color===e.color:t.kind==="mesh"?e.kind!=="mesh"||t.interpolation!==e.interpolation||t.bg!==e.bg||t.points.length!==e.points.length?!1:t.points.every((n,s)=>{let r=e.points[s];return n.color===r.color&&n.pos[0]===r.pos[0]&&n.pos[1]===r.pos[1]}):e.kind==="color"||e.kind==="mesh"||!Qi(t.stops,e.stops)||t.interpolation!==e.interpolation?!1:t.kind==="radial"&&e.kind==="radial"?JSON.stringify(t.center)===JSON.stringify(e.center)&&t.radius===e.radius:t.kind==="linear"&&e.kind==="linear"?JSON.stringify(t.from)===JSON.stringify(e.from)&&JSON.stringify(t.to)===JSON.stringify(e.to):!1,defaultHandoff:"blend-from-frozen"},Dn=class extends Error{constructor(t){super(`cannot infer a value type for ${JSON.stringify(t)}; register a custom type`),this.name="ValueTypeInferenceError"}},Ji=t=>typeof t=="object"&&t!==null&&typeof t.closed=="boolean"&&Array.isArray(t.v)&&Array.isArray(t.in)&&Array.isArray(t.out),Zi=t=>typeof t=="object"&&t!==null&&(t.kind==="color"||t.kind==="linear"||t.kind==="radial"||t.kind==="mesh");function Ot(t){if(typeof t=="number")return"number";if(typeof t=="boolean")return"boolean";if(Zi(t))return"paint";if(Array.isArray(t)&&t.length===2&&t.every(e=>typeof e=="number"))return"vec2";if(Array.isArray(t)&&t.length>0&&t.every(Ji))return"path";if(typeof t=="string")try{return ut(t),"color"}catch(e){return"string"}throw new Dn(t)}it(En);it(Tn);it(In);it($n);it(Cn);it(On);it(An);it(Pn);var yt=class extends Error{constructor(t,e){super(`track '${t}': ${e}`),this.name="TrackValidationError"}};function ee(t){let e=te(t.type);if(t.keys.length===0)throw new yt(t.target,"must have at least one key");if(e.defaultHandoff==="cut")for(let n of t.keys)n.interp!=="hold"&&(n.interp="hold");for(let n=1;n<t.keys.length;n++){let s=t.keys[n-1],r=t.keys[n];if(r.t<=s.t)throw new yt(t.target,`keys must be strictly increasing in t (key[${n}] at t=${r.t} after t=${s.t})`)}if(!/^[^/]+\/.+$/.test(t.target))throw new yt(t.target,"target must be '<nodeId>/<prop.path>' (e.g. 'circle/opacity')")}function C(t,e,n){if(n===void 0)return{t,value:e};if(typeof n=="string"||"kind"in n)return{t,value:e,ease:n};let s=n,r={t,value:e};return s.ease!==void 0&&(r.ease=s.ease),s.interp!==void 0&&(r.interp=s.interp),s.id!==void 0&&(r.id=s.id),s.derived!==void 0&&(r.derived=s.derived),r}function Js(t,e,n,s){let r=wt.duration(s);if(t-r<0)throw new yt("springTo",`this spring needs ${r.toFixed(3)}s to settle \u2014 endT must be \u2265 its duration (got ${t})`);return[C(t-r,e),C(t,n,wt(s))]}function Pe(t,e){let n=typeof e=="function"?e:s=>s*e;return t.map((s,r)=>{let i=n(r);return L(T({},s),{keys:s.keys.map(o=>L(T({},o),{t:o.t+i}))})})}function bt(t,e,n,s){let r={target:t,type:e,keys:n};return(s==null?void 0:s.editable)!==void 0&&(r.editable=s.editable),ee(r),r}function Fn(t){return t===void 0?Qt("linear"):typeof t=="string"?Qt(t):t.kind==="cubicBezier"?yn(...t.pts):kn(t)}var _s=new Set;function zn(t){if(t===void 0)return Ee.linear;if(typeof t=="string"){let e=Ee[t];if(e)return e;let n=Qt(t);_s.has(t)||(_s.add(t),B(`easing '${t}' has no registered derivative; velocity uses a numeric fallback \u2014 register one in easingDerivatives for exact interruption handoff`));let s=1/1024;return r=>(n(Math.min(1,r+s))-n(Math.max(0,r-s)))/(Math.min(1,r+s)-Math.max(0,r-s))}return t.kind==="cubicBezier"?wn(...t.pts):vn(t)}var js=new WeakMap;function Zs(t){let e=js.get(t);return e||(e={cursor:1,easeCache:new Array(t.keys.length)},js.set(t,e)),e}function tr(t,e,n){let s=e.easeCache[n];return s||(s=Fn(t.keys[n].ease),e.easeCache[n]=s),s}function er(t,e,n){let s=t.length;for(let o=Math.max(1,n-1);o<=Math.min(s-1,n+1);o++)if(t[o-1].t<=e&&e<t[o].t)return o;if(e<t[0].t)return 0;if(e>=t[s-1].t)return s;let r=1,i=s-1;for(;r<i;){let o=r+i>>1;t[o].t<=e?r=o+1:i=o}return r}function Ln(t,e){let n=te(t.type);if(!n.sub||!n.scale)return null;let s=t.keys,r=s.length,i=Zs(t),o=er(s,e,i.cursor),a=n.scale(n.sub(s[0].value,s[0].value),0);if(o===0||o>=r)return a;let l=s[o];if(l.interp==="hold")return a;let c=s[o-1],h=l.t-c.t,f=(e-c.t)/h;if(!n.extrapolates){let d=tr(t,i,o)(f);if(d<0||d>1)return a}let u=zn(l.ease)(f);return n.scale(n.sub(l.value,c.value),u/h)}function De(t,e){let n=t.keys,s=n.length,r=Zs(t),i=er(n,e,r.cursor);if(i===0)return n[0].value;if(i>=s)return n[s-1].value;r.cursor=i;let o=n[i],a=n[i-1];if(o.interp==="hold")return a.value;let l=te(t.type),c=(e-a.t)/(o.t-a.t),h=tr(t,r,i)(c);return!l.extrapolates&&(h<0||h>1)&&(r.warnedClamp||(r.warnedClamp=!0,B(`track '${t.target}' (type '${t.type}') clamped an out-of-range eased value \u2014 non-extrapolating types can't overshoot, so a spring/overshooting ease on this track is flattened`)),h=Math.min(1,Math.max(0,h))),l.lerp(a.value,o.value,h)}var At=Symbol.for("glissade.targetPath"),Ie=class extends Error{constructor(t){super(t!=null?t:'tween target is not addressable: pass a target string ("node/prop") or a property signal of a node that has an explicit id (\xA73.1 \u2014 anonymous nodes cannot be track targets)'),this.name="UnresolvableTargetError"}};function Vt(t){let e=t.indexOf("/");return e<0?t:t.slice(0,e)}function ne(t){return typeof t=="string"&&t.length>0&&t!=="__root"&&!t.startsWith("~")}function kt(t){let e=typeof t=="string"?t:t[At];if(typeof e!="string")throw new Ie;if(Vt(e).startsWith("~"))throw new Ie(`'${e}': structural ids (~Type.ordinal) are inspection-only and cannot be track targets (\xA76.5) \u2014 give the node an explicit id`);return e}function tt(t,e){return e+2<=t.byteLength?t.getUint16(e):0}function ft(t,e){return e+4<=t.byteLength?t.getUint32(e):0}function to(t,e){return t===3&&e===10||t===0&&e>=4?5:t===3&&e===1||t===0?3:0}function eo(t,e,n){let s=tt(t,e+6),r=s>>1,i=e+14,o=i+s+2,a=o+s,l=a+s;for(let c=0;c<r;c++){let h=tt(t,i+c*2),f=tt(t,o+c*2);if(f>h)continue;let u=tt(t,a+c*2),d=tt(t,l+c*2);for(let m=f;m<=h;m++){if(m===65535)continue;let p;if(d===0)p=m+u&65535;else{let v=tt(t,l+c*2+d+(m-f)*2);p=v===0?0:v+u&65535}p!==0&&n.add(m)}}}function no(t,e,n){let s=ft(t,e+12),r=Math.max(0,Math.floor((t.byteLength-(e+16))/12)),i=Math.min(s,r),o=e+16;for(let a=0;a<i;a++,o+=12){let l=ft(t,o),c=ft(t,o+4),h=ft(t,o+8);if(!(l>c)&&!(c-l>2097152))for(let f=l;f<=c;f++)h+(f-l)!==0&&n.add(f)}}function Fe(t){let e=new Set;try{let n=ArrayBuffer.isView(t)?new DataView(t.buffer,t.byteOffset,t.byteLength):new DataView(t);if(n.byteLength<12)return e;let s=0;ft(n,0)===1953784678&&(s=ft(n,12));let r=tt(n,s+4),i=0;for(let h=0;h<r;h++){let f=s+12+h*16;if(ft(n,f)===1668112752){i=ft(n,f+8);break}}if(i===0)return e;let o=tt(n,i+2),a=0,l=-1;for(let h=0;h<o;h++){let f=i+4+h*8,u=tt(n,f),d=tt(n,f+2),m=i+ft(n,f+4),p=to(u,d);p>l&&m+2<=n.byteLength&&(l=p,a=m)}if(l<0)return e;let c=tt(n,a);c===4?eo(n,a,e):c===12&&no(n,a,e)}catch(n){return e}return e}function Rn(t){var n;let e={version:1,tracks:(n=t.tracks)!=null?n:[]};return t.duration!==void 0&&(e.duration=t.duration),t.editableDuration!==void 0&&(e.editableDuration=t.editableDuration),t.fps!==void 0&&(e.fps=t.fps),t.posterTime!==void 0&&(e.posterTime=t.posterTime),t.labels!==void 0&&(e.labels=t.labels),t.markers!==void 0&&(e.markers=t.markers),t.children!==void 0&&(e.children=t.children),t.audio!==void 0&&(e.audio=t.audio),t.assets!==void 0&&(e.assets=t.assets),e}var et=class extends Error{constructor(t){super(t),this.name="TimelineValidationError"}};function so(t){for(let e=1;e<t.keys.length;e++){let n=t.keys[e];if(n.ease&&typeof n.ease=="object"&&n.ease.kind==="spring"){let s=t.keys[e-1].t+wt.duration(n.ease);if(Math.abs(n.t-s)>1e-6)throw new et(`track '${t.target}': spring-eased key at t=${n.t} must sit at prev.t + spring.duration (${s.toFixed(6)}); the builder computes this automatically`)}}}function sr(t,e=48e3){return Math.round(t*e)}function ro(t,e,n){return t.map(s=>L(T({},s),{t:e+s.t/n}))}function rr(t,e,n,s,r,i){var o,a;for(let l of t.tracks)ee(l),so(l),r.push({track:L(T({},l),{keys:ro(l.keys,e,n)}),unit:s});for(let l of(o=t.children)!=null?o:[]){let c=l.mode==="sync"&&(a=l.timeScale)!=null?a:1;if(l.mode==="add"&&l.timeScale!==void 0)throw new et("timeScale is only valid on mode:'sync' children (\xA72.3)");if(c<=0)throw new et("sync timeScale must be > 0");let h=l.mode==="sync"?++i.n:s;rr(l.timeline,e+l.at/n,n*c,h,r,i)}}function io(t){let e=new Map;for(let{track:s,unit:r}of t){let i=e.get(s.target);if(!i){e.set(s.target,{track:L(T({},s),{keys:[...s.keys]}),unit:r});continue}if(i.unit!==r)throw new et(`target '${s.target}' is animated by a sync (opaque) child and another timeline unit; sync children must own disjoint targets (no last-writer-wins across the sync boundary, \xA72.3)`);if(i.track.type!==s.type)throw new et(`target '${s.target}' has conflicting value types '${i.track.type}' and '${s.type}'`);let o=s.keys[0].t,a=s.keys[s.keys.length-1].t,l=i.track.keys[0].t,c=i.track.keys[i.track.keys.length-1].t,h=i.track.keys.filter(f=>f.t<o||f.t>a);l<=a&&o<=c&&B(`overlapping tracks for '${s.target}' in [${o}, ${a}]: later insertion wins (${i.track.keys.length-h.length} earlier key(s) dropped)`),i.track.keys=[...h,...s.keys].sort((f,u)=>f.t-u.t)}let n=new Map;for(let[s,{track:r}]of e)n.set(s,r);return n}function ir(t){return t.editableDuration===!0}function oo(t){var n;let e=t.mode==="sync"&&(n=t.timeScale)!=null?n:1;return t.at+or(t.timeline)/e}function or(t){var n,s;if(t.duration!==void 0)return t.duration;let e=0;for(let r of t.tracks){let i=r.keys[r.keys.length-1];i&&(e=Math.max(e,i.t))}for(let r of(n=t.markers)!=null?n:[])e=Math.max(e,r.t);for(let r of(s=t.children)!=null?s:[])e=Math.max(e,oo(r));return e}function nt(t){var a,l;if(t.version!==1)throw new et(`unsupported timeline document version ${String(t.version)}`);let e=[];rr(t,0,1,0,e,{n:0});let n=io(e),s=T({},t.labels),r=[...(a=t.markers)!=null?a:[]],i=[...(l=t.audio)!=null?l:[]],o=(c,h,f)=>{var u,d,m,p,v;for(let w of c!=null?c:[]){let y=h+w.at/f,g=f*(w.mode==="sync"&&(u=w.timeScale)!=null?u:1);for(let[k,M]of Object.entries((d=w.timeline.labels)!=null?d:{}))k in s||(s[k]=y+M/g);for(let k of(m=w.timeline.markers)!=null?m:[])r.push(L(T({},k),{t:y+k.t/g}));for(let k of(p=w.timeline.audio)!=null?p:[])i.push(T(L(T({},k),{at:y+k.at/g}),g!==1?{playbackRate:((v=k.playbackRate)!=null?v:1)*g}:{}));o(w.timeline.children,y,g)}};return o(t.children,0,1),r.sort((c,h)=>c.t-h.t),i.sort((c,h)=>c.at-h.at),{duration:or(t),labels:s,markers:r,tracks:n,audio:i}}var Nn="main",Vn=class extends Error{constructor(t){super(`unsupported sidecar version ${String(t)}; this build reads sidecarVersion 1 or 2`),this.name="SidecarVersionError"}};function ar(){return{sidecarVersion:2,timelines:{[Nn]:{tracks:{}}}}}function qn(t){if(!t)return null;if(t.sidecarVersion===2)return t;if(t.sidecarVersion===1){let e={};for(let s of t.tracks)e[s.target]={type:s.type,baseHash:null,keys:s.keys};let n={tracks:e};return t.labels&&(n.labels=t.labels),{sidecarVersion:2,timelines:{[Nn]:n}}}throw new Vn(t.sidecarVersion)}function ze(t){let e=JSON.stringify(t.map(s=>{var r,i;return[s.t,s.value,(r=s.ease)!=null?r:null,(i=s.interp)!=null?i:null]})),n=2166136261;for(let s=0;s<e.length;s++)n^=e.charCodeAt(s),n=Math.imul(n,16777619);return(n>>>0).toString(16)}function Wn(t){let e=-1;for(let n of t){let s=n.id?/^k(\d+)$/.exec(n.id):null;s&&(e=Math.max(e,Number(s[1])))}return t.map(n=>n.id?T({},n):L(T({},n),{id:`k${++e}`}))}function cr(t,e,n,s,r,i){var l;if(!ne(Vt(n)))throw new yt(n,"structural/un-id'd nodes cannot host editor tracks (\xA76.5) \u2014 only nodes with an explicit id");let o=(l=t.timelines[e])!=null?l:{tracks:{}},a={type:s,baseHash:i?ze(i):null,keys:Wn(r)};return L(T({},t),{timelines:L(T({},t.timelines),{[e]:L(T({},o),{tracks:L(T({},o.tracks),{[n]:a})})})})}function lr(t,e,n){let s=t.timelines[e];if(!s||!(n in s.tracks))return t;let o=s.tracks,{[n]:r}=o,i=Lt(o,[Rs(n)]);return L(T({},t),{timelines:L(T({},t.timelines),{[e]:L(T({},s),{tracks:i})})})}function nr(t){return t.some(e=>e.derived)?t.map((e,n)=>e.derived&&n>0?L(T({},e),{value:t[n-1].value}):e):t}function Bn(t,e){var c,h,f;let n=qn(e);if(!n)return{timeline:t,drift:[],orphans:{}};let s=(c=n.timelines[Nn])!=null?c:{tracks:{}},r=new Map(Object.entries(s.tracks)),i=[],o=T({},(h=s.orphans)!=null?h:{}),a=t.tracks.map(u=>{let d=r.get(u.target);return d?(r.delete(u.target),d.type!==u.type?(o[u.target]={type:d.type,keys:d.keys,reason:"type-changed"},u):(d.baseHash!==null&&d.baseHash!==ze(u.keys)&&i.push(u.target),L(T({},u),{keys:nr(d.keys.map(m=>T({},m))),editable:!0}))):u});for(let[u,d]of r)d.baseHash!==null?o[u]={type:d.type,keys:d.keys,reason:"prop-missing"}:a.push({target:u,type:d.type,keys:nr(d.keys.map(m=>T({},m))),editable:!0});let l=L(T({},t),{tracks:a});if(s.labels&&Object.keys(s.labels).length>0){let u=(f=t.labels)!=null?f:{},d=Object.keys(s.labels).filter(m=>m in u);d.length&&B(`sidecar label(s) ${d.join(", ")} collide with code labels; code wins (\xA76.2)`),l.labels=T(T({},s.labels),u)}return i.length&&B(`sidecar: code baseline changed beneath edits on ${i.join(", ")} (\xA76.2)`),{timeline:l,drift:i,orphans:o}}function hr(t,e){return Bn(t,e).timeline}function ur(t){let e=t.map(n=>T({},n)).sort((n,s)=>n.t-s.t);for(let n=0;n<2;n++){for(let s=1;s<e.length;s++){let r=e[s].ease;r&&typeof r=="object"&&r.kind==="spring"&&(e[s].t=e[s-1].t+wt.duration(r))}e.sort((s,r)=>s.t-r.t)}for(let n=1;n<e.length;n++)e[n].t<=e[n-1].t&&(e[n].t=e[n-1].t+.001);return e}var Hn=t=>t(),_n=Hn,Pt=new Set,Ve=0,qt=!1,se=!1,ao=1e3;function co(t){let e=_n;return _n=t!=null?t:Hn,se&&!qt&&(se=!1,Pt.size>0&&Xn()),e}function lo(t){Pt.add(t),Xn()}function Xn(){Ve>0||qt||se||(se=!0,_n(ho))}function ho(){se=!1,!qt&&uo()}function uo(){if(qt)return;qt=!0;let t;try{let e=0;for(;Pt.size>0;){if(++e>ao)throw Pt.clear(),new Error("signal notification flush did not settle within 1000 passes: a subscriber is writing to a signal it observes (DESIGN.md \xA76.1).");let n=[...Pt];Pt.clear();for(let s of n)try{s()}catch(r){t!=null||(t={err:r})}}}finally{qt=!1}if(t)throw t.err}function Le(){Ve++}function Re(){Ve--,Ve===0&&Pt.size>0&&Xn()}function fo(t){Le();try{return t()}finally{Re()}}var vt=null,Dt=0,Ne=class extends Error{constructor(){super("signal.set() during evaluation: the read phase is pure (DESIGN.md \xA72.1). Drivers write the playhead before evaluation begins; stateful animation belongs in bake()."),this.name="WriteDuringEvaluationError"}},dr=class extends Error{constructor(){super("circular signal dependency detected"),this.name="CircularDependencyError"}};function pr(){Dt++}function mr(){if(Dt===0)throw new Error("endReadPhase() without matching beginReadPhase()");Dt--}function po(){return Dt>0}var gr=class{constructor(t){x(this,"value");x(this,"fn");x(this,"equals");x(this,"version",0);x(this,"state");x(this,"computing",!1);x(this,"deps",[]);x(this,"depVersions",[]);x(this,"dependents",new Set);x(this,"subscribers",new Set);var e,n;this.fn=(e=t.fn)!=null?e:null,this.value=t.value,this.equals=(n=t.equals)!=null?n:Object.is,this.state=this.fn?2:0}get(){return vt&&vt.addDep(this),this.updateIfNecessary(),this.value}peek(){return this.updateIfNecessary(),this.value}set(t){if(Dt>0)throw new Ne;Le();try{this.fn&&this.detachFn(),this.writeValue(t)}finally{Re()}}forceSet(t){Le();try{this.fn&&this.detachFn(),this.writeValue(t)}finally{Re()}}bindSource(t){if(Dt>0)throw new Ne;Le();try{this.fn=t,this.state=2,this.invalidateDependents(2)}finally{Re()}}unbindSource(){if(Dt>0)throw new Ne;this.fn&&(this.updateIfNecessary(),this.detachFn())}get isBound(){return this.fn!==null}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}addDep(t){this.deps[this.deps.length-1]!==t&&(this.deps.push(t),this.depVersions.push(-1),t.dependents.add(this))}detachFn(){this.fn=null,this.clearDeps(),this.state=0}writeValue(t){(this.version>0||this.value!==void 0)&&this.equals(this.value,t)||(this.value=t,this.version++,this.invalidateDependents(2))}invalidateDependents(t){for(let e of[...this.dependents])e.markStale(t);if(this.subscribers.size>0)for(let e of[...this.subscribers])lo(e)}markStale(t){if(this.state>=t)return;let e=this.state===0;this.state=t,e&&this.invalidateDependents(1)}updateIfNecessary(){if(!(this.fn===null||this.state===0)){if(this.computing)throw new dr;if(this.state===1){this.state=0;for(let t=0;t<this.deps.length;t++){let e=this.deps[t];if(e.updateIfNecessary(),e.version!==this.depVersions[t]){this.state=2;break}}}this.state===2&&this.recompute(),this.state=0}}recompute(){this.clearDeps();let t=vt;vt=this,this.computing=!0;let e;try{e=this.fn()}finally{this.computing=!1,vt=t}for(let n=0;n<this.deps.length;n++)this.depVersions[n]=this.deps[n].version;(!(this.version>0||this.value!==void 0)||!this.equals(this.value,e))&&(this.value=e,this.version++)}clearDeps(){for(let t of this.deps)t.dependents.delete(this);this.deps=[],this.depVersions=[]}};function yr(t,e){let n=(()=>t.get());return n.peek=()=>t.peek(),n.subscribe=s=>t.subscribe(s),e(n),n}function O(t,e){let n=new gr({value:t,equals:e==null?void 0:e.equals});return yr(n,s=>{s.set=r=>n.set(r),s.forceSet=r=>n.forceSet(r),s.bindSource=r=>n.bindSource(r),s.unbindSource=()=>n.unbindSource(),Object.defineProperty(s,"isBound",{get:()=>n.isBound})})}function re(t,e){return yr(new gr({fn:t,equals:e==null?void 0:e.equals}),()=>{})}function mo(t){let e=vt;vt=null;try{return t()}finally{vt=e}}function Wt(t){let[e,n]=Array.isArray(t)?t:[t.x,t.y],s=O(e),r=O(n);s.expects="number",r.expects="number";let i=O(null,{equals:(h,f)=>h===null||f===null?h===f:h[0]===f[0]&&h[1]===f[1]}),o=O(e),a=O(n);s.bindSource(()=>{let h=i();return h===null?o():h[0]}),r.bindSource(()=>{let h=i();return h===null?a():h[1]});let l=re(()=>[s(),r()],{equals:(h,f)=>h[0]===f[0]&&h[1]===f[1]}),c=(()=>l());return c.peek=()=>l.peek(),c.subscribe=h=>l.subscribe(h),c.set=h=>{i.set(null),o.set(h[0]),a.set(h[1])},c.bindSource=h=>i.bindSource(()=>h()),c.unbindSource=()=>{i.unbindSource(),i.set(null)},c.expects="vec2",Object.defineProperty(c,"x",{value:s,enumerable:!0}),Object.defineProperty(c,"y",{value:r,enumerable:!0}),c}function go(t,e){return e.faces&&e.faces.length>0?e.faces.map(n=>{var s,r;return{family:t,url:n.url,weight:(s=n.weight)!=null?s:400,style:(r=n.style)!=null?r:"normal"}}):[{family:t,url:e.url,weight:400,style:"normal"}]}function yo(t,e){let n,s=Number.POSITIVE_INFINITY;for(let r of t){let i=Math.abs(r.weight-e);(i<s||i===s&&n!==void 0&&r.weight<n.weight)&&(n=r,s=i)}return n}function ie(t){let e=new Map;for(let[n,s]of Object.entries(t!=null?t:{}))s.kind==="font"&&e.set(n,{faces:go(n,s),fallback:s.fallback?[...s.fallback]:[]});return{has(n){return e.has(n)},faces(){let n=[];for(let s of e.values())n.push(...s.faces);return n},resolveFace(n,s=400,r="normal"){let i=e.get(n);if(!i)return;let o=i.faces.filter(a=>a.style===r);return yo(o.length>0?o:i.faces,s)},fallbackChain(n){let s=e.get(n);return s?[n,...s.fallback]:[n]}}}var wr=class extends Error{constructor(e){super(kr(e));x(this,"report");this.name="FontValidationError",this.report=e}},wo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);function br(t,e){var s;let n=t.trim().toLowerCase();return wo.has(n)?!0:(s=e==null?void 0:e.has(n))!=null?s:!1}function bo(t){let e=[];for(let n of t){let s=n.codePointAt(0);s!==void 0&&e.push(s)}return e}function kr(t){let e=[];t.unregistered.length>0&&e.push(`unregistered font ${t.unregistered.length===1?"family":"families"}: ${t.unregistered.join(", ")}`);for(let n of t.missingGlyphs){let s=n.codePoints.map(r=>"U+"+r.toString(16).toUpperCase().padStart(4,"0")).join(", ");e.push(`family '${n.family}' is missing glyphs for ${s}`)}return"font validation failed (\xA73.6): "+e.join("; ")+" \u2014 register the family with its faces/fallback, or supply covering glyphs"}function Yn(t,e,n,s,r={}){let i=new Set,o=new Map;for(let l of t){let c=l.family,h=br(c,r.osFamilies);if(!e.has(c)){h||i.add(c);continue}let f=e.fallbackChain(c);for(let u of bo(l.text))if(!f.some(d=>{var m,p;return(p=(m=n.get(d))==null?void 0:m.has(u))!=null?p:!1})){let d=o.get(c);d||(d=new Set,o.set(c,d)),d.add(u)}}let a={unregistered:[...i].sort(),missingGlyphs:[...o.entries()].map(([l,c])=>({family:l,codePoints:[...c].sort((h,f)=>h-f)})).sort((l,c)=>l.family<c.family?-1:l.family>c.family?1:0)};if(!(a.unregistered.length===0&&a.missingGlyphs.length===0)){if(s==="strict")throw new wr(a);B(kr(a))}return a}var jn=class extends Error{constructor(t,e){super(`invalid position '${t}': ${e}`),this.name="PositionError"}};function fr(t){return typeof t!="string"&&typeof t.peek=="function"?t.peek():void 0}var vr=new WeakMap;function xr(t){var e;return(e=vr.get(t))!=null?e:new Map}function Mr(t,e={}){var v;let n=[],s=T({},e.labels),r=[],i=[],o=new Map,a=!1,l=0,c=0,h=0;function f(w){if(w===void 0)return c;if(typeof w=="number")return w;if(w==="<")return l;if(w===">")return c;let y=/^([+-])=([\d.]+)$/.exec(w);if(y)return c+(y[1]==="+"?1:-1)*parseFloat(y[2]);let g=/^([^+\-=]+?)(?:([+-])=([\d.]+))?$/.exec(w);if(g){let k=g[1];if(!(k in s))throw new jn(w,`unknown label '${k}' (labels must be declared before use)`);let M=g[2]?(g[2]==="+"?1:-1)*parseFloat(g[3]):0;return s[k]+M}throw new jn(w,"expected a number, '<', '>', '+=x', '-=x', or 'label[+=x]'")}let u={to(w,y,g={}){var S,$;let k=(S=g.ease)!=null?S:"easeInOutCubic",M=typeof k=="object"&&k.kind==="spring",I=M?wt.duration(k):($=g.duration)!=null?$:1;if(M&&g.duration!==void 0)throw new et("a spring ease determines its duration (spring.duration(cfg)); do not pass duration with a spring");let b=f(g.at),E={kind:"tween",target:kt(w),value:y,duration:I,ease:k,at:g.at,baseValue:fr(w),editable:!1,start:b};return g.from!==void 0&&(E.explicitFrom=g.from),n.push(E),l=b,c=b+I,u},fromTo(w,y,g,k={}){return u.to(w,g,k),n[n.length-1].explicitFrom=y,u},stagger(w,y,g){var P;let k=w.length,M=f(g.at),I=(k-1)/2,b=D=>{var Y;let V=(Y=g.from)!=null?Y:"start";return V==="start"?D:V==="end"?k-1-D:Math.round(V==="center"?Math.abs(D-I):V==="edges"?I-Math.abs(D-I):Math.abs(D-V))},E=(P=y.duration)!=null?P:1,S=0,$=D=>T(T({at:M+D},y.duration!==void 0?{duration:y.duration}:{}),y.ease!==void 0?{ease:y.ease}:{});for(let D=0;D<k;D++){let V=b(D)*g.each;V>S&&(S=V);let Y=w[D];y.from!==void 0?u.fromTo(Y,y.from,y.to,$(V)):u.to(Y,y.to,$(V))}return l=M,c=M+S+E,u},set(w,y,g={}){let k=f(g.at);return n.push({kind:"set",target:kt(w),value:y,duration:0,ease:"linear",at:g.at,baseValue:fr(w),editable:!1,start:k}),l=k,c=k,u},label(w,y){return s[w]=y===void 0?c:f(y),u},add(w,y,g={}){var E,S;let k=y===void 0?c:f(y),M=(E=g.mode)!=null?E:"add",I={timeline:w,at:k,mode:M,_pos:y};g.timeScale!==void 0&&(I.timeScale=g.timeScale),r.push(I);for(let[$,P]of xr(w))o.has($)||o.set($,P);let b=M==="sync"&&(S=g.timeScale)!=null?S:1;return l=k,c=k+nt(w).duration/b,u},sequence(w,y={}){var M;let g=(M=y.gap)!=null?M:0,k=g<0?`-=${-g}`:`+=${g}`;for(let I=0;I<w.length;I++)u.add(w[I],I===0?void 0:k);return u},at(w,y){return u.add(y,w)},call(w,y){let g=y===void 0?c:f(y),k=`call:${h++}`;return i.push({t:g,name:k}),o.set(k,w),u},cue(w,y,g){let k=g!=null&&typeof g=="object"&&!Array.isArray(g)?T({kind:"cue"},g):{kind:"cue"};return i.push({t:f(w),name:y,data:k}),u},adBreak(w,y={}){var k;let g=T({kind:"ad-break"},y.duration!==void 0?{duration:y.duration}:{});return i.push({t:f(w),name:(k=y.id)!=null?k:"ad-break",data:g}),u},editable(){let w=n[n.length-1];if(!w)throw new et(".editable() requires a preceding insertion");let y=Vt(w.target);if(!ne(y))throw new et(`.editable() needs a node with an explicit id; '${y}' is not an editable host (\xA76.4)`);return w.editable=!0,u},editableDuration(){return a=!0,u}};t(u);let d=new Map;for(let w of n){let y=d.get(w.target);y||(y=[],d.set(w.target,y)),y.push(w)}let m=[];for(let[w,y]of d){y.sort((S,$)=>S.start-$.start);let g=[],k=y.some(S=>S.editable),M=(v=y.find(S=>S.baseValue!==void 0))==null?void 0:v.baseValue,I=y[0];I.kind==="tween"&&I.explicitFrom===void 0&&M===void 0&&B(`'${w}': first tween has no resolvable from-value (string targets have no base) \u2014 the track sits at its end state before the tween. Anchor it with { from }, fromTo(), or set(..., { at: 0 }).`);for(let S of y){if(S.kind==="set"){g.push({t:S.start,value:S.value,interp:"hold"}),M=S.value;continue}let $=S.explicitFrom!==void 0?S.explicitFrom:M,P=g[g.length-1];if($!==void 0&&(!P||P.t<S.start)){let D={t:S.start,value:$};S.explicitFrom===void 0&&(D.derived=!0),(!P||S.start>P.t)&&g.push(D)}g.push({t:S.start+S.duration,value:S.value,ease:S.ease}),M=S.value}let b=[];for(let S of g.sort(($,P)=>$.t-P.t)){let $=b[b.length-1];$&&$.t===S.t?b[b.length-1]=S:b.push(S)}let E={target:w,type:Ot(y[0].value),keys:b};k&&(E.editable=!0),m.push(E)}let p=Rn(T(T(T(L(T({},e),{tracks:m,labels:s}),a?{editableDuration:!0}:{}),i.length?{markers:i}:{}),r.length?{children:r.map(g=>{var k=g,{_pos:w}=k,y=Lt(k,["_pos"]);return y})}:{}));return o.size&&vr.set(p,o),p}function ko(t,e){return typeof t=="function"?Mr(t,e):Rn(t)}function Be(t=0){return O(t)}var Sr=class extends Error{constructor(t){super(`timeline targets '${t}' but no property signal resolves to it`),this.name="UnboundTargetError"}},Er=class extends Error{constructor(e,n,s){let r=e.slice(e.lastIndexOf("/")+1),i=[s].flat(),o=n==="number"&&i.includes("vec2")?`; target '${r}.x'/'${r}.y' or author a vec2 track`:"";super(`track '${e}' is '${n}' but '${r}' expects '${i.join("'|'")}' (would silently NaN evaluation)${o}`);x(this,"target");x(this,"got");x(this,"expected");this.target=e,this.got=n,this.name="BindTypeMismatchError",this.expected=s}};function Gn(t,e,n=Be()){let s=[],r=new Map;for(let[i,o]of t.tracks){let a=e(i);if(!a)throw new Sr(i);let l=o.type,c=a.expects;if(c!==void 0){let h=Oe(l);if(!(Array.isArray(c)?c:[c]).some(f=>Oe(f)===h))throw new Er(i,l,c)}a.bindSource(()=>De(o,n())),s.push(a),r.set(i,{track:o,value:h=>De(o,h),velocity:h=>Ln(o,h)})}return{playhead:n,samplers:r,unbind:()=>{for(let i of s)i.unbindSource()}}}function Un(t,e,n){t.forceSet(e),pr();try{return n()}finally{mr()}}function ot(t){let e=t>>>0;return()=>{e=e+2654435769|0;let n=e^e>>>16;return n=Math.imul(n,569420461),n=n^n>>>15,n=Math.imul(n,1935289751),n=n^n>>>15,(n>>>0)/4294967296}}var qe=class extends Error{constructor(t){super(`bake(): ${t}`),this.name="BakeError"}};function We(t,e,n){for(let[s,r]of Object.entries(e)){let i=t.get(s);i||(i={keys:[],type:Ot(r)},t.set(s,i)),i.keys.push({t:n,value:r})}}function Tr(t){return[...t.entries()].map(([e,n])=>({target:e,type:n.type,keys:n.keys}))}function vo(t){var o,a;if(!(t.fps>0)||!(t.duration>=0))throw new qe("fps must be > 0 and duration >= 0");let e=ot((o=t.seed)!=null?o:0),n=1/t.fps,s=Math.round(t.duration*t.fps),r=t.setup(e),i=new Map;We(i,t.sample(r),0);for(let l=1;l<=s;l++)r=(a=t.step(r,n,e))!=null?a:r,We(i,t.sample(r),l*n);return Tr(i)}function xo(t){var f;if(!(t.every>=1))throw new qe("checkpoint interval `every` must be >= 1 frame");let e=1/t.fps,n=Math.round(t.duration*t.fps),s=0,r=ot((f=t.seed)!=null?f:0),i=()=>(s++,r()),o=u=>{var m;let d=ot((m=t.seed)!=null?m:0);for(let p=0;p<u;p++)d();return d},a=t.setup(i),l=[{snap:t.snapshot(a),rngDraws:s}],c=0;function h(u){var d;for(;c<Math.min(u,n);)a=(d=t.step(a,e,i))!=null?d:a,c++,c%t.every===0&&l.push({snap:t.snapshot(a),rngDraws:s})}return{frames:n,bakeRange(u,d){var k;if(u<0||d>n||u>d)throw new qe(`range ${u}..${d} outside 0..${n}`);let m=Math.floor(u/t.every)*t.every;h(m);let p=l[m/t.every],v=t.restore(p.snap),w=o(p.rngDraws),y=m,g=new Map;for(y>=u&&We(g,t.sample(v),y*e);y<d;)v=(k=t.step(v,e,w))!=null?k:v,y++,y>=u&&We(g,t.sample(v),y*e);return Tr(g)}}}var Et=[1,0,0,1,0,0],_=t=>t===0?0:t;function ae(t,e){let[n,s,r,i,o,a]=t,[l,c,h,f,u,d]=e;return[_(n*l+r*c),_(s*l+i*c),_(n*h+r*f),_(s*h+i*f),_(n*u+r*d+o),_(s*u+i*d+a)]}function Zn(t,e,n){let s=e*Math.PI/180,r=Math.cos(s),i=Math.sin(s),[o,a]=n;return[_(r*o),_(i*o),_(-i*a),_(r*a),_(t[0]),_(t[1])]}function zr(t){let[e,n,s,r,i,o]=t,a=e*r-n*s;if(a===0)return null;let l=r/a,c=-n/a,h=-s/a,f=e/a;return[_(l),_(c),_(h),_(f),_(-(l*i+h*o)),_(-(c*i+f*o))]}function Lr(t,e){return[t[0]*e[0]+t[2]*e[1]+t[4],t[1]*e[0]+t[3]*e[1]+t[5]]}function St(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function _t(t,e){if(e instanceof ArrayBuffer)return`ab:${e.byteLength}`;if(ArrayBuffer.isView(e))return`view:${e.byteLength}`;if(typeof e!="function")return typeof e=="number"&&!Number.isFinite(e)?Number.isNaN(e)?"NaN":e>0?"Infinity":"-Infinity":e}function Ir(t,e){let n={};for(let[s,r]of Object.entries(t))n[s]=r;return t.op==="clip"||t.op==="fillPath"||t.op==="strokePath"?n.path=e[t.path]:t.op==="drawImage"&&(n.image=e[t.image]),n}var Bt=t=>JSON.stringify(t,_t);function Mo(t,e){let n=[],s=new Set([...Object.keys(t),...Object.keys(e)]);for(let r of s)r!=="op"&&Bt(t[r])!==Bt(e[r])&&n.push({path:r,from:t[r],to:e[r]});return n}function ts(t,e){let n=[],s=Math.max(t.commands.length,e.commands.length);for(let i=0;i<s;i++){let o=t.commands[i],a=e.commands[i];if(o!==void 0&&a!==void 0){let l=Ir(o,t.resources),c=Ir(a,e.resources);if(Bt(l)===Bt(c))continue;o.op!==a.op?n.push({index:i,kind:"change",opA:o.op,opB:a.op,fields:[{path:"op",from:o.op,to:a.op}]}):n.push({index:i,kind:"change",opA:o.op,opB:a.op,fields:Mo(l,c)})}else a!==void 0?n.push({index:i,kind:"add",opB:a.op,fields:[]}):o!==void 0&&n.push({index:i,kind:"remove",opA:o.op,fields:[]})}let r=t.size.w!==e.size.w||t.size.h!==e.size.h;return T({equal:n.length===0&&!r,deltas:n},r?{size:{from:t.size,to:e.size}}:{})}function Rr(t){var n,s,r,i;if(t.equal)return"DisplayLists are identical.";let e=[];t.size&&e.push(`size ${t.size.from.w}x${t.size.from.h} -> ${t.size.to.w}x${t.size.to.h}`);for(let o of t.deltas)if(o.kind==="add")e.push(`+ [${o.index}] add ${(n=o.opB)!=null?n:"?"}`);else if(o.kind==="remove")e.push(`- [${o.index}] remove ${(s=o.opA)!=null?s:"?"}`);else{let a=o.opA===o.opB?o.opA:`${(r=o.opA)!=null?r:"?"} -> ${(i=o.opB)!=null?i:"?"}`;e.push(`~ [${o.index}] ${a}`);for(let l of o.fields)e.push(` ${l.path}: ${Bt(l.from)} -> ${Bt(l.to)}`)}return e.join(`
2
+ `)}var Nr=1;function Vr(t){let e={dlSnapshotVersion:1,size:t.size,commands:t.commands,resources:t.resources};return JSON.stringify(e,_t,2)}var Xe=class extends Error{constructor(t){super(t),this.name="DlSnapshotError"}};function qr(t){let e=JSON.parse(t);if(e.dlSnapshotVersion!==1)throw new Xe(`unsupported dlSnapshotVersion ${String(e.dlSnapshotVersion)}; this build reads 1`);if(!e.size||!Array.isArray(e.commands)||!Array.isArray(e.resources))throw new Xe("malformed .dl.json snapshot (need size, commands[], resources[])");return{size:e.size,commands:e.commands,resources:e.resources}}var Ft=class extends Error{constructor(t){super(t),this.name="FilterValidationError"}},$r=new Set(["blur","drop-shadow","brightness","contrast","saturate"]);function es(t){for(let e of t){if(!$r.has(e.kind))throw new Ft(`unknown filter kind '${String(e.kind)}' (have: ${[...$r].join(", ")})`);if(e.kind==="blur"&&!(Number.isFinite(e.radius)&&e.radius>=0))throw new Ft(`blur radius must be \u2265 0, got ${String(e.radius)}`);if(e.kind==="drop-shadow"){if(![e.dx,e.dy,e.blur].every(Number.isFinite)||e.blur<0)throw new Ft("drop-shadow needs finite dx/dy and blur \u2265 0");if(typeof e.color!="string"||e.color.length===0)throw new Ft("drop-shadow needs a color string")}if((e.kind==="brightness"||e.kind==="contrast"||e.kind==="saturate")&&!(Number.isFinite(e.amount)&&e.amount>=0))throw new Ft(`${e.kind} amount must be \u2265 0, got ${String(e.amount)}`)}}function Ue(t){return t.length===0?"none":t.map(e=>{switch(e.kind){case"blur":return`blur(${e.radius}px)`;case"drop-shadow":return`drop-shadow(${e.dx}px ${e.dy}px ${e.blur}px ${e.color})`;default:return`${e.kind}(${e.amount})`}}).join(" ")}function Wr(t,e=16,n=2){let s=[];for(let r=0;r<Math.max(1,n);r++)s.push({kind:"drop-shadow",dx:0,dy:0,blur:e*(1+r*1.5),color:t});return s}function So(t){switch(t.op){case"clip":case"fillPath":case"strokePath":return[t.path];case"drawImage":return[t.image];default:return[]}}function Eo(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}function le(t){let e=[],n=[],s=new Map;return{push:r=>{r.op==="pushGroup"&&r.filters.length>0&&es(r.filters),e.push(r)},resource:r=>{let i=JSON.stringify(r),o=s.get(i);if(o!==void 0)return o;let a=n.length;return n.push(r),s.set(i,a),a},mark:()=>e.length,cacheKey:(r,i)=>{if(i<=r)return;let o=new Map,a=[],l=h=>{let f=o.get(h);return f===void 0&&(f=o.size,o.set(h,f),a.push(n[h])),f},c=e.slice(r,i).map(h=>So(h).length===0?h:h.op==="drawImage"?L(T({},h),{image:l(h.image)}):L(T({},h),{path:l(h.path)}));return Eo(JSON.stringify({c,r:a},_t))},patchCacheKey:(r,i)=>{let o=e[r];o&&o.op==="pushGroup"&&(o.cacheKey=i)},finish:()=>({commands:e,resources:n,size:t})}}var Ye=.5;function G(t){return Math.round(t/Ye)*Ye}var He=null;function Br(t){He=t}function K(){return He!=null?He:ns}var ns={measureText(t,e){return{width:t.length*e.size*.52,ascent:e.size*.8,descent:e.size*.2}}},_e;function Ke(t){if(_e===void 0&&(_e=typeof Intl!="undefined"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"word"}):null),_e){let e=[..._e.segment(t)].map(s=>s.segment),n=[];for(let s of e)n.length>0&&/^[^\p{L}\p{N}\s]+$/u.test(s)?n[n.length-1]+=s:n.push(s);return n}return t.split(/(\s+)/).filter(e=>e.length>0)}var je;function Mt(t){return je===void 0&&(je=typeof Intl!="undefined"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null),je?[...je.segment(t)].map(e=>e.segment):Array.from(t)}function at(t,e,n,s){let r=t.split(`
3
+ `);if(n===void 0||n<=0)return r;let i=[];for(let o of r){let a=Ke(o),l="";for(let c of a){let h=l+c;l!==""&&G(s.measureText(h.trimEnd(),e).width)>n?(i.push(l.trimEnd()),l=c.trimStart()===""?"":c):l=h}i.push(l.trimEnd())}return i}var To={center:[.5,.5],"top-left":[0,0],top:[.5,0],"top-right":[1,0],left:[0,.5],right:[1,.5],"bottom-left":[0,1],bottom:[.5,1],"bottom-right":[1,1]};function ss(t){if(typeof t=="string"){let e=To[t];if(!e)throw new Error(`unknown anchor '${t}' (use a preset like 'top-left' or a [ax, ay] pair)`);return e}return[t[0],t[1]]}function oe(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}function Cr(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}var ce,Dr,Q=(Dr=class{constructor(t={}){x(this,"id");x(this,"position");x(this,"rotation");x(this,"scale");x(this,"opacity");x(this,"blend");x(this,"zIndex");x(this,"filters");x(this,"anchor");x(this,"hasAnchor");x(this,"cache");x(this,"parent",null);U(this,ce,!1);x(this,"interactive",!1);x(this,"interactiveChildren",!0);x(this,"hitArea");x(this,"measurerSource",null);x(this,"localMatrix");x(this,"worldMatrix");x(this,"targets",new Map);var e;this.id=t.id,this.position=Cr(Wt([0,0]),t.position),this.rotation=oe(O(0),t.rotation),this.scale=Cr(Wt([1,1]),t.scale),this.opacity=oe(O(1),t.opacity),this.blend=oe(O("source-over"),t.blend),this.zIndex=oe(O(0),t.zIndex),this.filters=oe(O([]),t.filters),this.hasAnchor=t.anchor!==void 0,this.anchor=ss((e=t.anchor)!=null?e:"center"),this.cache=t.cache===!0,this.localMatrix=re(()=>{let n=Zn(this.position(),this.rotation(),this.scale()),[s,r]=this.anchorShift();return s===0&&r===0?n:ae(n,[1,0,0,1,s,r])},{equals:St}),this.worldMatrix=re(()=>this.parent?ae(this.parent.worldMatrix(),this.localMatrix()):this.localMatrix(),{equals:St}),this.registerTarget("position",this.position,"vec2"),this.registerTarget("position.x",this.position.x,"number"),this.registerTarget("position.y",this.position.y,"number"),this.registerTarget("rotation",this.rotation,"number"),this.registerTarget("scale",this.scale,"vec2"),this.registerTarget("scale.x",this.scale.x,"number"),this.registerTarget("scale.y",this.scale.y,"number"),this.registerTarget("opacity",this.opacity,"number"),this.registerTarget("zIndex",this.zIndex,"number")}registerTarget(t,e,n){e.expects=n,this.targets.set(t,e),this.id!==void 0&&(e[At]=`${this.id}/${t}`)}resolveTarget(t){return this.targets.get(t)}intrinsicSize(t){return null}drawOffset(t){var s,r,i;let e=(r=t!=null?t:(s=this.measurerSource)==null?void 0:s.call(this))!=null?r:K(),n=(i=this.intrinsicSize(e))!=null?i:{w:0,h:0};return{x:-n.w/2,y:-n.h/2}}flowOffset(t){var i,o;let e=(o=t!=null?t:(i=this.measurerSource)==null?void 0:i.call(this))!=null?o:K(),n=this.drawOffset(e),[s,r]=this.anchorShift(e);return{x:n.x+s,y:n.y+r}}anchorShift(t){var l,c;if(!this.hasAnchor)return[0,0];let[e,n]=this.anchor,s=(c=t!=null?t:(l=this.measurerSource)==null?void 0:l.call(this))!=null?c:K(),r=this.intrinsicSize(s);if(!r)return A(this,ce)||(H(this,ce,!0),B(`anchor set on a node without an intrinsic box${this.id?` ('${this.id}')`:""} \u2014 ignored (give it a sized node, or position children explicitly)`)),[0,0];let i=this.drawOffset(s),o=-(i.x+e*r.w),a=-(i.y+n*r.h);return[o===0?0:o,a===0?0:a]}requiresGroup(){return this.opacity()<1||this.blend()!=="source-over"||this.filters().length>0}groupShader(){}emit(t,e){let n=this.opacity();if(n<=0)return;let s=this.localMatrix(),r=St(s,Et),i=this.groupShader(),o=this.requiresGroup()||i!==void 0||this.cache,a=this.cache&&t.mark!==void 0;t.push({op:"save"}),r||t.push({op:"transform",m:s});let l=-1;o&&(a&&(l=t.mark()),t.push(T({op:"pushGroup",opacity:n,blend:this.blend(),filters:this.filters()},i!==void 0?{shader:i}:{})));let c=a?t.mark():-1;if(this.draw(t,e),o){if(a){let h=t.cacheKey(c,t.mark());h!==void 0&&t.patchCacheKey(l,h)}t.push({op:"popGroup"})}t.push({op:"restore"})}},ce=new WeakMap,Dr),Or=["marker","crayon","pencil","ink","chalk"],dt=class extends Error{constructor(t){super(t),this.name="SketchValidationError"}};function rs(t){if(!Or.includes(t.kind))throw new dt(`unknown sketch kind '${String(t.kind)}' (have: ${Or.join(", ")})`);if(t.width!==void 0&&!(t.width>0))throw new dt(`sketch width must be > 0, got ${String(t.width)}`);if(t.roughness!==void 0&&!(t.roughness>=0))throw new dt(`sketch roughness must be \u2265 0, got ${String(t.roughness)}`);if((t.kind==="crayon"||t.kind==="pencil")&&t.passes!==void 0&&!(t.passes>=1))throw new dt(`sketch passes must be \u2265 1, got ${String(t.passes)}`);if(t.kind==="chalk"&&t.dash!==void 0&&(!Array.isArray(t.dash)||t.dash.some(e=>!(e>=0))))throw new dt("sketch chalk dash must be an array of non-negative numbers")}function is(t){var e,n,s,r,i,o,a,l,c,h,f,u,d;switch(t.kind){case"marker":return{width:(e=t.width)!=null?e:8,roughness:(n=t.roughness)!=null?n:1.2,passes:2};case"crayon":return{width:(s=t.width)!=null?s:4,roughness:(r=t.roughness)!=null?r:2.4,passes:(i=t.passes)!=null?i:3};case"pencil":return{width:(o=t.width)!=null?o:1.5,roughness:(a=t.roughness)!=null?a:1,passes:(l=t.passes)!=null?l:2};case"ink":return{width:(c=t.width)!=null?c:2.5,roughness:(h=t.roughness)!=null?h:.8,passes:1};case"chalk":return{width:(f=t.width)!=null?f:3,roughness:(u=t.roughness)!=null?u:1.6,passes:1,dash:(d=t.dash)!=null?d:[6,5]}}}var Io=(t,e,n,s,r)=>{let i=1-r,o=i*i*i,a=3*i*i*r,l=3*i*r*r,c=r*r*r;return[o*t[0]+a*e[0]+l*n[0]+c*s[0],o*t[1]+a*e[1]+l*n[1]+c*s[1]]},$o=(t,e,n,s)=>{let r=1-s;return[r*r*t[0]+2*r*s*e[0]+s*s*n[0],r*r*t[1]+2*r*s*e[1]+s*s*n[1]]},Kn=(t,e,n,s,r,i)=>{let o=n*Math.cos(i),a=s*Math.sin(i),l=Math.cos(r),c=Math.sin(r);return[t+o*l-a*c,e+o*c+a*l]};function he(t,e=16){let n=[],s=null,r=0,i=0,o=0,a=0,l=(c,h)=>(s||(s={points:[[c,h]],closed:!1},n.push(s),o=c,a=h),s);for(let c of t)switch(c[0]){case"M":s={points:[[c[1],c[2]]],closed:!1},n.push(s),r=o=c[1],i=a=c[2];break;case"L":l(r,i).points.push([c[1],c[2]]),r=c[1],i=c[2];break;case"C":{let h=l(r,i);for(let f=1;f<=e;f++)h.points.push(Io([r,i],[c[1],c[2]],[c[3],c[4]],[c[5],c[6]],f/e));r=c[5],i=c[6];break}case"Q":{let h=l(r,i);for(let f=1;f<=e;f++)h.points.push($o([r,i],[c[1],c[2]],[c[3],c[4]],f/e));r=c[3],i=c[4];break}case"E":{let[,h,f,u,d,m,p,v]=c,w=Kn(h,f,u,d,m,p),y=l(w[0],w[1]);for(let k=1;k<=e;k++)y.points.push(Kn(h,f,u,d,m,p+(v-p)*(k/e)));let g=Kn(h,f,u,d,m,v);r=g[0],i=g[1];break}case"Z":s&&(s.points.push([o,a]),s.closed=!0,r=o,i=a);break}return n.filter(c=>c.points.length>0)}function os(t){let e=0;for(let n=1;n<t.points.length;n++)e+=Math.hypot(t.points[n][0]-t.points[n-1][0],t.points[n][1]-t.points[n-1][1]);return e}function as(t){if(!(t.gap>0))throw new dt(`hachure gap must be > 0, got ${String(t.gap)}`);if(t.roughness!==void 0&&!(t.roughness>=0))throw new dt(`hachure roughness must be \u2265 0, got ${String(t.roughness)}`)}function cs(t,e,n){var I;let s=he(t),r=1/0,i=1/0,o=-1/0,a=-1/0;for(let b of s)for(let[E,S]of b.points)E<r&&(r=E),S<i&&(i=S),E>o&&(o=E),S>a&&(a=S);if(!Number.isFinite(r))return[];let l=(r+o)/2,c=(i+a)/2,h=Math.cos(e.angleRad),f=Math.sin(e.angleRad),u=(b,E)=>[(b-l)*h+(E-c)*f,-(b-l)*f+(E-c)*h],d=(b,E)=>[l+b*h-E*f,c+b*f+E*h],m=1/0,p=1/0,v=-1/0,w=-1/0,y=[[r,i],[o,i],[o,a],[r,a]];for(let[b,E]of y){let[S,$]=u(b,E);S<m&&(m=S),$<p&&(p=$),S>v&&(v=S),$>w&&(w=$)}let g=(I=e.roughness)!=null?I:1,k=()=>(n()*2-1)*g,M=[];for(let b=p+e.gap/2;b<w;b+=e.gap){let E=d(m,b+k()),S=d(v,b+k());M.push(["M",E[0],E[1]],["L",S[0],S[1]])}return M}function Qe(t,e,n){let s=is(e),r=he(t),i=()=>(n()*2-1)*s.roughness,o=[];for(let a=0;a<s.passes;a++){let l=[];for(let c of r){let h=c.points;if(h.length<2)continue;let f=h[0][0]+i(),u=h[0][1]+i();l.push(["M",f,u]);for(let d=1;d<h.length;d++){let m=h[d][0]+i(),p=h[d][1]+i(),v=m-f,w=p-u,y=Math.hypot(v,w)||1,g=i()*.5,k=(f+m)/2+-w/y*g,M=(u+p)/2+v/y*g;l.push(["Q",k,M,m,p]),f=m,u=p}}o.push(l)}return{strokes:o,resolved:s}}function ls(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}function _r(t,e,n){return Qe(t,e,ot(n>>>0)).strokes}var jr=class extends Q{};function jt(t,e,n,s,r){if(r<=0)return[["M",t,e],["L",t+n,e],["L",t+n,e+s],["L",t,e+s],["Z"]];let i=Math.PI/2;return[["M",t+r,e],["L",t+n-r,e],["E",t+n-r,e+r,r,r,0,-i,0],["L",t+n,e+s-r],["E",t+n-r,e+s-r,r,r,0,0,i],["L",t+r,e+s],["E",t+r,e+s-r,r,r,0,i,Math.PI],["L",t,e+r],["E",t+r,e+r,r,r,0,Math.PI,Math.PI+i],["Z"]]}var xt,Fr,Tt=(Fr=class extends Q{constructor(e={}){var n;super(e);x(this,"children");U(this,xt,O(0));this.children=(n=e.children)!=null?n:[];for(let s of this.children)s.parent=this}trackStructure(){A(this,xt).call(this)}add(e){return e.parent=this,this.children.push(e),A(this,xt).set(A(this,xt).peek()+1),this}remove(e){let n=this.children.indexOf(e);return n>=0&&(this.children.splice(n,1),e.parent===this&&(e.parent=null),A(this,xt).set(A(this,xt).peek()+1)),this}draw(e,n){let s=this.children.map((r,i)=>({node:r,i})).sort((r,i)=>r.node.zIndex()-i.node.zIndex()||r.i-i.i).map(r=>r.node);for(let r of s)r.emit(e,n)}},xt=new WeakMap,Fr);function Ar(t){return typeof t=="string"?{kind:"color",color:t}:t}var hs=class extends Q{constructor(e={}){var n;super(e);x(this,"fill");x(this,"stroke");x(this,"strokeWidth");x(this,"sketch");x(this,"sketchFill");x(this,"sketchSeed");x(this,"reveal");this.fill=j(O(""),e.fill),this.stroke=j(O(""),e.stroke),this.strokeWidth=j(O(0),e.strokeWidth),this.reveal=j(O(1),e.reveal),this.registerTarget("fill",this.fill,["color","paint"]),this.registerTarget("stroke",this.stroke,"color"),this.registerTarget("strokeWidth",this.strokeWidth,"number"),this.registerTarget("reveal",this.reveal,"number"),e.sketch&&rs(e.sketch),e.sketchFill&&as(e.sketchFill),e.sketchFill&&!e.sketch&&B(`${this.id!==void 0?`'${this.id}': `:""}sketchFill is ignored without sketch \u2014 hachure fill is drawn only by the sketch renderer. Set a sketch style (e.g. { kind: 'pencil' }) to see it.`),this.sketch=e.sketch,this.sketchFill=e.sketchFill,this.sketchSeed=(n=e.sketchSeed)!=null?n:this.id!==void 0?ls(this.id):0}draw(e){let n=this.pathSegs();if(this.sketch)return this.drawSketch(e,n);let s=e.resource({kind:"path",segs:n}),r=this.fill();r&&e.push({op:"fillPath",path:s,paint:Ar(r)});let i=this.stroke(),o=this.strokeWidth();if(i&&o>0){let a=this.reveal();a<1?Pr(e,n,{kind:"color",color:i},{width:o},a):e.push({op:"strokePath",path:s,paint:{kind:"color",color:i},stroke:{width:o}})}}drawSketch(e,n){let s=ot(this.sketchSeed>>>0),r=this.fill();if(r){let h=e.resource({kind:"path",segs:n});e.push({op:"fillPath",path:h,paint:Ar(r)})}let{strokes:i,resolved:o}=Qe(n,this.sketch,s),a=this.stroke()||(typeof r=="string"?r:"")||"#000000";if(this.sketchFill){let h=e.resource({kind:"path",segs:n});e.push({op:"save"}),e.push({op:"clip",path:h,rule:"nonzero"});let f=cs(n,this.sketchFill,s);if(f.length>0){let u=e.resource({kind:"path",segs:f});e.push({op:"strokePath",path:u,paint:{kind:"color",color:a},stroke:{width:Math.max(1,o.width*.5),cap:"round"}})}e.push({op:"restore"})}let l=this.reveal(),c=l<1;for(let h of i){if(h.length===0)continue;if(c){Pr(e,h,{kind:"color",color:a},{width:o.width,cap:"round",join:"round"},l);continue}let f=e.resource({kind:"path",segs:h});e.push({op:"strokePath",path:f,paint:{kind:"color",color:a},stroke:T({width:o.width,cap:"round",join:"round"},o.dash?{dash:o.dash}:{})})}}};function j(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}function Co(t){let e=[],n=null;for(let s of t)s[0]==="M"?(n=[s],e.push(n)):n&&n.push(s);return e}function Pr(t,e,n,s,r){for(let i of Co(e)){let o=he(i).reduce((l,c)=>l+os(c),0),a=t.resource({kind:"path",segs:i});t.push({op:"strokePath",path:a,paint:n,stroke:L(T({},s),{dash:[o,o],dashOffset:o*(1-r)})})}}function Ge(t){if(t===void 0)return[];if(Array.isArray(t)&&t.every(e=>typeof e=="object"&&e!==null&&Array.isArray(e.v)&&Array.isArray(e.in)&&Array.isArray(e.out)))return t;throw new TypeError(`Path.data expects PathValue (PathContour[]); for an SVG path 'd' string, parse it with pathFromSvg(d) from "@glissade/scene/path" (or window.glissade.pathFromSvg in the browser bundle)`)}function Je(t){let e=[],n=null,s=(i,o=[0,0],a=[0,0])=>{n.v.push(i),n.in.push(o),n.out.push(a)},r=()=>n.v[n.v.length-1];for(let i of t)switch(i[0]){case"M":n={closed:!1,v:[[i[1],i[2]]],in:[[0,0]],out:[[0,0]]},e.push(n);break;case"L":n&&s([i[1],i[2]]);break;case"C":if(n){let o=r();n.out[n.out.length-1]=[i[1]-o[0],i[2]-o[1]],s([i[5],i[6]],[i[3]-i[5],i[4]-i[6]])}break;case"Q":if(n){let o=r(),a=i[1],l=i[2],c=i[3],h=i[4];n.out[n.out.length-1]=[2/3*(a-o[0]),2/3*(l-o[1])],s([c,h],[2/3*(a-c),2/3*(l-h)])}break;case"E":if(n){let[,o,a,l,c,h,f,u]=i,d=Math.cos(h),m=Math.sin(h);for(let p=1;p<=16;p++){let v=f+(u-f)*(p/16),w=l*Math.cos(v),y=c*Math.sin(v);s([o+w*d-y*m,a+w*m+y*d])}}break;case"Z":if(n){n.closed=!0;let o=n.v[0],a=r();n.v.length>1&&Math.abs(o[0]-a[0])<1e-9&&Math.abs(o[1]-a[1])<1e-9&&(n.in[0]=n.in[n.in.length-1],n.v.pop(),n.in.pop(),n.out.pop())}break}return e}var Hr=class extends hs{constructor(e={}){super(e);x(this,"width");x(this,"height");x(this,"cornerRadius");this.width=j(O(0),e.width),this.height=j(O(0),e.height),this.cornerRadius=j(O(0),e.cornerRadius),this.registerTarget("width",this.width,"number"),this.registerTarget("height",this.height,"number"),this.registerTarget("cornerRadius",this.cornerRadius,"number")}intrinsicSize(){return{w:this.width(),h:this.height()}}pathSegs(){let e=this.width(),n=this.height(),s=Math.min(Math.max(0,this.cornerRadius()),e/2,n/2);return jt(-e/2,-n/2,e,n,s)}},Xr=class extends hs{constructor(e={}){super(e);x(this,"radius");this.radius=j(O(0),e.radius),this.registerTarget("radius",this.radius,"number")}intrinsicSize(){let e=this.radius()*2;return{w:e,h:e}}pathSegs(){let e=this.radius();return[["E",0,0,e,e,0,0,Math.PI*2],["Z"]]}},us=class extends hs{constructor(e={}){super(e);x(this,"data");let n=e.data,s=typeof n=="function"?()=>Ge(n()):n!==void 0?Ge(n):void 0;this.data=j(O([]),s),this.registerTarget("d",this.data,"path")}bounds(){let e=1/0,n=1/0,s=-1/0,r=-1/0;for(let i of this.data())for(let o=0;o<i.v.length;o++){let a=i.v[o][0],l=i.v[o][1],c=[[a,l],[a+i.in[o][0],l+i.in[o][1]],[a+i.out[o][0],l+i.out[o][1]]];for(let h of c)h[0]<e&&(e=h[0]),h[1]<n&&(n=h[1]),h[0]>s&&(s=h[0]),h[1]>r&&(r=h[1])}return e>s?{minX:0,minY:0,maxX:0,maxY:0}:{minX:e,minY:n,maxX:s,maxY:r}}intrinsicSize(){let e=this.bounds();return{w:e.maxX-e.minX,h:e.maxY-e.minY}}drawOffset(){let e=this.bounds();return{x:e.minX,y:e.minY}}pathSegs(){let e=[];for(let n of this.data()){let s=n.v.length;if(s!==0){e.push(["M",n.v[0][0],n.v[0][1]]);for(let r=0;r<s-1;r++)e.push(["C",n.v[r][0]+n.out[r][0],n.v[r][1]+n.out[r][1],n.v[r+1][0]+n.in[r+1][0],n.v[r+1][1]+n.in[r+1][1],n.v[r+1][0],n.v[r+1][1]]);n.closed&&s>1&&(e.push(["C",n.v[s-1][0]+n.out[s-1][0],n.v[s-1][1]+n.out[s-1][1],n.v[0][0]+n.in[0][0],n.v[0][1]+n.in[0][1],n.v[0][0],n.v[0][1]]),e.push(["Z"]))}}return e}},Qn,Yr=(Qn=class extends Q{constructor(e){super(e);x(this,"assetId");x(this,"width");x(this,"height");this.assetId=e.assetId,this.width=j(O(0),e.width),this.height=j(O(0),e.height),this.registerTarget("width",this.width,"number"),this.registerTarget("height",this.height,"number")}intrinsicSize(){return{w:this.width(),h:this.height()}}draw(e){let n=this.width(),s=this.height();if(n<=0||s<=0)return;let r=e.resource({kind:"image",assetId:this.assetId});e.push({op:"drawImage",image:r,dst:{x:-n/2,y:-s/2,w:n,h:s}})}},x(Qn,"assetKind","image"),Qn),Jn,Gr=(Jn=class extends Q{constructor(e){var n,s,r;super(e);x(this,"assetId");x(this,"at");x(this,"trimStart");x(this,"playbackRate");x(this,"clipDuration");x(this,"sourceFps");x(this,"width");x(this,"height");this.assetId=e.assetId,this.at=(n=e.at)!=null?n:0,this.trimStart=(s=e.trimStart)!=null?s:0,this.playbackRate=(r=e.playbackRate)!=null?r:1,this.clipDuration=e.clipDuration,this.sourceFps=e.sourceFps,this.width=j(O(0),e.width),this.height=j(O(0),e.height),this.registerTarget("width",this.width,"number"),this.registerTarget("height",this.height,"number")}mediaTime(e){let n=(e-this.at)*this.playbackRate;if(n<0||this.clipDuration!==void 0&&e-this.at>=this.clipDuration)return null;let s=this.trimStart+n;return this.sourceFps!==void 0?Math.floor(s*this.sourceFps+1e-9)/this.sourceFps:s}draw(e,n){let s=this.mediaTime(n.time);if(s===null)return;let r=this.width(),i=this.height();if(r<=0||i<=0)return;let o=e.resource({kind:"videoFrame",assetId:this.assetId,mediaT:s});e.push({op:"drawImage",image:o,dst:{x:-r/2,y:-i/2,w:r,h:i}})}},x(Jn,"assetKind","video"),Jn),Ze=class extends Q{constructor(e={}){var n,s,r,i,o;super(e);x(this,"text");x(this,"fill");x(this,"fontSize");x(this,"fontFamily");x(this,"fontWeight");x(this,"fontStyle");x(this,"align");x(this,"width");x(this,"lineHeight");x(this,"reveal");this.text=j(O(""),e.text),this.fill=j(O("#000000"),e.fill),this.fontSize=j(O(16),e.fontSize),this.fontFamily=(n=e.fontFamily)!=null?n:"sans-serif",this.fontWeight=(s=e.fontWeight)!=null?s:400,this.fontStyle=(r=e.fontStyle)!=null?r:"normal",this.align=(i=e.align)!=null?i:"left",this.width=j(O(0),e.width),this.lineHeight=(o=e.lineHeight)!=null?o:1.25,this.reveal=j(O(Number.POSITIVE_INFINITY),e.reveal),this.registerTarget("width",this.width,"number"),this.registerTarget("text",this.text,"string"),this.registerTarget("fill",this.fill,"color"),this.registerTarget("fontSize",this.fontSize,"number"),this.registerTarget("reveal",this.reveal,"number")}intrinsicSize(e){let n=this.text();if(!n)return{w:0,h:0};let s=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),r=this.width(),i=at(n,s,r>0?r:void 0,e),o=Math.max(...i.map(a=>G(e.measureText(a,s).width)),0);return{w:r>0?r:o,h:G(s.size*this.lineHeight)*i.length}}drawOffset(e){var a,l,c;let n=(l=e!=null?e:(a=this.measurerSource)==null?void 0:a.call(this))!=null?l:K(),s=this.intrinsicSize(n),r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=(c=at(this.text(),r,this.width()>0?this.width():void 0,n)[0])!=null?c:"",o=n.measureText(i,r).ascent;return{x:this.align==="left"?0:this.align==="center"?-s.w/2:-s.w,y:-o}}measuredSize(e){var n,s;return this.intrinsicSize((s=e!=null?e:(n=this.measurerSource)==null?void 0:n.call(this))!=null?s:K())}lineBoxes(e){var c,h;let n=(h=e!=null?e:(c=this.measurerSource)==null?void 0:c.call(this))!=null?h:K(),s=this.text();if(!s)return[];let r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=this.width(),o=at(s,r,i>0?i:void 0,n),a=G(r.size*this.lineHeight),l=[];for(let f=0;f<o.length;f++){let u=o[f];if(!u)continue;let d=n.measureText(u,r),m=G(d.width),p=this.align==="left"?0:this.align==="center"?-m/2:-m;l.push({text:u,x:p,y:f*a-d.ascent,w:m,h:d.ascent+d.descent})}return l}wordBoxes(e){var c,h;let n=(h=e!=null?e:(c=this.measurerSource)==null?void 0:c.call(this))!=null?h:K(),s=this.text();if(!s)return[];let r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=this.width(),o=at(s,r,i>0?i:void 0,n),a=G(r.size*this.lineHeight),l=[];for(let f=0;f<o.length;f++){let u=o[f];if(!u)continue;let d=n.measureText(u,r),m=G(d.width),p=this.align==="left"?0:this.align==="center"?-m/2:-m,v=f*a-d.ascent,w=d.ascent+d.descent,y="";for(let g of Ke(u)){let k=y;y+=g;let M=g.trim();if(M==="")continue;let I=g.length-g.trimStart().length,b=n.measureText(k+g.slice(0,I),r).width,E=n.measureText(k+g.trimEnd(),r).width;l.push({text:M,line:f,x:p+b,y:v,w:E-b,h:w})}}return l}graphemes(e){var l,c;let n=(c=e!=null?e:(l=this.measurerSource)==null?void 0:l.call(this))!=null?c:K(),s=this.text();if(!s)return[];let r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=this.width(),o=at(s,r,i>0?i:void 0,n),a=[];for(let h of o)for(let f of Mt(h))a.push(f);return a}revealHead(e){var u,d,m;let n=(d=e!=null?e:(u=this.measurerSource)==null?void 0:u.call(this))!=null?d:K(),s=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),r=this.width(),i=at(this.text(),s,r>0?r:void 0,n),o=G(s.size*this.lineHeight),a=i.reduce((p,v)=>p+Mt(v).length,0),l=this.reveal(),c=Math.max(0,Math.min(Number.isFinite(l)?Math.floor(l):a,a)),h=c,f={x:0,y:0,h:0,line:0,index:c};for(let p=0;p<i.length;p++){let v=(m=i[p])!=null?m:"",w=n.measureText(v,s),y=G(w.width),g=this.align==="left"?0:this.align==="center"?-y/2:-y,k=p*o-w.ascent,M=w.ascent+w.descent,I=Mt(v);if(h<=I.length)return{x:g+(h<=0?0:n.measureText(I.slice(0,h).join(""),s).width),y:k,h:M,line:p,index:c};h-=I.length,f={x:g+w.width,y:k,h:M,line:p,index:c}}return f}draw(e,n){let s=this.text();if(!s)return;let r=T({family:this.fontFamily,size:this.fontSize(),weight:this.fontWeight},this.fontStyle==="italic"?{style:"italic"}:{}),i=this.width(),o=at(s,r,i>0?i:void 0,n.measurer),a=G(r.size*this.lineHeight),l=this.reveal(),c=Number.isFinite(l),h=c?Math.max(0,Math.floor(l)):0;for(let f=0;f<o.length;f++){let u=o[f];if(!u)continue;if(!c){e.push(T({op:"fillText",text:u,font:r,paint:{kind:"color",color:this.fill()},x:0,y:f*a},this.align!=="left"?{align:this.align}:{}));continue}if(h<=0)break;let d=Mt(u),m=Math.min(h,d.length);if(h-=m,m===d.length)e.push(T({op:"fillText",text:u,font:r,paint:{kind:"color",color:this.fill()},x:0,y:f*a},this.align!=="left"?{align:this.align}:{}));else{let p=G(n.measurer.measureText(u,r).width),v=this.align==="left"?0:this.align==="center"?-p/2:-p;e.push({op:"fillText",text:d.slice(0,m).join(""),font:r,paint:{kind:"color",color:this.fill()},x:v,y:f*a})}}}};function Ur(t,e,n){var u,d;let s=(d=n!=null?n:(u=t.measurerSource)==null?void 0:u.call(t))!=null?d:K(),r=t.text();if(!r)return[];let i=T({family:t.fontFamily,size:t.fontSize(),weight:t.fontWeight},t.fontStyle==="italic"?{style:"italic"}:{}),o=t.width(),a=at(r,i,o>0?o:void 0,s),l=G(i.size*t.lineHeight),c=e.keys,h=[],f=0;for(let m=0;m<a.length;m++){let p=a[m];if(!p)continue;let v=s.measureText(p,i),w=G(v.width),y=t.align==="left"?0:t.align==="center"?-w/2:-w,g=m*l-v.ascent,k="";for(let M of Mt(p)){k+=M;let I=f+1,b=Number.POSITIVE_INFINITY;for(let E of c)if(E.value>=I){b=E.t;break}Number.isFinite(b)&&h.push({charIndex:f,grapheme:M,time:b,x:y+s.measureText(k,i).width,y:g,line:m}),f++}}return h}var fs=class extends Error{constructor(){super("a Layout node was evaluated but no LayoutEngine is registered \u2014 await loadYogaLayoutEngine() from '@glissade/scene/layout' before mounting/rendering (the engine is wasm and loads async; evaluate() never awaits, \xA72.5)"),this.name="LayoutEngineMissingError"}},tn=null;function Kr(t){tn=t}function Qr(){return tn}function Jr(){if(!tn)throw new fs;return tn}var Oo=["Group","Rect","Circle","Path","Text","Image","Video","Layout","Custom"],ai=class extends Q{constructor(e){var n,s;super(e);x(this,"target");x(this,"color");x(this,"progress");x(this,"padding");x(this,"cornerRadius");this.target=e.text,this.color=Zr(O("#ffe066"),e.color),this.progress=Zr(O(1),e.progress),this.padding=(n=e.padding)!=null?n:[4,2],this.cornerRadius=(s=e.cornerRadius)!=null?s:4,this.registerTarget("progress",this.progress,"number"),this.registerTarget("color",this.color,"color")}draw(e,n){let s=Math.min(1,Math.max(0,this.progress()));if(s<=0)return;let[r,i]=this.padding,o=this.target.lineBoxes(n.measurer).map(f=>({x:f.x-r,y:f.y-i,w:f.w+2*r,h:f.h+2*i})),a=o.reduce((f,u)=>f+u.w,0);if(a<=0)return;let l=this.target.localMatrix();St(l,Et)||e.push({op:"transform",m:l});let c=this.color(),h=s*a;for(let f of o){let u=Math.min(f.w,h);if(h-=u,u<=0)break;let d=Math.min(this.cornerRadius,u/2,f.h/2),m=e.resource({kind:"path",segs:jt(f.x,f.y,u,f.h,d)});if(e.push({op:"fillPath",path:m,paint:{kind:"color",color:c}}),h<=0)break}}};function Ao(t,e={}){return new ai(L(T({},e),{text:t}))}function Zr(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}var ci=class extends Q{constructor(e){var n,s,r,i;super(e);x(this,"target");x(this,"blinkPeriod");x(this,"blinkPhase");x(this,"solidWhileTyping");x(this,"caretWidth");x(this,"fill");this.target=e.text,this.blinkPeriod=(n=e.blinkPeriod)!=null?n:1.06,this.blinkPhase=(s=e.blinkPhase)!=null?s:0,this.solidWhileTyping=(r=e.solidWhileTyping)!=null?r:!0,this.caretWidth=(i=e.width)!=null?i:2,this.fill=Do(O(""),e.fill),this.registerTarget("fill",this.fill,"color")}draw(e,n){let s=this.target.revealHead(n.measurer);if(s.h<=0)return;let r=!0,i=this.target.graphemes(n.measurer).length,o=s.index<i;if(!(this.solidWhileTyping&&o)){let h=this.blinkPeriod>0?this.blinkPeriod:1;r=((n.time-this.blinkPhase)%h+h)%h<h/2}if(!r)return;let a=this.target.localMatrix();St(a,Et)||e.push({op:"transform",m:a});let l=this.fill()||this.target.fill(),c=e.resource({kind:"path",segs:jt(s.x,s.y,this.caretWidth,s.h,0)});e.push({op:"fillPath",path:c,paint:{kind:"color",color:l}})}};function Po(t,e={}){return new ci(L(T({},e),{text:t}))}function Do(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}var Fo=.06;function zo(t,e,n={}){var f,u,d,m;let s=(f=n.start)!=null?f:0,r=(u=n.perChar)!=null?u:Fo,i=(d=n.gap)!=null?d:0,o=s,a=[],l=[C(s,"",{interp:"hold"})],c=[],h=[];for(let p=0;p<e.length;p++){let v=e[p],w=o,y=(m=v.perChar)!=null?m:r;if(v.type!==void 0)for(let g of Mt(v.type)){o+=y,a.push(g);let k=a.join("");l.push(C(o,k,{interp:"hold"})),c.push({time:o,kind:"insert",grapheme:g,value:k})}if(v.delete!==void 0)for(let g=0;g<v.delete&&a.length>0;g++){o+=y;let k=a.pop(),M=a.join("");l.push(C(o,M,{interp:"hold"})),c.push({time:o,kind:"delete",grapheme:k,value:M})}v.hold!==void 0&&(o+=v.hold),h.push({index:p,start:w,end:o,value:a.join("")}),i>0&&p<e.length-1&&(o+=i)}return{track:bt(t,"string",l),marks:c,steps:h,duration:o}}var Ht=class extends Error{constructor(t){super(t),this.name="EachError"}};function ds(t,e){let n=(t^Math.imul(e+1,2654435769))>>>0;return n=Math.imul(n^n>>>16,569420461),n=Math.imul(n^n>>>15,1935289751),(n^n>>>15)>>>0}var Lo=1779033703;function Ro(t,e,n){var s,r,i,o,a,l,c,h,f,u,d,m;if(typeof t=="function")return t(e,n);switch(t.kind){case"row":{let p=(s=t.gap)!=null?s:n>1?1/(n-1):0,v=(r=t.align)!=null?r:.5,w=.5-p*(n-1)/2;return[n===1?.5:w+p*e,v]}case"column":{let p=(i=t.gap)!=null?i:n>1?1/(n-1):0,v=(o=t.align)!=null?o:.5,w=.5-p*(n-1)/2;return[v,n===1?.5:w+p*e]}case"grid":{let p=t.cols;if(!(p>=1))throw new Ht(`grid layout needs cols >= 1 (got ${p})`);let v=(a=t.rows)!=null?a:Math.ceil(n/p),w=(l=t.order)!=null?l:"row",y=w==="row"?e%p:Math.floor(e/v),g=w==="row"?Math.floor(e/p):e%v,k=(c=t.gapX)!=null?c:p>1?1/(p-1):0,M=(h=t.gapY)!=null?h:v>1?1/(v-1):0,I=k*(p-1),b=M*(v-1);return[p===1?.5:.5-I/2+k*y,v===1?.5:.5-b/2+M*g]}case"ring":{let p=(f=t.radius)!=null?f:.5,[v,w]=(u=t.center)!=null?u:[.5,.5],y=((d=t.startAngle)!=null?d:-Math.PI/2)+((m=t.sweep)!=null?m:Math.PI*2)*(n===0?0:e/n);return[v+p*Math.cos(y),w+p*Math.sin(y)]}}}function No(t,e,n){let s=(n-1)/2;switch(t){case"from-center":return r=>Math.abs(r-s)*e;case"from-edges":return r=>(s-Math.abs(r-s))*e;case"delay":return r=>r*e}}function Vo(t,e){var s,r;let n=(s=t.stagger)!=null?s:0;return typeof n=="function"?n:No((r=t.distribute)!=null?r:"delay",n,e)}function qo(t,e,n){var d,m,p,v,w,y;if(!Number.isInteger(t)||t<0)throw new Ht(`each() count must be a non-negative integer (got ${t})`);let s=((d=n.seed)!=null?d:ls(n.id))>>>0,r=n.box,[i,o]=(m=r==null?void 0:r.origin)!=null?m:[0,0],a=[],l=[],c=new Set;for(let g=0;g<t;g++){let k=`${n.id}/${g}`,M=Ro(n.layout,g,t),I={i:g,n:t,id:k,place:M,rng:ot(ds(s,g)),seed:s},b=e(g,I);if(!(b instanceof Q))throw new Ht(`each() factory must return a Node for index ${g} (got ${typeof b})`);if(c.has(b))throw new Ht(`each() factory returned the same Node instance for index ${g} \u2014 the factory must construct a new node per index (it is called once per clone)`);if(c.add(b),b.id===void 0)b.id=k;else if(b.id!==k)throw new Ht(`each() factory set id '${b.id}' on index ${g}, but each owns the id namespace \u2014 leave it unset so it becomes '${k}'`);a.push(b),l.push(r?{frac:M,px:[i+M[0]*r.w,o+M[1]*r.h]}:{frac:M})}let h=new Tt({id:n.id,children:a}),f=[],u=(v=(p=n.motion)==null?void 0:p.startSec)!=null?v:0;if(n.motion){let g=n.motion,k=(w=g.startSec)!=null?w:0,M=Vo(g,t);for(let I=0;I<t;I++){let b=ot(ds(ds(s,I),Lo)),E=(y=g.jitter)==null?void 0:y.call(g,I,b,t),S=T(T({},E!==void 0?{overrides:E}:{}),g.speed!==void 0?{speed:g.speed}:{}),$=g.clip.apply(`${n.id}/${I}`,k+M(I),S);f.push(...$.tracks),$.end>u&&(u=$.end)}}return{node:h,children:a,tracks:f,end:u,places:l}}function li(t,e={}){var i,o,a;let n=(i=e.start)!=null?i:0,s=(o=e.duration)!=null?o:1,r=(a=e.ease)!=null?a:"easeInOutCubic";return bt(`${t}/reveal`,"number",[C(n,0),C(n+s,1,r)])}function Wo(t,e={}){var s,r;let n=(r=e.delay)!=null?r:((s=e.duration)!=null?s:1)*.6;return Pe(t.map(i=>li(i,e)),n)}var hi=class extends Error{constructor(t){super(`'${t}' was called inside evaluate() \u2014 scene code must be a pure function of time (\xA75.5). Read ctx.time/frame, use the seeded random(seed) from @glissade/core, and resolve assets before rendering.`),this.name="DeterminismViolationError"}};function Bo(){let t=globalThis,e=[{target:Math,key:"random",label:"Math.random"},{target:Date,key:"now",label:"Date.now"},{target:t,key:"setTimeout",label:"setTimeout"},{target:t,key:"setInterval",label:"setInterval"}];return typeof performance!="undefined"&&e.push({target:performance,key:"now",label:"performance.now"}),typeof t.requestAnimationFrame=="function"&&e.push({target:t,key:"requestAnimationFrame",label:"requestAnimationFrame"}),e}function _o(t,e){if(t==="off")return e();let n=Bo(),s=n.map(i=>i.target[i.key]),r=new Set;n.forEach((i,o)=>{i.target[i.key]=(...a)=>{if(t==="throw")throw new hi(i.label);return r.has(i.label)||(r.add(i.label),B(`${i.label} called inside evaluate() \u2014 nondeterministic, not reproducible on export (\xA75.5)`)),s[o].apply(i.target,a)}});try{return e()}finally{n.forEach((i,o)=>{i.target[i.key]=s[o]})}}var ui=class extends Error{constructor(t){super(`duplicate node id '${t}' \u2014 explicit ids must be unique (\xA73.1/\xA76.5)`),this.name="DuplicateNodeIdError"}},fi=class extends Error{constructor(t){super(`node id '${t}' uses the reserved '~' prefix \u2014 that namespace is for structural fallback ids (\xA76.5), which are inspection-only and never track targets; choose another id`),this.name="ReservedNodeIdError"}};function di(t,e,n){if(t.measurerSource=n,t.id!==void 0){if(t.id.startsWith("~"))throw new fi(t.id);if(e.has(t.id))throw new ui(t.id);e.set(t.id,t)}if(t instanceof Tt)for(let s of t.children)di(s,e,n)}function jo(t){let e=new Tt({id:"__root",children:t.children}),n=new Map,s=Be(),r=O(null);return di(e,n,()=>{var i;return(i=r())!=null?i:K()}),{root:e,nodes:n,size:t.size,playhead:s,resolveTarget:i=>{for(let o=i.lastIndexOf("/");o>0;o=i.lastIndexOf("/",o-1)){let a=n.get(i.slice(0,o));if(a)return a.resolveTarget(i.slice(o+1))}},setTextMeasurer:i=>{r.set(i)},get textMeasurer(){var i;return(i=r.peek())!=null?i:K()}}}var ti=new WeakMap;function pi(t,e){let n=ti.get(t);n||(n=new WeakMap,ti.set(t,n));let s=n.get(e);if(!s){let r=nt(e);s={compiled:r,bound:Gn(r,t.resolveTarget,t.playhead)},n.set(e,s)}return s}function de(t,e,n){pi(t,e);let s=e.fps,r={time:n,frame:s!==void 0?Math.round(n*s):-1,measurer:t.textMeasurer};return Un(t.playhead,n,()=>{let i=le(t.size);return t.root.emit(i,r),i.finish()})}function en(t){return JSON.stringify(t,_t)}function Ho(t,e,n){let s=t(),r=t(),i=de(s,e,n),o=de(r,e,n);if(en(i)===en(o))return{ok:!0};let a=e.fps!==void 0?Math.round(n*e.fps):-1,l={time:n,frame:a,measurer:s.textMeasurer},c={time:n,frame:a,measurer:r.textMeasurer},h;for(let[f,u]of s.nodes){let d=r.nodes.get(f);if(!d)return{ok:!1,node:f};let m=le(s.size);u.emit(m,l);let p=le(r.size);d.emit(p,c);let v=m.finish(),w=p.finish();if(en(v)===en(w))continue;if(u instanceof Tt){h!=null||(h=f);continue}let y=ts(v,w).deltas[0];return T({ok:!1,node:f},y!==void 0?{delta:y}:{})}return T({ok:!1},h!==void 0?{node:h}:{})}var ws=new Set(["blur","drop-shadow","brightness","contrast","saturate"]),ei=t=>t<0?0:t>1?1:t;function ni(t,e,n,s,r){let i=1-r,o=i*i*i,a=3*i*i*r,l=3*i*r*r,c=r*r*r;return[o*t[0]+a*e[0]+l*n[0]+c*s[0],o*t[1]+a*e[1]+l*n[1]+c*s[1]]}function Xo(t){let e=[];for(let n of t){let s=n.v.length;for(let r=0;r<s-1;r++)e.push([n.v[r],[n.v[r][0]+n.out[r][0],n.v[r][1]+n.out[r][1]],[n.v[r+1][0]+n.in[r+1][0],n.v[r+1][1]+n.in[r+1][1]],n.v[r+1]]);n.closed&&s>1&&e.push([n.v[s-1],[n.v[s-1][0]+n.out[s-1][0],n.v[s-1][1]+n.out[s-1][1]],[n.v[0][0]+n.in[0][0],n.v[0][1]+n.in[0][1]],n.v[0]])}return e}function pe(t,e={}){var h,f;let n=Math.max(1,Math.floor((h=e.samplesPerSegment)!=null?h:32)),s=Xo(t),r=[],i=[];if(s.length>0){let u=ni(...s[0],0);r.push(u),i.push(0);let d=0;for(let m of s)for(let p=1;p<=n;p++){let v=ni(...m,p/n);d+=Math.hypot(v[0]-u[0],v[1]-u[1]),r.push(v),i.push(d),u=v}}else{let u=(f=t[0])==null?void 0:f.v[0];r.push(u?[u[0],u[1]]:[0,0]),i.push(0)}let o=i[i.length-1],a=u=>{if(o<=0||u<=0)return{i:0,f:0};if(u>=o)return{i:r.length-2,f:1};let d=0;for(;d<i.length-1&&i[d+1]<u;)d++;let m=i[d+1]-i[d];return{i:d,f:m>0?(u-i[d])/m:0}},l=u=>{if(r.length===1)return[r[0][0],r[0][1]];let{i:d,f:m}=a(u),p=r[d],v=r[d+1];return[p[0]+(v[0]-p[0])*m,p[1]+(v[1]-p[1])*m]},c=u=>{if(r.length===1)return[1,0];let{i:d}=a(u),m=r[d],p=r[d+1],v=p[0]-m[0],w=p[1]-m[1],y=Math.hypot(v,w);return y>0?[v/y,w/y]:[1,0]};return{length:o,at:l,tangentAt:c,atProgress:u=>l(ei(u)*o),tangentAtProgress:u=>c(ei(u)*o)}}function Yo(t){return pe(t).length}function Go(t,e){return pe(t).at(e)}var mi=class extends Q{constructor(e){var a;super(e);x(this,"target");x(this,"progress");this.target=e.target,this.progress=O(1),typeof e.progress=="function"?this.progress.bindSource(e.progress):e.progress!==void 0&&this.progress.set(e.progress),this.registerTarget("progress",this.progress,"number");let n=e.samplesPerSegment!==void 0?{samplesPerSegment:e.samplesPerSegment}:{},s=e.path instanceof us?()=>e.path.data():()=>e.path,r=s(),i=pe(r,n),o=()=>{let l=s();return l!==r&&(r=l,i=pe(l,n)),i};if(e.target.position.bindSource(()=>o().atProgress(this.progress())),e.orient){let l=(a=e.orientOffset)!=null?a:0;e.target.rotation.bindSource(()=>{let c=o().tangentAtProgress(this.progress());return Math.atan2(c[1],c[0])*180/Math.PI+l})}}draw(){}};function Uo(t,e,n={}){return new mi(L(T({},n),{target:t,path:e}))}var me=class extends Error{constructor(t){super(t),this.name="TokenMatchError"}},ms=t=>t.replace(/\s+/g,"");function gs(t,e,n=1){let s=ms(e);if(s.length===0)throw new me("empty token");let r=0;for(let i=0;i<t.length;i++){let o="";for(let a=i;a<t.length;a++){if(o+=ms(t[a].text),o===s){if(r++,r===n)return[i,a];break}if(!s.startsWith(o))break}}throw new me(`no match for token '${e}'${n>1?` (occurrence ${n})`:""} \u2014 segments are [${t.map(i=>`'${i.text}'`).join(", ")}]`)}var gi=class extends Q{constructor(e){var s,r,i;super(e);x(this,"target");x(this,"padding");x(this,"cornerRadius");x(this,"rematch");x(this,"ranges");this.target=e.text,this.padding=(s=e.padding)!=null?s:[4,2],this.cornerRadius=(r=e.cornerRadius)!=null?r:4,this.rematch=(i=e.rematch)!=null?i:!1;let n=this.target.wordBoxes();this.ranges=e.ranges.map((o,a)=>{var f;let l=this.resolveRun(n,o),c=(f=o.id)!=null?f:`r${a}`,h={spec:o,fill:nn(O("#ffe066"),o.fill),opacity:nn(O(1),o.opacity),progress:nn(O(1),o.progress),scale:nn(O(1),o.scale),offset:Qo(Wt([0,0]),o.offset),run:l,bound:si(n,l)};return this.registerTarget(`${c}/fill`,h.fill,"color"),this.registerTarget(`${c}/opacity`,h.opacity,"number"),this.registerTarget(`${c}/progress`,h.progress,"number"),this.registerTarget(`${c}/scale`,h.scale,"number"),this.registerTarget(`${c}/offset`,h.offset,"vec2"),this.registerTarget(`${c}/offset.x`,h.offset.x,"number"),this.registerTarget(`${c}/offset.y`,h.offset.y,"number"),h})}resolveRun(e,n){var s;if(typeof n.match!="string"){let[r,i]=n.match;if(r<0||i>=e.length||r>i)throw new me(`word index range [${r}, ${i}] out of bounds (${e.length} boxes)`);return[r,i]}return gs(e,n.match,(s=n.occurrence)!=null?s:1)}draw(e,n){var l;let s=this.target.wordBoxes(n.measurer);if(s.length===0)return;let r=this.target.localMatrix(),[i,o]=this.padding,a=!1;for(let c of this.ranges){let h=c.opacity();if(h<=0)continue;let f=Math.min(1,Math.max(0,c.progress()));if(f<=0)continue;let u=c.run;if(this.rematch&&typeof c.spec.match=="string")u=gs(s,c.spec.match,(l=c.spec.occurrence)!=null?l:1);else if(si(s,u)!==c.bound)throw new me(`bound token '${c.bound}' no longer matches boxes [${u[0]}, ${u[1]}] \u2014 the text changed (segments now [${s.slice(u[0],u[1]+1).map(k=>`'${k.text}'`).join(", ")}]); pass rematch: true for animated text`);let d=[];for(let k=u[0];k<=u[1];k++){let M=s[k],I=d[d.length-1],b=k>u[0]&&s[k-1].line===M.line?I:void 0;b?(b.w=M.x+M.w+i-b.x,b.y=Math.min(b.y,M.y-o),b.h=Math.max(b.h,M.y+M.h+o-b.y)):d.push({x:M.x-i,y:M.y-o,w:M.w+2*i,h:M.h+2*o})}!a&&!St(r,Et)&&(e.push({op:"transform",m:r}),a=!0);let m=h<1;m&&e.push({op:"pushGroup",opacity:h,blend:"source-over",filters:[]});let p=c.fill(),v=c.scale(),[w,y]=c.offset(),g=f*d.reduce((k,M)=>k+M.w,0);for(let k of d){let M=Math.min(k.w,g);if(g-=M,M<=0)break;let I=k.x+k.w/2+w,b=k.y+k.h/2+y,E=M*v,S=k.h*v,$=I-k.w/2*v,P=b-S/2,D=Math.min(this.cornerRadius,E/2,S/2),V=e.resource({kind:"path",segs:jt($,P,E,S,D)});if(e.push({op:"fillPath",path:V,paint:{kind:"color",color:p}}),g<=0)break}m&&e.push({op:"popGroup"})}}};function si(t,e){return t.slice(e[0],e[1]+1).map(n=>ms(n.text)).join("")}function Ko(t,e){return new gi(L(T({},e),{text:t}))}function nn(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}function Qo(t,e){return typeof e=="function"?t.bindSource(e):e!==void 0&&t.set(e),t}function yi(t){let e=[],n=s=>{if(s instanceof Ze){let r=s.text();r&&e.push({family:s.fontFamily,text:r})}if(s instanceof Tt)for(let r of s.children)n(r)};return n(t.root),e}function Jo(t){let e=t.indexOf("/");return e>=0?t.slice(0,e):t}function Zo(t,e){let n=[];for(let s of e.tracks){if(s.type!=="string")continue;let r=t.nodes.get(Jo(s.target));if(r instanceof Ze)for(let i of s.keys){let o=i.value;typeof o=="string"&&o&&n.push({family:r.fontFamily,text:o})}}return n}async function bs(t,e,n,s={}){var c,h;let r=(c=s.mode)!=null?c:"dev",i=ie(e.assets),o=[...yi(t),...(h=s.extraUsages)!=null?h:[]],a=new Set;for(let f of o)if(i.has(f.family))for(let u of i.fallbackChain(f.family))a.add(u);let l=new Map;for(let f of a){let u=i.resolveFace(f);if(!u)continue;let d=await n(u.url);d&&l.set(f,Fe(d))}return Yn(o,i,l,r,T({},s.osFamilies!==void 0?{osFamilies:s.osFamilies}:{}))}var fe=class extends Error{constructor(e,n,s){super(`asset '${e}' not ready: ${n}. evaluate() never awaits \u2014 warm assets before evaluating (\xA72.5 readiness precondition)`);x(this,"assetId");x(this,"detail");x(this,"mediaT");this.name="ColdAssetError",this.assetId=e,this.detail=n,this.mediaT=s}},ta=class extends Tt{constructor(e){var s;super(e);x(this,"wgsl");x(this,"uniformSignals");this.wgsl=e.wgsl;let n=new Map;for(let[r,i]of Object.entries((s=e.uniforms)!=null?s:{})){let o=O(i);n.set(r,o),this.registerTarget(`u.${r}`,o,"number")}this.uniformSignals=n}uniform(e){let n=this.uniformSignals.get(e);if(!n)throw new Error(`ShaderEffect has no uniform '${e}' (have: ${[...this.uniformSignals.keys()].join(", ")})`);return n}groupShader(){let e={};for(let[n,s]of this.uniformSignals)e[n]=s();return{wgsl:this.wgsl,uniforms:e}}},ea=t=>t*t*(3-2*t),na=2.4,sa=1-Math.exp(-5.76/2),ra=t=>(1-Math.exp(-((t*na)**2)/2))/sa;function ia(t,e){if(e==="linear"||t.length<2)return t;let n=e==="gaussian"?ra:ea,s=t[0].offset,r=t[t.length-1].offset-s;if(r<=0)return t;let i=[],o=0;for(let a=0;a<64;a++){let l=s+r*(a/63);for(;o<t.length-2&&l>t[o+1].offset;)o++;let c=t[o],h=t[o+1],f=h.offset-c.offset,u=f>0?Math.min(1,Math.max(0,(l-c.offset)/f)):0;i.push({offset:l,color:ht(c.color,h.color,n(u))})}return i}var oa=4,aa=2,ys=.32,ri=1e-6,ii=1024;function wi(t,e,n){let s=new Uint8ClampedArray(Math.max(1,e)*Math.max(1,n)*4),r=t.points.map(l=>({u:l.pos[0],v:l.pos[1],lab:Ct(ut(l.color))})),i=t.bg!==void 0?Ct(ut(t.bg)):null,o=t.interpolation==="gaussian",a=2*ys*ys;for(let l=0;l<n;l++){let c=n>1?(l+.5)/n:.5;for(let h=0;h<e;h++){let f=e>1?(h+.5)/e:.5,u=0,d=0,m=0,p=0,v=0;i&&(u=1,d=i.L,m=i.a,p=i.b,v=i.alpha);let w=!1;for(let k=0;k<r.length;k++){let M=r[k],I=f-M.u,b=c-M.v,E=I*I+b*b;if(E<=ri*ri){d=M.lab.L,m=M.lab.a,p=M.lab.b,v=M.lab.alpha,w=!0;break}let S;o?S=Math.exp(-E/a):S=1/E,u+=S,d+=S*M.lab.L,m+=S*M.lab.a,p+=S*M.lab.b,v+=S*M.lab.alpha}let y;if(w)y=Nt({L:d,a:m,b:p,alpha:v});else if(u>0){let k=1/u;y=Nt({L:d*k,a:m*k,b:p*k,alpha:v*k})}else y={r:0,g:0,b:0,a:0};let g=(l*e+h)*4;s[g]=y.r,s[g+1]=y.g,s[g+2]=y.b,s[g+3]=Math.round(y.a*255)}}return s}function bi(t,e){return{w:Math.min(ii,Math.max(1,Math.ceil(Math.abs(t)/4))),h:Math.min(ii,Math.max(1,Math.ceil(Math.abs(e)/4)))}}var oi=!1;function ca(t){var e,n,s;return oi||(oi=!0,B("mesh Paint on a stroke/text resolves to a representative solid color (mesh fill is supported only on filled paths, \xA73 Paint) \u2014 use a fillPath for the mesh gradient")),(s=(n=t.bg)!=null?n:(e=t.points[0])==null?void 0:e.color)!=null?s:"#00000000"}function ps(t,e,n){if(e.kind==="color")return e.color;if(e.kind==="mesh")return ca(e);let s;if(e.kind==="radial"){let i=e.center?e.center[0]:n?(n.minX+n.maxX)/2:0,o=e.center?e.center[1]:n?(n.minY+n.maxY)/2:0,a=e.radius!==void 0?e.radius:n?Math.hypot(n.maxX-n.minX,n.maxY-n.minY)/2:0;s=t.createRadialGradient(i,o,0,i,o,a)}else{let i=e.from?e.from[0]:n?(n.minX+n.maxX)/2:0,o=e.from?e.from[1]:n?n.minY:0,a=e.to?e.to[0]:n?(n.minX+n.maxX)/2:0,l=e.to?e.to[1]:n?n.maxY:0;s=t.createLinearGradient(i,o,a,l)}let r=e.interpolation?ia(e.stops,e.interpolation):e.stops;for(let i of r)s.addColorStop(i.offset,i.color);return s}function sn(t){return`${t.style==="italic"?"italic ":""}${t.weight!==void 0&&t.weight!==400?`${t.weight} `:""}${t.size}px ${t.family}`}var la=16;function ha(t){let e=n=>Object.is(n,-0)?"0":String(Math.round(n*1e4)/1e4);return`${e(t[0])},${e(t[1])},${e(t[2])},${e(t[3])},${e(t[4])},${e(t[5])}`}function ua(t){let e=0;for(let n of t!=null?t:[])n.kind==="blur"?e+=3*n.radius:n.kind==="drop-shadow"&&(e+=Math.max(Math.abs(n.dx),Math.abs(n.dy))+3*n.blur);return e}function ki(t,e,n){return t?(e<t.minX&&(t.minX=e),n<t.minY&&(t.minY=n),e>t.maxX&&(t.maxX=e),n>t.maxY&&(t.maxY=n),t):{minX:e,minY:n,maxX:e,maxY:n}}function ue(t,e,n,s,r,i){for(let[o,a]of[[n,s],[r,s],[n,i],[r,i]])t.bounds=ki(t.bounds,e[0]*o+e[2]*a+e[4],e[1]*o+e[3]*a+e[5])}function fa(t){let e=null,n=(s,r)=>{e=ki(e,s,r)};for(let s of t)switch(s[0]){case"M":case"L":n(s[1],s[2]);break;case"C":n(s[1],s[2]),n(s[3],s[4]),n(s[5],s[6]);break;case"Q":n(s[1],s[2]),n(s[3],s[4]);break;case"E":{let r=Math.max(s[3],s[4]);n(s[1]-r,s[2]-r),n(s[1]+r,s[2]+r);break}}return e}var ks=class{constructor(t,e="warn",n=(i=>(i=(r=>(r=(s=>(s=globalThis.process)==null?void 0:s.env)())==null?void 0:r.RASTER_CACHE)())!=null?i:"1")()!=="0"){x(this,"host");x(this,"shaderCaps");x(this,"pool",[]);x(this,"pathCache",new WeakMap);x(this,"pathBoundsCache",new WeakMap);x(this,"images",new Map);x(this,"videos",new Map);x(this,"warnedShaders",!1);x(this,"rasterCache",new Map);x(this,"cacheEnabled");this.host=t,this.shaderCaps=e,this.cacheEnabled=n}setImageAsset(t,e){this.images.set(t,e)}setVideoAsset(t,e){this.videos.set(t,e)}dispose(){this.pool.length=0,this.rasterCache.clear()}resolveDrawable(t,e){if(t.kind==="image"){let n=this.images.get(t.assetId);if(!n)throw new fe(t.assetId,"no decoded image registered");return n}if(t.kind==="videoFrame"){let n=this.videos.get(t.assetId);if(!n)throw new fe(t.assetId,"no VideoFrameSource registered",t.mediaT);try{return n.getFrameSync(t.mediaT)}catch(s){throw s instanceof fe?new fe(t.assetId,s.detail,t.mediaT):s}}throw new Error(`resource ${e} is not drawable`)}path(t,e){let n=t[e];if(!n||n.kind!=="path")throw new Error(`resource ${e} is not a path`);let s=this.pathCache.get(n);return s||(s=this.buildPath(n.segs),this.pathCache.set(n,s)),s}pathBounds(t,e){var s;let n=t[e];return!n||n.kind!=="path"?null:(this.pathBoundsCache.has(n)||this.pathBoundsCache.set(n,fa(n.segs)),(s=this.pathBoundsCache.get(n))!=null?s:null)}buildPath(t){let e=this.host.newPath();for(let n of t)switch(n[0]){case"M":e.moveTo(n[1],n[2]);break;case"L":e.lineTo(n[1],n[2]);break;case"C":e.bezierCurveTo(n[1],n[2],n[3],n[4],n[5],n[6]);break;case"Q":e.quadraticCurveTo(n[1],n[2],n[3],n[4]);break;case"E":e.ellipse(n[1],n[2],n[3],n[4],n[5],n[6],n[7]);break;case"Z":e.closePath();break}return e}acquire(t,e){let n=this.pool.pop();return n?(n.width!==t&&(n.width=t),n.height!==e&&(n.height=e),n):this.host.createCanvas(t,e)}release(t){this.pool.length<8&&this.pool.push(t)}cacheStore(t,e){let n=this.rasterCache.get(t);for(n&&(this.rasterCache.delete(t),n.canvas!==e.canvas&&this.release(n.canvas)),this.rasterCache.set(t,e);this.rasterCache.size>la;){let s=this.rasterCache.keys().next().value;if(s===void 0)break;let r=this.rasterCache.get(s);this.rasterCache.delete(s),this.release(r.canvas)}}cacheTouch(t){let e=this.rasterCache.get(t);return e&&(this.rasterCache.delete(t),this.rasterCache.set(t,e)),e}fillMesh(t,e,n,s){let r=s.maxX-s.minX,i=s.maxY-s.minY;if(r<=0||i<=0)return;let{w:o,h:a}=bi(r,i),l=wi(n,o,a),c=this.acquire(o,a),h=this.host.context(c),f=h.createImageData(o,a);f.data.set(l),h.putImageData(f,0,0),t.save(),t.clip(e,"nonzero"),t.imageSmoothingEnabled=!0,t.drawImage(c,0,0,o,a,s.minX,s.minY,r,i),t.restore(),this.release(c)}composite(t,e,n,s,r,i,o,a,l,c,h,f){let u=l!==void 0&&l!=="none",d=u?ua(c):0;r||a!=="source-over"?e.unbounded=!0:s&&ue(e,Et,s.minX-d,s.minY-d,s.maxX+d,s.maxY+d);let m=u&&!i&&!r&&a==="source-over";if(!(m&&s===null)){if(t.save(),t.resetTransform(),m&&s){let p=Math.max(0,Math.floor(s.minX-d)),v=Math.max(0,Math.floor(s.minY-d)),w=Math.min(h,Math.ceil(s.maxX+d)),y=Math.min(f,Math.ceil(s.maxY+d));if(p>=w||v>=y){t.restore();return}let g=this.host.newPath();g.moveTo(p,v),g.lineTo(w,v),g.lineTo(w,y),g.lineTo(p,y),g.closePath(),t.clip(g,"nonzero")}t.globalAlpha=o,u&&(t.filter=l),t.globalCompositeOperation=a,t.drawImage(n,0,0),t.restore()}}render(t,e){var f,u,d,m,p,v,w,y,g,k,M;let{w:n,h:s}=e.size;t.width!==n&&(t.width=n),t.height!==s&&(t.height=s);let r=this.host.context(t);r.resetTransform(),r.clearRect(0,0,n,s);let i=[{ctx:r,canvas:null,opacity:1,blend:"source-over",bounds:null,unbounded:!1}],o=()=>i[i.length-1].ctx,a=()=>i[i.length-1],l=Et,c=[],h=e.commands;for(let I=0;I<h.length;I++){let b=h[I];switch(b.op){case"save":c.push(l),o().save();break;case"restore":l=(f=c.pop())!=null?f:l,o().restore();break;case"transform":l=ae(l,b.m),o().transform(b.m[0],b.m[1],b.m[2],b.m[3],b.m[4],b.m[5]);break;case"clip":o().clip(this.path(e.resources,b.path),(u=b.rule)!=null?u:"nonzero");break;case"fillPath":{let E=o(),S=this.pathBounds(e.resources,b.path);b.paint.kind==="mesh"&&S?this.fillMesh(E,this.path(e.resources,b.path),b.paint,S):(E.fillStyle=ps(E,b.paint,S),E.fill(this.path(e.resources,b.path))),S&&ue(a(),l,S.minX,S.minY,S.maxX,S.maxY);break}case"strokePath":{let E=o(),S=this.pathBounds(e.resources,b.path);if(E.strokeStyle=ps(E,b.paint,S),E.lineWidth=b.stroke.width,E.lineCap=(d=b.stroke.cap)!=null?d:"butt",E.lineJoin=(m=b.stroke.join)!=null?m:"miter",b.stroke.dash&&(E.setLineDash(b.stroke.dash),E.lineDashOffset=(p=b.stroke.dashOffset)!=null?p:0),E.stroke(this.path(e.resources,b.path)),b.stroke.dash&&(E.setLineDash([]),E.lineDashOffset=0),S){let $=b.stroke.width*(((v=b.stroke.join)!=null?v:"miter")==="miter"?5:1);ue(a(),l,S.minX-$,S.minY-$,S.maxX+$,S.maxY+$)}break}case"fillText":{let E=o();E.font=sn(b.font),E.fillStyle=ps(E,b.paint,null),E.textBaseline="alphabetic",E.textAlign=(w=b.align)!=null?w:"left",E.fillText(b.text,b.x,b.y);try{let S=E.measureText(b.text).width,$=(y=b.align)!=null?y:"left",P=$==="center"?b.x-S/2:$==="right"?b.x-S:b.x,D=b.font.size;ue(a(),l,P-D,b.y-1.5*D,P+S+D,b.y+.75*D)}catch(S){a().unbounded=!0}break}case"drawImage":{let E=e.resources[b.image];if(!E)throw new Error(`drawImage references missing resource ${b.image}`);let S=this.resolveDrawable(E,b.image),$=o();b.smoothing!==void 0&&($.imageSmoothingEnabled=b.smoothing);let{x:P,y:D,w:V,h:Y}=b.dst;b.src?$.drawImage(S,b.src.x,b.src.y,b.src.w,b.src.h,P,D,V,Y):$.drawImage(S,P,D,V,Y),ue(a(),l,P,D,P+V,D+Y);break}case"pushGroup":{let E=o(),S=this.cacheEnabled&&b.cacheKey!==void 0&&b.shader===void 0?`${b.cacheKey}@${ha(l)}`:void 0;if(S!==void 0){let D=this.cacheTouch(S);if(D){this.composite(E,a(),D.canvas,D.bounds,D.unbounded,!1,b.opacity,b.blend,Ue(b.filters),b.filters,n,s);let V=1;for(;V>0&&++I<h.length;){let Y=h[I];Y.op==="pushGroup"?V++:Y.op==="popGroup"&&V--}break}}let $=this.acquire(n,s),P=this.host.context($);P.resetTransform(),P.clearRect(0,0,n,s),P.setTransform(E.getTransform()),i.push(T(L(T({ctx:P,canvas:$,opacity:b.opacity,blend:b.blend,filter:Ue(b.filters),filters:b.filters},b.shader!==void 0?{shader:b.shader}:{}),{bounds:null,unbounded:!1}),S!==void 0?{cacheStoreKey:S}:{}));break}case"popGroup":{let E=i.pop();if(!E||E.canvas===null)throw new Error("popGroup without matching pushGroup");let S=o(),$=E.canvas,P=!1;if(E.shader!==void 0){let D=(M=(k=(g=this.host).applyShader)==null?void 0:k.call(g,E.canvas,E.shader,n,s))!=null?M:null;if(D!==null)$=D,P=!0,E.bounds={minX:0,minY:0,maxX:n,maxY:s},E.unbounded=!1;else{if(this.shaderCaps==="error")throw new Error("a ShaderEffect reached a backend without a shader runner (\xA73.7) \u2014 load @glissade/effects-webgpu in the browser, or accept passthrough with caps.shaders: warn");this.warnedShaders||(this.warnedShaders=!0,B("ShaderEffect pass skipped: no shader runner here (headless or webgpu-less browser) \u2014 subtree composites unfiltered (\xA73.7 caps.shaders)"))}}this.composite(S,a(),$,E.bounds,E.unbounded,P,E.opacity,E.blend,E.filter,E.filters,n,s),E.cacheStoreKey!==void 0&&!P?this.cacheStore(E.cacheStoreKey,{canvas:E.canvas,bounds:E.bounds,unbounded:E.unbounded}):this.release(E.canvas);break}}}if(i.length!==1)throw new Error("unbalanced pushGroup/popGroup in DisplayList")}};var ge=null;function vi(t){ge=t}function da(t,e){if(typeof OffscreenCanvas!="undefined")return new OffscreenCanvas(t,e);let n=document.createElement("canvas");return n.width=t,n.height=e,n}var pa=16384,rn=class{constructor(t,e={}){x(this,"target");x(this,"raster");var n;this.target=t,this.raster=new ks({context:s=>this.context(s),createCanvas:(s,r)=>da(s,r),newPath:()=>new Path2D,applyShader:(s,r,i,o)=>{var a;return(a=ge==null?void 0:ge.apply(s,r,i,o))!=null?a:null}},(n=e.shaderCaps)!=null?n:"warn")}get caps(){return{filters:ws,shaders:ge!==null,maxTextureSize:pa}}setImageAsset(t,e){this.raster.setImageAsset(t,e)}setVideoAsset(t,e){this.raster.setVideoAsset(t,e)}measureText(t,e){let n=this.context(this.target);n.save(),n.font=sn(e);let s=n.measureText(t);return n.restore(),{width:s.width,ascent:s.actualBoundingBoxAscent,descent:s.actualBoundingBoxDescent}}render(t){this.raster.render(this.target,t)}async readPixels(){return this.context(this.target).getImageData(0,0,this.target.width,this.target.height).data}dispose(){this.raster.dispose()}context(t){let e=t.getContext("2d");if(!e)throw new Error("canvas 2d context unavailable");return e}};var ct=class extends Error{constructor(t){super(t),this.name="ClipError"}};function xi(t,e,n){let s;try{s=Ot(n)}catch(i){throw new ct(`clip override for '${t}' has an un-typeable value ${JSON.stringify(n)} (channel type '${e}')`)}let r=i=>i==="color"||i==="string";if(!(s===e||r(s)&&r(e)))throw new ct(`clip override for '${t}' is a '${s}' value but the channel is '${e}' (${JSON.stringify(n)}); a mismatched override samples to NaN`);return n}function Mi(t){return t.keys.length===0?0:t.keys[t.keys.length-1].t}function ma(t,e,n){if(typeof t=="string")return kt(`${t}/${n}`);let s=t[e];if(s===void 0)throw new ct(`clip target map is missing channel '${e}' \u2014 provide a target for every channel, or pass a node-id string`);return kt(s)}function ga(t,e,n,s,r){var a;if(e.keys.length===0)throw new ct(`clip channel '${t}' has no keys`);let i=(a=e.type)!=null?a:Ot(e.keys[0].value),o=e.keys.length-1;if(r&&o===0&&r.from!==void 0)throw new ct(r.to!==void 0?`clip override for '${t}' supplies both 'from' and 'to' on a single-key channel \u2014 ambiguous (both target the only key)`:`clip override for '${t}' supplies 'from' on a single-key channel \u2014 ambiguous (the only key already is the 'to' value)`);return bt(t,i,e.keys.map((l,c)=>{let h=l.value,f=!1;r&&(c===0&&r.from!==void 0&&(h=xi(t,i,r.from),f=!0),c===o&&r.to!==void 0&&(h=xi(t,i,r.to),f=!0));let u={t:n+l.t/s,value:h},d=r&&c===o&&r.ease!==void 0?r.ease:l.ease;return d!==void 0&&(u.ease=d),l.interp!==void 0&&(u.interp=l.interp),l.id!==void 0&&(u.id=l.id),l.derived!==void 0&&!f&&(u.derived=l.derived),l.from!==void 0&&(u.from=l.from),u}))}function pt(t){let e=Object.keys(t.channels);if(e.length===0)throw new ct("clip() requires at least one channel");let n=0;for(let r of e){let i=t.channels[r];if(i.keys.length===0)throw new ct(`clip channel '${r}' has no keys`);n=Math.max(n,Mi(i))}function s(r,i,o){var f;let a=(f=o==null?void 0:o.speed)!=null?f:1;if(!(a>0))throw new ct(`clip speed must be > 0 (got ${a})`);let l=o==null?void 0:o.overrides,c=[],h=i;for(let u of e){let d=t.channels[u],m=ma(r,u,d.path);c.push(ga(m,d,i,a,l==null?void 0:l[u])),h=Math.max(h,i+Mi(d)/a)}if(l){for(let u of Object.keys(l))if(!(u in t.channels))throw new ct(`clip override references unknown channel '${u}'`)}return{tracks:c,end:h}}return{spec:t,duration:n,apply:s}}function ya(t,e,n,s){var h;let r=(h=s==null?void 0:s.stagger)!=null?h:0,i=typeof r=="function"?r:u=>u*r,f=s!=null?s:{},{stagger:o}=f,a=Lt(f,["stagger"]),l=[],c=n;return e.forEach((u,d)=>{let m=t.apply(u,n+i(d),a);l.push(...m.tracks),m.end>c&&(c=m.end)}),{tracks:l,end:c}}function wa(t){var s,r;let e=(s=t==null?void 0:t.duration)!=null?s:.3,n=(r=t==null?void 0:t.ease)!=null?r:"easeOutCubic";return pt({channels:{opacity:{path:"opacity",keys:[C(0,0),C(e,1,n)]},scale:{path:"scale",keys:[C(0,[.8,.8]),C(e,[1,1],n)]}}})}function ba(t,e){var o,a,l;let n=(o=e==null?void 0:e.duration)!=null?o:.3,s=(a=e==null?void 0:e.ease)!=null?a:"easeOutCubic",r=(l=e==null?void 0:e.distance)!=null?l:40,i=t==="left"?[-r,0]:t==="right"?[r,0]:t==="top"?[0,-r]:[0,r];return pt({channels:{opacity:{path:"opacity",keys:[C(0,0),C(n,1,s)]},offset:{path:"position",keys:[C(0,i),C(n,[0,0],s)]}}})}function ka(t){var r,i,o;let e=(r=t==null?void 0:t.duration)!=null?r:.4,n=(i=t==null?void 0:t.ease)!=null?i:"easeInOutSine",s=(o=t==null?void 0:t.scale)!=null?o:1.1;return pt({channels:{scale:{path:"scale",keys:[C(0,[1,1]),C(e/2,[s,s],n),C(e,[1,1],n)]}}})}function va(t){var r,i,o;let e=(r=t==null?void 0:t.duration)!=null?r:2,n=(i=t==null?void 0:t.ease)!=null?i:"easeInOutSine",s=(o=t==null?void 0:t.amplitude)!=null?o:8;return pt({channels:{drift:{path:"position",keys:[C(0,[0,0]),C(e/2,[s,0],n),C(e,[0,0],n)]}}})}var Xt=class extends Error{constructor(t){super(t),this.name="MorphError"}};function vs(t,e){for(let[n,s]of[["x",e.x],["y",e.y],["w",e.w],["h",e.h]])if(!Number.isFinite(s))throw new Xt(`morph ${t}.${n} must be finite (got ${s})`);if(!(e.w>0)||!(e.h>0))throw new Xt(`morph ${t} must have w>0 and h>0 (got w=${e.w}, h=${e.h}); a zero/negative box yields a NaN/Infinity scale`)}function on(t,e){let n=typeof t=="string"?t:t[At];return typeof n!="string"||n.length===0?`${String(n)}/${e}`:`${typeof t=="string"?n:n.slice(0,Math.max(0,n.lastIndexOf("/")))}/${e}`}function xa(t,e,n,s){var w,y,g;let{at:r,duration:i}=s,o=s.ease,a=(w=s.crossfade)!=null?w:.5,l=(y=s.metric)!=null?y:"transform";if(l!=="transform")throw new Xt(`morph metric '${l}' is not supported in v1 (only 'transform')`);if(vs("from",t),vs("to",e),!(i>0))throw new Xt(`morph duration must be > 0 (got ${i})`);if(!(a>=0&&a<=1))throw new Xt(`morph crossfade must be in [0,1] (got ${a})`);let c=(g=s.base)!=null?g:{w:e.w,h:e.h};vs("to",{x:0,y:0,w:c.w,h:c.h});let h=[t.w/c.w,t.h/c.h],f=[e.w/c.w,e.h/c.h],u=[t.x,t.y],d=[e.x,e.y],m={position:{path:"position",type:"vec2",keys:[C(0,u),C(i,d,o)]},scale:{path:"scale",type:"vec2",keys:[C(0,h),C(i,f,o)]}},p={position:on(n.morphNode,"position"),scale:on(n.morphNode,"scale")};n.fromNode!==void 0&&i*a>0&&(m.fromOpacity={path:"opacity",type:"number",keys:[C(0,1),C(i*a,0,o)]},p.fromOpacity=on(n.fromNode,"opacity")),n.toNode!==void 0&&i*(1-a)<i&&(m.toOpacity={path:"opacity",type:"number",keys:[C(i*(1-a),0),C(i,1,o)]},p.toOpacity=on(n.toNode,"opacity"));let{tracks:v}=pt({channels:m}).apply(p,r);return{tracks:v,end:r+i}}var Ms=class extends Error{constructor(t){super(t),this.name="PresenceError"}},Es=.3;function Ma(){return pt({channels:{opacity:{path:"opacity",keys:[C(0,0),C(Es,1)]}}})}function Sa(){return pt({channels:{opacity:{path:"opacity",keys:[C(0,1),C(Es,0)]}}})}function Ea(t){return typeof t.apply=="function"}function Ss(t){return Array.isArray(t)}function Ii(t,e){var i,o;let n=(i=t.dur)!=null?i:Es,s=t.ease,r={};if(t.opacity!==void 0){let[a,l]=t.opacity;r.opacity={path:"opacity",keys:[C(0,a),C(n,l,...xs(s))]}}if(t.offset!==void 0){let[a,l]=Ia(t.offset,(o=t.edge)!=null?o:"bottom",e);r.offset={path:"position",keys:[C(0,a),C(n,l,...xs(s))]}}if(t.scale!==void 0){let[a,l]=$a(t.scale);r.scale={path:"scale",keys:[C(0,a),C(n,l,...xs(s))]}}return pt({channels:r})}function xs(t){return t!==void 0?[t]:[]}function Ta(t,e){return t==="left"?[-e,0]:t==="right"?[e,0]:t==="top"?[0,-e]:[0,e]}function Ia(t,e,n){if(Array.isArray(t)&&Ss(t[0]))return t;let s=Ss(t)?t:Ta(e,t),r=[0,0];return n==="enter"?[s,r]:[r,s]}function $a(t){let[e,n]=t,s=r=>Ss(r)?r:[r,r];return[s(e),s(n)]}function Si(t,e,n){return t===void 0?n():Ea(t)?t:Ii(t,e)}function Ei(t,e){var n;return t.duration/((n=e==null?void 0:e.speed)!=null?n:1)}function Ca(t){return t.map((e,n)=>[e,n]).sort((e,n)=>e[0].t-n[0].t||e[1]-n[1]).map(([e])=>e)}function Ti(t,e){let n=[],s=[];for(let r of t)r.target===e?s=r.keys:n.push(r);return{opacityKeys:s,rest:n}}function Oa(t,e){var I,b,E,S;let n=(b=e.show)!=null?b:(I=e.window)==null?void 0:I[0],s=(S=e.hide)!=null?S:(E=e.window)==null?void 0:E[1];if(n===void 0||s===void 0)throw new Ms("presence() needs a window: pass { show, hide } or { window: [show, hide] }");let r=kt(typeof t=="string"?`${t}/opacity`:t),i=r.lastIndexOf("/"),o=i<0?r:r.slice(0,i),a=Si(e.enter,"enter",Ma),l=Si(e.exit,"exit",Sa),c=a.apply(o,n,e.enterOpts),h=n+Ei(a,e.enterOpts),f=Ei(l,e.exitOpts),u=s-f;if(u<=n)throw new Ms(`presence('${o}') exit needs ${f.toFixed(3)}s but only ${(s-n).toFixed(3)}s between show (${n}) and hide (${s}) \u2014 widen the window or shorten/speed up the exit`);let d=l.apply(o,u,e.exitOpts),{opacityKeys:m,rest:p}=Ti(c.tracks,r),{opacityKeys:v,rest:w}=Ti(d.tracks,r),y=[C(0,0,{interp:"hold"}),C(h,1,{interp:"hold"}),C(s,0,{interp:"hold"})],g=[];if(m.length>0?m.forEach(($,P)=>{P===0&&$.value!==0&&$.interp!=="hold"?g.push(L(T({},$),{interp:"hold"})):g.push($)}):g.push(C(n,0),C(h,1)),v.length>0)for(let $ of v)g.push($);else g.push(C(u,1),C(s,0));let k=Ca([...y,...g]),M=[];for(let $ of k){let P=M[M.length-1];P&&P.t===$.t?M[M.length-1]=$:M.push($)}return{tracks:[bt(r,"number",M),...p,...w],end:s,shownAt:n,hiddenAt:s}}function $i(t){var f;let e=(f=t.match(/[MmLlHhVvCcQqZz]|-?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g))!=null?f:[],n=[],s=0,r=0,i=0,o=0,a=0,l="",c=()=>Number(e[s++]),h=u=>!!u&&/^[MmLlHhVvCcQqZz]$/.test(u);for(;s<e.length;){let u=e[s];if(h(u)?s++:u=l==="M"?"L":l==="m"?"l":l,!u)break;let d=u===u.toLowerCase();switch(u.toUpperCase()){case"M":{let m=c()+(d?r:0),p=c()+(d?i:0);r=m,i=p,o=m,a=p,n.push(["M",m,p]);break}case"L":{let m=c()+(d?r:0),p=c()+(d?i:0);r=m,i=p,n.push(["L",m,p]);break}case"H":{let m=c()+(d?r:0);r=m,n.push(["L",m,i]);break}case"V":{let m=c()+(d?i:0);i=m,n.push(["L",r,m]);break}case"C":{let m=c()+(d?r:0),p=c()+(d?i:0),v=c()+(d?r:0),w=c()+(d?i:0),y=c()+(d?r:0),g=c()+(d?i:0);r=y,i=g,n.push(["C",m,p,v,w,y,g]);break}case"Q":{let m=c()+(d?r:0),p=c()+(d?i:0),v=c()+(d?r:0),w=c()+(d?i:0);r=v,i=w,n.push(["Q",m,p,v,w]);break}case"Z":n.push(["Z"]),r=o,i=a;break;default:s++;break}l=u}return n}function Aa(t){return Je($i(t))}function Ci(){let t=0,e=!1;return{start(n){e=!0;let s,r=i=>{e&&(s!=null||(s=i),n((i-s)/1e3),t=requestAnimationFrame(r))};t=requestAnimationFrame(r)},stop(){e=!1,cancelAnimationFrame(t)}}}function Pa(t){var r;let e=(r=t.axis)!=null?r:"y",n=null,s=t.source;return{start(i,o){var c,h;let a=(h=t.range)!=null?h:[0,(c=o.duration)!=null?c:1],l=()=>{if(s instanceof Element){let m=e==="y"?s.scrollHeight-s.clientHeight:s.scrollWidth-s.clientWidth,p=e==="y"?s.scrollTop:s.scrollLeft;return m>0?p/m:0}let f=document.documentElement,u=e==="y"?f.scrollHeight-window.innerHeight:f.scrollWidth-window.innerWidth,d=e==="y"?window.scrollY:window.scrollX;return u>0?d/u:0};n=()=>{let f=Math.min(1,Math.max(0,l()));i(a[0]+f*(a[1]-a[0]))},s.addEventListener("scroll",n,{passive:!0}),n()},stop(){n&&s.removeEventListener("scroll",n),n=null}}}var Oi=class extends Error{constructor(t){super(`machine targets overlap an already-bound target set: ${t.join(", ")} \u2014 concurrent writers to one property is the silent last-writer-wins \xA72.2 exists to kill`),this.name="TargetOverlapError"}};function Ai(t,e={}){var D,V,Y,As,Ps,Ds,Fs;let{playhead:n}=t,s=t.duration,r=(D=t.markers)!=null?D:[],i=(V=t.driver)!=null?V:Ci(),o=(Y=e.loop)!=null?Y:!1,a=(As=e.background)!=null?As:"pause",l=(Ps=t.visibility)!=null?Ps:(()=>"visible"),c=new Map,h=new Map,f=(Ds=e.rate)!=null?Ds:1,u=!1,d=O(!1),m=F=>{u=F,d.set(F)},p=!1,v=new Set((Fs=t.targets)!=null?Fs:[]),w=[],y=0,g=null,k=0,M=[0,s],I=0,b=null;function E(F,z){var W,X,Z;if(F===z||c.size===0&&h.size===0)return;let R=z>F;for(let rt of r){if(!(R?rt.t>F&&rt.t<=z:rt.t>=z&&rt.t<F))continue;for(let ln of(W=c.get(rt.name))!=null?W:[])ln(rt);let $t=(X=rt.data)==null?void 0:X.kind;if(typeof $t=="string")for(let ln of(Z=h.get($t))!=null?Z:[])ln(rt)}}function S(F){m(!1),g=null;let z=b;b=null,z==null||z(F)}function $(F){k=F;for(let $t of w)$t.step(F);if(!u)return;if(a==="pause"&&l()==="hidden"){y=n.peek(),g=null;return}g!=null||(g=F);let z=n.peek(),R=y+(F-g)*f,[W,X]=M;if(!(f>=0?R>=X:R<=W)){n.set(R),E(z,R);return}let Z=o===!0?{mode:"restart"}:o===!1?null:o,rt=Z&&"count"in Z&&Z.count!==void 0?Z.count:1/0;if(!Z||I+1>=rt){let $t=f>=0?X:W;n.set($t),E(z,$t),S(!0);return}I++,X-W,Z.mode==="alternate"?(E(z,f>=0?X:W),f=-f,y=f>=0?W:X):(E(z,f>=0?X:W),y=f>=0?W:X),g=F,R=y,n.set(R)}function P(){p||(p=!0,i.start($,{duration:s,visibility:l}))}return{playhead:n,get duration(){return s},get playing(){return u},playingSignal:d,get rate(){return f},set rate(F){y=n.peek(),g=u?k:null,f=F},play(F){var X;b&&S(!1),M=(X=F==null?void 0:F.range)!=null?X:[0,s];let z=n.peek(),[R,W]=M;return y=f>=0?z>=W||z<R?R:z:z<=R||z>W?W:z,n.set(y),g=null,I=0,m(!0),P(),{finished:new Promise(Z=>{b=Z})}},pause(){u&&(y=n.peek(),S(!1))},seek(F){y=Math.min(Math.max(F,0),s),g=u?k:null,n.set(y)},swap(F){var R,W;s=F.duration,r=(R=F.markers)!=null?R:[],v=new Set((W=F.targets)!=null?W:[]);let z=Math.min(n.peek(),s);M=[0,s],y=z,g=u?k:null,I=0,n.set(z)},attach(F){if(F.targets){let z=[];for(let R of F.targets)v.has(R)?z.push(`'${R}' (player timeline)`):w.some(W=>{var X;return(X=W.targets)==null?void 0:X.has(R)})&&z.push(`'${R}' (another machine)`);if(z.length>0)throw new Oi(z)}return w.push(F),P(),()=>{let z=w.indexOf(F);z>=0&&w.splice(z,1)}},onMarker(F,z){let R=c.get(F);return R||(R=new Set,c.set(F,R)),R.add(z),()=>R.delete(z)},onCue(F,z){let R=h.get(F);return R||(R=new Set,h.set(F,R)),R.add(z),()=>R.delete(z)},dispose(){u&&S(!1),w.length=0,p&&i.stop(),p=!1}}}function Pi(t,e,n,s,r){var o;let i=t!=null?t:"respect";return i==="ignore"||!e?{autoplay:r}:typeof i=="function"?{autoplay:r,swapTo:i(n)}:{autoplay:!1,seekTo:(o=n.posterTime)!=null?o:s}}function Di(){return typeof matchMedia!="undefined"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function Ts(t,e,n,s={}){var w;let r=t,i=e,o=nt(i),a=new rn(n);r.setTextMeasurer(a);let l=r.playhead,c=Ai({playhead:l,duration:o.duration,markers:o.markers,targets:o.tracks.keys()},s),h=()=>a.render(de(r,i,l.peek())),f=!1,u=()=>{f||(f=!0,requestAnimationFrame(()=>{f=!1,h()}))},d=l.subscribe(u),m=y=>{if(typeof FontFace=="undefined")return;let g=ie(y.assets);for(let k of g.faces()){let M=new FontFace(k.family,`url(${k.url})`,{weight:String(k.weight),style:k.style});document.fonts.add(M),M.load().then(()=>h(),()=>{})}bs(r,y,async k=>{try{let M=await fetch(k);return M.ok?await M.arrayBuffer():void 0}catch(M){return}},T({mode:s.strictFonts?"strict":"dev"},s.osFonts!==void 0?{osFamilies:s.osFonts}:{}))};m(i);let p=((w=s.prefersReducedMotion)!=null?w:Di)(),v=Pi(s.reducedMotion,p,i,o.duration,!!s.autoplay);if(v.swapTo){i=v.swapTo;let y=nt(i);c.swap({duration:y.duration,markers:y.markers,targets:y.tracks.keys()}),m(i)}return v.seekTo!==void 0&&c.seek(v.seekTo),h(),v.autoplay&&c.play(),{player:c,backend:a,render:h,swap(y){y.scene&&(r=y.scene,r.setTextMeasurer(a)),i=y.timeline;let g=nt(i);c.swap({duration:g.duration,markers:g.markers,targets:g.tracks.keys()}),m(i),h()},dispose(){d(),c.dispose(),a.dispose()}}}function Da(t,e,n){let s=Object.keys(nt(e).labels);return r=>{if(r==null)return;let i=n(r),o=Object.keys(nt(i.timeline).labels),a=s.filter(l=>!o.includes(l));a.length>0&&console.warn(`[glissade] HMR: this edit removed label(s) ${a.map(l=>`'${l}'`).join(", ")} \u2014 anything seeking to them will no longer resolve`),s=o,t.swap(i)}}var Fa=`
4
4
  <style>
5
5
  :host { display: inline-block; }
6
6
  canvas { display: block; width: 100%; height: auto; }
@@ -10,5 +10,5 @@
10
10
  .time { font-variant-numeric: tabular-nums; opacity: 0.75; min-width: 9ch; text-align: right; }
11
11
  </style>
12
12
  <canvas part="canvas"></canvas>
13
- `,Ms,st,pt,lt,Gt,It,ye,zt,J,N,Ss,Es,Ai,Pi,Ts,an,cn,Yt,Oi=(Ms=class extends HTMLElement{constructor(){super();U(this,N);U(this,st,null);U(this,pt,null);U(this,lt,null);U(this,Gt,!1);U(this,It,null);U(this,ye);U(this,zt);U(this,J,null);let e=this.attachShadow({mode:"open"});e.innerHTML=Ta,H(this,ye,e),H(this,zt,e.querySelector("canvas"))}get scene(){return A(this,pt)}set scene(e){H(this,pt,e),q(this,N,an).call(this)}get player(){var e,n;return(n=(e=A(this,st))==null?void 0:e.player)!=null?n:null}connectedCallback(){q(this,N,Es).call(this),q(this,N,an).call(this)}disconnectedCallback(){q(this,N,Ts).call(this)}attributeChangedCallback(e){if(e==="controls"){q(this,N,Es).call(this),q(this,N,Ss).call(this);return}this.isConnected&&A(this,pt)&&q(this,N,an).call(this)}},st=new WeakMap,pt=new WeakMap,lt=new WeakMap,Gt=new WeakMap,It=new WeakMap,ye=new WeakMap,zt=new WeakMap,J=new WeakMap,N=new WeakSet,Ss=function(){A(this,J)&&!A(this,lt)&&A(this,It)?(H(this,lt,A(this,It).subscribe(()=>{requestAnimationFrame(()=>{A(this,J)&&(q(this,N,cn).call(this),q(this,N,Yt).call(this))})})),q(this,N,cn).call(this),q(this,N,Yt).call(this)):!A(this,J)&&A(this,lt)&&(A(this,lt).call(this),H(this,lt,null))},Es=function(){let e=this.hasAttribute("controls");e&&!A(this,J)?q(this,N,Ai).call(this):!e&&A(this,J)&&q(this,N,Pi).call(this)},Ai=function(){let e=document.createElement("div");e.className="controls",e.setAttribute("part","controls");let n=document.createElement("button");n.setAttribute("part","button"),n.setAttribute("aria-label","Play or pause"),n.textContent="Play";let s=document.createElement("input");s.setAttribute("part","scrubber"),s.type="range",s.min="0",s.max="1",s.step="0.0001",s.value="0",s.setAttribute("aria-label","Seek");let r=document.createElement("span");r.className="time",r.setAttribute("part","time");let i=()=>{var l;let a=(l=A(this,st))==null?void 0:l.player;a&&(a.playing?a.pause():a.play(),q(this,N,Yt).call(this))},o=()=>{var l;let a=(l=A(this,st))==null?void 0:l.player;a&&(H(this,Gt,!0),a.pause(),a.seek(parseFloat(s.value)*a.duration),H(this,Gt,!1),q(this,N,Yt).call(this))};n.addEventListener("click",i),s.addEventListener("input",o),e.append(n,s,r),A(this,ye).append(e),H(this,J,{root:e,button:n,scrubber:s,time:r,onClick:i,onInput:o}),q(this,N,cn).call(this),q(this,N,Yt).call(this)},Pi=function(){let e=A(this,J);e&&(e.button.removeEventListener("click",e.onClick),e.scrubber.removeEventListener("input",e.onInput),e.root.remove(),H(this,J,null))},Ts=function(){var e,n;(e=A(this,lt))==null||e.call(this),H(this,lt,null),(n=A(this,st))==null||n.dispose(),H(this,st,null),H(this,It,null)},an=function(){if(q(this,N,Ts).call(this),!A(this,pt)||!this.isConnected)return;let e=A(this,pt).createScene();A(this,zt).width=e.size.w,A(this,zt).height=e.size.h;let n=this.hasAttribute("pingpong")||this.hasAttribute("yoyo")?{mode:"alternate"}:this.hasAttribute("loop");H(this,st,xs(e,A(this,pt).timeline,A(this,zt),{loop:n,autoplay:this.hasAttribute("autoplay")})),H(this,It,e.playhead),q(this,N,Ss).call(this)},cn=function(){var r,i,o;let e=A(this,J),n=(r=A(this,st))==null?void 0:r.player;if(!e||!n)return;let s=(o=(i=A(this,It))==null?void 0:i.peek())!=null?o:0;e.time.textContent=`${s.toFixed(2)} / ${n.duration.toFixed(2)}s`,!A(this,Gt)&&n.duration>0&&(e.scrubber.value=String(s/n.duration))},Yt=function(){var s,r;let e=A(this,J);if(!e)return;let n=(r=(s=A(this,st))==null?void 0:s.player.playing)!=null?r:!1;e.button.textContent=n?"Pause":"Play"},x(Ms,"observedAttributes",["loop","pingpong","yoyo","autoplay","controls"]),Ms);function Di(t="gs-player"){customElements.get(t)||customElements.define(t,Oi)}Di();return qi(Ia);})();
13
+ `,Is,st,mt,lt,Gt,It,ye,zt,J,N,$s,Cs,zi,Li,Os,an,cn,Yt,Fi=(Is=class extends HTMLElement{constructor(){super();U(this,N);U(this,st,null);U(this,mt,null);U(this,lt,null);U(this,Gt,!1);U(this,It,null);U(this,ye);U(this,zt);U(this,J,null);let e=this.attachShadow({mode:"open"});e.innerHTML=Fa,H(this,ye,e),H(this,zt,e.querySelector("canvas"))}get scene(){return A(this,mt)}set scene(e){H(this,mt,e),q(this,N,an).call(this)}get player(){var e,n;return(n=(e=A(this,st))==null?void 0:e.player)!=null?n:null}connectedCallback(){q(this,N,Cs).call(this),q(this,N,an).call(this)}disconnectedCallback(){q(this,N,Os).call(this)}attributeChangedCallback(e){if(e==="controls"){q(this,N,Cs).call(this),q(this,N,$s).call(this);return}this.isConnected&&A(this,mt)&&q(this,N,an).call(this)}},st=new WeakMap,mt=new WeakMap,lt=new WeakMap,Gt=new WeakMap,It=new WeakMap,ye=new WeakMap,zt=new WeakMap,J=new WeakMap,N=new WeakSet,$s=function(){A(this,J)&&!A(this,lt)&&A(this,It)?(H(this,lt,A(this,It).subscribe(()=>{requestAnimationFrame(()=>{A(this,J)&&(q(this,N,cn).call(this),q(this,N,Yt).call(this))})})),q(this,N,cn).call(this),q(this,N,Yt).call(this)):!A(this,J)&&A(this,lt)&&(A(this,lt).call(this),H(this,lt,null))},Cs=function(){let e=this.hasAttribute("controls");e&&!A(this,J)?q(this,N,zi).call(this):!e&&A(this,J)&&q(this,N,Li).call(this)},zi=function(){let e=document.createElement("div");e.className="controls",e.setAttribute("part","controls");let n=document.createElement("button");n.setAttribute("part","button"),n.setAttribute("aria-label","Play or pause"),n.textContent="Play";let s=document.createElement("input");s.setAttribute("part","scrubber"),s.type="range",s.min="0",s.max="1",s.step="0.0001",s.value="0",s.setAttribute("aria-label","Seek");let r=document.createElement("span");r.className="time",r.setAttribute("part","time");let i=()=>{var l;let a=(l=A(this,st))==null?void 0:l.player;a&&(a.playing?a.pause():a.play(),q(this,N,Yt).call(this))},o=()=>{var l;let a=(l=A(this,st))==null?void 0:l.player;a&&(H(this,Gt,!0),a.pause(),a.seek(parseFloat(s.value)*a.duration),H(this,Gt,!1),q(this,N,Yt).call(this))};n.addEventListener("click",i),s.addEventListener("input",o),e.append(n,s,r),A(this,ye).append(e),H(this,J,{root:e,button:n,scrubber:s,time:r,onClick:i,onInput:o}),q(this,N,cn).call(this),q(this,N,Yt).call(this)},Li=function(){let e=A(this,J);e&&(e.button.removeEventListener("click",e.onClick),e.scrubber.removeEventListener("input",e.onInput),e.root.remove(),H(this,J,null))},Os=function(){var e,n;(e=A(this,lt))==null||e.call(this),H(this,lt,null),(n=A(this,st))==null||n.dispose(),H(this,st,null),H(this,It,null)},an=function(){if(q(this,N,Os).call(this),!A(this,mt)||!this.isConnected)return;let e=A(this,mt).createScene();A(this,zt).width=e.size.w,A(this,zt).height=e.size.h;let n=this.hasAttribute("pingpong")||this.hasAttribute("yoyo")?{mode:"alternate"}:this.hasAttribute("loop");H(this,st,Ts(e,A(this,mt).timeline,A(this,zt),{loop:n,autoplay:this.hasAttribute("autoplay")})),H(this,It,e.playhead),q(this,N,$s).call(this)},cn=function(){var r,i,o;let e=A(this,J),n=(r=A(this,st))==null?void 0:r.player;if(!e||!n)return;let s=(o=(i=A(this,It))==null?void 0:i.peek())!=null?o:0;e.time.textContent=`${s.toFixed(2)} / ${n.duration.toFixed(2)}s`,!A(this,Gt)&&n.duration>0&&(e.scrubber.value=String(s/n.duration))},Yt=function(){var s,r;let e=A(this,J);if(!e)return;let n=(r=(s=A(this,st))==null?void 0:s.player.playing)!=null?r:!1;e.button.textContent=n?"Pause":"Play"},x(Is,"observedAttributes",["loop","pingpong","yoyo","autoplay","controls"]),Is);function Ri(t="gs-player"){customElements.get(t)||customElements.define(t,Fi)}Ri();return ji(za);})();
14
14
  //# sourceMappingURL=glissade.browser.js.map