@hyperframes/core 0.6.71 → 0.6.73

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 +1 @@
1
- {"version":3,"file":"runtime-inline.js","sourceRoot":"","sources":["../../src/generated/runtime-inline.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,YAAY,GAAW,u+6LAAu+6L,CAAC;AAErg7L;;;;GAIG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,YAAY,CAAC;AACtB,CAAC"}
1
+ {"version":3,"file":"runtime-inline.js","sourceRoot":"","sources":["../../src/generated/runtime-inline.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,YAAY,GAAW,2/6LAA2/6L,CAAC;AAEzh7L;;;;GAIG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "0902588ac3546ce8d79f742aa4efd7c05da3df806fc1745878201753a96963f6",
4
+ "sha256": "4397770676b0461930d94e02f40cc3fa4da9978fa5e5d6f682a7dd9ba73ea12c",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"
@@ -36,7 +36,7 @@ https://www.w3ctech.com/topic/2226`));let l=n(...s);return l.postcssPlugin=e,l.p
36
36
  0% { outline-color: rgba(59, 130, 246, 0.8); }
37
37
  100% { outline-color: transparent; }
38
38
  }
39
- `,document.head.appendChild(n)}for(let n of t)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch(i){_("bridge.flashElements.querySelector",i)}}var gn=null;function xi(t){gn=t}function dt(t,e){if(gn)try{gn({source:"hf-preview",type:"analytics",event:t,properties:e??{}})}catch(n){_("runtime.analytics.site1",n)}}function gi(t){let e=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=(l,a)=>{for(let c of l){try{c.currentTime=a}catch(u){_("runtime.adapters.css.site1",u)}try{c.pause()}catch(u){_("runtime.adapters.css.site2",u)}}},r=l=>{for(let a of l)try{a.play()}catch(c){_("runtime.adapters.css.site3",c)}},o=l=>{for(let a of l)try{a.pause()}catch(c){_("runtime.adapters.css.site4",c)}},s=l=>{l.baseDelay?l.el.style.animationDelay=l.baseDelay:l.el.style.removeProperty("animation-delay"),l.basePlayState?l.el.style.animationPlayState=l.basePlayState:l.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let l=document.querySelectorAll("*");for(let a of l){if(!(a instanceof HTMLElement))continue;let c=window.getComputedStyle(a);!c.animationName||c.animationName==="none"||e.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:l=>{let a=Number(l.time)||0;for(let c of e){if(!c.el.isConnected)continue;let u=t?.resolveStartSeconds?t.resolveStartSeconds(c.el):Number.parseFloat(c.el.getAttribute("data-start")??"0")||0,m=Math.max(0,a-u)*1e3,f=n(c.el);if(f.length>0){i(f,m);continue}c.el.style.animationPlayState="paused",c.el.style.animationDelay=`-${(m/1e3).toFixed(3)}s`}},pause:()=>{for(let l of e){if(!l.el.isConnected)continue;let a=n(l.el);a.length>0&&o(a),s(l)}},play:()=>{for(let l of e)l.el.isConnected&&(s(l),r(n(l.el)))},revert:()=>{e=[]}}}function yi(t){return{name:"gsap",discover:()=>{},seek:e=>{let n=t.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(e.time)||0);typeof n.totalTime=="function"?n.totalTime(i,!1):n.seek(i,!1)},pause:()=>{let e=t.getTimeline();e&&e.pause()}}}function Si(){return{name:"animejs",discover:()=>{try{let t=window.anime;if(!t||typeof t.running>"u")return;let e=t.running;if(!Array.isArray(e)||e.length===0)return;let n=window.__hfAnime??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfAnime=n}catch(t){_("runtime.adapters.animejs.site1",t)}},seek:t=>{let e=Math.max(0,(Number(t.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(e)}catch(r){_("runtime.adapters.animejs.site2",r)}},pause:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.pause=="function"&&e.pause()}catch(n){_("runtime.adapters.animejs.site3",n)}},play:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.play=="function"&&e.play()}catch(n){_("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ei(){return{name:"lottie",discover:()=>{try{let t=window.lottie;if(t&&typeof t.getRegisteredAnimations=="function"){let e=t.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let n=window.__hfLottie??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(t){_("runtime.adapters.lottie.site1",t)}},seek:t=>{let e=Math.max(0,Number(t.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let i of n)try{if(bi(i))i.goToAndStop(e*1e3,!1);else if(Ai(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch(r){_("runtime.adapters.lottie.site2",r)}},pause:()=>{let t=window.__hfLottie;if(!(!t||t.length===0))for(let e of t)try{(bi(e)||Ai(e))&&e.pause()}catch(n){_("runtime.adapters.lottie.site3",n)}},revert:()=>{}}}function bi(t){return typeof t=="object"&&t!==null&&typeof t.goToAndStop=="function"}function Ai(t){return typeof t=="object"&&t!==null&&typeof t.pause=="function"&&("totalFrames"in t||"duration"in t)}var Fi=-1;function Ht(t){if(t!==Fi){Fi=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){_("runtime.adapters.seek-dispatch.site1",e)}}}function wi(){let t=null,e=0;return{name:"three",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfThreeTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ni(){let t=null,e=0;return{name:"typegpu",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfTypegpuTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ci(){let t=globalThis.GPUQueue;if(!t?.prototype?.copyExternalImageToTexture)return;let e=t.prototype.copyExternalImageToTexture;t.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=n.source.nextElementSibling;if(o instanceof HTMLImageElement&&o.classList.contains("__render_frame__")&&o.complete&&o.naturalWidth>0)return e.call(this,{...n,source:o},i,r)}return e.call(this,n,i,r)}}function Mi(){let t=!1,e=0,n=new WeakMap,i=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},r=l=>{let a=Number(l.currentTime);return Number.isFinite(a)&&a>0?a:0},o=(l,a)=>a<=0?l:l>=a?Math.max(0,l-a):l,s=(l,a)=>{let c=n.get(l);if(c)return c;let u={compositionTimeMs:a,animationTimeMs:t?o(r(l),a):r(l)};return n.set(l,u),u};return{name:"waapi",discover:()=>{t=!0;for(let l of i())s(l,e)},seek:l=>{let a=Math.max(0,(Number(l.time)||0)*1e3);e=a;for(let c of i()){let u=t?s(c,a):s(c,0),m=u.animationTimeMs+Math.max(0,a-u.compositionTimeMs);try{c.currentTime=m}catch(f){_("runtime.adapters.waapi.site1",f)}try{c.pause()}catch(f){_("runtime.adapters.waapi.site2",f)}}},pause:()=>{if(document.getAnimations)for(let l of document.getAnimations())try{l.pause()}catch(a){_("runtime.adapters.waapi.site3",a)}}}}function Ti(t,e){if(t.length===0)return 1;let n=0;for(;n<t.length-2&&e>=t[n+1].time;)n+=1;let i=t[n],r=t[n+1]??i,o=r.time-i.time,s=o<=0?0:Math.min(1,Math.max(0,(e-i.time)/o));return i.volume+(r.volume-i.volume)*s}function ds(t,e,n,i){let r=Number.parseFloat(t.dataset.start??"0")||0,o=Number.parseFloat(t.dataset.end??""),s=Number.parseFloat(t.dataset.duration??""),l=Number.isFinite(o)&&o>r?o:Number.isFinite(s)&&s>0?r+s:n,a=Number.parseFloat(t.dataset.volume??""),c=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;t.volume=c;let u=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,l),x=[];for(let E=m;E<=f+1e-6;E+=u){let S=Math.min(f,E);e(S);let B=Number(t.volume);if(!Number.isFinite(B))continue;let D=Math.max(0,Math.min(1,B)),v=x.at(-1);if((!v||Math.abs(v.volume-D)>1e-4||S===f)&&x.push({time:Number(S.toFixed(6)),volume:Number(D.toFixed(6))}),S===f)break}return x.some(E=>Math.abs(E.volume-c)>1e-4)?x:null}function ki(t,e,n,i){if(!e||!(t instanceof HTMLAudioElement)&&!(t instanceof HTMLVideoElement)||n<=0)return;let o=ds(t,s=>{try{typeof e.totalTime=="function"?e.totalTime(s,!0):typeof e.seek=="function"&&e.seek(s,!0)}catch{}},n,60);o&&i.set(t,o)}function vi(t){let e=Array.from(document.querySelectorAll("video, audio")),n=t?.shouldIncludeElement?e.filter(s=>t.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of n){let l=t?.resolveStartSeconds?t.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(l))continue;let a=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,c=s.defaultPlaybackRate,u=Number.isFinite(c)&&c>0?Math.max(.1,Math.min(5,c)):1,m=s.loop,f=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,x=t?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(x)||x<=0)&&f!=null&&(x=Math.max(0,(f-a)/u));let F=Number.isFinite(x)&&x>0?l+x:Number.POSITIVE_INFINITY,E=Number.parseFloat(s.dataset.volume??""),S={el:s,start:l,mediaStart:a,duration:Number.isFinite(x)&&x>0?x:Number.POSITIVE_INFINITY,end:F,volume:Number.isFinite(E)?E:null,playbackRate:u,loop:m,sourceDuration:f};i.push(S),s.tagName==="VIDEO"&&r.push(S),Number.isFinite(F)&&(o=Math.max(o,F))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var yn=new WeakMap,ft=new WeakMap,Sn=new WeakSet,et=new WeakSet;function fs(t){if(et.has(t))return;et.add(t);let e=()=>et.delete(t);t.addEventListener("playing",e,{once:!0}),t.addEventListener("pause",e,{once:!0}),t.addEventListener("error",e,{once:!0})}var bn=new WeakMap;function mt(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function _i(t){let e=!!(t.outputMuted||t.userMuted);for(let n of t.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(t.timeSeconds-n.start)*n.playbackRate+n.mediaStart;if(t.timeSeconds>=n.start&&t.timeSeconds<n.end&&r>=0){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let w=n.sourceDuration-n.mediaStart;w>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%w)}let s=mt(t.userVolume??1),l=mt(n.volume??1),a=bn.get(i),c=mt(i.volume),u;n.volumeKeyframes&&n.volumeKeyframes.length>0?u=mt(Ti(n.volumeKeyframes,r)):a===void 0||Math.abs(c-a)>1e-4?u=c:u=l;let m=mt(u*s);i.volume=m,bn.set(i,m),t.onElementVolume?.(i,m),e&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*t.playbackRate}catch(w){_("runtime.media.site1",w)}let f=.04,x=2,F=i.currentTime||0,E=Math.abs(F-r),S=r-F,B=yn.get(i);yn.set(i,S);let D=B===void 0,v=!D&&Math.abs(S-B)>.5,X=E>3,q=E>.5&&(D||v||X),N=i.tagName==="VIDEO"&&!i.paused,g=B!==void 0&&Math.abs(S-B)<.004,A=!1;if(!N&&!q&&!D&&g&&E>f){let w=(ft.get(i)??0)+1;ft.set(i,w),w>=x&&(A=!0,ft.set(i,0))}else E<=f&&ft.set(i,0);let C=!N&&t.forceSync&&E>.02;if(q||A||C){try{i.currentTime=r}catch(w){_("runtime.media.site2",w)}if(Math.abs(i.currentTime-r)>.5&&!Sn.has(i)){Sn.add(i),i.load();try{i.currentTime=r}catch(w){_("runtime.media.site3",w)}}et.delete(i)}t.playing&&i.paused&&!et.has(i)?(fs(i),i.play().catch(w=>{et.delete(i),(w&&typeof w=="object"&&"name"in w?String(w.name??""):"")==="NotAllowedError"&&t.onAutoplayBlocked?.()})):!t.playing&&!i.paused&&i.pause();continue}yn.delete(i),ft.delete(i),Sn.delete(i),bn.delete(i),i.paused||i.pause()}}var ms=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),ps=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function Ri(t){let e=!1,n=null,i=null,r=null,o=null;function s(g,A){try{window.dispatchEvent(new CustomEvent(g,{detail:A}))}catch(C){_("runtime.picker.site1",C)}}function l(g){r=g,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function a(g){o=g,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function c(g){let A=g.ownerDocument.defaultView;if(!A)return!1;let C=g;for(;C&&C!==document.body&&C!==document.documentElement;){let w=A.getComputedStyle(C);if(w.display==="none"||w.visibility==="hidden"||w.pointerEvents==="none")return!0;let T=Number.parseFloat(w.opacity);if(Number.isFinite(T)&&T<=.01)return!0;C=C.parentElement}return!1}function u(g){if(!g||g===document.body||g===document.documentElement)return!1;let A=g.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||g.classList.contains("__hf-pick-highlight")||g.closest(ms)||c(g))}function m(g){return!!g?.closest(ps)}function f(g){let A=g;if(A.id)return`#${A.id}`;let C=g.getAttribute("data-composition-id");if(C)return`[data-composition-id="${C}"]`;let w=g.getAttribute("data-composition-src");if(w)return`[data-composition-src="${w}"]`;let T=g.getAttribute("data-track-index");if(T)return`[data-track-index="${T}"]`;let L=g.tagName.toLowerCase(),P=g.parentElement;if(!P)return L;let J=P.querySelectorAll(`:scope > ${L}`);if(J.length===1)return L;for(let R=0;R<J.length;R+=1)if(J[R]===g)return`${L}:nth-of-type(${R+1})`;return L}function x(g){let A=g.tagName.toLowerCase(),C=(g.textContent??"").trim().replace(/\s+/g," "),w=(T,L)=>T.length>L?`${T.slice(0,L-1)}\u2026`:T;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?w(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":g.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function F(g,A,C){let w=typeof C=="number"&&C>0?C:8,T=[];if(document.elementsFromPoint)T=document.elementsFromPoint(g,A);else if(document.elementFromPoint){let J=document.elementFromPoint(g,A);T=J?[J]:[]}if(m(T[0]??null))return[];let L={},P=[];for(let J=0;J<T.length;J+=1){let R=T[J];if(!u(R))continue;let le=`${R.tagName}::${R.id||""}::${J}`;if(!L[le]&&(L[le]=!0,P.push(R),P.length>=w))break}return P}function E(g){let A=g.getBoundingClientRect(),C={};for(let T=0;T<g.attributes.length;T+=1){let L=g.attributes[T];L.name.startsWith("data-")&&(C[L.name]=L.value)}return{id:g.id||null,tagName:g.tagName.toLowerCase(),selector:f(g),label:x(g),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:g.textContent?g.textContent.trim().slice(0,200):null,src:g.getAttribute("src")||g.getAttribute("data-composition-src")||null,dataAttributes:C}}function S(g,A,C){return F(g,A,C).map(E)}function B(g){if(!e)return;let C=F(g.clientX,g.clientY,1)[0]??(g.target instanceof Element?g.target:null);if(!u(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let w=E(C);l(w),t.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:w})}function D(g){if(!e)return;g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation();let A=S(g.clientX,g.clientY,8);A.length!==0&&(l(A[0]??null),t.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:g.clientX,y:g.clientY}}))}function v(g){g.key==="Escape"&&(q(),t.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function X(){e||(e=!0,i=document.createElement("style"),i.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
39
+ `,document.head.appendChild(n)}for(let n of t)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch(i){_("bridge.flashElements.querySelector",i)}}var gn=null;function xi(t){gn=t}function dt(t,e){if(gn)try{gn({source:"hf-preview",type:"analytics",event:t,properties:e??{}})}catch(n){_("runtime.analytics.site1",n)}}function gi(t){let e=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=(l,a)=>{for(let c of l){try{c.currentTime=a}catch(u){_("runtime.adapters.css.site1",u)}try{c.pause()}catch(u){_("runtime.adapters.css.site2",u)}}},r=l=>{for(let a of l)try{a.play()}catch(c){_("runtime.adapters.css.site3",c)}},o=l=>{for(let a of l)try{a.pause()}catch(c){_("runtime.adapters.css.site4",c)}},s=l=>{l.baseDelay?l.el.style.animationDelay=l.baseDelay:l.el.style.removeProperty("animation-delay"),l.basePlayState?l.el.style.animationPlayState=l.basePlayState:l.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let l=document.querySelectorAll("*");for(let a of l){if(!(a instanceof HTMLElement))continue;let c=window.getComputedStyle(a);!c.animationName||c.animationName==="none"||e.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:l=>{let a=Number(l.time)||0;for(let c of e){if(!c.el.isConnected)continue;let u=t?.resolveStartSeconds?t.resolveStartSeconds(c.el):Number.parseFloat(c.el.getAttribute("data-start")??"0")||0,m=Math.max(0,a-u)*1e3,f=n(c.el);if(f.length>0){i(f,m);continue}c.el.style.animationPlayState="paused",c.el.style.animationDelay=`-${(m/1e3).toFixed(3)}s`}},pause:()=>{for(let l of e){if(!l.el.isConnected)continue;let a=n(l.el);a.length>0&&o(a),s(l)}},play:()=>{for(let l of e)l.el.isConnected&&(s(l),r(n(l.el)))},revert:()=>{e=[]}}}function yi(t){return{name:"gsap",discover:()=>{},seek:e=>{let n=t.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(e.time)||0);typeof n.totalTime=="function"?n.totalTime(i,!1):n.seek(i,!1)},pause:()=>{let e=t.getTimeline();e&&e.pause()}}}function Si(){return{name:"animejs",discover:()=>{try{let t=window.anime;if(!t||typeof t.running>"u")return;let e=t.running;if(!Array.isArray(e)||e.length===0)return;let n=window.__hfAnime??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfAnime=n}catch(t){_("runtime.adapters.animejs.site1",t)}},seek:t=>{let e=Math.max(0,(Number(t.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(e)}catch(r){_("runtime.adapters.animejs.site2",r)}},pause:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.pause=="function"&&e.pause()}catch(n){_("runtime.adapters.animejs.site3",n)}},play:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.play=="function"&&e.play()}catch(n){_("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ei(){return{name:"lottie",discover:()=>{try{let t=window.lottie;if(t&&typeof t.getRegisteredAnimations=="function"){let e=t.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let n=window.__hfLottie??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(t){_("runtime.adapters.lottie.site1",t)}},seek:t=>{let e=Math.max(0,Number(t.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let i of n)try{if(bi(i))i.goToAndStop(e*1e3,!1);else if(Ai(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch(r){_("runtime.adapters.lottie.site2",r)}},pause:()=>{let t=window.__hfLottie;if(!(!t||t.length===0))for(let e of t)try{(bi(e)||Ai(e))&&e.pause()}catch(n){_("runtime.adapters.lottie.site3",n)}},revert:()=>{}}}function bi(t){return typeof t=="object"&&t!==null&&typeof t.goToAndStop=="function"}function Ai(t){return typeof t=="object"&&t!==null&&typeof t.pause=="function"&&("totalFrames"in t||"duration"in t)}var Fi=-1;function Ht(t){if(t!==Fi){Fi=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){_("runtime.adapters.seek-dispatch.site1",e)}}}function wi(){let t=null,e=0;return{name:"three",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfThreeTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ni(){let t=null,e=0;return{name:"typegpu",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfTypegpuTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ci(){let t=globalThis.GPUQueue;if(!t?.prototype?.copyExternalImageToTexture)return;let e=t.prototype.copyExternalImageToTexture;t.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=n.source.nextElementSibling;if(o instanceof HTMLImageElement&&o.classList.contains("__render_frame__")&&o.complete&&o.naturalWidth>0)return e.call(this,{...n,source:o},i,r)}return e.call(this,n,i,r)}}function Mi(){let t=!1,e=0,n=new WeakMap,i=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},r=l=>{let a=Number(l.currentTime);return Number.isFinite(a)&&a>0?a:0},o=(l,a)=>a<=0?l:l>=a?Math.max(0,l-a):l,s=(l,a)=>{let c=n.get(l);if(c)return c;let u={compositionTimeMs:a,animationTimeMs:t?o(r(l),a):r(l)};return n.set(l,u),u};return{name:"waapi",discover:()=>{t=!0;for(let l of i())s(l,e)},seek:l=>{let a=Math.max(0,(Number(l.time)||0)*1e3);e=a;for(let c of i()){let u=t?s(c,a):s(c,0),m=u.animationTimeMs+Math.max(0,a-u.compositionTimeMs);try{c.currentTime=m}catch(f){_("runtime.adapters.waapi.site1",f)}try{c.pause()}catch(f){_("runtime.adapters.waapi.site2",f)}}},pause:()=>{if(document.getAnimations)for(let l of document.getAnimations())try{l.pause()}catch(a){_("runtime.adapters.waapi.site3",a)}}}}function Ti(t,e){if(t.length===0)return 1;let n=0;for(;n<t.length-2&&e>=t[n+1].time;)n+=1;let i=t[n],r=t[n+1]??i,o=r.time-i.time,s=o<=0?0:Math.min(1,Math.max(0,(e-i.time)/o));return i.volume+(r.volume-i.volume)*s}function ds(t,e,n,i){let r=Number.parseFloat(t.dataset.start??"0")||0,o=Number.parseFloat(t.dataset.end??""),s=Number.parseFloat(t.dataset.duration??""),l=Number.isFinite(o)&&o>r?o:Number.isFinite(s)&&s>0?r+s:n,a=Number.parseFloat(t.dataset.volume??""),c=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;t.volume=c;let u=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,l),x=[];for(let E=m;E<=f+1e-6;E+=u){let S=Math.min(f,E);e(S);let B=Number(t.volume);if(!Number.isFinite(B))continue;let D=Math.max(0,Math.min(1,B)),v=x.at(-1);if((!v||Math.abs(v.volume-D)>1e-4||S===f)&&x.push({time:Number(S.toFixed(6)),volume:Number(D.toFixed(6))}),S===f)break}return x.some(E=>Math.abs(E.volume-c)>1e-4)?x:null}function ki(t,e,n,i){if(!e||!(t instanceof HTMLAudioElement)&&!(t instanceof HTMLVideoElement)||n<=0)return;let o=ds(t,s=>{try{typeof e.totalTime=="function"?e.totalTime(s,!0):typeof e.seek=="function"&&e.seek(s,!0)}catch{}},n,60);o&&i.set(t,o)}function vi(t){let e=Array.from(document.querySelectorAll("video, audio")),n=t?.shouldIncludeElement?e.filter(s=>t.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of n){let l=t?.resolveStartSeconds?t.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(l))continue;let a=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,c=s.defaultPlaybackRate,u=Number.isFinite(c)&&c>0?Math.max(.1,Math.min(5,c)):1,m=s.loop,f=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,x=t?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(x)||x<=0)&&f!=null&&(x=Math.max(0,(f-a)/u));let F=Number.isFinite(x)&&x>0?l+x:Number.POSITIVE_INFINITY,E=Number.parseFloat(s.dataset.volume??""),S={el:s,start:l,mediaStart:a,duration:Number.isFinite(x)&&x>0?x:Number.POSITIVE_INFINITY,end:F,volume:Number.isFinite(E)?E:null,playbackRate:u,loop:m,sourceDuration:f};i.push(S),s.tagName==="VIDEO"&&r.push(S),Number.isFinite(F)&&(o=Math.max(o,F))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var yn=new WeakMap,ft=new WeakMap,Sn=new WeakSet,et=new WeakSet;function fs(t){if(et.has(t))return;et.add(t);let e=()=>et.delete(t);t.addEventListener("playing",e,{once:!0}),t.addEventListener("pause",e,{once:!0}),t.addEventListener("error",e,{once:!0})}var bn=new WeakMap;function mt(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function _i(t){let e=!!(t.outputMuted||t.userMuted);for(let n of t.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(t.timeSeconds-n.start)*n.playbackRate+n.mediaStart;if(t.timeSeconds>=n.start&&t.timeSeconds<n.end&&r>=0&&(!i.ended||n.loop)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let w=n.sourceDuration-n.mediaStart;w>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%w)}let s=mt(t.userVolume??1),l=mt(n.volume??1),a=bn.get(i),c=mt(i.volume),u;n.volumeKeyframes&&n.volumeKeyframes.length>0?u=mt(Ti(n.volumeKeyframes,r)):a===void 0||Math.abs(c-a)>1e-4?u=c:u=l;let m=mt(u*s);i.volume=m,bn.set(i,m),t.onElementVolume?.(i,m),e&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*t.playbackRate}catch(w){_("runtime.media.site1",w)}let f=.04,x=2,F=i.currentTime||0,E=Math.abs(F-r),S=r-F,B=yn.get(i);yn.set(i,S);let D=B===void 0,v=!D&&Math.abs(S-B)>.5,X=E>3,q=E>.5&&(D||v||X),N=i.tagName==="VIDEO"&&!i.paused,g=B!==void 0&&Math.abs(S-B)<.004,A=!1;if(!N&&!q&&!D&&g&&E>f){let w=(ft.get(i)??0)+1;ft.set(i,w),w>=x&&(A=!0,ft.set(i,0))}else E<=f&&ft.set(i,0);let C=!N&&t.forceSync&&E>.02;if(q||A||C){try{i.currentTime=r}catch(w){_("runtime.media.site2",w)}if(Math.abs(i.currentTime-r)>.5&&!Sn.has(i)){Sn.add(i),i.load();try{i.currentTime=r}catch(w){_("runtime.media.site3",w)}}et.delete(i)}t.playing&&i.paused&&!et.has(i)?(fs(i),i.play().catch(w=>{et.delete(i),(w&&typeof w=="object"&&"name"in w?String(w.name??""):"")==="NotAllowedError"&&t.onAutoplayBlocked?.()})):!t.playing&&!i.paused&&i.pause();continue}yn.delete(i),ft.delete(i),Sn.delete(i),bn.delete(i),i.paused||i.pause()}}var ms=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),ps=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function Ri(t){let e=!1,n=null,i=null,r=null,o=null;function s(g,A){try{window.dispatchEvent(new CustomEvent(g,{detail:A}))}catch(C){_("runtime.picker.site1",C)}}function l(g){r=g,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function a(g){o=g,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function c(g){let A=g.ownerDocument.defaultView;if(!A)return!1;let C=g;for(;C&&C!==document.body&&C!==document.documentElement;){let w=A.getComputedStyle(C);if(w.display==="none"||w.visibility==="hidden"||w.pointerEvents==="none")return!0;let T=Number.parseFloat(w.opacity);if(Number.isFinite(T)&&T<=.01)return!0;C=C.parentElement}return!1}function u(g){if(!g||g===document.body||g===document.documentElement)return!1;let A=g.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||g.classList.contains("__hf-pick-highlight")||g.closest(ms)||c(g))}function m(g){return!!g?.closest(ps)}function f(g){let A=g;if(A.id)return`#${A.id}`;let C=g.getAttribute("data-composition-id");if(C)return`[data-composition-id="${C}"]`;let w=g.getAttribute("data-composition-src");if(w)return`[data-composition-src="${w}"]`;let T=g.getAttribute("data-track-index");if(T)return`[data-track-index="${T}"]`;let L=g.tagName.toLowerCase(),P=g.parentElement;if(!P)return L;let J=P.querySelectorAll(`:scope > ${L}`);if(J.length===1)return L;for(let R=0;R<J.length;R+=1)if(J[R]===g)return`${L}:nth-of-type(${R+1})`;return L}function x(g){let A=g.tagName.toLowerCase(),C=(g.textContent??"").trim().replace(/\s+/g," "),w=(T,L)=>T.length>L?`${T.slice(0,L-1)}\u2026`:T;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?w(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":g.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function F(g,A,C){let w=typeof C=="number"&&C>0?C:8,T=[];if(document.elementsFromPoint)T=document.elementsFromPoint(g,A);else if(document.elementFromPoint){let J=document.elementFromPoint(g,A);T=J?[J]:[]}if(m(T[0]??null))return[];let L={},P=[];for(let J=0;J<T.length;J+=1){let R=T[J];if(!u(R))continue;let le=`${R.tagName}::${R.id||""}::${J}`;if(!L[le]&&(L[le]=!0,P.push(R),P.length>=w))break}return P}function E(g){let A=g.getBoundingClientRect(),C={};for(let T=0;T<g.attributes.length;T+=1){let L=g.attributes[T];L.name.startsWith("data-")&&(C[L.name]=L.value)}return{id:g.id||null,tagName:g.tagName.toLowerCase(),selector:f(g),label:x(g),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:g.textContent?g.textContent.trim().slice(0,200):null,src:g.getAttribute("src")||g.getAttribute("data-composition-src")||null,dataAttributes:C}}function S(g,A,C){return F(g,A,C).map(E)}function B(g){if(!e)return;let C=F(g.clientX,g.clientY,1)[0]??(g.target instanceof Element?g.target:null);if(!u(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let w=E(C);l(w),t.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:w})}function D(g){if(!e)return;g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation();let A=S(g.clientX,g.clientY,8);A.length!==0&&(l(A[0]??null),t.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:g.clientX,y:g.clientY}}))}function v(g){g.key==="Escape"&&(q(),t.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function X(){e||(e=!0,i=document.createElement("style"),i.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
40
40
  `),document.head.appendChild(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",B,!0),document.addEventListener("click",D,!0),document.addEventListener("keydown",v,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function q(){e&&(e=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",B,!0),document.removeEventListener("click",D,!0),document.removeEventListener("keydown",v,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function N(){window.__HF_PICKER_API={enable:X,disable:q,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(g,A,C)=>Number.isFinite(g)&&Number.isFinite(A)?S(g,A,C):[],pickAtPoint:(g,A,C)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return null;let w=S(g,A,8);if(!w.length)return null;let T=Math.max(0,Math.min(w.length-1,Number(C??0))),L=w[T]??null;return L?(a(L),t.postMessage({source:"hf-preview",type:"element-picked",elementInfo:L}),q(),L):null},pickManyAtPoint:(g,A,C)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return[];let w=S(g,A,8);if(!w.length)return[];let T=[],L=Array.isArray(C)?C:[0];for(let P of L){let J=Math.max(0,Math.min(w.length-1,Math.floor(Number(P)))),R=w[J];if(!R)continue;T.some(Se=>Se.selector===R.selector&&Se.tagName===R.tagName)||T.push(R)}return T.length?(a(T[0]??null),t.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:T}),q(),T):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:X,disablePickMode:q,installPickerApi:N}}function tt(t,e){let n=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(t)&&t>0?t:0;return Math.floor(i*n+1e-9)/n}function pt(t,e,n){let i=t?.[e];return typeof i=="function"?Number(i.call(t))||n:typeof i=="number"&&Number.isFinite(i)?i:(i!=null&&_("runtime.player.nonConformantNum",{prop:e,actual:typeof i}),n)}function ve(t,e){let n=t?.[e];if(typeof n=="function"){n.call(t);return}n!==void 0&&_("runtime.player.nonConformantVoid",{method:e,actual:typeof n})}function ht(t,e,n){if(t){for(let i of Object.values(t))if(!(!i||i===e))try{n(i)}catch(r){_("runtime.player.site1",r)}}}function Li(t,e,n){let i=tt(e,n);return ve(t,"pause"),typeof t.totalTime=="function"?t.totalTime(i,!1):typeof t.seek=="function"&&t.seek(i,!1),i}function hs(t,e,n,i){let r=[];ht(t,e,o=>{ve(o,"play"),r.push(o)});try{return Li(e,n,i)}finally{for(let o of r)try{ve(o,"pause")}catch(s){_("runtime.player.site2",s)}}}function xs(t,e){ht(t,e,n=>{ve(n,"play")})}function Di(t){return{_timeline:null,play:()=>{let e=t.getTimeline();if(!e||t.getIsPlaying())return;let n=Math.max(0,Number(t.getSafeDuration?.()??pt(e,"duration",0))||0);n>0&&Math.max(0,pt(e,"time",0))>=n&&(ve(e,"pause"),typeof e.seek=="function"&&e.seek(0,!1),t.onDeterministicSeek(0),t.setIsPlaying(!1),t.onSyncMedia(0,!1),t.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(t.getPlaybackRate()),ve(e,"play"),ht(t.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ve(i,"play")}),t.onDeterministicPlay(),t.setIsPlaying(!0),t.onShowNativeVideos(),t.onStatePost(!0)},pause:()=>{let e=t.getTimeline();if(!e)return;ve(e,"pause"),ht(t.getTimelineRegistry?.(),e,i=>{ve(i,"pause")});let n=Math.max(0,pt(e,"time",0));t.onDeterministicSeek(n),t.onDeterministicPause(),t.setIsPlaying(!1),t.onSyncMedia(n,!1),t.onRenderFrameSeek(n),t.onStatePost(!0)},seek:(e,n)=>{let i=t.getTimeline();if(!i)return;let r=Math.max(0,Number(e)||0),o=t.getIsPlaying(),s=hs(t.getTimelineRegistry?.(),i,r,t.getCanonicalFps());t.onDeterministicSeek(s),n?.keepPlaying&&o?(typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ve(i,"play"),ht(t.getTimelineRegistry?.(),i,l=>{typeof l.timeScale=="function"&&l.timeScale(t.getPlaybackRate()),ve(l,"play")}),t.onDeterministicPlay(),t.onShowNativeVideos(),t.onSyncMedia(s,!0)):(t.setIsPlaying(!1),t.onSyncMedia(s,!1)),t.onRenderFrameSeek(s),t.onStatePost(!0)},renderSeek:e=>{let n=t.getTimeline(),i=t.getCanonicalFps(),r=n?(xs(t.getTimelineRegistry?.(),n),Li(n,e,i)):tt(Math.max(0,Number(e)||0),i);t.onDeterministicSeek(r),t.setIsPlaying(!1),t.onSyncMedia(r,!1),t.onRenderFrameSeek(r),t.onStatePost(!0)},getTime:()=>pt(t.getTimeline(),"time",0),getDuration:()=>pt(t.getTimeline(),"duration",0),isPlaying:()=>t.getIsPlaying(),setPlaybackRate:e=>t.setPlaybackRate(e),getPlaybackRate:()=>t.getPlaybackRate()}}function Bi(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,nativeVisualWatchdogTick:0,transportClock:null,transportRafId:null}}var gs="data-hf-authored-duration",ys="data-hf-authored-end";function Qe(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function Ss(t){return Qe(t.getAttribute("data-duration"))}function bs(t){return Qe(t.getAttribute("data-end"))}function As(t){return Qe(t.getAttribute(gs))}function Es(t){return Qe(t.getAttribute(ys))}function Fs(t){let e=(t??"").trim();if(!e)return null;let n=Qe(e);if(n!=null)return{kind:"absolute",value:n};let i=e.match(/^([A-Za-z0-9_.:-]+)(?:\s*([+-])\s*([0-9]*\.?[0-9]+))?$/);if(!i)return null;let r=(i[1]??"").trim();if(!r)return null;let o=i[2]??"+",s=i[3]??"0",l=Number.parseFloat(s),a=Number.isFinite(l)?Math.max(0,l):0,c=o==="-"?-a:a;return{kind:"reference",refId:r,offset:c}}function Ye(t){let e=t.timelineRegistry??{},n=t.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=u=>{let m=document.getElementById(u);return m||(document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`)??null)},l=u=>{let m=r.get(u);if(m!==void 0)return m;let f=null,x=Ss(u)??(n?As(u):null);if(x!=null&&x>0&&(f=x),f==null||f<=0){let F=bs(u)??(n?Es(u):null);if(F!=null){let E=c(u,0),S=F-E;Number.isFinite(S)&&S>0&&(f=S)}}if((f==null||f<=0)&&u instanceof HTMLMediaElement){let F=Qe(u.getAttribute("data-playback-start"))??Qe(u.getAttribute("data-media-start"))??0;Number.isFinite(u.duration)&&u.duration>F&&(f=u.duration-F)}if(f==null||f<=0){let F=u.getAttribute("data-composition-id");if(F){let E=e[F]??null;if(E&&typeof E.duration=="function")try{let S=Number(E.duration());Number.isFinite(S)&&S>0&&(f=S)}catch(S){_("runtime.startResolver.site1",S)}}}return f!=null&&Number.isFinite(f)&&f>0?(r.set(u,f),f):(r.set(u,null),null)},a=(u,m)=>{if(u.hasAttribute("data-composition-id")){let x=u.parentElement?.closest("[data-composition-id]");return x?c(x,m):0}let f=u.closest("[data-composition-id]");return f?c(f,m):0},c=(u,m)=>{let f=i.get(u);if(f!==void 0)return f??m;if(o.has(u))return m;o.add(u);try{let x=Fs(u.getAttribute("data-start"));if(!x){if(u.hasAttribute("data-composition-id")){let D=u.parentElement;if(D&&(D.hasAttribute("data-composition-src")||D.hasAttribute("data-composition-id"))){let v=c(D,m);return i.set(u,v),v}}return i.set(u,m),m}if(x.kind==="absolute"){let D=Math.max(0,x.value),v=Math.max(0,a(u,m)+D);return i.set(u,v),v}let F=s(x.refId);if(!F)return i.set(u,m),m;let E=c(F,0),S=l(F);if(S==null||S<=0){let D=Math.max(0,E+x.offset);return i.set(u,D),D}let B=Math.max(0,E+S+x.offset);return i.set(u,B),B}finally{o.delete(u)}};return{resolveStartForElement:(u,m=0)=>c(u,Math.max(0,m)),resolveDurationForElement:u=>l(u)}}var ws="data-hf-authored-duration",Ns="data-hf-authored-end";function Ee(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function An(t){return Ee(t.getAttribute("data-duration"))??Ee(t.getAttribute(ws))}function Ii(t){return Ee(t.getAttribute("data-end"))??Ee(t.getAttribute(Ns))}function En(...t){let e=t.filter(n=>Number.isFinite(n??null));return e.length===0?null:Math.max(...e)}var Oi={composition:0,video:1,image:2,element:3,audio:4};function Cs(t){if(t.length===0)return;let e=new Map;for(let s of t){let l=e.get(s.track)??new Set;l.add(s.kind),e.set(s.track,l)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,l)=>s-l);for(let s of o){let l=e.get(s);if(l.size===1)r.set(`${s}:${[...l][0]}`,i++);else{let a=[...l].sort((c,u)=>(Oi[c]??99)-(Oi[u]??99));for(let c of a)r.set(`${s}:${c}`,i++)}}for(let s of t){let l=`${s.track}:${s.kind}`,a=r.get(l);a!=null&&(s.track=a)}}function gt(t){let e=String(t??"").trim();if(!e)return null;let n=e.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function Pi(t){let e=t.getAttribute("src")??t.getAttribute("data-src");if(e)return gt(e);let n=t.getAttribute("data-composition-src");if(n)return gt(n);let i=t.querySelector("img[src], video[src], audio[src], source[src]");return i?gt(i.getAttribute("src")):null}function Ms(t){let e=t.className;return typeof e!="string"?null:e.split(/\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function Ts(t){if(!t)return null;try{return new URL(t,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return t.split(/[\\/]/).filter(Boolean).at(-1)??null}}function ks(t){let e=t.textContent?.replace(/\s+/g," ").trim();return e?e.length>32?`${e.slice(0,31)}...`:e:null}function xt(t){let e=t.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return e?e.replace(/\b\w/g,n=>n.toUpperCase()):t}function vs(t,e,n){let i=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=t.getAttribute("data-composition-id");if(r)return xt(r);let o=t.id;if(o)return xt(o);let s=Ms(t);if(s)return xt(s);let l=Ts(Pi(t));if(l)return xt(l);let a=ks(t);return a||`${xt(e)} ${n+1}`}function Wi(t){let n=window.__timelines??{},i=Ye({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=H=>{if(!H)return null;let k=n[H]??null;if(!k||typeof k.duration!="function")return null;try{let O=Number(k.duration());return Number.isFinite(O)&&O>0?O:null}catch{return null}},o=H=>{let k=Ee(H.getAttribute("data-duration"));if(k!=null&&k>0)return k;let O=Ee(H.getAttribute("data-playback-start"))??Ee(H.getAttribute("data-media-start"))??0;return Number.isFinite(H.duration)&&H.duration>O?Math.max(0,H.duration-O):null},s=()=>{let H=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(H.length===0)return null;let k=0;for(let O of H){let ne=O.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(O,0):Math.max(0,Number(O.getAttribute("data-start")??0)||0);if(!Number.isFinite(ne))continue;let ee=o(O);ee==null||ee<=0||(k=Math.max(k,Math.max(0,ne)+ee))}return k>0?k:null},l=H=>{let k=H.trim().toLowerCase();return!(!k||k==="main"||k.includes("caption")||k.includes("ambient"))},a=(H,k)=>{let O=[],ne=null,ee=null,z=null,V=H.parentElement;for(;V;){let j=V.getAttribute("data-composition-id");j&&(O.push(j),!z&&V!==k&&(z=j),ne==null&&(ne=i.resolveStartForElement(V,0)),ee==null&&(ee=Ee(V.getAttribute("data-duration"))??r(j)??null)),V=V.parentElement}return{parentCompositionId:z,compositionAncestors:O.reverse(),inheritedStart:ne,inheritedDuration:ee}},c=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),m=c?.getAttribute("data-composition-id")??null,f=c?i.resolveStartForElement(c,0):0,x=s(),F=x!=null?Math.max(0,x-Math.max(0,f)):null,E=r(m),S=An(c??document.body),B=En(...u.filter(H=>H!==c).map(H=>{let k=i.resolveStartForElement(H,0),O=i.resolveDurationForElement(H)??r(H.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||O==null||O<=0?null:Math.max(0,k)+O})),D=B!=null?Math.max(0,B-Math.max(0,f)):null,v=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,X=typeof S=="number"&&Number.isFinite(S)&&S>0?S:null,q=typeof F=="number"&&Number.isFinite(F)&&F>0?F:null,N=typeof D=="number"&&Number.isFinite(D)&&D>0?D:null,g=En(q,N),A=v!=null&&g!=null&&v>g+1,w=X??(A?g:En(v,q,N))??null,L=(w!=null?f+w:null)??(typeof x=="number"&&Number.isFinite(x)&&x>0?x:null),P=(H,k)=>!Number.isFinite(k)||k<=0?0:L==null||!Number.isFinite(L)?k:!Number.isFinite(H)||H>=L?0:Math.max(0,Math.min(k,L-H)),J=[],R=[],le=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),Se=0;for(let H=0;H<le.length;H+=1){let k=le[H];if(k===c||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let O=a(k,c),ne=i.resolveStartForElement(k,O.inheritedStart??0),ee=k.getAttribute("data-composition-id"),z=An(k);if((z==null||z<=0)&&ee&&ee!==m&&(z=r(ee)),(z==null||z<=0)&&k instanceof HTMLMediaElement){let we=Ee(k.getAttribute("data-playback-start"))??Ee(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(z=Math.max(0,k.duration-we))}if(z==null||z<=0){let we=O.inheritedDuration;if(we!=null&&we>0){let Le=(O.inheritedStart??0)+we;z=Math.max(0,Le-ne)}}if(z==null||z<=0||(z=P(ne,z),z<=0))continue;let V=ne+z;Se=Math.max(Se,V);let j=k.tagName.toLowerCase(),Ce=ee&&ee!==m?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";J.push({id:k.id||ee||null,label:vs(k,Ce,J.length),start:ne,duration:z,track:Number.parseInt(k.getAttribute("data-track-index")??k.getAttribute("data-track")??String(H),10)||0,kind:Ce,tagName:j,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:O.compositionAncestors,parentCompositionId:O.parentCompositionId,nodePath:null,compositionSrc:gt(k.getAttribute("data-composition-src")),assetUrl:Pi(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:Ee(k.getAttribute("data-timeline-priority"))})}let $=new Set(J.map(H=>H.id)),U=c?.getAttribute("data-composition-id")??null,W=U?n[U]??null:null;if(W&&c){let H=W;if(typeof H.getChildren=="function")try{let k=H.getChildren(!0,!0,!1)??[],O=new Map;for(let z of c.children){let V=z;if(!V.id)continue;let j=V.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||O.set(V,{id:V.id,start:1/0,end:-1/0})}let ne=z=>{let V=z;for(;V;){if(O.has(V))return V;if(V===c)return null;V=V.parentElement}return null};for(let z of k){if(typeof z.targets!="function"||typeof z.startTime!="function"||typeof z.duration!="function")continue;let V=z.startTime(),j=z.parent;for(;j&&j!==W&&typeof j.startTime=="function";)V+=j.startTime(),j=j.parent;let Ce=V+z.duration();if(!(!Number.isFinite(V)||!Number.isFinite(Ce)))for(let we of z.targets()){if(!(we instanceof Element))continue;let $e=ne(we);if(!$e)continue;let Le=O.get($e);Le&&(Le.start=Math.min(Le.start,V),Le.end=Math.max(Le.end,Ce))}}let ee=J.length>0?Math.max(...J.map(z=>z.track))+1:0;for(let[z,V]of O){if(V.start===1/0||V.end===-1/0)continue;let j=z;if($.has(j.id))continue;let Ce=Math.max(0,V.end-V.start);if(Ce<=0)continue;let we=P(V.start,Ce);we<=0||(Se=Math.max(Se,V.start+we),J.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:V.start,duration:we,track:Number.parseInt(j.getAttribute("data-track-index")??j.getAttribute("data-track")??"",10)||ee,kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:j.getAttribute("data-timeline-role"),timelineLabel:j.getAttribute("data-timeline-label"),timelineGroup:j.getAttribute("data-timeline-group"),timelinePriority:Ee(j.getAttribute("data-timeline-priority"))}),$.add(j.id))}}catch(k){_("runtime.timeline.site1",k)}}if(c&&w!=null&&w>0){let H=J.length>0?Math.max(...J.map(k=>k.track))+1:0;for(let k of c.children){let O=k;if(!O.id||$.has(O.id))continue;let ne=O.getAttribute("data-timeline-role");if(ne!=="overlay"&&ne!=="persistent-overlay")continue;let ee=O.tagName.toLowerCase();if(ee==="script"||ee==="style"||ee==="link"||ee==="meta"||window.getComputedStyle(O).display==="none")continue;let V=P(0,w);V<=0||(Se=Math.max(Se,V),J.push({id:O.id,label:O.getAttribute("data-timeline-label")??O.getAttribute("data-label")??O.getAttribute("aria-label")??O.id,start:0,duration:V,track:Number.parseInt(O.getAttribute("data-track-index")??O.getAttribute("data-track")??"",10)||H,kind:"element",tagName:ee,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:ne,timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ee(O.getAttribute("data-timeline-priority"))}),$.add(O.id))}}Cs(J);for(let H of u){if(H===c)continue;let k=H.getAttribute("data-composition-id");if(!k||!l(k))continue;let O=i.resolveStartForElement(H,0),ne=An(H);if((ne==null||ne<=0)&&Ii(H)!=null){let j=Ii(H);ne=Math.max(0,j-O)}let ee=r(k),z=ne&&ne>0?ne:ee;if(z==null||z<=0)continue;let V=P(O,z);V<=0||R.push({id:k,label:H.getAttribute("data-label")??k,start:O,duration:V,thumbnailUrl:gt(H.getAttribute("data-thumbnail-url")),avatarName:null})}let Y=Math.max(1,Se||1,w??0);return{source:"hf-preview",type:"timeline",durationInFrames:A&&X==null?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(Y*Math.max(1,t.canonicalFps))),clips:J,scenes:R,compositionWidth:Ee(c?.getAttribute("data-width"))??1920,compositionHeight:Ee(c?.getAttribute("data-height"))??1080}}var ae=us(co(),1),fo=ae.default,Xc=ae.default.stringify,ed=ae.default.fromJSON,td=ae.default.plugin,nd=ae.default.parse,id=ae.default.list,rd=ae.default.document,od=ae.default.comment,sd=ae.default.atRule,ad=ae.default.rule,ld=ae.default.decl,ud=ae.default.root,cd=ae.default.CssSyntaxError,dd=ae.default.Declaration,fd=ae.default.Container,md=ae.default.Processor,pd=ae.default.Document,hd=ae.default.Comment,xd=ae.default.Warning,gd=ae.default.AtRule,yd=ae.default.Result,Sd=ae.default.Input,bd=ae.default.Rule,Ad=ae.default.Root,Ed=ae.default.Node;var Kn="data-hf-authored-id";function Jn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Za(t){return t&&t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function mo(t){let e=t.trim();return e?Array.from(new Set([e,Za(e)])).filter(Boolean):[]}function Xa(t){return!!t&&/[\w-]/.test(t)}function el(t,e,n){let i=mo(e).sort((l,a)=>a.length-l.length);if(i.length===0)return t;let r="",o=0,s=null;for(let l=0;l<t.length;l+=1){let a=t[l],c=l>0?t[l-1]:"";if(s){r+=a,a===s&&c!=="\\"&&(s=null);continue}if(a==='"'||a==="'"){s=a,r+=a;continue}if(a==="["){o+=1,r+=a;continue}if(a==="]"){o=Math.max(0,o-1),r+=a;continue}if(a==="#"&&o===0){let u=i.find(m=>t.startsWith(m,l+1));if(u){let m=t[l+1+u.length];if(!Xa(m)){r+=n,l+=u.length;continue}}}r+=a}return r}function tl(t,e){let n=e?.trim();return n?el(t,n,`[${Kn}="${Qn(n)}"]`):t}function nl(t,e,n,i,r){let o=tl(t,i),s=il(o,e,n),l=s.trim();if(!l||/^(html|body|:root|\*)$/i.test(l))return t;let a=new RegExp(`\\[\\s*data-composition-id\\s*=\\s*(["'])${Jn(n)}\\1\\s*\\]`,"g");if(a.test(l))return s.replace(a,e);let c=s.match(/^\s*/)?.[0]??"",u=s.match(/\s*$/)?.[0]??"";if(r){let m=i?`[${Kn}="${Qn(i)}"]`:null;if(m&&l.startsWith(m)){let f=l.slice(m.length);return`${c}${e}${m}${f}${u}`}}return`${c}${e} ${l}${u}`}function il(t,e,n){let i=Jn(n),r=String.raw`\[\s*data-composition-id\s*=\s*(?:"${i}"|'${i}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return t.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var rl=new Set(["keyframes","-webkit-keyframes","font-face"]);function ol(t){return t?.type==="atrule"}function sl(t){let e=t.parent;for(;e;){if(ol(e)&&rl.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function Yn(t,e,n,i,r){let o=e.trim();if(!t||!o)return t;let s=n||`[data-composition-id="${Qn(o)}"]`,l=fo.parse(t);return l.walkRules(a=>{sl(a)||(a.selectors=a.selectors.map(c=>nl(c,s,o,i,r?.compoundAuthoredRoot)))}),l.toResult({map:!1}).css}function po(t,e,n="[HyperFrames] composition script error:",i,r=e,o){let s=JSON.stringify(e),l=JSON.stringify(r),a=JSON.stringify(n),c=Jn(e),u=JSON.stringify(o?.trim()||null),m=JSON.stringify(i??null),f=JSON.stringify(String.raw`\[\s*data-composition-id\s*=\s*(?:"${c}"|'${c}')\s*\]`),x=JSON.stringify(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),F=JSON.stringify(mo(o?.trim()||""));return`(function(){
41
41
  var __hfCompId = ${s};
42
42
  var __hfTimelineCompId = ${l};
@@ -36,7 +36,7 @@ https://www.w3ctech.com/topic/2226`));let l=n(...s);return l.postcssPlugin=e,l.p
36
36
  0% { outline-color: rgba(59, 130, 246, 0.8); }
37
37
  100% { outline-color: transparent; }
38
38
  }
39
- `,document.head.appendChild(n)}for(let n of t)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch(i){_("bridge.flashElements.querySelector",i)}}var gn=null;function xi(t){gn=t}function dt(t,e){if(gn)try{gn({source:"hf-preview",type:"analytics",event:t,properties:e??{}})}catch(n){_("runtime.analytics.site1",n)}}function gi(t){let e=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=(l,a)=>{for(let c of l){try{c.currentTime=a}catch(u){_("runtime.adapters.css.site1",u)}try{c.pause()}catch(u){_("runtime.adapters.css.site2",u)}}},r=l=>{for(let a of l)try{a.play()}catch(c){_("runtime.adapters.css.site3",c)}},o=l=>{for(let a of l)try{a.pause()}catch(c){_("runtime.adapters.css.site4",c)}},s=l=>{l.baseDelay?l.el.style.animationDelay=l.baseDelay:l.el.style.removeProperty("animation-delay"),l.basePlayState?l.el.style.animationPlayState=l.basePlayState:l.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let l=document.querySelectorAll("*");for(let a of l){if(!(a instanceof HTMLElement))continue;let c=window.getComputedStyle(a);!c.animationName||c.animationName==="none"||e.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:l=>{let a=Number(l.time)||0;for(let c of e){if(!c.el.isConnected)continue;let u=t?.resolveStartSeconds?t.resolveStartSeconds(c.el):Number.parseFloat(c.el.getAttribute("data-start")??"0")||0,m=Math.max(0,a-u)*1e3,f=n(c.el);if(f.length>0){i(f,m);continue}c.el.style.animationPlayState="paused",c.el.style.animationDelay=`-${(m/1e3).toFixed(3)}s`}},pause:()=>{for(let l of e){if(!l.el.isConnected)continue;let a=n(l.el);a.length>0&&o(a),s(l)}},play:()=>{for(let l of e)l.el.isConnected&&(s(l),r(n(l.el)))},revert:()=>{e=[]}}}function yi(t){return{name:"gsap",discover:()=>{},seek:e=>{let n=t.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(e.time)||0);typeof n.totalTime=="function"?n.totalTime(i,!1):n.seek(i,!1)},pause:()=>{let e=t.getTimeline();e&&e.pause()}}}function Si(){return{name:"animejs",discover:()=>{try{let t=window.anime;if(!t||typeof t.running>"u")return;let e=t.running;if(!Array.isArray(e)||e.length===0)return;let n=window.__hfAnime??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfAnime=n}catch(t){_("runtime.adapters.animejs.site1",t)}},seek:t=>{let e=Math.max(0,(Number(t.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(e)}catch(r){_("runtime.adapters.animejs.site2",r)}},pause:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.pause=="function"&&e.pause()}catch(n){_("runtime.adapters.animejs.site3",n)}},play:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.play=="function"&&e.play()}catch(n){_("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ei(){return{name:"lottie",discover:()=>{try{let t=window.lottie;if(t&&typeof t.getRegisteredAnimations=="function"){let e=t.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let n=window.__hfLottie??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(t){_("runtime.adapters.lottie.site1",t)}},seek:t=>{let e=Math.max(0,Number(t.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let i of n)try{if(bi(i))i.goToAndStop(e*1e3,!1);else if(Ai(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch(r){_("runtime.adapters.lottie.site2",r)}},pause:()=>{let t=window.__hfLottie;if(!(!t||t.length===0))for(let e of t)try{(bi(e)||Ai(e))&&e.pause()}catch(n){_("runtime.adapters.lottie.site3",n)}},revert:()=>{}}}function bi(t){return typeof t=="object"&&t!==null&&typeof t.goToAndStop=="function"}function Ai(t){return typeof t=="object"&&t!==null&&typeof t.pause=="function"&&("totalFrames"in t||"duration"in t)}var Fi=-1;function Ht(t){if(t!==Fi){Fi=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){_("runtime.adapters.seek-dispatch.site1",e)}}}function wi(){let t=null,e=0;return{name:"three",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfThreeTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ni(){let t=null,e=0;return{name:"typegpu",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfTypegpuTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ci(){let t=globalThis.GPUQueue;if(!t?.prototype?.copyExternalImageToTexture)return;let e=t.prototype.copyExternalImageToTexture;t.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=n.source.nextElementSibling;if(o instanceof HTMLImageElement&&o.classList.contains("__render_frame__")&&o.complete&&o.naturalWidth>0)return e.call(this,{...n,source:o},i,r)}return e.call(this,n,i,r)}}function Mi(){let t=!1,e=0,n=new WeakMap,i=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},r=l=>{let a=Number(l.currentTime);return Number.isFinite(a)&&a>0?a:0},o=(l,a)=>a<=0?l:l>=a?Math.max(0,l-a):l,s=(l,a)=>{let c=n.get(l);if(c)return c;let u={compositionTimeMs:a,animationTimeMs:t?o(r(l),a):r(l)};return n.set(l,u),u};return{name:"waapi",discover:()=>{t=!0;for(let l of i())s(l,e)},seek:l=>{let a=Math.max(0,(Number(l.time)||0)*1e3);e=a;for(let c of i()){let u=t?s(c,a):s(c,0),m=u.animationTimeMs+Math.max(0,a-u.compositionTimeMs);try{c.currentTime=m}catch(f){_("runtime.adapters.waapi.site1",f)}try{c.pause()}catch(f){_("runtime.adapters.waapi.site2",f)}}},pause:()=>{if(document.getAnimations)for(let l of document.getAnimations())try{l.pause()}catch(a){_("runtime.adapters.waapi.site3",a)}}}}function Ti(t,e){if(t.length===0)return 1;let n=0;for(;n<t.length-2&&e>=t[n+1].time;)n+=1;let i=t[n],r=t[n+1]??i,o=r.time-i.time,s=o<=0?0:Math.min(1,Math.max(0,(e-i.time)/o));return i.volume+(r.volume-i.volume)*s}function ds(t,e,n,i){let r=Number.parseFloat(t.dataset.start??"0")||0,o=Number.parseFloat(t.dataset.end??""),s=Number.parseFloat(t.dataset.duration??""),l=Number.isFinite(o)&&o>r?o:Number.isFinite(s)&&s>0?r+s:n,a=Number.parseFloat(t.dataset.volume??""),c=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;t.volume=c;let u=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,l),x=[];for(let E=m;E<=f+1e-6;E+=u){let S=Math.min(f,E);e(S);let B=Number(t.volume);if(!Number.isFinite(B))continue;let D=Math.max(0,Math.min(1,B)),v=x.at(-1);if((!v||Math.abs(v.volume-D)>1e-4||S===f)&&x.push({time:Number(S.toFixed(6)),volume:Number(D.toFixed(6))}),S===f)break}return x.some(E=>Math.abs(E.volume-c)>1e-4)?x:null}function ki(t,e,n,i){if(!e||!(t instanceof HTMLAudioElement)&&!(t instanceof HTMLVideoElement)||n<=0)return;let o=ds(t,s=>{try{typeof e.totalTime=="function"?e.totalTime(s,!0):typeof e.seek=="function"&&e.seek(s,!0)}catch{}},n,60);o&&i.set(t,o)}function vi(t){let e=Array.from(document.querySelectorAll("video, audio")),n=t?.shouldIncludeElement?e.filter(s=>t.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of n){let l=t?.resolveStartSeconds?t.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(l))continue;let a=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,c=s.defaultPlaybackRate,u=Number.isFinite(c)&&c>0?Math.max(.1,Math.min(5,c)):1,m=s.loop,f=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,x=t?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(x)||x<=0)&&f!=null&&(x=Math.max(0,(f-a)/u));let F=Number.isFinite(x)&&x>0?l+x:Number.POSITIVE_INFINITY,E=Number.parseFloat(s.dataset.volume??""),S={el:s,start:l,mediaStart:a,duration:Number.isFinite(x)&&x>0?x:Number.POSITIVE_INFINITY,end:F,volume:Number.isFinite(E)?E:null,playbackRate:u,loop:m,sourceDuration:f};i.push(S),s.tagName==="VIDEO"&&r.push(S),Number.isFinite(F)&&(o=Math.max(o,F))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var yn=new WeakMap,ft=new WeakMap,Sn=new WeakSet,et=new WeakSet;function fs(t){if(et.has(t))return;et.add(t);let e=()=>et.delete(t);t.addEventListener("playing",e,{once:!0}),t.addEventListener("pause",e,{once:!0}),t.addEventListener("error",e,{once:!0})}var bn=new WeakMap;function mt(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function _i(t){let e=!!(t.outputMuted||t.userMuted);for(let n of t.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(t.timeSeconds-n.start)*n.playbackRate+n.mediaStart;if(t.timeSeconds>=n.start&&t.timeSeconds<n.end&&r>=0){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let w=n.sourceDuration-n.mediaStart;w>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%w)}let s=mt(t.userVolume??1),l=mt(n.volume??1),a=bn.get(i),c=mt(i.volume),u;n.volumeKeyframes&&n.volumeKeyframes.length>0?u=mt(Ti(n.volumeKeyframes,r)):a===void 0||Math.abs(c-a)>1e-4?u=c:u=l;let m=mt(u*s);i.volume=m,bn.set(i,m),t.onElementVolume?.(i,m),e&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*t.playbackRate}catch(w){_("runtime.media.site1",w)}let f=.04,x=2,F=i.currentTime||0,E=Math.abs(F-r),S=r-F,B=yn.get(i);yn.set(i,S);let D=B===void 0,v=!D&&Math.abs(S-B)>.5,X=E>3,q=E>.5&&(D||v||X),N=i.tagName==="VIDEO"&&!i.paused,g=B!==void 0&&Math.abs(S-B)<.004,A=!1;if(!N&&!q&&!D&&g&&E>f){let w=(ft.get(i)??0)+1;ft.set(i,w),w>=x&&(A=!0,ft.set(i,0))}else E<=f&&ft.set(i,0);let C=!N&&t.forceSync&&E>.02;if(q||A||C){try{i.currentTime=r}catch(w){_("runtime.media.site2",w)}if(Math.abs(i.currentTime-r)>.5&&!Sn.has(i)){Sn.add(i),i.load();try{i.currentTime=r}catch(w){_("runtime.media.site3",w)}}et.delete(i)}t.playing&&i.paused&&!et.has(i)?(fs(i),i.play().catch(w=>{et.delete(i),(w&&typeof w=="object"&&"name"in w?String(w.name??""):"")==="NotAllowedError"&&t.onAutoplayBlocked?.()})):!t.playing&&!i.paused&&i.pause();continue}yn.delete(i),ft.delete(i),Sn.delete(i),bn.delete(i),i.paused||i.pause()}}var ms=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),ps=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function Ri(t){let e=!1,n=null,i=null,r=null,o=null;function s(g,A){try{window.dispatchEvent(new CustomEvent(g,{detail:A}))}catch(C){_("runtime.picker.site1",C)}}function l(g){r=g,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function a(g){o=g,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function c(g){let A=g.ownerDocument.defaultView;if(!A)return!1;let C=g;for(;C&&C!==document.body&&C!==document.documentElement;){let w=A.getComputedStyle(C);if(w.display==="none"||w.visibility==="hidden"||w.pointerEvents==="none")return!0;let T=Number.parseFloat(w.opacity);if(Number.isFinite(T)&&T<=.01)return!0;C=C.parentElement}return!1}function u(g){if(!g||g===document.body||g===document.documentElement)return!1;let A=g.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||g.classList.contains("__hf-pick-highlight")||g.closest(ms)||c(g))}function m(g){return!!g?.closest(ps)}function f(g){let A=g;if(A.id)return`#${A.id}`;let C=g.getAttribute("data-composition-id");if(C)return`[data-composition-id="${C}"]`;let w=g.getAttribute("data-composition-src");if(w)return`[data-composition-src="${w}"]`;let T=g.getAttribute("data-track-index");if(T)return`[data-track-index="${T}"]`;let L=g.tagName.toLowerCase(),P=g.parentElement;if(!P)return L;let J=P.querySelectorAll(`:scope > ${L}`);if(J.length===1)return L;for(let R=0;R<J.length;R+=1)if(J[R]===g)return`${L}:nth-of-type(${R+1})`;return L}function x(g){let A=g.tagName.toLowerCase(),C=(g.textContent??"").trim().replace(/\s+/g," "),w=(T,L)=>T.length>L?`${T.slice(0,L-1)}\u2026`:T;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?w(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":g.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function F(g,A,C){let w=typeof C=="number"&&C>0?C:8,T=[];if(document.elementsFromPoint)T=document.elementsFromPoint(g,A);else if(document.elementFromPoint){let J=document.elementFromPoint(g,A);T=J?[J]:[]}if(m(T[0]??null))return[];let L={},P=[];for(let J=0;J<T.length;J+=1){let R=T[J];if(!u(R))continue;let le=`${R.tagName}::${R.id||""}::${J}`;if(!L[le]&&(L[le]=!0,P.push(R),P.length>=w))break}return P}function E(g){let A=g.getBoundingClientRect(),C={};for(let T=0;T<g.attributes.length;T+=1){let L=g.attributes[T];L.name.startsWith("data-")&&(C[L.name]=L.value)}return{id:g.id||null,tagName:g.tagName.toLowerCase(),selector:f(g),label:x(g),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:g.textContent?g.textContent.trim().slice(0,200):null,src:g.getAttribute("src")||g.getAttribute("data-composition-src")||null,dataAttributes:C}}function S(g,A,C){return F(g,A,C).map(E)}function B(g){if(!e)return;let C=F(g.clientX,g.clientY,1)[0]??(g.target instanceof Element?g.target:null);if(!u(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let w=E(C);l(w),t.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:w})}function D(g){if(!e)return;g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation();let A=S(g.clientX,g.clientY,8);A.length!==0&&(l(A[0]??null),t.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:g.clientX,y:g.clientY}}))}function v(g){g.key==="Escape"&&(q(),t.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function X(){e||(e=!0,i=document.createElement("style"),i.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
39
+ `,document.head.appendChild(n)}for(let n of t)try{document.querySelectorAll(n).forEach(r=>{r.classList.add("__hf-flash"),setTimeout(()=>r.classList.remove("__hf-flash"),e)})}catch(i){_("bridge.flashElements.querySelector",i)}}var gn=null;function xi(t){gn=t}function dt(t,e){if(gn)try{gn({source:"hf-preview",type:"analytics",event:t,properties:e??{}})}catch(n){_("runtime.analytics.site1",n)}}function gi(t){let e=[],n=l=>{if(typeof l.getAnimations!="function")return[];try{return l.getAnimations()}catch{return[]}},i=(l,a)=>{for(let c of l){try{c.currentTime=a}catch(u){_("runtime.adapters.css.site1",u)}try{c.pause()}catch(u){_("runtime.adapters.css.site2",u)}}},r=l=>{for(let a of l)try{a.play()}catch(c){_("runtime.adapters.css.site3",c)}},o=l=>{for(let a of l)try{a.pause()}catch(c){_("runtime.adapters.css.site4",c)}},s=l=>{l.baseDelay?l.el.style.animationDelay=l.baseDelay:l.el.style.removeProperty("animation-delay"),l.basePlayState?l.el.style.animationPlayState=l.basePlayState:l.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{e=[];let l=document.querySelectorAll("*");for(let a of l){if(!(a instanceof HTMLElement))continue;let c=window.getComputedStyle(a);!c.animationName||c.animationName==="none"||e.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:l=>{let a=Number(l.time)||0;for(let c of e){if(!c.el.isConnected)continue;let u=t?.resolveStartSeconds?t.resolveStartSeconds(c.el):Number.parseFloat(c.el.getAttribute("data-start")??"0")||0,m=Math.max(0,a-u)*1e3,f=n(c.el);if(f.length>0){i(f,m);continue}c.el.style.animationPlayState="paused",c.el.style.animationDelay=`-${(m/1e3).toFixed(3)}s`}},pause:()=>{for(let l of e){if(!l.el.isConnected)continue;let a=n(l.el);a.length>0&&o(a),s(l)}},play:()=>{for(let l of e)l.el.isConnected&&(s(l),r(n(l.el)))},revert:()=>{e=[]}}}function yi(t){return{name:"gsap",discover:()=>{},seek:e=>{let n=t.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(e.time)||0);typeof n.totalTime=="function"?n.totalTime(i,!1):n.seek(i,!1)},pause:()=>{let e=t.getTimeline();e&&e.pause()}}}function Si(){return{name:"animejs",discover:()=>{try{let t=window.anime;if(!t||typeof t.running>"u")return;let e=t.running;if(!Array.isArray(e)||e.length===0)return;let n=window.__hfAnime??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfAnime=n}catch(t){_("runtime.adapters.animejs.site1",t)}},seek:t=>{let e=Math.max(0,(Number(t.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let i of n)try{typeof i.seek=="function"&&i.seek(e)}catch(r){_("runtime.adapters.animejs.site2",r)}},pause:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.pause=="function"&&e.pause()}catch(n){_("runtime.adapters.animejs.site3",n)}},play:()=>{let t=window.__hfAnime;if(!(!t||t.length===0))for(let e of t)try{typeof e.play=="function"&&e.play()}catch(n){_("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ei(){return{name:"lottie",discover:()=>{try{let t=window.lottie;if(t&&typeof t.getRegisteredAnimations=="function"){let e=t.getRegisteredAnimations();if(Array.isArray(e)&&e.length>0){let n=window.__hfLottie??[],i=new Set(n);for(let r of e)i.has(r)||n.push(r);window.__hfLottie=n}}}catch(t){_("runtime.adapters.lottie.site1",t)}},seek:t=>{let e=Math.max(0,Number(t.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let i of n)try{if(bi(i))i.goToAndStop(e*1e3,!1);else if(Ai(i)){if(typeof i.setCurrentRawFrameValue=="function"){let r=i.totalFrames??0,o=i.frameRate??30,s=e*o;r>0&&i.setCurrentRawFrameValue(Math.min(s,r-1))}else if(typeof i.seek=="function"){let r=i.duration??1,o=Math.min(100,e/r*100);i.seek(o)}}}catch(r){_("runtime.adapters.lottie.site2",r)}},pause:()=>{let t=window.__hfLottie;if(!(!t||t.length===0))for(let e of t)try{(bi(e)||Ai(e))&&e.pause()}catch(n){_("runtime.adapters.lottie.site3",n)}},revert:()=>{}}}function bi(t){return typeof t=="object"&&t!==null&&typeof t.goToAndStop=="function"}function Ai(t){return typeof t=="object"&&t!==null&&typeof t.pause=="function"&&("totalFrames"in t||"duration"in t)}var Fi=-1;function Ht(t){if(t!==Fi){Fi=t;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:t}}))}catch(e){_("runtime.adapters.seek-dispatch.site1",e)}}}function wi(){let t=null,e=0;return{name:"three",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfThreeTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ni(){let t=null,e=0;return{name:"typegpu",discover:()=>{},seek:n=>{t=Math.max(0,Number(n.time)||0),e=t,window.__hfTypegpuTime=t,Ht(t)},pause:()=>{t==null&&(t=Math.max(0,e))},play:()=>{t=null},revert:()=>{t=null,e=0}}}function Ci(){let t=globalThis.GPUQueue;if(!t?.prototype?.copyExternalImageToTexture)return;let e=t.prototype.copyExternalImageToTexture;t.prototype.copyExternalImageToTexture=function(n,i,r){if(n?.source instanceof HTMLVideoElement){let o=n.source.nextElementSibling;if(o instanceof HTMLImageElement&&o.classList.contains("__render_frame__")&&o.complete&&o.naturalWidth>0)return e.call(this,{...n,source:o},i,r)}return e.call(this,n,i,r)}}function Mi(){let t=!1,e=0,n=new WeakMap,i=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},r=l=>{let a=Number(l.currentTime);return Number.isFinite(a)&&a>0?a:0},o=(l,a)=>a<=0?l:l>=a?Math.max(0,l-a):l,s=(l,a)=>{let c=n.get(l);if(c)return c;let u={compositionTimeMs:a,animationTimeMs:t?o(r(l),a):r(l)};return n.set(l,u),u};return{name:"waapi",discover:()=>{t=!0;for(let l of i())s(l,e)},seek:l=>{let a=Math.max(0,(Number(l.time)||0)*1e3);e=a;for(let c of i()){let u=t?s(c,a):s(c,0),m=u.animationTimeMs+Math.max(0,a-u.compositionTimeMs);try{c.currentTime=m}catch(f){_("runtime.adapters.waapi.site1",f)}try{c.pause()}catch(f){_("runtime.adapters.waapi.site2",f)}}},pause:()=>{if(document.getAnimations)for(let l of document.getAnimations())try{l.pause()}catch(a){_("runtime.adapters.waapi.site3",a)}}}}function Ti(t,e){if(t.length===0)return 1;let n=0;for(;n<t.length-2&&e>=t[n+1].time;)n+=1;let i=t[n],r=t[n+1]??i,o=r.time-i.time,s=o<=0?0:Math.min(1,Math.max(0,(e-i.time)/o));return i.volume+(r.volume-i.volume)*s}function ds(t,e,n,i){let r=Number.parseFloat(t.dataset.start??"0")||0,o=Number.parseFloat(t.dataset.end??""),s=Number.parseFloat(t.dataset.duration??""),l=Number.isFinite(o)&&o>r?o:Number.isFinite(s)&&s>0?r+s:n,a=Number.parseFloat(t.dataset.volume??""),c=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;t.volume=c;let u=1/Math.min(60,Math.max(1,i)),m=Math.max(0,r),f=Math.min(n,l),x=[];for(let E=m;E<=f+1e-6;E+=u){let S=Math.min(f,E);e(S);let B=Number(t.volume);if(!Number.isFinite(B))continue;let D=Math.max(0,Math.min(1,B)),v=x.at(-1);if((!v||Math.abs(v.volume-D)>1e-4||S===f)&&x.push({time:Number(S.toFixed(6)),volume:Number(D.toFixed(6))}),S===f)break}return x.some(E=>Math.abs(E.volume-c)>1e-4)?x:null}function ki(t,e,n,i){if(!e||!(t instanceof HTMLAudioElement)&&!(t instanceof HTMLVideoElement)||n<=0)return;let o=ds(t,s=>{try{typeof e.totalTime=="function"?e.totalTime(s,!0):typeof e.seek=="function"&&e.seek(s,!0)}catch{}},n,60);o&&i.set(t,o)}function vi(t){let e=Array.from(document.querySelectorAll("video, audio")),n=t?.shouldIncludeElement?e.filter(s=>t.shouldIncludeElement?.(s)):e.filter(s=>s.hasAttribute("data-start")),i=[],r=[],o=0;for(let s of n){let l=t?.resolveStartSeconds?t.resolveStartSeconds(s):Number.parseFloat(s.dataset.start??"0");if(!Number.isFinite(l))continue;let a=Number.parseFloat(s.dataset.playbackStart??s.dataset.mediaStart??"0")||0,c=s.defaultPlaybackRate,u=Number.isFinite(c)&&c>0?Math.max(.1,Math.min(5,c)):1,m=s.loop,f=Number.isFinite(s.duration)&&s.duration>0?s.duration:null,x=t?.resolveDurationSeconds?.(s)??Number.parseFloat(s.dataset.duration??"");(!Number.isFinite(x)||x<=0)&&f!=null&&(x=Math.max(0,(f-a)/u));let F=Number.isFinite(x)&&x>0?l+x:Number.POSITIVE_INFINITY,E=Number.parseFloat(s.dataset.volume??""),S={el:s,start:l,mediaStart:a,duration:Number.isFinite(x)&&x>0?x:Number.POSITIVE_INFINITY,end:F,volume:Number.isFinite(E)?E:null,playbackRate:u,loop:m,sourceDuration:f};i.push(S),s.tagName==="VIDEO"&&r.push(S),Number.isFinite(F)&&(o=Math.max(o,F))}return{timedMediaEls:n,mediaClips:i,videoClips:r,maxMediaEnd:o}}var yn=new WeakMap,ft=new WeakMap,Sn=new WeakSet,et=new WeakSet;function fs(t){if(et.has(t))return;et.add(t);let e=()=>et.delete(t);t.addEventListener("playing",e,{once:!0}),t.addEventListener("pause",e,{once:!0}),t.addEventListener("error",e,{once:!0})}var bn=new WeakMap;function mt(t){return Number.isFinite(t)?Math.max(0,Math.min(1,t)):1}function _i(t){let e=!!(t.outputMuted||t.userMuted);for(let n of t.clips){let{el:i}=n;if(!i.isConnected)continue;let r=(t.timeSeconds-n.start)*n.playbackRate+n.mediaStart;if(t.timeSeconds>=n.start&&t.timeSeconds<n.end&&r>=0&&(!i.ended||n.loop)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let w=n.sourceDuration-n.mediaStart;w>0&&r>=n.sourceDuration&&(r=n.mediaStart+(r-n.mediaStart)%w)}let s=mt(t.userVolume??1),l=mt(n.volume??1),a=bn.get(i),c=mt(i.volume),u;n.volumeKeyframes&&n.volumeKeyframes.length>0?u=mt(Ti(n.volumeKeyframes,r)):a===void 0||Math.abs(c-a)>1e-4?u=c:u=l;let m=mt(u*s);i.volume=m,bn.set(i,m),t.onElementVolume?.(i,m),e&&(i.muted=!0),i.preload!=="auto"&&(i.preload="auto");try{i.playbackRate=n.playbackRate*t.playbackRate}catch(w){_("runtime.media.site1",w)}let f=.04,x=2,F=i.currentTime||0,E=Math.abs(F-r),S=r-F,B=yn.get(i);yn.set(i,S);let D=B===void 0,v=!D&&Math.abs(S-B)>.5,X=E>3,q=E>.5&&(D||v||X),N=i.tagName==="VIDEO"&&!i.paused,g=B!==void 0&&Math.abs(S-B)<.004,A=!1;if(!N&&!q&&!D&&g&&E>f){let w=(ft.get(i)??0)+1;ft.set(i,w),w>=x&&(A=!0,ft.set(i,0))}else E<=f&&ft.set(i,0);let C=!N&&t.forceSync&&E>.02;if(q||A||C){try{i.currentTime=r}catch(w){_("runtime.media.site2",w)}if(Math.abs(i.currentTime-r)>.5&&!Sn.has(i)){Sn.add(i),i.load();try{i.currentTime=r}catch(w){_("runtime.media.site3",w)}}et.delete(i)}t.playing&&i.paused&&!et.has(i)?(fs(i),i.play().catch(w=>{et.delete(i),(w&&typeof w=="object"&&"name"in w?String(w.name??""):"")==="NotAllowedError"&&t.onAutoplayBlocked?.()})):!t.playing&&!i.paused&&i.pause();continue}yn.delete(i),ft.delete(i),Sn.delete(i),bn.delete(i),i.paused||i.pause()}}var ms=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),ps=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function Ri(t){let e=!1,n=null,i=null,r=null,o=null;function s(g,A){try{window.dispatchEvent(new CustomEvent(g,{detail:A}))}catch(C){_("runtime.picker.site1",C)}}function l(g){r=g,s("hyperframe:picker:hovered",{elementInfo:r,isPickMode:e,timestamp:Date.now()})}function a(g){o=g,s("hyperframe:picker:selected",{elementInfo:o,isPickMode:e,timestamp:Date.now()})}function c(g){let A=g.ownerDocument.defaultView;if(!A)return!1;let C=g;for(;C&&C!==document.body&&C!==document.documentElement;){let w=A.getComputedStyle(C);if(w.display==="none"||w.visibility==="hidden"||w.pointerEvents==="none")return!0;let T=Number.parseFloat(w.opacity);if(Number.isFinite(T)&&T<=.01)return!0;C=C.parentElement}return!1}function u(g){if(!g||g===document.body||g===document.documentElement)return!1;let A=g.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||g.classList.contains("__hf-pick-highlight")||g.closest(ms)||c(g))}function m(g){return!!g?.closest(ps)}function f(g){let A=g;if(A.id)return`#${A.id}`;let C=g.getAttribute("data-composition-id");if(C)return`[data-composition-id="${C}"]`;let w=g.getAttribute("data-composition-src");if(w)return`[data-composition-src="${w}"]`;let T=g.getAttribute("data-track-index");if(T)return`[data-track-index="${T}"]`;let L=g.tagName.toLowerCase(),P=g.parentElement;if(!P)return L;let J=P.querySelectorAll(`:scope > ${L}`);if(J.length===1)return L;for(let R=0;R<J.length;R+=1)if(J[R]===g)return`${L}:nth-of-type(${R+1})`;return L}function x(g){let A=g.tagName.toLowerCase(),C=(g.textContent??"").trim().replace(/\s+/g," "),w=(T,L)=>T.length>L?`${T.slice(0,L-1)}\u2026`:T;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?C.length>0?w(C,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":g.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function F(g,A,C){let w=typeof C=="number"&&C>0?C:8,T=[];if(document.elementsFromPoint)T=document.elementsFromPoint(g,A);else if(document.elementFromPoint){let J=document.elementFromPoint(g,A);T=J?[J]:[]}if(m(T[0]??null))return[];let L={},P=[];for(let J=0;J<T.length;J+=1){let R=T[J];if(!u(R))continue;let le=`${R.tagName}::${R.id||""}::${J}`;if(!L[le]&&(L[le]=!0,P.push(R),P.length>=w))break}return P}function E(g){let A=g.getBoundingClientRect(),C={};for(let T=0;T<g.attributes.length;T+=1){let L=g.attributes[T];L.name.startsWith("data-")&&(C[L.name]=L.value)}return{id:g.id||null,tagName:g.tagName.toLowerCase(),selector:f(g),label:x(g),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:g.textContent?g.textContent.trim().slice(0,200):null,src:g.getAttribute("src")||g.getAttribute("data-composition-src")||null,dataAttributes:C}}function S(g,A,C){return F(g,A,C).map(E)}function B(g){if(!e)return;let C=F(g.clientX,g.clientY,1)[0]??(g.target instanceof Element?g.target:null);if(!u(C)||n===C)return;n&&n.classList.remove("__hf-pick-highlight"),n=C,C.classList.add("__hf-pick-highlight");let w=E(C);l(w),t.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:w})}function D(g){if(!e)return;g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation();let A=S(g.clientX,g.clientY,8);A.length!==0&&(l(A[0]??null),t.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:g.clientX,y:g.clientY}}))}function v(g){g.key==="Escape"&&(q(),t.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function X(){e||(e=!0,i=document.createElement("style"),i.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
40
40
  `),document.head.appendChild(i),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",B,!0),document.addEventListener("click",D,!0),document.addEventListener("keydown",v,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function q(){e&&(e=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),i&&(i.remove(),i=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",B,!0),document.removeEventListener("click",D,!0),document.removeEventListener("keydown",v,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function N(){window.__HF_PICKER_API={enable:X,disable:q,isActive:()=>e,getHovered:()=>r,getSelected:()=>o,getCandidatesAtPoint:(g,A,C)=>Number.isFinite(g)&&Number.isFinite(A)?S(g,A,C):[],pickAtPoint:(g,A,C)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return null;let w=S(g,A,8);if(!w.length)return null;let T=Math.max(0,Math.min(w.length-1,Number(C??0))),L=w[T]??null;return L?(a(L),t.postMessage({source:"hf-preview",type:"element-picked",elementInfo:L}),q(),L):null},pickManyAtPoint:(g,A,C)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return[];let w=S(g,A,8);if(!w.length)return[];let T=[],L=Array.isArray(C)?C:[0];for(let P of L){let J=Math.max(0,Math.min(w.length-1,Math.floor(Number(P)))),R=w[J];if(!R)continue;T.some(Se=>Se.selector===R.selector&&Se.tagName===R.tagName)||T.push(R)}return T.length?(a(T[0]??null),t.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:T}),q(),T):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:X,disablePickMode:q,installPickerApi:N}}function tt(t,e){let n=Number.isFinite(e)&&e>0?e:30,i=Number.isFinite(t)&&t>0?t:0;return Math.floor(i*n+1e-9)/n}function pt(t,e,n){let i=t?.[e];return typeof i=="function"?Number(i.call(t))||n:typeof i=="number"&&Number.isFinite(i)?i:(i!=null&&_("runtime.player.nonConformantNum",{prop:e,actual:typeof i}),n)}function ve(t,e){let n=t?.[e];if(typeof n=="function"){n.call(t);return}n!==void 0&&_("runtime.player.nonConformantVoid",{method:e,actual:typeof n})}function ht(t,e,n){if(t){for(let i of Object.values(t))if(!(!i||i===e))try{n(i)}catch(r){_("runtime.player.site1",r)}}}function Li(t,e,n){let i=tt(e,n);return ve(t,"pause"),typeof t.totalTime=="function"?t.totalTime(i,!1):typeof t.seek=="function"&&t.seek(i,!1),i}function hs(t,e,n,i){let r=[];ht(t,e,o=>{ve(o,"play"),r.push(o)});try{return Li(e,n,i)}finally{for(let o of r)try{ve(o,"pause")}catch(s){_("runtime.player.site2",s)}}}function xs(t,e){ht(t,e,n=>{ve(n,"play")})}function Di(t){return{_timeline:null,play:()=>{let e=t.getTimeline();if(!e||t.getIsPlaying())return;let n=Math.max(0,Number(t.getSafeDuration?.()??pt(e,"duration",0))||0);n>0&&Math.max(0,pt(e,"time",0))>=n&&(ve(e,"pause"),typeof e.seek=="function"&&e.seek(0,!1),t.onDeterministicSeek(0),t.setIsPlaying(!1),t.onSyncMedia(0,!1),t.onRenderFrameSeek(0)),typeof e.timeScale=="function"&&e.timeScale(t.getPlaybackRate()),ve(e,"play"),ht(t.getTimelineRegistry?.(),e,i=>{typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ve(i,"play")}),t.onDeterministicPlay(),t.setIsPlaying(!0),t.onShowNativeVideos(),t.onStatePost(!0)},pause:()=>{let e=t.getTimeline();if(!e)return;ve(e,"pause"),ht(t.getTimelineRegistry?.(),e,i=>{ve(i,"pause")});let n=Math.max(0,pt(e,"time",0));t.onDeterministicSeek(n),t.onDeterministicPause(),t.setIsPlaying(!1),t.onSyncMedia(n,!1),t.onRenderFrameSeek(n),t.onStatePost(!0)},seek:(e,n)=>{let i=t.getTimeline();if(!i)return;let r=Math.max(0,Number(e)||0),o=t.getIsPlaying(),s=hs(t.getTimelineRegistry?.(),i,r,t.getCanonicalFps());t.onDeterministicSeek(s),n?.keepPlaying&&o?(typeof i.timeScale=="function"&&i.timeScale(t.getPlaybackRate()),ve(i,"play"),ht(t.getTimelineRegistry?.(),i,l=>{typeof l.timeScale=="function"&&l.timeScale(t.getPlaybackRate()),ve(l,"play")}),t.onDeterministicPlay(),t.onShowNativeVideos(),t.onSyncMedia(s,!0)):(t.setIsPlaying(!1),t.onSyncMedia(s,!1)),t.onRenderFrameSeek(s),t.onStatePost(!0)},renderSeek:e=>{let n=t.getTimeline(),i=t.getCanonicalFps(),r=n?(xs(t.getTimelineRegistry?.(),n),Li(n,e,i)):tt(Math.max(0,Number(e)||0),i);t.onDeterministicSeek(r),t.setIsPlaying(!1),t.onSyncMedia(r,!1),t.onRenderFrameSeek(r),t.onStatePost(!0)},getTime:()=>pt(t.getTimeline(),"time",0),getDuration:()=>pt(t.getTimeline(),"duration",0),isPlaying:()=>t.getIsPlaying(),setPlaybackRate:e=>t.setPlaybackRate(e),getPlaybackRate:()=>t.getPlaybackRate()}}function Bi(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,nativeVisualWatchdogTick:0,transportClock:null,transportRafId:null}}var gs="data-hf-authored-duration",ys="data-hf-authored-end";function Qe(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function Ss(t){return Qe(t.getAttribute("data-duration"))}function bs(t){return Qe(t.getAttribute("data-end"))}function As(t){return Qe(t.getAttribute(gs))}function Es(t){return Qe(t.getAttribute(ys))}function Fs(t){let e=(t??"").trim();if(!e)return null;let n=Qe(e);if(n!=null)return{kind:"absolute",value:n};let i=e.match(/^([A-Za-z0-9_.:-]+)(?:\s*([+-])\s*([0-9]*\.?[0-9]+))?$/);if(!i)return null;let r=(i[1]??"").trim();if(!r)return null;let o=i[2]??"+",s=i[3]??"0",l=Number.parseFloat(s),a=Number.isFinite(l)?Math.max(0,l):0,c=o==="-"?-a:a;return{kind:"reference",refId:r,offset:c}}function Ye(t){let e=t.timelineRegistry??{},n=t.includeAuthoredTimingAttrs??!1,i=new WeakMap,r=new WeakMap,o=new Set,s=u=>{let m=document.getElementById(u);return m||(document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`)??null)},l=u=>{let m=r.get(u);if(m!==void 0)return m;let f=null,x=Ss(u)??(n?As(u):null);if(x!=null&&x>0&&(f=x),f==null||f<=0){let F=bs(u)??(n?Es(u):null);if(F!=null){let E=c(u,0),S=F-E;Number.isFinite(S)&&S>0&&(f=S)}}if((f==null||f<=0)&&u instanceof HTMLMediaElement){let F=Qe(u.getAttribute("data-playback-start"))??Qe(u.getAttribute("data-media-start"))??0;Number.isFinite(u.duration)&&u.duration>F&&(f=u.duration-F)}if(f==null||f<=0){let F=u.getAttribute("data-composition-id");if(F){let E=e[F]??null;if(E&&typeof E.duration=="function")try{let S=Number(E.duration());Number.isFinite(S)&&S>0&&(f=S)}catch(S){_("runtime.startResolver.site1",S)}}}return f!=null&&Number.isFinite(f)&&f>0?(r.set(u,f),f):(r.set(u,null),null)},a=(u,m)=>{if(u.hasAttribute("data-composition-id")){let x=u.parentElement?.closest("[data-composition-id]");return x?c(x,m):0}let f=u.closest("[data-composition-id]");return f?c(f,m):0},c=(u,m)=>{let f=i.get(u);if(f!==void 0)return f??m;if(o.has(u))return m;o.add(u);try{let x=Fs(u.getAttribute("data-start"));if(!x){if(u.hasAttribute("data-composition-id")){let D=u.parentElement;if(D&&(D.hasAttribute("data-composition-src")||D.hasAttribute("data-composition-id"))){let v=c(D,m);return i.set(u,v),v}}return i.set(u,m),m}if(x.kind==="absolute"){let D=Math.max(0,x.value),v=Math.max(0,a(u,m)+D);return i.set(u,v),v}let F=s(x.refId);if(!F)return i.set(u,m),m;let E=c(F,0),S=l(F);if(S==null||S<=0){let D=Math.max(0,E+x.offset);return i.set(u,D),D}let B=Math.max(0,E+S+x.offset);return i.set(u,B),B}finally{o.delete(u)}};return{resolveStartForElement:(u,m=0)=>c(u,Math.max(0,m)),resolveDurationForElement:u=>l(u)}}var ws="data-hf-authored-duration",Ns="data-hf-authored-end";function Ee(t){if(t==null||t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function An(t){return Ee(t.getAttribute("data-duration"))??Ee(t.getAttribute(ws))}function Ii(t){return Ee(t.getAttribute("data-end"))??Ee(t.getAttribute(Ns))}function En(...t){let e=t.filter(n=>Number.isFinite(n??null));return e.length===0?null:Math.max(...e)}var Oi={composition:0,video:1,image:2,element:3,audio:4};function Cs(t){if(t.length===0)return;let e=new Map;for(let s of t){let l=e.get(s.track)??new Set;l.add(s.kind),e.set(s.track,l)}if(!Array.from(e.values()).some(s=>s.size>1))return;let i=0,r=new Map,o=[...e.keys()].sort((s,l)=>s-l);for(let s of o){let l=e.get(s);if(l.size===1)r.set(`${s}:${[...l][0]}`,i++);else{let a=[...l].sort((c,u)=>(Oi[c]??99)-(Oi[u]??99));for(let c of a)r.set(`${s}:${c}`,i++)}}for(let s of t){let l=`${s.track}:${s.kind}`,a=r.get(l);a!=null&&(s.track=a)}}function gt(t){let e=String(t??"").trim();if(!e)return null;let n=e.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(e,document.baseURI).toString()}catch{return e}}function Pi(t){let e=t.getAttribute("src")??t.getAttribute("data-src");if(e)return gt(e);let n=t.getAttribute("data-composition-src");if(n)return gt(n);let i=t.querySelector("img[src], video[src], audio[src], source[src]");return i?gt(i.getAttribute("src")):null}function Ms(t){let e=t.className;return typeof e!="string"?null:e.split(/\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function Ts(t){if(!t)return null;try{return new URL(t,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return t.split(/[\\/]/).filter(Boolean).at(-1)??null}}function ks(t){let e=t.textContent?.replace(/\s+/g," ").trim();return e?e.length>32?`${e.slice(0,31)}...`:e:null}function xt(t){let e=t.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return e?e.replace(/\b\w/g,n=>n.toUpperCase()):t}function vs(t,e,n){let i=t.getAttribute("data-timeline-label")??t.getAttribute("data-label")??t.getAttribute("aria-label")??null;if(i?.trim())return i.trim();let r=t.getAttribute("data-composition-id");if(r)return xt(r);let o=t.id;if(o)return xt(o);let s=Ms(t);if(s)return xt(s);let l=Ts(Pi(t));if(l)return xt(l);let a=ks(t);return a||`${xt(e)} ${n+1}`}function Wi(t){let n=window.__timelines??{},i=Ye({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),r=H=>{if(!H)return null;let k=n[H]??null;if(!k||typeof k.duration!="function")return null;try{let O=Number(k.duration());return Number.isFinite(O)&&O>0?O:null}catch{return null}},o=H=>{let k=Ee(H.getAttribute("data-duration"));if(k!=null&&k>0)return k;let O=Ee(H.getAttribute("data-playback-start"))??Ee(H.getAttribute("data-media-start"))??0;return Number.isFinite(H.duration)&&H.duration>O?Math.max(0,H.duration-O):null},s=()=>{let H=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(H.length===0)return null;let k=0;for(let O of H){let ne=O.hasAttribute("data-hf-auto-start")?i.resolveStartForElement(O,0):Math.max(0,Number(O.getAttribute("data-start")??0)||0);if(!Number.isFinite(ne))continue;let ee=o(O);ee==null||ee<=0||(k=Math.max(k,Math.max(0,ne)+ee))}return k>0?k:null},l=H=>{let k=H.trim().toLowerCase();return!(!k||k==="main"||k.includes("caption")||k.includes("ambient"))},a=(H,k)=>{let O=[],ne=null,ee=null,z=null,V=H.parentElement;for(;V;){let j=V.getAttribute("data-composition-id");j&&(O.push(j),!z&&V!==k&&(z=j),ne==null&&(ne=i.resolveStartForElement(V,0)),ee==null&&(ee=Ee(V.getAttribute("data-duration"))??r(j)??null)),V=V.parentElement}return{parentCompositionId:z,compositionAncestors:O.reverse(),inheritedStart:ne,inheritedDuration:ee}},c=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),m=c?.getAttribute("data-composition-id")??null,f=c?i.resolveStartForElement(c,0):0,x=s(),F=x!=null?Math.max(0,x-Math.max(0,f)):null,E=r(m),S=An(c??document.body),B=En(...u.filter(H=>H!==c).map(H=>{let k=i.resolveStartForElement(H,0),O=i.resolveDurationForElement(H)??r(H.getAttribute("data-composition-id"))??null;return!Number.isFinite(k)||O==null||O<=0?null:Math.max(0,k)+O})),D=B!=null?Math.max(0,B-Math.max(0,f)):null,v=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,X=typeof S=="number"&&Number.isFinite(S)&&S>0?S:null,q=typeof F=="number"&&Number.isFinite(F)&&F>0?F:null,N=typeof D=="number"&&Number.isFinite(D)&&D>0?D:null,g=En(q,N),A=v!=null&&g!=null&&v>g+1,w=X??(A?g:En(v,q,N))??null,L=(w!=null?f+w:null)??(typeof x=="number"&&Number.isFinite(x)&&x>0?x:null),P=(H,k)=>!Number.isFinite(k)||k<=0?0:L==null||!Number.isFinite(L)?k:!Number.isFinite(H)||H>=L?0:Math.max(0,Math.min(k,L-H)),J=[],R=[],le=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),Se=0;for(let H=0;H<le.length;H+=1){let k=le[H];if(k===c||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(k.tagName))continue;let O=a(k,c),ne=i.resolveStartForElement(k,O.inheritedStart??0),ee=k.getAttribute("data-composition-id"),z=An(k);if((z==null||z<=0)&&ee&&ee!==m&&(z=r(ee)),(z==null||z<=0)&&k instanceof HTMLMediaElement){let we=Ee(k.getAttribute("data-playback-start"))??Ee(k.getAttribute("data-media-start"))??0;Number.isFinite(k.duration)&&k.duration>0&&(z=Math.max(0,k.duration-we))}if(z==null||z<=0){let we=O.inheritedDuration;if(we!=null&&we>0){let Le=(O.inheritedStart??0)+we;z=Math.max(0,Le-ne)}}if(z==null||z<=0||(z=P(ne,z),z<=0))continue;let V=ne+z;Se=Math.max(Se,V);let j=k.tagName.toLowerCase(),Ce=ee&&ee!==m?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";J.push({id:k.id||ee||null,label:vs(k,Ce,J.length),start:ne,duration:z,track:Number.parseInt(k.getAttribute("data-track-index")??k.getAttribute("data-track")??String(H),10)||0,kind:Ce,tagName:j,compositionId:k.getAttribute("data-composition-id"),compositionAncestors:O.compositionAncestors,parentCompositionId:O.parentCompositionId,nodePath:null,compositionSrc:gt(k.getAttribute("data-composition-src")),assetUrl:Pi(k),timelineRole:k.getAttribute("data-timeline-role"),timelineLabel:k.getAttribute("data-timeline-label"),timelineGroup:k.getAttribute("data-timeline-group"),timelinePriority:Ee(k.getAttribute("data-timeline-priority"))})}let $=new Set(J.map(H=>H.id)),U=c?.getAttribute("data-composition-id")??null,W=U?n[U]??null:null;if(W&&c){let H=W;if(typeof H.getChildren=="function")try{let k=H.getChildren(!0,!0,!1)??[],O=new Map;for(let z of c.children){let V=z;if(!V.id)continue;let j=V.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||O.set(V,{id:V.id,start:1/0,end:-1/0})}let ne=z=>{let V=z;for(;V;){if(O.has(V))return V;if(V===c)return null;V=V.parentElement}return null};for(let z of k){if(typeof z.targets!="function"||typeof z.startTime!="function"||typeof z.duration!="function")continue;let V=z.startTime(),j=z.parent;for(;j&&j!==W&&typeof j.startTime=="function";)V+=j.startTime(),j=j.parent;let Ce=V+z.duration();if(!(!Number.isFinite(V)||!Number.isFinite(Ce)))for(let we of z.targets()){if(!(we instanceof Element))continue;let $e=ne(we);if(!$e)continue;let Le=O.get($e);Le&&(Le.start=Math.min(Le.start,V),Le.end=Math.max(Le.end,Ce))}}let ee=J.length>0?Math.max(...J.map(z=>z.track))+1:0;for(let[z,V]of O){if(V.start===1/0||V.end===-1/0)continue;let j=z;if($.has(j.id))continue;let Ce=Math.max(0,V.end-V.start);if(Ce<=0)continue;let we=P(V.start,Ce);we<=0||(Se=Math.max(Se,V.start+we),J.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:V.start,duration:we,track:Number.parseInt(j.getAttribute("data-track-index")??j.getAttribute("data-track")??"",10)||ee,kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:j.getAttribute("data-timeline-role"),timelineLabel:j.getAttribute("data-timeline-label"),timelineGroup:j.getAttribute("data-timeline-group"),timelinePriority:Ee(j.getAttribute("data-timeline-priority"))}),$.add(j.id))}}catch(k){_("runtime.timeline.site1",k)}}if(c&&w!=null&&w>0){let H=J.length>0?Math.max(...J.map(k=>k.track))+1:0;for(let k of c.children){let O=k;if(!O.id||$.has(O.id))continue;let ne=O.getAttribute("data-timeline-role");if(ne!=="overlay"&&ne!=="persistent-overlay")continue;let ee=O.tagName.toLowerCase();if(ee==="script"||ee==="style"||ee==="link"||ee==="meta"||window.getComputedStyle(O).display==="none")continue;let V=P(0,w);V<=0||(Se=Math.max(Se,V),J.push({id:O.id,label:O.getAttribute("data-timeline-label")??O.getAttribute("data-label")??O.getAttribute("aria-label")??O.id,start:0,duration:V,track:Number.parseInt(O.getAttribute("data-track-index")??O.getAttribute("data-track")??"",10)||H,kind:"element",tagName:ee,compositionId:O.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:ne,timelineLabel:O.getAttribute("data-timeline-label"),timelineGroup:O.getAttribute("data-timeline-group"),timelinePriority:Ee(O.getAttribute("data-timeline-priority"))}),$.add(O.id))}}Cs(J);for(let H of u){if(H===c)continue;let k=H.getAttribute("data-composition-id");if(!k||!l(k))continue;let O=i.resolveStartForElement(H,0),ne=An(H);if((ne==null||ne<=0)&&Ii(H)!=null){let j=Ii(H);ne=Math.max(0,j-O)}let ee=r(k),z=ne&&ne>0?ne:ee;if(z==null||z<=0)continue;let V=P(O,z);V<=0||R.push({id:k,label:H.getAttribute("data-label")??k,start:O,duration:V,thumbnailUrl:gt(H.getAttribute("data-thumbnail-url")),avatarName:null})}let Y=Math.max(1,Se||1,w??0);return{source:"hf-preview",type:"timeline",durationInFrames:A&&X==null?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(Y*Math.max(1,t.canonicalFps))),clips:J,scenes:R,compositionWidth:Ee(c?.getAttribute("data-width"))??1920,compositionHeight:Ee(c?.getAttribute("data-height"))??1080}}var ae=us(co(),1),fo=ae.default,Xc=ae.default.stringify,ed=ae.default.fromJSON,td=ae.default.plugin,nd=ae.default.parse,id=ae.default.list,rd=ae.default.document,od=ae.default.comment,sd=ae.default.atRule,ad=ae.default.rule,ld=ae.default.decl,ud=ae.default.root,cd=ae.default.CssSyntaxError,dd=ae.default.Declaration,fd=ae.default.Container,md=ae.default.Processor,pd=ae.default.Document,hd=ae.default.Comment,xd=ae.default.Warning,gd=ae.default.AtRule,yd=ae.default.Result,Sd=ae.default.Input,bd=ae.default.Rule,Ad=ae.default.Root,Ed=ae.default.Node;var Kn="data-hf-authored-id";function Jn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Za(t){return t&&t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function mo(t){let e=t.trim();return e?Array.from(new Set([e,Za(e)])).filter(Boolean):[]}function Xa(t){return!!t&&/[\w-]/.test(t)}function el(t,e,n){let i=mo(e).sort((l,a)=>a.length-l.length);if(i.length===0)return t;let r="",o=0,s=null;for(let l=0;l<t.length;l+=1){let a=t[l],c=l>0?t[l-1]:"";if(s){r+=a,a===s&&c!=="\\"&&(s=null);continue}if(a==='"'||a==="'"){s=a,r+=a;continue}if(a==="["){o+=1,r+=a;continue}if(a==="]"){o=Math.max(0,o-1),r+=a;continue}if(a==="#"&&o===0){let u=i.find(m=>t.startsWith(m,l+1));if(u){let m=t[l+1+u.length];if(!Xa(m)){r+=n,l+=u.length;continue}}}r+=a}return r}function tl(t,e){let n=e?.trim();return n?el(t,n,`[${Kn}="${Qn(n)}"]`):t}function nl(t,e,n,i,r){let o=tl(t,i),s=il(o,e,n),l=s.trim();if(!l||/^(html|body|:root|\*)$/i.test(l))return t;let a=new RegExp(`\\[\\s*data-composition-id\\s*=\\s*(["'])${Jn(n)}\\1\\s*\\]`,"g");if(a.test(l))return s.replace(a,e);let c=s.match(/^\s*/)?.[0]??"",u=s.match(/\s*$/)?.[0]??"";if(r){let m=i?`[${Kn}="${Qn(i)}"]`:null;if(m&&l.startsWith(m)){let f=l.slice(m.length);return`${c}${e}${m}${f}${u}`}}return`${c}${e} ${l}${u}`}function il(t,e,n){let i=Jn(n),r=String.raw`\[\s*data-composition-id\s*=\s*(?:"${i}"|'${i}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return t.replace(new RegExp(`${r}(?:${o})+`,"g"),e).replace(new RegExp(`(?:${o})+${r}`,"g"),e)}var rl=new Set(["keyframes","-webkit-keyframes","font-face"]);function ol(t){return t?.type==="atrule"}function sl(t){let e=t.parent;for(;e;){if(ol(e)&&rl.has(e.name.toLowerCase()))return!0;e=e.parent}return!1}function Yn(t,e,n,i,r){let o=e.trim();if(!t||!o)return t;let s=n||`[data-composition-id="${Qn(o)}"]`,l=fo.parse(t);return l.walkRules(a=>{sl(a)||(a.selectors=a.selectors.map(c=>nl(c,s,o,i,r?.compoundAuthoredRoot)))}),l.toResult({map:!1}).css}function po(t,e,n="[HyperFrames] composition script error:",i,r=e,o){let s=JSON.stringify(e),l=JSON.stringify(r),a=JSON.stringify(n),c=Jn(e),u=JSON.stringify(o?.trim()||null),m=JSON.stringify(i??null),f=JSON.stringify(String.raw`\[\s*data-composition-id\s*=\s*(?:"${c}"|'${c}')\s*\]`),x=JSON.stringify(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),F=JSON.stringify(mo(o?.trim()||""));return`(function(){
41
41
  var __hfCompId = ${s};
42
42
  var __hfTimelineCompId = ${l};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/core",
3
- "version": "0.6.71",
3
+ "version": "0.6.73",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",